Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "TRootHelpDialog.h"
13#include "TPluginManager.h"
14#include "TApplication.h"
15#include "TGClient.h"
16#include "TGCanvas.h"
17#include "HelpText.h"
18#include "GuiTypes.h"
19#include "TG3DLine.h"
20#include "TSystem.h"
21#include "TGFrame.h"
22#include "TGMenu.h"
23#include "TGSplitter.h"
24#include "TGButton.h"
25
26#include "TVirtualPad.h"
27#include "TGedEditor.h"
28#include "TRootEmbeddedCanvas.h"
29#include "TString.h"
30#include "TGFileDialog.h"
31#include "TVirtualX.h"
32
33#include "TGLOutput.h"
34#include "TGLFormat.h"
35
36#include "TGLLogicalShape.h"
37#include "TGLPhysicalShape.h"
38#include "TGLPShapeObj.h"
39#include "TGLClip.h"
40#include "TROOT.h"
41
42#ifdef WIN32
43#include "TWin32SplashThread.h"
44#endif
45
46#include "TGLWidget.h"
47#include "TGLSAViewer.h"
48#include "TGLSAFrame.h"
49#include "TGLEventHandler.h"
50
51#include <cstdio>
52#include <memory>
53
54const char * TGLSAViewer::fgHelpText1 = "\
55DIRECT SCENE INTERACTIONS\n\n\
56 Press:\n\
57 \tw --- wireframe mode\n\
58 \te --- switch between dark / light color-set\n\
59 \tr --- filled polygons mode\n\
60 \tt --- outline mode\n\
61 \tj --- ZOOM in\n\
62 \tk --- ZOOM out\n\
63 \ta --- switch on/off arc-ball camera rotation control\n\
64 \tArrow Keys --- PAN (TRUCK) across scene\n\
65 \tHome --- reset current camera\n\
66 \tCtrl-Home --- switch external/automatic camera center\n\
67\n\
68 LEFT mouse button -- ROTATE (ORBIT) the scene by holding the mouse button and moving\n\
69 the mouse (perspective camera, needs to be enabled in menu for orthographic cameras).\n\
70 By default, the scene will be rotated about its center. To select arbitrary center\n\
71 bring up the viewer-editor (e.g., shift-click into empty background) and use\n\
72 'Camera center' controls in the 'Guides' tab.\n\
73\n\
74 MIDDLE mouse button or arrow keys -- PAN (TRUCK) the camera.\n\
75\n\
76 RIGHT mouse button action depends on camera type:\n\
77 orthographic -- zoom,\n\
78 perspective -- move camera forwards / backwards\n\
79\n\
80 By pressing Ctrl and Shift keys the mouse precision can be changed:\n\
81 Shift -- 10 times less precise\n\
82 Ctrl -- 10 times more precise\n\
83 Ctrl Shift -- 100 times more precise\n\
84\n\
85 Mouse wheel action depends on camera type:\n\
86 orthographic -- zoom,\n\
87 perspective -- change field-of-view (focal length)\n\
88\n\
89 To invert direction of mouse and key actions from scene-centric\n\
90 to viewer-centric, set in your .rootrc file:\n\
91 OpenGL.EventHandler.ViewerCentricControls: 1\n\
92\n\
93 Double click will show GUI editor of the viewer (if assigned).\n\
94\n\
95 RESET the camera via the button in viewer-editor or Home key.\n\
96\n\
97 SELECT a shape with Shift+Left mouse button click.\n\
98\n\
99 SELECT the viewer with Shift+Left mouse button click on a free space.\n\
100\n\
101 MOVE a selected shape using Shift+Mid mouse drag.\n\
102\n\
103 Invoke the CONTEXT menu with Shift+Right mouse click.\n\n"
104 "Secondary selection and direct render object interaction is initiated\n\
105 by Alt+Left mouse click (Mod1, actually). Only few classes support this option.\n\
106 When 'Alt' is taken by window manager, try Alt-Ctrl-Left.\n\
107\n\
108CAMERA\n\
109\n\
110 The \"Camera\" menu is used to select the different projections from \n\
111 the 3D world onto the 2D viewport. There are three perspective cameras:\n\
112\n\
113 \tPerspective (Floor XOZ)\n\
114 \tPerspective (Floor YOZ)\n\
115 \tPerspective (Floor XOY)\n\
116\n\
117 In each case the floor plane (defined by two axes) is kept level.\n\
118\n\
119 There are also four orthographic cameras:\n\
120\n\
121 \tOrthographic (XOY)\n\
122 \tOrthographic (XOZ)\n\
123 \tOrthographic (ZOY)\n\
124 \tOrthographic (ZOX)\n\
125\n\
126 In each case the first axis is placed horizontal, the second vertical e.g.\n\
127 XOY means X horizontal, Y vertical.\n\n";
128
129const char * TGLSAViewer::fgHelpText2 = "\
130SHAPES COLOR AND MATERIAL\n\
131\n\
132 The selected shape's color can be modified in the Shapes-Color tabs.\n\
133 Shape's color is specified by the percentage of red, green, blue light\n\
134 it reflects. A surface can reflect DIFFUSE, AMBIENT and SPECULAR light.\n\
135 A surface can also emit light. The EMISSIVE parameter allows to define it.\n\
136 The surface SHININESS can also be modified.\n\
137\n\
138SHAPES GEOMETRY\n\
139\n\
140 The selected shape's location and geometry can be modified in the Shapes-Geom\n\
141 tabs by entering desired values in respective number entry controls.\n\
142\n\
143SCENE CLIPPING\n\
144\n\
145 In the Scene-Clipping tabs select a 'Clip Type': None, Plane, Box\n\
146\n\
147 For 'Plane' and 'Box' the lower pane shows the relevant parameters:\n\
148\n\
149\tPlane: Equation coefficients of form aX + bY + cZ + d = 0\n\
150\tBox: Center X/Y/Z and Length X/Y/Z\n\n"
151 "For Box checking the 'Show / Edit' checkbox shows the clip box (in light blue)\n\
152 in viewer. It also attaches the current manipulator to the box - enabling\n\
153 direct editing in viewer.\n\
154\n\
155MANIPULATORS\n\
156\n\
157 A widget attached to the selected object - allowing direct manipulation\n\
158 of the object with respect to its local axes.\n\
159\n\
160 There are three modes, toggled with keys while manipulator is active, that is,\n\
161 mouse pointer is above it (switches color to yellow):\n\
162 \tMode\t\tWidget Component Style\t\tKey\n\
163 \t----\t\t----------------------\t\t---\n\
164 \tTranslation\tLocal axes with arrows\t\tv\n\
165 \tScale\t\tLocal axes with boxes\t\tx\n\
166 \tRotate\t\tLocal axes rings\t\tc\n\
167\n\
168 Each widget has three axis components - red (X), green (Y) and blue (Z).\n\
169 The component turns yellow, indicating an active state, when the mouse is moved\n\
170 over it. Left click and drag on the active component to adjust the objects\n\
171 translation, scale or rotation.\n\
172 Some objects do not support all manipulations (e.g. clipping planes cannot be \n\
173 scaled). If a manipulation is not permitted the component it drawn in grey and \n\
174 cannot be selected/dragged.\n";
175
176
177/** \class TGLSAViewer
178\ingroup opengl
179The top level standalone GL-viewer - created via plugin manager.
180*/
181
182
184
187const Int_t TGLSAViewer::fgInitW = 780;
188const Int_t TGLSAViewer::fgInitH = 670;
189
190// A lot of raw pointers/naked new-expressions - good way to discredit C++ (or C++ programmer
191// ROOT has system to cleanup - I'll try to use it
192
193const char *gGLSaveAsTypes[] = {"Encapsulated PostScript", "*.eps",
194 "PDF", "*.pdf",
195 "GIF", "*.gif",
196 "Animated GIF", "*.gif+",
197 "JPEG", "*.jpg",
198 "PNG", "*.png",
199 nullptr, nullptr};
200
201////////////////////////////////////////////////////////////////////////////////
202/// Construct a standalone viewer, bound to supplied 'pad'.
203
205 TGLViewer(pad, fgInitX, fgInitY, fgInitW, fgInitH),
206 fFrame(nullptr),
207 fFormat(format),
208 fFileMenu(nullptr),
209 fFileSaveMenu(nullptr),
210 fCameraMenu(nullptr),
211 fHelpMenu(nullptr),
212 fLeftVerticalFrame(nullptr),
213 fRightVerticalFrame(nullptr),
214 fDirName("."),
215 fTypeIdx(0),
216 fOverwrite(kFALSE),
217 fMenuBar(nullptr),
218 fMenuBut(nullptr),
219 fHideMenuBar(kFALSE),
220 fMenuHidingTimer(nullptr),
221 fMenuHidingShowMenu(kTRUE),
222 fDeleteMenuBar(kFALSE)
223{
224 fFrame = new TGLSAFrame(*this);
225
226 CreateMenus();
227 CreateFrames();
228
229 fFrame->SetWindowName("ROOT's GL viewer");
230 fFrame->SetClassHints("GLViewer", "GLViewer");
234
238
239 // set recursive cleanup, but exclude fGedEditor
240 // destructor of fGedEditor has own way of handling child nodes
241 TObject* fe = fLeftVerticalFrame->GetList()->First();
242 fLeftVerticalFrame->GetList()->Remove(fe);
244 fLeftVerticalFrame->GetList()->AddFirst(fe);
245
246 Show();
247}
248
249////////////////////////////////////////////////////////////////////////////////
250/// Construct an embedded standalone viewer, bound to supplied 'pad'.
251/// If format is passed, it gets adopted by the viewer as it might
252/// need to be reused several times when recreating the GL-widget.
253///
254/// Modified version of the previous constructor for embedding the
255/// viewer into another frame (parent).
256
258 TGLFormat* format) :
259 TGLViewer(pad, fgInitX, fgInitY, fgInitW, fgInitH),
260 fFrame(nullptr),
261 fFormat(format),
262 fFileMenu(nullptr),
263 fCameraMenu(nullptr),
264 fHelpMenu(nullptr),
265 fLeftVerticalFrame(nullptr),
266 fRightVerticalFrame(nullptr),
267 fTypeIdx(0),
268 fMenuBar(nullptr),
269 fMenuBut(nullptr),
270 fHideMenuBar(kFALSE),
271 fMenuHidingTimer(nullptr),
272 fMenuHidingShowMenu(kTRUE),
273 fDeleteMenuBar(kFALSE)
274{
275 fGedEditor = ged;
276 fFrame = new TGLSAFrame(parent, *this);
277
278 CreateMenus();
279 CreateFrames();
280
285
286 // set recursive cleanup, but exclude fGedEditor
287 // destructor of fGedEditor has own way of handling child nodes
289 {
290 TObject* fe = fLeftVerticalFrame->GetList()->First();
291 fLeftVerticalFrame->GetList()->Remove(fe);
293 fLeftVerticalFrame->GetList()->AddFirst(fe);
294 }
295
296 Show();
297}
298
299////////////////////////////////////////////////////////////////////////////////
300/// Destroy standalone viewer object.
301
303{
305
307
308 delete fHelpMenu;
309 delete fCameraMenu;
310 delete fFileSaveMenu;
311 delete fFileMenu;
312 if(fDeleteMenuBar) {
313 delete fMenuBar;
314 }
315 delete fFormat;
316 delete fFrame;
317 fGLWidget = nullptr;
318}
319
320////////////////////////////////////////////////////////////////////////////////
321/// Return the main-frame.
322
324{
325 return fFrame;
326}
327
328////////////////////////////////////////////////////////////////////////////////
329/// Create a GLwidget, it is an error if it is already created.
330/// This is needed for frame-swapping on mac.
331
333{
334 if (fGLWidget) {
335 Error("CreateGLWidget", "Widget already exists.");
336 return;
337 }
338
339 if (fFormat == nullptr)
340 fFormat = new TGLFormat;
341
344
346 fFrame->Layout();
347
349}
350
351////////////////////////////////////////////////////////////////////////////////
352/// Destroy the GLwidget, it is an error if it does not exist.
353/// This is needed for frame-swapping on mac.
354
356{
357 if (fGLWidget == nullptr) {
358 Error("DestroyGLWidget", "Widget does not exist.");
359 return;
360 }
361
363 fGLWidget->SetEventHandler(nullptr);
364
367 fGLWidget = nullptr;
368}
369
370////////////////////////////////////////////////////////////////////////////////
371///File/Camera/Help menus.
372
374{
376 fFileMenu->AddEntry("&Hide Menus", kGLHideMenus);
377 fFileMenu->AddEntry("&Edit Object", kGLEditObject);
379 fFileMenu->AddEntry("&Close Viewer", kGLCloseViewer);
382 fFileSaveMenu->AddEntry("viewer.&eps", kGLSaveEPS);
383 fFileSaveMenu->AddEntry("viewer.&pdf", kGLSavePDF);
384 fFileSaveMenu->AddEntry("viewer.&gif", kGLSaveGIF);
385 fFileSaveMenu->AddEntry("viewer.g&if+", kGLSaveAnimGIF);
386 fFileSaveMenu->AddEntry("viewer.&jpg", kGLSaveJPG);
387 fFileSaveMenu->AddEntry("viewer.p&ng", kGLSavePNG);
389 fFileMenu->AddEntry("Save &As...", kGLSaveAS);
391 fFileMenu->AddEntry("&Quit ROOT", kGLQuitROOT);
393
395 fCameraMenu->AddEntry("Perspective (Floor XOZ)", kGLPerspXOZ);
396 fCameraMenu->AddEntry("Perspective (Floor YOZ)", kGLPerspYOZ);
397 fCameraMenu->AddEntry("Perspective (Floor XOY)", kGLPerspXOY);
398 fCameraMenu->AddEntry("Orthographic (XOY)", kGLXOY);
399 fCameraMenu->AddEntry("Orthographic (XOZ)", kGLXOZ);
400 fCameraMenu->AddEntry("Orthographic (ZOY)", kGLZOY);
401 fCameraMenu->AddEntry("Orthographic (ZOX)", kGLZOX);
402 fCameraMenu->AddEntry("Orthographic (XnOY)", kGLXnOY);
403 fCameraMenu->AddEntry("Orthographic (XnOZ)", kGLXnOZ);
404 fCameraMenu->AddEntry("Orthographic (ZnOY)", kGLZnOY);
405 fCameraMenu->AddEntry("Orthographic (ZnOX)", kGLZnOX);
407 fCameraMenu->AddEntry("Ortho allow rotate", kGLOrthoRotate);
408 fCameraMenu->AddEntry("Ortho allow dolly", kGLOrthoDolly);
410
412 fHelpMenu->AddEntry("Help on GL Viewer...", kGLHelpViewer);
414 fHelpMenu->AddEntry("&About ROOT...", kGLHelpAbout);
416
417 // Create menubar
419 fMenuBar->AddPopup("&File", fFileMenu, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
420 fMenuBar->AddPopup("&Camera", fCameraMenu, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
423 gVirtualX->SelectInput(fMenuBar->GetId(),
427
428 fMenuBut = new TGButton(fFrame);
430 fMenuBut->Resize(20, 4);
431 fMenuBut->SetBackgroundColor(0x80A0C0);
433}
434
435////////////////////////////////////////////////////////////////////////////////
436/// Internal frames creation.
437
439{
441 if (fGedEditor == nullptr)
442 {
445
448
449 const TGWindow* cw = fFrame->GetClient()->GetRoot();
451
452 fGedEditor = new TGedEditor();
458
462 }
463
464 // SunkenFrame introduces 1-pixel offset - in TGFrame.cxx:163
465 //
466 // TGVerticalFrame *rightVerticalFrame = new TGVerticalFrame(compositeFrame, 10, 10, kSunkenFrame);
467 // compositeFrame->AddFrame(rightVerticalFrame, new TGLayoutHints(kLHintsRight | kLHintsExpandX | kLHintsExpandY,0,2,2,2));
470
471 fEventHandler = new TGLEventHandler(nullptr, this);
473}
474
475////////////////////////////////////////////////////////////////////////////////
476/// Update GUI components for embedded viewer selection change.
477/// Override from TGLViewer.
478
480{
481 TGLPhysicalShape *selected = const_cast<TGLPhysicalShape*>(GetSelected());
482
483 if (selected) {
484 fPShapeWrap->fPShape = selected;
486 fGedEditor->SetModel(fPad, selected->GetLogical()->GetExternal(), kButton1Down);
487 else
489 } else {
490 fPShapeWrap->fPShape = nullptr;
492 }
493}
494
495////////////////////////////////////////////////////////////////////////////////
496/// Show the viewer
497
499{
500 fFrame->MapRaised();
502 RequestDraw();
503}
504
505////////////////////////////////////////////////////////////////////////////////
506/// Close the viewer - destructed.
507
509{
510 // Commit suicide when contained GUI is closed.
511 delete this;
512}
513
514////////////////////////////////////////////////////////////////////////////////
515/// Delete the menu bar.
516
521
522////////////////////////////////////////////////////////////////////////////////
523/// Deactivate menu entries for closing the GL window and exiting ROOT.
524
530
531////////////////////////////////////////////////////////////////////////////////
532/// Enable hiding of menu bar.
533
535{
536 if (fHideMenuBar)
537 return;
538
540
541 fMenuBar->Connect("ProcessedEvent(Event_t*)", "TGLSAViewer", this, "HandleMenuBarHiding(Event_t*)");
542 fMenuBut->Connect("ProcessedEvent(Event_t*)", "TGLSAViewer", this, "HandleMenuBarHiding(Event_t*)");
543
546 fFrame->Layout();
547
549 fMenuHidingTimer->Connect("Timeout()", "TGLSAViewer", this, "MenuHidingTimeout()");
550
552}
553
554////////////////////////////////////////////////////////////////////////////////
555/// Disable hiding of menu bar.
556
558{
559 if (!fHideMenuBar)
560 return;
561
563
564 fMenuBar->Disconnect("ProcessedEvent(Event_t*)", this, "HandleMenuBarHiding(Event_t*)");
565 fMenuBut->Disconnect("ProcessedEvent(Event_t*)", this, "HandleMenuBarHiding(Event_t*)");
566
569 fFrame->Layout();
570
572 delete fMenuHidingTimer;
573 fMenuHidingTimer = nullptr;
574
576}
577
578////////////////////////////////////////////////////////////////////////////////
579/// Maybe switch menu-bar / menu-button.
580
582{
584
585 if (f == fMenuBut)
586 {
587 if (ev->fType == kEnterNotify)
589 else
591 }
592 else if (f == fMenuBar)
593 {
594 if (ev->fType == kLeaveNotify &&
595 (ev->fX < 0 || ev->fX >= (Int_t) f->GetWidth() ||
596 ev->fY < 0 || ev->fY >= (Int_t) f->GetHeight()))
597 {
598 if (fMenuBar->GetCurrent() == nullptr)
600 else
601 fMenuBar->GetCurrent()->Connect("ProcessedEvent(Event_t*)", "TGLSAViewer", this, "HandleMenuBarHiding(Event_t*)");
602 }
603 else
604 {
606 }
607 }
608 else
609 {
610 f->Disconnect("ProcessedEvent(Event_t*)", this);
612 }
613}
614
615////////////////////////////////////////////////////////////////////////////////
616/// Reset the timer for menu-bar hiding.
617
619{
620 // This happens, mysteriously.
621 if (fMenuHidingTimer == nullptr)
622 return;
623
625
627
631}
632
633////////////////////////////////////////////////////////////////////////////////
634/// Action for menu-hiding timeout.
635
648
649////////////////////////////////////////////////////////////////////////////////
650/// Set global timeout for menu-hiding in mili-seconds.
651/// Static function.
652
657
658////////////////////////////////////////////////////////////////////////////////
659/// Process GUI message capture by the main GUI frame (TGLSAFrame).
660
662{
663 switch (GET_MSG(msg)) {
664 case kC_COMMAND:
665 switch (GET_SUBMSG(msg)) {
666 case kCM_BUTTON:
667 case kCM_MENU:
668 switch (parm1) {
669 case kGLHelpAbout: {
670#ifdef WIN32
672#else
673 char str[32];
674 snprintf(str,32, "About ROOT %s...", gROOT->GetVersion());
675 TRootHelpDialog * hd = new TRootHelpDialog(fFrame, str, 600, 400);
676 hd->SetText(gHelpAbout);
677 hd->Popup();
678#endif
679 break;
680 }
681 case kGLHelpViewer: {
682 TRootHelpDialog * hd = new TRootHelpDialog(fFrame, "Help on GL Viewer...", 660, 400);
683 hd->AddText(fgHelpText1);
684 hd->AddText(fgHelpText2);
685 hd->Popup();
686 break;
687 }
688 case kGLPerspYOZ:
690 break;
691 case kGLPerspXOZ:
693 break;
694 case kGLPerspXOY:
696 break;
697 case kGLXOY:
699 break;
700 case kGLXOZ:
702 break;
703 case kGLZOY:
705 break;
706 case kGLZOX:
708 break;
709 case kGLXnOY:
711 break;
712 case kGLXnOZ:
714 break;
715 case kGLZnOY:
717 break;
718 case kGLZnOX:
720 break;
721 case kGLOrthoRotate:
723 break;
724 case kGLOrthoDolly:
726 break;
727 case kGLSaveEPS:
728 SavePicture("viewer.eps");
729 break;
730 case kGLSavePDF:
731 SavePicture("viewer.pdf");
732 break;
733 case kGLSaveGIF:
734 SavePicture("viewer.gif");
735 break;
736 case kGLSaveAnimGIF:
737 SavePicture("viewer.gif+");
738 break;
739 case kGLSaveJPG:
740 SavePicture("viewer.jpg");
741 break;
742 case kGLSavePNG:
743 SavePicture("viewer.png");
744 break;
745 case kGLSaveAS:
746 {
748 fi.fFileTypes = gGLSaveAsTypes;
749 fi.SetIniDir(fDirName);
750 fi.fFileTypeIdx = fTypeIdx;
751 fi.fOverwrite = fOverwrite;
752 new TGFileDialog(gClient->GetDefaultRoot(), fFrame, kFDSave, &fi);
753 if (!fi.fFilename) return kTRUE;
754 TString ft(fi.fFileTypes[fi.fFileTypeIdx+1]);
755 fDirName = fi.fIniDir;
756 fTypeIdx = fi.fFileTypeIdx;
757 fOverwrite = fi.fOverwrite;
758
759 TString file = fi.fFilename;
760 Bool_t match = kFALSE;
761 const char** fin = gGLSaveAsTypes; ++fin;
762 while (*fin != nullptr)
763 {
764 if (file.EndsWith(*fin + 1))
765 {
766 match = kTRUE;
767 break;
768 }
769 fin += 2;
770 }
771 if ( ! match)
772 {
773 file += ft(ft.Index("."), ft.Length());
774 }
775 SavePicture(file);
776 }
777 break;
778 case kGLHideMenus:
779 if (fHideMenuBar)
781 else
783 break;
784 case kGLEditObject:
786 break;
787 case kGLCloseViewer:
788 // Exit needs to be delayed to avoid bad drawable X ids - GUI
789 // will all be changed in future anyway
790 TTimer::SingleShot(50, "TGLSAFrame", fFrame, "SendCloseMessage()");
791 break;
792 case kGLQuitROOT:
794 delete this;
796 break;
797 default:
798 break;
799 }
800 default:
801 break;
802 }
803 default:
804 break;
805 }
806
807 return kTRUE;
808}
809
810////////////////////////////////////////////////////////////////////////////////
811/// Toggle state of the 'Edit Object' menu entry.
812
821
822////////////////////////////////////////////////////////////////////////////////
823/// Toggle state of the 'Ortho allow rotate' menu entry.
824
839
840////////////////////////////////////////////////////////////////////////////////
841/// Toggle state of the 'Ortho allow dolly' menu entry.
842
@ kButton1Down
Definition Buttons.h:17
@ kEnterNotify
Definition GuiTypes.h:62
@ kLeaveNotify
Definition GuiTypes.h:62
const Mask_t kFocusChangeMask
Definition GuiTypes.h:170
const Mask_t kExposureMask
Definition GuiTypes.h:166
const Mask_t kKeyPressMask
Definition GuiTypes.h:160
const Mask_t kPointerMotionMask
Definition GuiTypes.h:164
@ kRaisedFrame
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:388
@ kHorizontalFrame
Definition GuiTypes.h:383
@ kFixedHeight
Definition GuiTypes.h:390
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:169
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:167
const Mask_t kEnterWindowMask
Definition GuiTypes.h:168
R__EXTERN const char gHelpAbout[]
Definition HelpText.h:17
#define f(i)
Definition RSha256.hxx:104
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:69
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gClient
Definition TGClient.h:157
@ kFDSave
@ kMWMFuncAll
Definition TGFrame.h:49
@ kMWMDecorAll
Definition TGFrame.h:63
@ kMWMInputModeless
Definition TGFrame.h:57
@ kDeepCleanup
Definition TGFrame.h:42
const char * gGLSaveAsTypes[]
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsNormal
Definition TGLayout.h:32
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
R__EXTERN void * gTQSender
Definition TQObject.h:46
#define gROOT
Definition TROOT.h:417
#define gVirtualX
Definition TVirtualX.h:379
Int_t GET_MSG(Long_t val)
@ kCM_MENU
@ kC_COMMAND
@ kCM_BUTTON
Int_t GET_SUBMSG(Long_t val)
Bool_t ReturnFromRun() const
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
A button abstract base class.
Definition TGButton.h:68
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=nullptr)
Sets the current root (i.e.
Definition TGClient.cxx:244
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:318
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1110
virtual TList * GetList() const
Definition TGFrame.h:312
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1157
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1250
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1197
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1065
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1142
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1183
This class creates a file selection dialog.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:314
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
Definition TGFrame.cxx:622
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:598
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:305
void MapWindow() override
map window
Definition TGFrame.h:206
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:269
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
void MapRaised() override
map raised
Definition TGFrame.h:207
Encapsulation of format / contents of an OpenGL buffer.
Definition TGLFormat.h:36
void SetDollyToZoom(Bool_t x)
void SetEnableRotate(Bool_t x)
TGLPhysicalShape * fPShape
Concrete physical shape - a GL drawable.
Standalone GL Viewer GUI main frame.
Definition TGLSAFrame.h:29
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.
TGPopupMenu * fFileMenu
Definition TGLSAViewer.h:54
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.
void SelectionChanged() override
Update GUI components for embedded viewer selection change.
Int_t fTypeIdx
Definition TGLSAViewer.h:65
void CreateGLWidget() override
Create a GLwidget, it is an error if it is already created.
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 DestroyGLWidget() override
Destroy the GLwidget, it is an error if it does not exist.
void Close()
Close the viewer - destructed.
void DisableMenuBarHiding()
Disable hiding of menu bar.
Bool_t fOverwrite
Definition TGLSAViewer.h:66
static const Int_t fgInitX
Definition TGLSAViewer.h:80
Bool_t fHideMenuBar
Definition TGLSAViewer.h:69
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
~TGLSAViewer() override
Destroy standalone viewer object.
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:55
TGLOrthoCamera fOrthoXOYCamera
!
Definition TGLViewer.h:88
TGLOrthoCamera fOrthoXnOZCamera
!
Definition TGLViewer.h:93
TGEventHandler * fEventHandler
! event handler
Definition TGLViewer.h:119
TGLOrthoCamera fOrthoZnOYCamera
!
Definition TGLViewer.h:94
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...
TGLOrthoCamera fOrthoZOYCamera
!
Definition TGLViewer.h:90
TGLPShapeObj * fPShapeWrap
Definition TGLViewer.h:121
TGLWidget * fGLWidget
Definition TGLViewer.h:185
void SetCurrentCamera(ECameraType camera)
Set current active camera - 'cameraType' one of: kCameraPerspX, kCameraPerspY, kCameraPerspZ,...
Bool_t SavePicture()
Save current image using the default file name which can be set via SetPictureFileName() and defaults...
TGLOrthoCamera fOrthoXOZCamera
!
Definition TGLViewer.h:89
TGedEditor * fGedEditor
! GED editor
Definition TGLViewer.h:120
TVirtualPad * fPad
! external pad - remove replace with signal
Definition TGLViewer.h:78
friend class TGLEventHandler
Definition TGLViewer.h:57
const TGLPhysicalShape * GetSelected() const
Return selected physical shape.
TGLOrthoCamera fOrthoXnOYCamera
!
Definition TGLViewer.h:92
@ kCameraPerspXOY
Definition TGLViewer.h:61
@ kCameraPerspXOZ
Definition TGLViewer.h:61
@ kCameraOrthoXnOZ
Definition TGLViewer.h:63
@ kCameraPerspYOZ
Definition TGLViewer.h:61
@ kCameraOrthoZnOY
Definition TGLViewer.h:63
@ kCameraOrthoZOY
Definition TGLViewer.h:62
@ kCameraOrthoXOY
Definition TGLViewer.h:62
@ kCameraOrthoZOX
Definition TGLViewer.h:62
@ kCameraOrthoZnOX
Definition TGLViewer.h:63
@ kCameraOrthoXOZ
Definition TGLViewer.h:62
@ kCameraOrthoXnOY
Definition TGLViewer.h:63
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:82
void SetEventHandler(TGEventHandler *eh)
Set event-handler. All events are passed to this object.
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition TGFrame.cxx:1853
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition TGFrame.cxx:1876
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1783
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
Definition TGFrame.cxx:1863
The TGMenu.h header contains all different menu classes.
Definition TGMenu.h:282
virtual TGMenuTitle * GetCurrent() const
Definition TGMenu.h:326
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=nullptr)
Add popup menu to menu bar.
Definition TGMenu.cxx:414
Handle_t GetId() const
Definition TGObject.h:41
TGClient * GetClient() const
Definition TGObject.h:42
This class creates a popup menu object.
Definition TGMenu.h:110
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition TGMenu.cxx:1842
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=nullptr, const TGPicture *p=nullptr)
Add a (cascading) popup menu to a popup menu.
Definition TGMenu.cxx:1149
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition TGMenu.cxx:1779
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition TGMenu.cxx:1804
virtual void Associate(const TGWindow *w)
Definition TGMenu.h:206
virtual void DeleteEntry(Int_t id)
Delete entry with specified id from menu.
Definition TGMenu.cxx:1923
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1057
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu entry.
Definition TGMenu.cxx:987
A composite frame that layout their children in vertical way.
Definition TGFrame.h:376
ROOT GUI Window base class.
Definition TGWindow.h:23
TGCanvas * GetTGCanvas() const
Definition TGedEditor.h:72
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Mother of all ROOT objects.
Definition TObject.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1096
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:865
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
A TRootHelpDialog is used to display help text (or any text in a dialog window).
Basic string class.
Definition TString.h:137
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition TString.cxx:2325
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
virtual void TurnOff()
Remove timer from system timer list.
Definition TTimer.cxx:234
virtual void TurnOn()
Add the timer to the system timer list.
Definition TTimer.cxx:246
void Reset()
Reset the timer.
Definition TTimer.cxx:162
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:261
void SetTime(Long_t milliSec)
Definition TTimer.h:91
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
Event structure.
Definition GuiTypes.h:175