Logo ROOT  
Reference Guide
TGLSAViewer.cxx
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Timur Pocheptsov / Richard Maunder
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include <memory>
13
14#include "TRootHelpDialog.h"
15#include "TPluginManager.h"
16#include "TApplication.h"
17#include "TGClient.h"
18#include "TGCanvas.h"
19#include "HelpText.h"
20#include "GuiTypes.h"
21#include "TG3DLine.h"
22#include "TSystem.h"
23#include "TGFrame.h"
24#include "TGLabel.h"
25#include "TGMenu.h"
26#include "TGButton.h"
27#include "TGSplitter.h"
28#include "TColor.h"
29
30#include "TVirtualPad.h"
31#include "TGedEditor.h"
32#include "TRootEmbeddedCanvas.h"
33#include "TString.h"
34#include "TGFileDialog.h"
35#include "TVirtualX.h"
36
37#include "TGLOutput.h"
38#include "TGLFormat.h"
39
40#include "TGLLogicalShape.h"
41#include "TGLPhysicalShape.h"
42#include "TGLPShapeObj.h"
43#include "TGLClip.h"
44#include "TROOT.h"
45
46#ifdef WIN32
47#include "TWin32SplashThread.h"
48#endif
49
50#include "TGLWidget.h"
51#include "TGLSAViewer.h"
52#include "TGLSAFrame.h"
53#include "TGLEventHandler.h"
54
55
56const char * TGLSAViewer::fgHelpText1 = "\
57DIRECT SCENE INTERACTIONS\n\n\
58 Press:\n\
59 \tw --- wireframe mode\n\
60 \te --- switch between dark / light color-set\n\
61 \tr --- filled polygons mode\n\
62 \tt --- outline mode\n\
63 \tj --- ZOOM in\n\
64 \tk --- ZOOM out\n\
65 \ta --- switch on/off arc-ball camera rotation control\n\
66 \tArrow Keys --- PAN (TRUCK) across scene\n\
67 \tHome --- reset current camera\n\
68 \tCtrl-Home --- switch external/automatic camera center\n\
69\n\
70 LEFT mouse button -- ROTATE (ORBIT) the scene by holding the mouse button and moving\n\
71 the mouse (perspective camera, needs to be enabled in menu for orthographic cameras).\n\
72 By default, the scene will be rotated about its center. To select arbitrary center\n\
73 bring up the viewer-editor (e.g., shift-click into empty background) and use\n\
74 'Camera center' controls in the 'Guides' tab.\n\
75\n\
76 MIDDLE mouse button or arrow keys -- PAN (TRUCK) the camera.\n\
77\n\
78 RIGHT mouse button action depends on camera type:\n\
79 orthographic -- zoom,\n\
80 perspective -- move camera forwards / backwards\n\
81\n\
82 By pressing Ctrl and Shift keys the mouse precision can be changed:\n\
83 Shift -- 10 times less precise\n\
84 Ctrl -- 10 times more precise\n\
85 Ctrl Shift -- 100 times more precise\n\
86\n\
87 Mouse wheel action depends on camera type:\n\
88 orthographic -- zoom,\n\
89 perspective -- change field-of-view (focal length)\n\
90\n\
91 To invert direction of mouse and key actions from scene-centric\n\
92 to viewer-centric, set in your .rootrc file:\n\
93 OpenGL.EventHandler.ViewerCentricControls: 1\n\
94\n\
95 Double click will show GUI editor of the viewer (if assigned).\n\
96\n\
97 RESET the camera via the button in viewer-editor or Home key.\n\
98\n\
99 SELECT a shape with Shift+Left mouse button click.\n\
100\n\
101 SELECT the viewer with Shift+Left mouse button click on a free space.\n\
102\n\
103 MOVE a selected shape using Shift+Mid mouse drag.\n\
104\n\
105 Invoke the CONTEXT menu with Shift+Right mouse click.\n\n"
106 "Secondary selection and direct render object interaction is initiated\n\
107 by Alt+Left mouse click (Mod1, actually). Only few classes support this option.\n\
108 When 'Alt' is taken by window manager, try Alt-Ctrl-Left.\n\
109\n\
110CAMERA\n\
111\n\
112 The \"Camera\" menu is used to select the different projections from \n\
113 the 3D world onto the 2D viewport. There are three perspective cameras:\n\
114\n\
115 \tPerspective (Floor XOZ)\n\
116 \tPerspective (Floor YOZ)\n\
117 \tPerspective (Floor XOY)\n\
118\n\
119 In each case the floor plane (defined by two axes) is kept level.\n\
120\n\
121 There are also four orthographic cameras:\n\
122\n\
123 \tOrthographic (XOY)\n\
124 \tOrthographic (XOZ)\n\
125 \tOrthographic (ZOY)\n\
126 \tOrthographic (ZOX)\n\
127\n\
128 In each case the first axis is placed horizontal, the second vertical e.g.\n\
129 XOY means X horizontal, Y vertical.\n\n";
130
131const char * TGLSAViewer::fgHelpText2 = "\
132SHAPES COLOR AND MATERIAL\n\
133\n\
134 The selected shape's color can be modified in the Shapes-Color tabs.\n\
135 Shape's color is specified by the percentage of red, green, blue light\n\
136 it reflects. A surface can reflect DIFFUSE, AMBIENT and SPECULAR light.\n\
137 A surface can also emit light. The EMISSIVE parameter allows to define it.\n\
138 The surface SHININESS can also be modified.\n\
139\n\
140SHAPES GEOMETRY\n\
141\n\
142 The selected shape's location and geometry can be modified in the Shapes-Geom\n\
143 tabs by entering desired values in respective number entry controls.\n\
144\n\
145SCENE CLIPPING\n\
146\n\
147 In the Scene-Clipping tabs select a 'Clip Type': None, Plane, Box\n\
148\n\
149 For 'Plane' and 'Box' the lower pane shows the relevant parameters:\n\
150\n\
151\tPlane: Equation coefficients of form aX + bY + cZ + d = 0\n\
152\tBox: Center X/Y/Z and Length X/Y/Z\n\n"
153 "For Box checking the 'Show / Edit' checkbox shows the clip box (in light blue)\n\
154 in viewer. It also attaches the current manipulator to the box - enabling\n\
155 direct editing in viewer.\n\
156\n\
157MANIPULATORS\n\
158\n\
159 A widget attached to the selected object - allowing direct manipulation\n\
160 of the object with respect to its local axes.\n\
161\n\
162 There are three modes, toggled with keys while manipulator is active, that is,\n\
163 mouse pointer is above it (switches color to yellow):\n\
164 \tMode\t\tWidget Component Style\t\tKey\n\
165 \t----\t\t----------------------\t\t---\n\
166 \tTranslation\tLocal axes with arrows\t\tv\n\
167 \tScale\t\tLocal axes with boxes\t\tx\n\
168 \tRotate\t\tLocal axes rings\t\tc\n\
169\n\
170 Each widget has three axis components - red (X), green (Y) and blue (Z).\n\
171 The component turns yellow, indicating an active state, when the mouse is moved\n\
172 over it. Left click and drag on the active component to adjust the objects\n\
173 translation, scale or rotation.\n\
174 Some objects do not support all manipulations (e.g. clipping planes cannot be \n\
175 scaled). If a manipulation is not permitted the component it drawn in grey and \n\
176 cannot be selected/dragged.\n";
177
178
179/** \class TGLSAViewer
180\ingroup opengl
181The top level standalone GL-viewer - created via plugin manager.
182*/
183
185
187
190const Int_t TGLSAViewer::fgInitW = 780;
191const Int_t TGLSAViewer::fgInitH = 670;
192
193// A lot of raw pointers/naked new-expressions - good way to discredit C++ (or C++ programmer
194// ROOT has system to cleanup - I'll try to use it
195
196const char *gGLSaveAsTypes[] = {"Encapsulated PostScript", "*.eps",
197 "PDF", "*.pdf",
198 "GIF", "*.gif",
199 "Animated GIF", "*.gif+",
200 "JPEG", "*.jpg",
201 "PNG", "*.png",
202 0, 0};
203
204////////////////////////////////////////////////////////////////////////////////
205/// Construct a standalone viewer, bound to supplied 'pad'.
206
208 TGLViewer(pad, fgInitX, fgInitY, fgInitW, fgInitH),
209 fFrame(0),
210 fFormat(format),
211 fFileMenu(0),
212 fFileSaveMenu(0),
213 fCameraMenu(0),
214 fHelpMenu(0),
215 fLeftVerticalFrame(0),
216 fRightVerticalFrame(0),
217 fDirName("."),
218 fTypeIdx(0),
219 fOverwrite(kFALSE),
220 fMenuBar(0),
221 fMenuBut(0),
222 fHideMenuBar(kFALSE),
223 fMenuHidingTimer(0),
224 fMenuHidingShowMenu(kTRUE),
225 fDeleteMenuBar(kFALSE)
226{
227 fFrame = new TGLSAFrame(*this);
228
229 CreateMenus();
230 CreateFrames();
231
232 fFrame->SetWindowName("ROOT's GL viewer");
233 fFrame->SetClassHints("GLViewer", "GLViewer");
237
241
242 // set recursive cleanup, but exclude fGedEditor
243 // destructor of fGedEditor has own way of handling child nodes
248
249 Show();
250}
251
252////////////////////////////////////////////////////////////////////////////////
253/// Construct an embedded standalone viewer, bound to supplied 'pad'.
254/// If format is passed, it gets adopted by the viewer as it might
255/// need to be reused several times when recreating the GL-widget.
256///
257/// Modified version of the previous constructor for embedding the
258/// viewer into another frame (parent).
259
261 TGLFormat* format) :
262 TGLViewer(pad, fgInitX, fgInitY, fgInitW, fgInitH),
263 fFrame(0),
264 fFormat(format),
265 fFileMenu(0),
266 fCameraMenu(0),
267 fHelpMenu(0),
268 fLeftVerticalFrame(0),
269 fRightVerticalFrame(0),
270 fTypeIdx(0),
271 fMenuBar(0),
272 fMenuBut(0),
273 fHideMenuBar(kFALSE),
274 fMenuHidingTimer(0),
275 fMenuHidingShowMenu(kTRUE),
276 fDeleteMenuBar(kFALSE)
277{
278 fGedEditor = ged;
279 fFrame = new TGLSAFrame(parent, *this);
280
281 CreateMenus();
282 CreateFrames();
283
288
289 // set recursive cleanup, but exclude fGedEditor
290 // destructor of fGedEditor has own way of handling child nodes
292 {
297 }
298
299 Show();
300}
301
302////////////////////////////////////////////////////////////////////////////////
303/// Destroy standalone viewer object.
304
306{
308
310
311 delete fHelpMenu;
312 delete fCameraMenu;
313 delete fFileSaveMenu;
314 delete fFileMenu;
315 if(fDeleteMenuBar) {
316 delete fMenuBar;
317 }
318 delete fFormat;
319 delete fFrame;
320 fGLWidget = 0;
321}
322
323////////////////////////////////////////////////////////////////////////////////
324/// Return the main-frame.
325
327{
328 return fFrame;
329}
330
331////////////////////////////////////////////////////////////////////////////////
332/// Create a GLwidget, it is an error if it is already created.
333/// This is needed for frame-swapping on mac.
334
336{
337 if (fGLWidget) {
338 Error("CreateGLWidget", "Widget already exists.");
339 return;
340 }
341
342 if (fFormat == 0)
343 fFormat = new TGLFormat;
344
347
349 fFrame->Layout();
350
352}
353
354////////////////////////////////////////////////////////////////////////////////
355/// Destroy the GLwidget, it is an error if it does not exist.
356/// This is needed for frame-swapping on mac.
357
359{
360 if (fGLWidget == 0) {
361 Error("DestroyGLWidget", "Widget does not exist.");
362 return;
363 }
364
367
370 fGLWidget = 0;
371}
372
373////////////////////////////////////////////////////////////////////////////////
374///File/Camera/Help menus.
375
377{
379 fFileMenu->AddEntry("&Hide Menus", kGLHideMenus);
380 fFileMenu->AddEntry("&Edit Object", kGLEditObject);
382 fFileMenu->AddEntry("&Close Viewer", kGLCloseViewer);
385 fFileSaveMenu->AddEntry("viewer.&eps", kGLSaveEPS);
386 fFileSaveMenu->AddEntry("viewer.&pdf", kGLSavePDF);
387 fFileSaveMenu->AddEntry("viewer.&gif", kGLSaveGIF);
388 fFileSaveMenu->AddEntry("viewer.g&if+", kGLSaveAnimGIF);
389 fFileSaveMenu->AddEntry("viewer.&jpg", kGLSaveJPG);
390 fFileSaveMenu->AddEntry("viewer.p&ng", kGLSavePNG);
392 fFileMenu->AddEntry("Save &As...", kGLSaveAS);
394 fFileMenu->AddEntry("&Quit ROOT", kGLQuitROOT);
396
398 fCameraMenu->AddEntry("Perspective (Floor XOZ)", kGLPerspXOZ);
399 fCameraMenu->AddEntry("Perspective (Floor YOZ)", kGLPerspYOZ);
400 fCameraMenu->AddEntry("Perspective (Floor XOY)", kGLPerspXOY);
401 fCameraMenu->AddEntry("Orthographic (XOY)", kGLXOY);
402 fCameraMenu->AddEntry("Orthographic (XOZ)", kGLXOZ);
403 fCameraMenu->AddEntry("Orthographic (ZOY)", kGLZOY);
404 fCameraMenu->AddEntry("Orthographic (ZOX)", kGLZOX);
405 fCameraMenu->AddEntry("Orthographic (XnOY)", kGLXnOY);
406 fCameraMenu->AddEntry("Orthographic (XnOZ)", kGLXnOZ);
407 fCameraMenu->AddEntry("Orthographic (ZnOY)", kGLZnOY);
408 fCameraMenu->AddEntry("Orthographic (ZnOX)", kGLZnOX);
410 fCameraMenu->AddEntry("Ortho allow rotate", kGLOrthoRotate);
411 fCameraMenu->AddEntry("Ortho allow dolly", kGLOrthoDolly);
413
415 fHelpMenu->AddEntry("Help on GL Viewer...", kGLHelpViewer);
417 fHelpMenu->AddEntry("&About ROOT...", kGLHelpAbout);
419
420 // Create menubar
422 fMenuBar->AddPopup("&File", fFileMenu, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
423 fMenuBar->AddPopup("&Camera", fCameraMenu, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
426 gVirtualX->SelectInput(fMenuBar->GetId(),
430
431 fMenuBut = new TGButton(fFrame);
433 fMenuBut->Resize(20, 4);
434 fMenuBut->SetBackgroundColor(0x80A0C0);
436}
437
438////////////////////////////////////////////////////////////////////////////////
439/// Internal frames creation.
440
442{
443 TGCompositeFrame* compositeFrame = fFrame;
444 if (fGedEditor == 0)
445 {
446 compositeFrame = new TGCompositeFrame(fFrame, 100, 100, kHorizontalFrame | kRaisedFrame);
448
449 fLeftVerticalFrame = new TGVerticalFrame(compositeFrame, 195, 10, kFixedWidth);
450 compositeFrame->AddFrame(fLeftVerticalFrame, new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 2, 2, 2, 2));
451
452 const TGWindow* cw = fFrame->GetClient()->GetRoot();
454
455 fGedEditor = new TGedEditor();
461
462 TGVSplitter *splitter = new TGVSplitter(compositeFrame);
464 compositeFrame->AddFrame(splitter, new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 0,1,2,2) );
465 }
466
467 // SunkenFrame introduces 1-pixel offset - in TGFrame.cxx:163
468 //
469 // TGVerticalFrame *rightVerticalFrame = new TGVerticalFrame(compositeFrame, 10, 10, kSunkenFrame);
470 // compositeFrame->AddFrame(rightVerticalFrame, new TGLayoutHints(kLHintsRight | kLHintsExpandX | kLHintsExpandY,0,2,2,2));
471 fRightVerticalFrame = new TGVerticalFrame(compositeFrame, 10, 10);
473
474 fEventHandler = new TGLEventHandler(0, this);
476}
477
478////////////////////////////////////////////////////////////////////////////////
479/// Update GUI components for embedded viewer selection change.
480/// Override from TGLViewer.
481
483{
484 TGLPhysicalShape *selected = const_cast<TGLPhysicalShape*>(GetSelected());
485
486 if (selected) {
487 fPShapeWrap->fPShape = selected;
490 else
492 } else {
493 fPShapeWrap->fPShape = 0;
495 }
496}
497
498////////////////////////////////////////////////////////////////////////////////
499/// Show the viewer
500
502{
503 fFrame->MapRaised();
505 RequestDraw();
506}
507
508////////////////////////////////////////////////////////////////////////////////
509/// Close the viewer - destructed.
510
512{
513 // Commit suicide when contained GUI is closed.
514 delete this;
515}
516
517////////////////////////////////////////////////////////////////////////////////
518/// Delete the menu bar.
519
521{
523}
524
525////////////////////////////////////////////////////////////////////////////////
526/// Deactivate menu entries for closing the GL window and exiting ROOT.
527
529{
532}
533
534////////////////////////////////////////////////////////////////////////////////
535/// Enable hiding of menu bar.
536
538{
539 if (fHideMenuBar)
540 return;
541
543
544 fMenuBar->Connect("ProcessedEvent(Event_t*)", "TGLSAViewer", this, "HandleMenuBarHiding(Event_t*)");
545 fMenuBut->Connect("ProcessedEvent(Event_t*)", "TGLSAViewer", this, "HandleMenuBarHiding(Event_t*)");
546
549 fFrame->Layout();
550
552 fMenuHidingTimer->Connect("Timeout()", "TGLSAViewer", this, "MenuHidingTimeout()");
553
555}
556
557////////////////////////////////////////////////////////////////////////////////
558/// Disable hiding of menu bar.
559
561{
562 if (!fHideMenuBar)
563 return;
564
566
567 fMenuBar->Disconnect("ProcessedEvent(Event_t*)", this, "HandleMenuBarHiding(Event_t*)");
568 fMenuBut->Disconnect("ProcessedEvent(Event_t*)", this, "HandleMenuBarHiding(Event_t*)");
569
572 fFrame->Layout();
573
575 delete fMenuHidingTimer;
577
579}
580
581////////////////////////////////////////////////////////////////////////////////
582/// Maybe switch menu-bar / menu-button.
583
585{
587
588 if (f == fMenuBut)
589 {
590 if (ev->fType == kEnterNotify)
592 else
594 }
595 else if (f == fMenuBar)
596 {
597 if (ev->fType == kLeaveNotify &&
598 (ev->fX < 0 || ev->fX >= (Int_t) f->GetWidth() ||
599 ev->fY < 0 || ev->fY >= (Int_t) f->GetHeight()))
600 {
601 if (fMenuBar->GetCurrent() == 0)
603 else
604 fMenuBar->GetCurrent()->Connect("ProcessedEvent(Event_t*)", "TGLSAViewer", this, "HandleMenuBarHiding(Event_t*)");
605 }
606 else
607 {
609 }
610 }
611 else
612 {
613 f->Disconnect("ProcessedEvent(Event_t*)", this);
615 }
616}
617
618////////////////////////////////////////////////////////////////////////////////
619/// Reset the timer for menu-bar hiding.
620
622{
623 // This happens, mysteriously.
624 if (fMenuHidingTimer == 0)
625 return;
626
628
629 fMenuHidingShowMenu = show_menu;
630
634}
635
636////////////////////////////////////////////////////////////////////////////////
637/// Action for menu-hiding timeout.
638
640{
645 } else {
648 }
649 fFrame->Layout();
650}
651
652////////////////////////////////////////////////////////////////////////////////
653/// Set global timeout for menu-hiding in mili-seconds.
654/// Static function.
655
657{
658 fgMenuHidingTimeout = timeout;
659}
660
661////////////////////////////////////////////////////////////////////////////////
662/// Process GUI message capture by the main GUI frame (TGLSAFrame).
663
665{
666 switch (GET_MSG(msg)) {
667 case kC_COMMAND:
668 switch (GET_SUBMSG(msg)) {
669 case kCM_BUTTON:
670 case kCM_MENU:
671 switch (parm1) {
672 case kGLHelpAbout: {
673#ifdef R__UNIX
674 TString rootx = TROOT::GetBinDir() + "/root -a &";
675 gSystem->Exec(rootx);
676#else
677#ifdef WIN32
679#else
680 char str[32];
681 snprintf(str,32, "About ROOT %s...", gROOT->GetVersion());
682 hd = new TRootHelpDialog(this, str, 600, 400);
683 hd->SetText(gHelpAbout);
684 hd->Popup();
685#endif
686#endif
687 break;
688 }
689 case kGLHelpViewer: {
690 TRootHelpDialog * hd = new TRootHelpDialog(fFrame, "Help on GL Viewer...", 660, 400);
691 hd->AddText(fgHelpText1);
692 hd->AddText(fgHelpText2);
693 hd->Popup();
694 break;
695 }
696 case kGLPerspYOZ:
698 break;
699 case kGLPerspXOZ:
701 break;
702 case kGLPerspXOY:
704 break;
705 case kGLXOY:
707 break;
708 case kGLXOZ:
710 break;
711 case kGLZOY:
713 break;
714 case kGLZOX:
716 break;
717 case kGLXnOY:
719 break;
720 case kGLXnOZ:
722 break;
723 case kGLZnOY:
725 break;
726 case kGLZnOX:
728 break;
729 case kGLOrthoRotate:
731 break;
732 case kGLOrthoDolly:
734 break;
735 case kGLSaveEPS:
736 SavePicture("viewer.eps");
737 break;
738 case kGLSavePDF:
739 SavePicture("viewer.pdf");
740 break;
741 case kGLSaveGIF:
742 SavePicture("viewer.gif");
743 break;
744 case kGLSaveAnimGIF:
745 SavePicture("viewer.gif+");
746 break;
747 case kGLSaveJPG:
748 SavePicture("viewer.jpg");
749 break;
750 case kGLSavePNG:
751 SavePicture("viewer.png");
752 break;
753 case kGLSaveAS:
754 {
755 TGFileInfo fi;
760 new TGFileDialog(gClient->GetDefaultRoot(), fFrame, kFDSave, &fi);
761 if (!fi.fFilename) return kTRUE;
762 TString ft(fi.fFileTypes[fi.fFileTypeIdx+1]);
763 fDirName = fi.fIniDir;
766
768 Bool_t match = kFALSE;
769 const char** fin = gGLSaveAsTypes; ++fin;
770 while (*fin != 0)
771 {
772 if (file.EndsWith(*fin + 1))
773 {
774 match = kTRUE;
775 break;
776 }
777 fin += 2;
778 }
779 if ( ! match)
780 {
781 file += ft(ft.Index("."), ft.Length());
782 }
784 }
785 break;
786 case kGLHideMenus:
787 if (fHideMenuBar)
789 else
791 break;
792 case kGLEditObject:
794 break;
795 case kGLCloseViewer:
796 // Exit needs to be delayed to avoid bad drawable X ids - GUI
797 // will all be changed in future anyway
798 TTimer::SingleShot(50, "TGLSAFrame", fFrame, "SendCloseMessage()");
799 break;
800 case kGLQuitROOT:
802 delete this;
804 break;
805 default:
806 break;
807 }
808 default:
809 break;
810 }
811 default:
812 break;
813 }
814
815 return kTRUE;
816}
817
818////////////////////////////////////////////////////////////////////////////////
819/// Toggle state of the 'Edit Object' menu entry.
820
822{
825 else
828}
829
830////////////////////////////////////////////////////////////////////////////////
831/// Toggle state of the 'Ortho allow rotate' menu entry.
832
834{
837 else
846}
847
848////////////////////////////////////////////////////////////////////////////////
849/// Toggle state of the 'Ortho allow dolly' menu entry.
850
852{
855 else
861}
@ kButton1Down
Definition: Buttons.h:17
@ kEnterNotify
Definition: GuiTypes.h:60
@ kLeaveNotify
Definition: GuiTypes.h:60
const Mask_t kFocusChangeMask
Definition: GuiTypes.h:168
const Mask_t kExposureMask
Definition: GuiTypes.h:164
const Mask_t kKeyPressMask
Definition: GuiTypes.h:158
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
@ kRaisedFrame
Definition: GuiTypes.h:384
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
@ kFixedHeight
Definition: GuiTypes.h:389
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:166
R__EXTERN const char gHelpAbout[]
Definition: HelpText.h:14
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:43
const Bool_t kFALSE
Definition: RtypesCore.h:90
long Long_t
Definition: RtypesCore.h:52
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
#define gClient
Definition: TGClient.h:166
@ kFDSave
Definition: TGFileDialog.h:39
@ kMWMFuncAll
Definition: TGFrame.h:58
@ kMWMDecorAll
Definition: TGFrame.h:72
@ kMWMInputModeless
Definition: TGFrame.h:66
@ kDeepCleanup
Definition: TGFrame.h:51
const char * gGLSaveAsTypes[]
@ kLHintsRight
Definition: TGLayout.h:33
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsNormal
Definition: TGLayout.h:39
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
R__EXTERN void * gTQSender
Definition: TQObject.h:44
#define gROOT
Definition: TROOT.h:406
R__EXTERN TSystem * gSystem
Definition: TSystem.h:556
#define gVirtualX
Definition: TVirtualX.h:338
Int_t GET_MSG(Long_t val)
@ kCM_MENU
@ kC_COMMAND
@ kCM_BUTTON
Int_t GET_SUBMSG(Long_t val)
#define snprintf
Definition: civetweb.c:1540
Bool_t ReturnFromRun() const
Definition: TApplication.h:149
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:234
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:224
void SetRoot(TGWindow *root=0)
Sets the current root (i.e.
Definition: TGClient.cxx:244
virtual TList * GetList() const
Definition: TGFrame.h:347
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:353
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1188
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1133
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1174
char * fFilename
Definition: TGFileDialog.h:61
Int_t fFileTypeIdx
Definition: TGFileDialog.h:64
const char ** fFileTypes
Definition: TGFileDialog.h:63
char * fIniDir
Definition: TGFileDialog.h:62
Bool_t fOverwrite
Definition: TGFileDialog.h:65
void SetIniDir(const char *inidir)
Set directory name.
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:305
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:296
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:260
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGFrame.cxx:613
virtual void MapWindow()
map window
Definition: TGFrame.h:229
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
Encapsulation of format / contents of an OpenGL buffer.
Definition: TGLFormat.h:36
TObject * GetExternal() const
void SetDollyToZoom(Bool_t x)
void SetEnableRotate(Bool_t x)
TGLPhysicalShape * fPShape
Definition: TGLPShapeObj.h:23
Concrete physical shape - a GL drawable.
const TGLLogicalShape * GetLogical() const
Standalone GL Viewer GUI main frame.
Definition: TGLSAFrame.h:29
The top level standalone GL-viewer - created via plugin manager.
Definition: TGLSAViewer.h:38
void Show()
Show the viewer.
Bool_t fDeleteMenuBar
Definition: TGLSAViewer.h:73
static void SetMenuHidingTimeout(Long_t timeout)
Set global timeout for menu-hiding in mili-seconds.
void ToggleOrthoDolly()
Toggle state of the 'Ortho allow dolly' menu entry.
~TGLSAViewer()
Destroy standalone viewer object.
TGPopupMenu * fFileMenu
Definition: TGLSAViewer.h:54
virtual void CreateGLWidget()
Create a GLwidget, it is an error if it is already created.
static const Int_t fgInitH
Definition: TGLSAViewer.h:83
Bool_t ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t)
Process GUI message capture by the main GUI frame (TGLSAFrame).
void EnableMenuBarHiding()
Enable hiding of menu bar.
TGLSAViewer(const TGLSAViewer &)
TString fDirName
Definition: TGLSAViewer.h:64
TGCompositeFrame * fRightVerticalFrame
Definition: TGLSAViewer.h:62
TGMenuBar * fMenuBar
Definition: TGLSAViewer.h:67
TGPopupMenu * fHelpMenu
Definition: TGLSAViewer.h:57
void ResetMenuHidingTimer(Bool_t show_menu)
Reset the timer for menu-bar hiding.
void CreateMenus()
File/Camera/Help menus.
void ToggleOrthoRotate()
Toggle state of the 'Ortho allow rotate' menu entry.
void CreateFrames()
Internal frames creation.
Int_t fTypeIdx
Definition: TGLSAViewer.h:65
void DeleteMenuBar()
Delete the menu bar.
void HandleMenuBarHiding(Event_t *ev)
Maybe switch menu-bar / menu-button.
static const char * fgHelpText2
Definition: TGLSAViewer.h:86
TTimer * fMenuHidingTimer
Definition: TGLSAViewer.h:70
void MenuHidingTimeout()
Action for menu-hiding timeout.
static Long_t fgMenuHidingTimeout
Definition: TGLSAViewer.h:75
void Close()
Close the viewer - destructed.
void DisableMenuBarHiding()
Disable hiding of menu bar.
Bool_t fOverwrite
Definition: TGLSAViewer.h:66
virtual void SelectionChanged()
Update GUI components for embedded viewer selection change.
static const Int_t fgInitX
Definition: TGLSAViewer.h:80
Bool_t fHideMenuBar
Definition: TGLSAViewer.h:69
virtual void DestroyGLWidget()
Destroy the GLwidget, it is an error if it does not exist.
static const Int_t fgInitW
Definition: TGLSAViewer.h:82
TGLFormat * fFormat
Definition: TGLSAViewer.h:53
TGPopupMenu * fFileSaveMenu
Definition: TGLSAViewer.h:55
void ToggleEditObject()
Toggle state of the 'Edit Object' menu entry.
TGCompositeFrame * GetFrame() const
Return the main-frame.
TGButton * fMenuBut
Definition: TGLSAViewer.h:68
TGPopupMenu * fCameraMenu
Definition: TGLSAViewer.h:56
TGCompositeFrame * fLeftVerticalFrame
Definition: TGLSAViewer.h:60
void DisableCloseMenuEntries()
Deactivate menu entries for closing the GL window and exiting ROOT.
TGLSAFrame * fFrame
Definition: TGLSAViewer.h:52
static const char * fgHelpText1
Definition: TGLSAViewer.h:85
static const Int_t fgInitY
Definition: TGLSAViewer.h:81
Bool_t fMenuHidingShowMenu
Definition: TGLSAViewer.h:71
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition: TGLViewer.h:57
TGLOrthoCamera fOrthoXOYCamera
Definition: TGLViewer.h:90
TGLOrthoCamera fOrthoXnOZCamera
Definition: TGLViewer.h:95
TGEventHandler * fEventHandler
select record from last overlay select
Definition: TGLViewer.h:121
TGLOrthoCamera fOrthoZnOYCamera
Definition: TGLViewer.h:96
void RequestDraw(Short_t LOD=TGLRnrCtx::kLODMed)
Post request for redraw of viewer at level of detail 'LOD' Request is directed via cross thread gVirt...
Definition: TGLViewer.cxx:438
TGLOrthoCamera fOrthoZOYCamera
Definition: TGLViewer.h:92
TGLPShapeObj * fPShapeWrap
GED editor.
Definition: TGLViewer.h:123
TGLWidget * fGLWidget
Definition: TGLViewer.h:187
void SetCurrentCamera(ECameraType camera)
Set current active camera - 'cameraType' one of: kCameraPerspX, kCameraPerspY, kCameraPerspZ,...
Definition: TGLViewer.cxx:1792
Bool_t SavePicture()
Save current image using the default file name which can be set via SetPictureFileName() and defaults...
Definition: TGLViewer.cxx:783
TGLOrthoCamera fOrthoXOZCamera
Definition: TGLViewer.h:91
TGedEditor * fGedEditor
event handler
Definition: TGLViewer.h:122
TVirtualPad * fPad
Definition: TGLViewer.h:80
friend class TGLEventHandler
Definition: TGLViewer.h:59
const TGLPhysicalShape * GetSelected() const
Return selected physical shape.
Definition: TGLViewer.cxx:2084
TGLOrthoCamera fOrthoXnOYCamera
Definition: TGLViewer.h:94
@ kCameraPerspXOY
Definition: TGLViewer.h:63
@ kCameraPerspXOZ
Definition: TGLViewer.h:63
@ kCameraOrthoXnOZ
Definition: TGLViewer.h:65
@ kCameraPerspYOZ
Definition: TGLViewer.h:63
@ kCameraOrthoZnOY
Definition: TGLViewer.h:65
@ kCameraOrthoZOY
Definition: TGLViewer.h:64
@ kCameraOrthoXOY
Definition: TGLViewer.h:64
@ kCameraOrthoZOX
Definition: TGLViewer.h:64
@ kCameraOrthoZnOX
Definition: TGLViewer.h:65
@ kCameraOrthoXOZ
Definition: TGLViewer.h:64
@ kCameraOrthoXnOY
Definition: TGLViewer.h:65
static TGLWidget * Create(const TGWindow *parent, Bool_t selectInput, Bool_t shareDefault, const TGLPaintDevice *shareDevice, UInt_t width, UInt_t height)
Static constructor for creating widget with default pixel format.
Definition: TGLWidget.cxx:83
void SetEventHandler(TGEventHandler *eh)
Set event-handler. All events are passed to this object.
Definition: TGLWidget.cxx:558
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition: TGFrame.cxx:1816
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1839
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
Definition: TGFrame.cxx:1826
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
virtual TGMenuTitle * GetCurrent() const
Definition: TGMenu.h:348
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:416
Handle_t GetId() const
Definition: TGObject.h:47
TGClient * GetClient() const
Definition: TGObject.h:48
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=0, const TGPicture *p=0)
Add a (cascading) popup menu to a popup menu.
Definition: TGMenu.cxx:1150
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition: TGMenu.cxx:1843
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
Add a menu entry.
Definition: TGMenu.cxx:988
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1058
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition: TGMenu.cxx:1780
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition: TGMenu.cxx:1805
virtual void Associate(const TGWindow *w)
Definition: TGMenu.h:219
virtual void DeleteEntry(Int_t id)
Delete entry with specified id from menu.
Definition: TGMenu.cxx:1924
TGCanvas * GetTGCanvas() const
Definition: TGedEditor.h:83
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
Definition: TGedEditor.cxx:351
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Definition: TGedEditor.cxx:324
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
Definition: TList.cxx:99
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:891
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1024
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition: TROOT.cxx:2887
void Popup()
Show help dialog.
void AddText(const char *helpText)
Add help text from helpText buffer to already existing text in TGTextView.
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:634
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:651
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
virtual void TurnOff()
Remove timer from system timer list.
Definition: TTimer.cxx:229
virtual void TurnOn()
Add the timer to the system timer list.
Definition: TTimer.cxx:241
void Reset()
Reset the timer.
Definition: TTimer.cxx:157
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
Definition: TTimer.cxx:256
void SetTime(Long_t milliSec)
Definition: TTimer.h:90
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
Definition: file.py:1
EGEventType fType
Definition: GuiTypes.h:174
Int_t fY
Definition: GuiTypes.h:177
Int_t fX
Definition: GuiTypes.h:177
REAL splitter
Definition: triangle.c:616