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 <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 "TGMenu.h"
25#include "TGSplitter.h"
26#include "TGButton.h"
27#include "snprintf.h"
28
29#include "TVirtualPad.h"
30#include "TGedEditor.h"
31#include "TRootEmbeddedCanvas.h"
32#include "TString.h"
33#include "TGFileDialog.h"
34#include "TVirtualX.h"
35
36#include "TGLOutput.h"
37#include "TGLFormat.h"
38
39#include "TGLLogicalShape.h"
40#include "TGLPhysicalShape.h"
41#include "TGLPShapeObj.h"
42#include "TGLClip.h"
43#include "TROOT.h"
44
45#ifdef WIN32
46#include "TWin32SplashThread.h"
47#endif
48
49#include "TGLWidget.h"
50#include "TGLSAViewer.h"
51#include "TGLSAFrame.h"
52#include "TGLEventHandler.h"
53
54
55const char * TGLSAViewer::fgHelpText1 = "\
56DIRECT SCENE INTERACTIONS\n\n\
57 Press:\n\
58 \tw --- wireframe mode\n\
59 \te --- switch between dark / light color-set\n\
60 \tr --- filled polygons mode\n\
61 \tt --- outline mode\n\
62 \tj --- ZOOM in\n\
63 \tk --- ZOOM out\n\
64 \ta --- switch on/off arc-ball camera rotation control\n\
65 \tArrow Keys --- PAN (TRUCK) across scene\n\
66 \tHome --- reset current camera\n\
67 \tCtrl-Home --- switch external/automatic camera center\n\
68\n\
69 LEFT mouse button -- ROTATE (ORBIT) the scene by holding the mouse button and moving\n\
70 the mouse (perspective camera, needs to be enabled in menu for orthographic cameras).\n\
71 By default, the scene will be rotated about its center. To select arbitrary center\n\
72 bring up the viewer-editor (e.g., shift-click into empty background) and use\n\
73 'Camera center' controls in the 'Guides' tab.\n\
74\n\
75 MIDDLE mouse button or arrow keys -- PAN (TRUCK) the camera.\n\
76\n\
77 RIGHT mouse button action depends on camera type:\n\
78 orthographic -- zoom,\n\
79 perspective -- move camera forwards / backwards\n\
80\n\
81 By pressing Ctrl and Shift keys the mouse precision can be changed:\n\
82 Shift -- 10 times less precise\n\
83 Ctrl -- 10 times more precise\n\
84 Ctrl Shift -- 100 times more precise\n\
85\n\
86 Mouse wheel action depends on camera type:\n\
87 orthographic -- zoom,\n\
88 perspective -- change field-of-view (focal length)\n\
89\n\
90 To invert direction of mouse and key actions from scene-centric\n\
91 to viewer-centric, set in your .rootrc file:\n\
92 OpenGL.EventHandler.ViewerCentricControls: 1\n\
93\n\
94 Double click will show GUI editor of the viewer (if assigned).\n\
95\n\
96 RESET the camera via the button in viewer-editor or Home key.\n\
97\n\
98 SELECT a shape with Shift+Left mouse button click.\n\
99\n\
100 SELECT the viewer with Shift+Left mouse button click on a free space.\n\
101\n\
102 MOVE a selected shape using Shift+Mid mouse drag.\n\
103\n\
104 Invoke the CONTEXT menu with Shift+Right mouse click.\n\n"
105 "Secondary selection and direct render object interaction is initiated\n\
106 by Alt+Left mouse click (Mod1, actually). Only few classes support this option.\n\
107 When 'Alt' is taken by window manager, try Alt-Ctrl-Left.\n\
108\n\
109CAMERA\n\
110\n\
111 The \"Camera\" menu is used to select the different projections from \n\
112 the 3D world onto the 2D viewport. There are three perspective cameras:\n\
113\n\
114 \tPerspective (Floor XOZ)\n\
115 \tPerspective (Floor YOZ)\n\
116 \tPerspective (Floor XOY)\n\
117\n\
118 In each case the floor plane (defined by two axes) is kept level.\n\
119\n\
120 There are also four orthographic cameras:\n\
121\n\
122 \tOrthographic (XOY)\n\
123 \tOrthographic (XOZ)\n\
124 \tOrthographic (ZOY)\n\
125 \tOrthographic (ZOX)\n\
126\n\
127 In each case the first axis is placed horizontal, the second vertical e.g.\n\
128 XOY means X horizontal, Y vertical.\n\n";
129
130const char * TGLSAViewer::fgHelpText2 = "\
131SHAPES COLOR AND MATERIAL\n\
132\n\
133 The selected shape's color can be modified in the Shapes-Color tabs.\n\
134 Shape's color is specified by the percentage of red, green, blue light\n\
135 it reflects. A surface can reflect DIFFUSE, AMBIENT and SPECULAR light.\n\
136 A surface can also emit light. The EMISSIVE parameter allows to define it.\n\
137 The surface SHININESS can also be modified.\n\
138\n\
139SHAPES GEOMETRY\n\
140\n\
141 The selected shape's location and geometry can be modified in the Shapes-Geom\n\
142 tabs by entering desired values in respective number entry controls.\n\
143\n\
144SCENE CLIPPING\n\
145\n\
146 In the Scene-Clipping tabs select a 'Clip Type': None, Plane, Box\n\
147\n\
148 For 'Plane' and 'Box' the lower pane shows the relevant parameters:\n\
149\n\
150\tPlane: Equation coefficients of form aX + bY + cZ + d = 0\n\
151\tBox: Center X/Y/Z and Length X/Y/Z\n\n"
152 "For Box checking the 'Show / Edit' checkbox shows the clip box (in light blue)\n\
153 in viewer. It also attaches the current manipulator to the box - enabling\n\
154 direct editing in viewer.\n\
155\n\
156MANIPULATORS\n\
157\n\
158 A widget attached to the selected object - allowing direct manipulation\n\
159 of the object with respect to its local axes.\n\
160\n\
161 There are three modes, toggled with keys while manipulator is active, that is,\n\
162 mouse pointer is above it (switches color to yellow):\n\
163 \tMode\t\tWidget Component Style\t\tKey\n\
164 \t----\t\t----------------------\t\t---\n\
165 \tTranslation\tLocal axes with arrows\t\tv\n\
166 \tScale\t\tLocal axes with boxes\t\tx\n\
167 \tRotate\t\tLocal axes rings\t\tc\n\
168\n\
169 Each widget has three axis components - red (X), green (Y) and blue (Z).\n\
170 The component turns yellow, indicating an active state, when the mouse is moved\n\
171 over it. Left click and drag on the active component to adjust the objects\n\
172 translation, scale or rotation.\n\
173 Some objects do not support all manipulations (e.g. clipping planes cannot be \n\
174 scaled). If a manipulation is not permitted the component it drawn in grey and \n\
175 cannot be selected/dragged.\n";
176
177
178/** \class TGLSAViewer
179\ingroup opengl
180The top level standalone GL-viewer - created via plugin manager.
181*/
182
184
186
189const Int_t TGLSAViewer::fgInitW = 780;
190const Int_t TGLSAViewer::fgInitH = 670;
191
192// A lot of raw pointers/naked new-expressions - good way to discredit C++ (or C++ programmer
193// ROOT has system to cleanup - I'll try to use it
194
195const char *gGLSaveAsTypes[] = {"Encapsulated PostScript", "*.eps",
196 "PDF", "*.pdf",
197 "GIF", "*.gif",
198 "Animated GIF", "*.gif+",
199 "JPEG", "*.jpg",
200 "PNG", "*.png",
201 nullptr, nullptr};
202
203////////////////////////////////////////////////////////////////////////////////
204/// Construct a standalone viewer, bound to supplied 'pad'.
205
207 TGLViewer(pad, fgInitX, fgInitY, fgInitW, fgInitH),
208 fFrame(nullptr),
209 fFormat(format),
210 fFileMenu(nullptr),
211 fFileSaveMenu(nullptr),
212 fCameraMenu(nullptr),
213 fHelpMenu(nullptr),
214 fLeftVerticalFrame(nullptr),
215 fRightVerticalFrame(nullptr),
216 fDirName("."),
217 fTypeIdx(0),
218 fOverwrite(kFALSE),
219 fMenuBar(nullptr),
220 fMenuBut(nullptr),
221 fHideMenuBar(kFALSE),
222 fMenuHidingTimer(nullptr),
223 fMenuHidingShowMenu(kTRUE),
224 fDeleteMenuBar(kFALSE)
225{
226 fFrame = new TGLSAFrame(*this);
227
228 CreateMenus();
229 CreateFrames();
230
231 fFrame->SetWindowName("ROOT's GL viewer");
232 fFrame->SetClassHints("GLViewer", "GLViewer");
236
240
241 // set recursive cleanup, but exclude fGedEditor
242 // destructor of fGedEditor has own way of handling child nodes
247
248 Show();
249}
250
251////////////////////////////////////////////////////////////////////////////////
252/// Construct an embedded standalone viewer, bound to supplied 'pad'.
253/// If format is passed, it gets adopted by the viewer as it might
254/// need to be reused several times when recreating the GL-widget.
255///
256/// Modified version of the previous constructor for embedding the
257/// viewer into another frame (parent).
258
260 TGLFormat* format) :
261 TGLViewer(pad, fgInitX, fgInitY, fgInitW, fgInitH),
262 fFrame(nullptr),
263 fFormat(format),
264 fFileMenu(nullptr),
265 fCameraMenu(nullptr),
266 fHelpMenu(nullptr),
267 fLeftVerticalFrame(nullptr),
268 fRightVerticalFrame(nullptr),
269 fTypeIdx(0),
270 fMenuBar(nullptr),
271 fMenuBut(nullptr),
272 fHideMenuBar(kFALSE),
273 fMenuHidingTimer(nullptr),
274 fMenuHidingShowMenu(kTRUE),
275 fDeleteMenuBar(kFALSE)
276{
277 fGedEditor = ged;
278 fFrame = new TGLSAFrame(parent, *this);
279
280 CreateMenus();
281 CreateFrames();
282
287
288 // set recursive cleanup, but exclude fGedEditor
289 // destructor of fGedEditor has own way of handling child nodes
291 {
296 }
297
298 Show();
299}
300
301////////////////////////////////////////////////////////////////////////////////
302/// Destroy standalone viewer object.
303
305{
307
309
310 delete fHelpMenu;
311 delete fCameraMenu;
312 delete fFileSaveMenu;
313 delete fFileMenu;
314 if(fDeleteMenuBar) {
315 delete fMenuBar;
316 }
317 delete fFormat;
318 delete fFrame;
319 fGLWidget = nullptr;
320}
321
322////////////////////////////////////////////////////////////////////////////////
323/// Return the main-frame.
324
326{
327 return fFrame;
328}
329
330////////////////////////////////////////////////////////////////////////////////
331/// Create a GLwidget, it is an error if it is already created.
332/// This is needed for frame-swapping on mac.
333
335{
336 if (fGLWidget) {
337 Error("CreateGLWidget", "Widget already exists.");
338 return;
339 }
340
341 if (fFormat == nullptr)
342 fFormat = new TGLFormat;
343
346
348 fFrame->Layout();
349
351}
352
353////////////////////////////////////////////////////////////////////////////////
354/// Destroy the GLwidget, it is an error if it does not exist.
355/// This is needed for frame-swapping on mac.
356
358{
359 if (fGLWidget == nullptr) {
360 Error("DestroyGLWidget", "Widget does not exist.");
361 return;
362 }
363
365 fGLWidget->SetEventHandler(nullptr);
366
369 fGLWidget = nullptr;
370}
371
372////////////////////////////////////////////////////////////////////////////////
373///File/Camera/Help menus.
374
376{
378 fFileMenu->AddEntry("&Hide Menus", kGLHideMenus);
379 fFileMenu->AddEntry("&Edit Object", kGLEditObject);
381 fFileMenu->AddEntry("&Close Viewer", kGLCloseViewer);
384 fFileSaveMenu->AddEntry("viewer.&eps", kGLSaveEPS);
385 fFileSaveMenu->AddEntry("viewer.&pdf", kGLSavePDF);
386 fFileSaveMenu->AddEntry("viewer.&gif", kGLSaveGIF);
387 fFileSaveMenu->AddEntry("viewer.g&if+", kGLSaveAnimGIF);
388 fFileSaveMenu->AddEntry("viewer.&jpg", kGLSaveJPG);
389 fFileSaveMenu->AddEntry("viewer.p&ng", kGLSavePNG);
391 fFileMenu->AddEntry("Save &As...", kGLSaveAS);
393 fFileMenu->AddEntry("&Quit ROOT", kGLQuitROOT);
395
397 fCameraMenu->AddEntry("Perspective (Floor XOZ)", kGLPerspXOZ);
398 fCameraMenu->AddEntry("Perspective (Floor YOZ)", kGLPerspYOZ);
399 fCameraMenu->AddEntry("Perspective (Floor XOY)", kGLPerspXOY);
400 fCameraMenu->AddEntry("Orthographic (XOY)", kGLXOY);
401 fCameraMenu->AddEntry("Orthographic (XOZ)", kGLXOZ);
402 fCameraMenu->AddEntry("Orthographic (ZOY)", kGLZOY);
403 fCameraMenu->AddEntry("Orthographic (ZOX)", kGLZOX);
404 fCameraMenu->AddEntry("Orthographic (XnOY)", kGLXnOY);
405 fCameraMenu->AddEntry("Orthographic (XnOZ)", kGLXnOZ);
406 fCameraMenu->AddEntry("Orthographic (ZnOY)", kGLZnOY);
407 fCameraMenu->AddEntry("Orthographic (ZnOX)", kGLZnOX);
409 fCameraMenu->AddEntry("Ortho allow rotate", kGLOrthoRotate);
410 fCameraMenu->AddEntry("Ortho allow dolly", kGLOrthoDolly);
412
414 fHelpMenu->AddEntry("Help on GL Viewer...", kGLHelpViewer);
416 fHelpMenu->AddEntry("&About ROOT...", kGLHelpAbout);
418
419 // Create menubar
421 fMenuBar->AddPopup("&File", fFileMenu, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
422 fMenuBar->AddPopup("&Camera", fCameraMenu, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
425 gVirtualX->SelectInput(fMenuBar->GetId(),
429
430 fMenuBut = new TGButton(fFrame);
432 fMenuBut->Resize(20, 4);
433 fMenuBut->SetBackgroundColor(0x80A0C0);
435}
436
437////////////////////////////////////////////////////////////////////////////////
438/// Internal frames creation.
439
441{
442 TGCompositeFrame* compositeFrame = fFrame;
443 if (fGedEditor == nullptr)
444 {
445 compositeFrame = new TGCompositeFrame(fFrame, 100, 100, kHorizontalFrame | kRaisedFrame);
447
448 fLeftVerticalFrame = new TGVerticalFrame(compositeFrame, 195, 10, kFixedWidth);
449 compositeFrame->AddFrame(fLeftVerticalFrame, new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 2, 2, 2, 2));
450
451 const TGWindow* cw = fFrame->GetClient()->GetRoot();
453
454 fGedEditor = new TGedEditor();
460
461 TGVSplitter *splitter = new TGVSplitter(compositeFrame);
463 compositeFrame->AddFrame(splitter, new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 0,1,2,2) );
464 }
465
466 // SunkenFrame introduces 1-pixel offset - in TGFrame.cxx:163
467 //
468 // TGVerticalFrame *rightVerticalFrame = new TGVerticalFrame(compositeFrame, 10, 10, kSunkenFrame);
469 // compositeFrame->AddFrame(rightVerticalFrame, new TGLayoutHints(kLHintsRight | kLHintsExpandX | kLHintsExpandY,0,2,2,2));
470 fRightVerticalFrame = new TGVerticalFrame(compositeFrame, 10, 10);
472
473 fEventHandler = new TGLEventHandler(nullptr, this);
475}
476
477////////////////////////////////////////////////////////////////////////////////
478/// Update GUI components for embedded viewer selection change.
479/// Override from TGLViewer.
480
482{
483 TGLPhysicalShape *selected = const_cast<TGLPhysicalShape*>(GetSelected());
484
485 if (selected) {
486 fPShapeWrap->fPShape = selected;
489 else
491 } else {
492 fPShapeWrap->fPShape = nullptr;
494 }
495}
496
497////////////////////////////////////////////////////////////////////////////////
498/// Show the viewer
499
501{
502 fFrame->MapRaised();
504 RequestDraw();
505}
506
507////////////////////////////////////////////////////////////////////////////////
508/// Close the viewer - destructed.
509
511{
512 // Commit suicide when contained GUI is closed.
513 delete this;
514}
515
516////////////////////////////////////////////////////////////////////////////////
517/// Delete the menu bar.
518
520{
522}
523
524////////////////////////////////////////////////////////////////////////////////
525/// Deactivate menu entries for closing the GL window and exiting ROOT.
526
528{
531}
532
533////////////////////////////////////////////////////////////////////////////////
534/// Enable hiding of menu bar.
535
537{
538 if (fHideMenuBar)
539 return;
540
542
543 fMenuBar->Connect("ProcessedEvent(Event_t*)", "TGLSAViewer", this, "HandleMenuBarHiding(Event_t*)");
544 fMenuBut->Connect("ProcessedEvent(Event_t*)", "TGLSAViewer", this, "HandleMenuBarHiding(Event_t*)");
545
548 fFrame->Layout();
549
551 fMenuHidingTimer->Connect("Timeout()", "TGLSAViewer", this, "MenuHidingTimeout()");
552
554}
555
556////////////////////////////////////////////////////////////////////////////////
557/// Disable hiding of menu bar.
558
560{
561 if (!fHideMenuBar)
562 return;
563
565
566 fMenuBar->Disconnect("ProcessedEvent(Event_t*)", this, "HandleMenuBarHiding(Event_t*)");
567 fMenuBut->Disconnect("ProcessedEvent(Event_t*)", this, "HandleMenuBarHiding(Event_t*)");
568
571 fFrame->Layout();
572
574 delete fMenuHidingTimer;
575 fMenuHidingTimer = nullptr;
576
578}
579
580////////////////////////////////////////////////////////////////////////////////
581/// Maybe switch menu-bar / menu-button.
582
584{
586
587 if (f == fMenuBut)
588 {
589 if (ev->fType == kEnterNotify)
591 else
593 }
594 else if (f == fMenuBar)
595 {
596 if (ev->fType == kLeaveNotify &&
597 (ev->fX < 0 || ev->fX >= (Int_t) f->GetWidth() ||
598 ev->fY < 0 || ev->fY >= (Int_t) f->GetHeight()))
599 {
600 if (fMenuBar->GetCurrent() == nullptr)
602 else
603 fMenuBar->GetCurrent()->Connect("ProcessedEvent(Event_t*)", "TGLSAViewer", this, "HandleMenuBarHiding(Event_t*)");
604 }
605 else
606 {
608 }
609 }
610 else
611 {
612 f->Disconnect("ProcessedEvent(Event_t*)", this);
614 }
615}
616
617////////////////////////////////////////////////////////////////////////////////
618/// Reset the timer for menu-bar hiding.
619
621{
622 // This happens, mysteriously.
623 if (fMenuHidingTimer == nullptr)
624 return;
625
627
628 fMenuHidingShowMenu = show_menu;
629
633}
634
635////////////////////////////////////////////////////////////////////////////////
636/// Action for menu-hiding timeout.
637
639{
644 } else {
647 }
648 fFrame->Layout();
649}
650
651////////////////////////////////////////////////////////////////////////////////
652/// Set global timeout for menu-hiding in mili-seconds.
653/// Static function.
654
656{
657 fgMenuHidingTimeout = timeout;
658}
659
660////////////////////////////////////////////////////////////////////////////////
661/// Process GUI message capture by the main GUI frame (TGLSAFrame).
662
664{
665 switch (GET_MSG(msg)) {
666 case kC_COMMAND:
667 switch (GET_SUBMSG(msg)) {
668 case kCM_BUTTON:
669 case kCM_MENU:
670 switch (parm1) {
671 case kGLHelpAbout: {
672#ifdef WIN32
674#else
675 char str[32];
676 snprintf(str,32, "About ROOT %s...", gROOT->GetVersion());
677 TRootHelpDialog * hd = new TRootHelpDialog(fFrame, str, 600, 400);
678 hd->SetText(gHelpAbout);
679 hd->Popup();
680#endif
681 break;
682 }
683 case kGLHelpViewer: {
684 TRootHelpDialog * hd = new TRootHelpDialog(fFrame, "Help on GL Viewer...", 660, 400);
685 hd->AddText(fgHelpText1);
686 hd->AddText(fgHelpText2);
687 hd->Popup();
688 break;
689 }
690 case kGLPerspYOZ:
692 break;
693 case kGLPerspXOZ:
695 break;
696 case kGLPerspXOY:
698 break;
699 case kGLXOY:
701 break;
702 case kGLXOZ:
704 break;
705 case kGLZOY:
707 break;
708 case kGLZOX:
710 break;
711 case kGLXnOY:
713 break;
714 case kGLXnOZ:
716 break;
717 case kGLZnOY:
719 break;
720 case kGLZnOX:
722 break;
723 case kGLOrthoRotate:
725 break;
726 case kGLOrthoDolly:
728 break;
729 case kGLSaveEPS:
730 SavePicture("viewer.eps");
731 break;
732 case kGLSavePDF:
733 SavePicture("viewer.pdf");
734 break;
735 case kGLSaveGIF:
736 SavePicture("viewer.gif");
737 break;
738 case kGLSaveAnimGIF:
739 SavePicture("viewer.gif+");
740 break;
741 case kGLSaveJPG:
742 SavePicture("viewer.jpg");
743 break;
744 case kGLSavePNG:
745 SavePicture("viewer.png");
746 break;
747 case kGLSaveAS:
748 {
749 TGFileInfo fi;
754 new TGFileDialog(gClient->GetDefaultRoot(), fFrame, kFDSave, &fi);
755 if (!fi.fFilename) return kTRUE;
756 TString ft(fi.fFileTypes[fi.fFileTypeIdx+1]);
757 fDirName = fi.fIniDir;
760
761 TString file = fi.fFilename;
762 Bool_t match = kFALSE;
763 const char** fin = gGLSaveAsTypes; ++fin;
764 while (*fin != nullptr)
765 {
766 if (file.EndsWith(*fin + 1))
767 {
768 match = kTRUE;
769 break;
770 }
771 fin += 2;
772 }
773 if ( ! match)
774 {
775 file += ft(ft.Index("."), ft.Length());
776 }
777 SavePicture(file);
778 }
779 break;
780 case kGLHideMenus:
781 if (fHideMenuBar)
783 else
785 break;
786 case kGLEditObject:
788 break;
789 case kGLCloseViewer:
790 // Exit needs to be delayed to avoid bad drawable X ids - GUI
791 // will all be changed in future anyway
792 TTimer::SingleShot(50, "TGLSAFrame", fFrame, "SendCloseMessage()");
793 break;
794 case kGLQuitROOT:
796 delete this;
798 break;
799 default:
800 break;
801 }
802 default:
803 break;
804 }
805 default:
806 break;
807 }
808
809 return kTRUE;
810}
811
812////////////////////////////////////////////////////////////////////////////////
813/// Toggle state of the 'Edit Object' menu entry.
814
816{
819 else
822}
823
824////////////////////////////////////////////////////////////////////////////////
825/// Toggle state of the 'Ortho allow rotate' menu entry.
826
828{
831 else
840}
841
842////////////////////////////////////////////////////////////////////////////////
843/// Toggle state of the 'Ortho allow dolly' menu entry.
844
846{
849 else
855}
@ kButton1Down
Definition Buttons.h:17
@ kEnterNotify
Definition GuiTypes.h:61
@ kLeaveNotify
Definition GuiTypes.h:61
const Mask_t kFocusChangeMask
Definition GuiTypes.h:169
const Mask_t kExposureMask
Definition GuiTypes.h:165
const Mask_t kKeyPressMask
Definition GuiTypes.h:159
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
@ 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:168
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:166
const Mask_t kEnterWindowMask
Definition GuiTypes.h:167
R__EXTERN const char gHelpAbout[]
Definition HelpText.h:17
#define f(i)
Definition RSha256.hxx:104
int Int_t
Definition RtypesCore.h:45
long Long_t
Definition RtypesCore.h:54
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassImp(name)
Definition Rtypes.h:382
R__EXTERN TApplication * gApplication
#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:406
#define gVirtualX
Definition TVirtualX.h:337
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
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:287
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:316
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual TList * GetList() const
Definition TGFrame.h:310
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1204
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1072
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1149
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1190
This class creates a file selection dialog.
char * fFilename
selected file name
Int_t fFileTypeIdx
selected file type, index in fFileTypes
const char ** fFileTypes
file types used to filter selectable files
char * fIniDir
on input: initial directory, on output: new directory
Bool_t fOverwrite
if true overwrite the file with existing name on save
void SetIniDir(const char *inidir)
Set directory name.
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:321
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:629
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:312
void MapWindow() override
map window
Definition TGFrame.h:204
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:276
void UnmapWindow() override
unmap window
Definition TGFrame.h:206
void MapRaised() override
map raised
Definition TGFrame.h:205
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
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.
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
select record from last overlay select
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
GED editor.
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
event handler
Definition TGLViewer.h:120
TVirtualPad * fPad
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:83
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:1858
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition TGFrame.cxx:1881
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1788
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
Definition TGFrame.cxx:1868
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:418
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:1845
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:1152
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition TGMenu.cxx:1782
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition TGMenu.cxx:1807
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:1926
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1060
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:990
void SetFrame(TGFrame *frame, Bool_t left) override
Set frame to be resized.
A composite frame that layout their children in vertical way.
Definition TGFrame.h:374
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.
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition TList.cxx:820
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:657
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
Definition TList.cxx:98
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1005
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:869
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).
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
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:139
Ssiz_t Length() const
Definition TString.h:417
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition TString.cxx:2244
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:651
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
virtual void TurnOff()
Remove timer from system timer list.
Definition TTimer.cxx:231
virtual void TurnOn()
Add the timer to the system timer list.
Definition TTimer.cxx:243
void Reset()
Reset the timer.
Definition TTimer.cxx:159
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:258
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:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:178
Int_t fX
Definition GuiTypes.h:178