Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveViewer.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, 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 "TEveViewer.h"
13#include "TEveScene.h"
14#include "TEveSceneInfo.h"
15
16#include "TEveManager.h"
17#include "TEveSelection.h"
18
19#include "TGLFormat.h"
20#include "TGLSAViewer.h"
21#include "TGLEmbeddedViewer.h"
22#include "TGLScenePad.h"
23
24#include "TGLEventHandler.h"
25
26#include "TApplication.h"
27#include "TEnv.h"
28#include "TVirtualX.h"
29
30/** \class TEveViewer
31\ingroup TEve
32Eve representation of TGLViewer.
33
34The gl-viewer is owned by this class and is deleted in destructor.
35
36The frame is not deleted, it is expected that the gl-viewer implementation
37will delete that. TGLSAViewer and TGEmbeddedViewer both do so.
38This could be an optional argument to SetGLViewer. A frame could be
39passed as well.
40
41When stand-alone viewer is requested, it will come up with menu-hiding
42enabled by default. If you dislike this, add the following line to rootrc
43file (or set corresponding gEnv entry in application initialization):
44~~~ {.cpp}
45 Eve.Viewer.HideMenus: off
46~~~
47*/
48
50
53
54////////////////////////////////////////////////////////////////////////////////
55/// Constructor.
56///
57/// The base-class TEveWindowFrame is constructed without a frame so
58/// a default composite-frame is instantiated and stored in fGUIFrame.
59/// Cleanup is set to no-cleanup as viewers need to be zapped with some
60/// more care.
61
62TEveViewer::TEveViewer(const char* n, const char* t) :
63 TEveWindowFrame(nullptr, n, t),
64 fGLViewer (nullptr),
65 fGLViewerFrame (nullptr)
66{
68 fGUIFrame->SetCleanup(kNoCleanup); // the gl-viewer's frame deleted elsewhere.
69
70 if (!fgInitInternal)
71 {
73 }
74}
75
76////////////////////////////////////////////////////////////////////////////////
77/// Destructor.
78
80{
81 fGLViewer->SetEventHandler(nullptr);
82
85 fGLViewerFrame->ReparentWindow(gClient->GetDefaultRoot());
86 TTimer::SingleShot(150, "TGLViewer", fGLViewer, "Delete()");
87}
88
89////////////////////////////////////////////////////////////////////////////////
90/// Initialize static data-members according to running conditions.
91
93{
94 // Determine if display is running on a mac.
95 // This also works for ssh connection mac->linux.
96 fgRecreateGlOnDockOps = (gVirtualX->SupportsExtension("Apple-WM") == 1);
97
99}
100
101////////////////////////////////////////////////////////////////////////////////
102/// Virtual function called before a window is undocked.
103/// On mac we have to force recreation of gl-context.
104
106{
109 {
110 // Mac only: TGLWidget can be already deleted
111 // in case of recursive delete
112 if (fGLViewer->GetGLWidget())
113 {
115 }
116 }
117}
118
119////////////////////////////////////////////////////////////////////////////////
120/// Virtual function called after a window is docked.
121/// On mac we have to force recreation of gl-context.
122
124{
127 }
129}
130
131////////////////////////////////////////////////////////////////////////////////
132/// Return TEveViewer icon.
133
135{
137}
138
139////////////////////////////////////////////////////////////////////////////////
140/// Set TGLViewer that is represented by this object.
141/// The old gl-viewer is deleted.
142
144{
145 delete fGLViewer;
146 fGLViewer = viewer;
147 fGLViewerFrame = frame;
148
150}
151
152////////////////////////////////////////////////////////////////////////////////
153/// Spawn new GLViewer and adopt it.
154
156{
157 static const TEveException kEH("TEveViewer::SpawnGLViewer ");
158
160
161 TGLFormat *form = nullptr;
162 if (stereo && quad_buf)
163 {
164 form = new TGLFormat;
165 form->SetStereo(kTRUE);
166 }
167
168 cf->SetEditable(kTRUE);
169 TGLSAViewer* v = nullptr;
170 try
171 {
172 v = new TGLSAViewer(cf, nullptr, ged, form);
173 }
174 catch (std::exception&)
175 {
176 Error("SpawnGLViewer", "Insufficient support from the graphics hardware. Aborting.");
178 }
179 cf->SetEditable(kFALSE);
180 v->ToggleEditObject();
181 v->DisableCloseMenuEntries();
182 if (gEnv->GetValue("Eve.Viewer.HideMenus", 1) == 1)
183 {
184 v->EnableMenuBarHiding();
185 }
186 SetGLViewer(v, v->GetFrame());
187
188 if (stereo)
189 v->SetStereo(kTRUE, quad_buf);
190
191 if (fEveFrame == nullptr)
192 PreUndock();
193
194 return v;
195}
196
197////////////////////////////////////////////////////////////////////////////////
198/// Spawn new GLViewer and adopt it.
199
201{
202 static const TEveException kEH("TEveViewer::SpawnGLEmbeddedViewer ");
203
205
206 TGLEmbeddedViewer* v = new TGLEmbeddedViewer(cf, nullptr, ged, border);
207 SetGLViewer(v, v->GetFrame());
208
210
212
213 if (fEveFrame == nullptr)
214 PreUndock();
215
216 return v;
217}
218
219////////////////////////////////////////////////////////////////////////////////
220/// Redraw viewer immediately.
221
222void TEveViewer::Redraw(Bool_t resetCameras)
223{
224 if (resetCameras) fGLViewer->PostSceneBuildSetup(kTRUE);
226}
227
228////////////////////////////////////////////////////////////////////////////////
229/// Switch stereo mode.
230/// This only works TGLSAViewers and, of course, with stereo support
231/// provided by the OpenGL driver.
232
234{
235 TGLSAViewer *v = dynamic_cast<TGLSAViewer*>(fGLViewer);
236
237 if (!v) {
238 Warning("SwitchStereo", "Only supported for TGLSAViewer.");
239 return;
240 }
241
242 v->DestroyGLWidget();
243 TGLFormat *f = v->GetFormat();
244switch_stereo:
245 f->SetStereo(!f->IsStereo());
246 v->SetStereo(f->IsStereo());
247 try
248 {
249 v->CreateGLWidget();
250 }
251 catch (std::exception&)
252 {
253 Error("SwitchStereo", "Insufficient support from the graphics hardware. Reverting.");
254 goto switch_stereo;
255 }
256}
257
258////////////////////////////////////////////////////////////////////////////////
259/// Add 'scene' to the list of scenes.
260
262{
263 static const TEveException eh("TEveViewer::AddScene ");
264
265 TGLSceneInfo* glsi = fGLViewer->AddScene(scene->GetGLScene());
266 if (glsi != nullptr) {
267 TEveSceneInfo* si = new TEveSceneInfo(this, scene, glsi);
268 AddElement(si);
269 } else {
270 throw(eh + "scene already in the viewer.");
271 }
272}
273
274////////////////////////////////////////////////////////////////////////////////
275/// Remove element 'el' from the list of children and also remove
276/// appropriate GLScene from GLViewer's list of scenes.
277/// Virtual from TEveElement.
278
280{
281 fGLViewer->RemoveScene(((TEveSceneInfo*)el)->GetGLScene());
282}
283
284////////////////////////////////////////////////////////////////////////////////
285/// Remove all children, forwarded to GLViewer.
286/// Virtual from TEveElement.
287
289{
291}
292
293////////////////////////////////////////////////////////////////////////////////
294/// Object to be edited when this is selected, returns the TGLViewer.
295/// Virtual from TEveElement.
296
298{
299 if (!fGLViewer)
300 throw(eh + "fGLViewer not set.");
301 return fGLViewer;
302}
303
304////////////////////////////////////////////////////////////////////////////////
305/// Receive a pasted object. TEveViewer only accepts objects of
306/// class TEveScene.
307/// Virtual from TEveElement.
308
310{
311 static const TEveException eh("TEveViewer::HandleElementPaste ");
312
313 TEveScene* scene = dynamic_cast<TEveScene*>(el);
314 if (scene != nullptr) {
315 AddScene(scene);
316 return kTRUE;
317 } else {
318 Warning(eh.Data(), "class TEveViewer only accepts TEveScene paste argument.");
319 return kFALSE;
320 }
321}
322
323/** \class TEveViewerList
324\ingroup TEve
325List of Viewers providing common operations on TEveViewer collections.
326*/
327
329
330////////////////////////////////////////////////////////////////////////////////
331
332TEveViewerList::TEveViewerList(const char* n, const char* t) :
333 TEveElementList(n, t),
334 fShowTooltip (kTRUE),
335
336 fBrightness(0),
337 fUseLightColorSet(kFALSE)
338{
339 // Constructor.
340
342 Connect();
343}
344
345////////////////////////////////////////////////////////////////////////////////
346/// Destructor.
347
349{
350 Disconnect();
351}
352
353////////////////////////////////////////////////////////////////////////////////
354/// Call base-class implementation.
355/// If compound is open and compound of the new element is not set,
356/// the el's compound is set to this.
357
359{
361 el->IncParentIgnoreCnt();
362}
363
364////////////////////////////////////////////////////////////////////////////////
365/// Decompoundofy el, call base-class version.
366
368{
369 el->DecParentIgnoreCnt();
371}
372
373////////////////////////////////////////////////////////////////////////////////
374/// Decompoundofy children, call base-class version.
375
377{
378 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
379 {
380 (*i)->DecParentIgnoreCnt();
381 }
382
384}
385
386////////////////////////////////////////////////////////////////////////////////
387/// Connect to TGLViewer class-signals.
388
390{
391 TQObject::Connect("TGLViewer", "MouseOver(TObject*,UInt_t)",
392 "TEveViewerList", this, "OnMouseOver(TObject*,UInt_t)");
393
394 TQObject::Connect("TGLViewer", "ReMouseOver(TObject*,UInt_t)",
395 "TEveViewerList", this, "OnReMouseOver(TObject*,UInt_t)");
396
397 TQObject::Connect("TGLViewer", "UnMouseOver(TObject*,UInt_t)",
398 "TEveViewerList", this, "OnUnMouseOver(TObject*,UInt_t)");
399
400 TQObject::Connect("TGLViewer", "Clicked(TObject*,UInt_t,UInt_t)",
401 "TEveViewerList", this, "OnClicked(TObject*,UInt_t,UInt_t)");
402
403 TQObject::Connect("TGLViewer", "ReClicked(TObject*,UInt_t,UInt_t)",
404 "TEveViewerList", this, "OnReClicked(TObject*,UInt_t,UInt_t)");
405
406 TQObject::Connect("TGLViewer", "UnClicked(TObject*,UInt_t,UInt_t)",
407 "TEveViewerList", this, "OnUnClicked(TObject*,UInt_t,UInt_t)");
408}
409
410////////////////////////////////////////////////////////////////////////////////
411/// Disconnect from TGLViewer class-signals.
412
414{
415 TQObject::Disconnect("TGLViewer", "MouseOver(TObject*,UInt_t)",
416 this, "OnMouseOver(TObject*,UInt_t)");
417
418 TQObject::Disconnect("TGLViewer", "ReMouseOver(TObject*,UInt_t)",
419 this, "OnReMouseOver(TObject*,UInt_t)");
420
421 TQObject::Disconnect("TGLViewer", "UnMouseOver(TObject*,UInt_t)",
422 this, "OnUnMouseOver(TObject*,UInt_t)");
423
424 TQObject::Disconnect("TGLViewer", "Clicked(TObject*,UInt_t,UInt_t)",
425 this, "OnClicked(TObject*,UInt_t,UInt_t)");
426
427 TQObject::Disconnect("TGLViewer", "ReClicked(TObject*,UInt_t,UInt_t)",
428 this, "OnReClicked(TObject*,UInt_t,UInt_t)");
429
430 TQObject::Disconnect("TGLViewer", "UnClicked(TObject*,UInt_t,UInt_t)",
431 this, "OnUnClicked(TObject*,UInt_t,UInt_t)");
432}
433
434////////////////////////////////////////////////////////////////////////////////
435/// Repaint viewers that are tagged as changed.
436
438{
439 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
440 {
441 TGLViewer* glv = ((TEveViewer*)*i)->GetGLViewer();
442 if (glv->IsChanged())
443 {
444 if (resetCameras) glv->PostSceneBuildSetup(kTRUE);
445 if (dropLogicals) glv->SetSmartRefresh(kFALSE);
446
448
449 if (dropLogicals) glv->SetSmartRefresh(kTRUE);
450 }
451 }
452}
453
454////////////////////////////////////////////////////////////////////////////////
455/// Repaint all viewers.
456
457void TEveViewerList::RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals)
458{
459 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
460 {
461 TGLViewer* glv = ((TEveViewer*)*i)->GetGLViewer();
462
463 if (resetCameras) glv->PostSceneBuildSetup(kTRUE);
464 if (dropLogicals) glv->SetSmartRefresh(kFALSE);
465
467
468 if (dropLogicals) glv->SetSmartRefresh(kTRUE);
469 }
470}
471
472////////////////////////////////////////////////////////////////////////////////
473/// Delete annotations from all viewers.
474
476{
477 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
478 {
479 TGLViewer* glv = ((TEveViewer*)*i)->GetGLViewer();
481 }
482}
483
484////////////////////////////////////////////////////////////////////////////////
485/// Callback done from a TEveScene destructor allowing proper
486/// removal of the scene from affected viewers.
487
489{
490 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
491 {
492 TEveViewer* viewer = (TEveViewer*) *i;
493 List_i j = viewer->BeginChildren();
494 while (j != viewer->EndChildren())
495 {
496 TEveSceneInfo* sinfo = (TEveSceneInfo*) *j;
497 ++j;
498 if (sinfo->GetScene() == scene)
499 viewer->RemoveElement(sinfo);
500 }
501 }
502}
503
504////////////////////////////////////////////////////////////////////////////////
505/// Show / hide tooltip for various MouseOver events.
506/// Must be called from slots where sender is TGLEventHandler.
507
509{
510 if (fShowTooltip)
511 {
512 TGLViewer *glw = dynamic_cast<TGLViewer*>((TQObject*) gTQSender);
514 if (gEve->GetHighlight()->NumChildren() == 1)
515 {
517 if ( ! title.IsNull())
518 glh->TriggerTooltip(title);
519 }
520 else
521 {
522 glh->RemoveTooltip();
523 }
524 }
525}
526
527////////////////////////////////////////////////////////////////////////////////
528/// Slot for global TGLViewer::MouseOver() signal.
529///
530/// The attempt is made to determine the TEveElement being
531/// represented by the physical shape and global highlight is updated
532/// accordingly.
533///
534/// If TEveElement::IsPickable() returns false, the element is not
535/// highlighted.
536///
537/// Highlight is always in single-selection mode.
538
540{
541 TEveElement *el = dynamic_cast<TEveElement*>(obj);
542 if (el && !el->IsPickable())
543 el = nullptr;
544
545 void *qsender = gTQSender;
547 gTQSender = qsender;
548
550}
551
552////////////////////////////////////////////////////////////////////////////////
553/// Slot for global TGLViewer::ReMouseOver().
554///
555/// The obj is dyn-casted to the TEveElement and global selection is
556/// updated accordingly.
557///
558/// If TEveElement::IsPickable() returns false, the element is not
559/// selected.
560
562{
563 TEveElement* el = dynamic_cast<TEveElement*>(obj);
564 if (el && !el->IsPickable())
565 el = nullptr;
566
567 void *qsender = gTQSender;
569 gTQSender = qsender;
570
572}
573
574////////////////////////////////////////////////////////////////////////////////
575/// Slot for global TGLViewer::UnMouseOver().
576///
577/// The obj is dyn-casted to the TEveElement and global selection is
578/// updated accordingly.
579///
580/// If TEveElement::IsPickable() returns false, the element is not
581/// selected.
582
584{
585 TEveElement* el = dynamic_cast<TEveElement*>(obj);
586 if (el && !el->IsPickable())
587 el = nullptr;
588
589 void *qsender = gTQSender;
591 gTQSender = qsender;
592
594}
595
596////////////////////////////////////////////////////////////////////////////////
597/// Slot for global TGLViewer::Clicked().
598///
599/// The obj is dyn-casted to the TEveElement and global selection is
600/// updated accordingly.
601///
602/// If TEveElement::IsPickable() returns false, the element is not
603/// selected.
604
605void TEveViewerList::OnClicked(TObject *obj, UInt_t /*button*/, UInt_t state)
606{
607 TEveElement* el = dynamic_cast<TEveElement*>(obj);
608 if (el && !el->IsPickable())
609 el = nullptr;
611}
612
613////////////////////////////////////////////////////////////////////////////////
614/// Slot for global TGLViewer::ReClicked().
615///
616/// The obj is dyn-casted to the TEveElement and global selection is
617/// updated accordingly.
618///
619/// If TEveElement::IsPickable() returns false, the element is not
620/// selected.
621
622void TEveViewerList::OnReClicked(TObject *obj, UInt_t /*button*/, UInt_t /*state*/)
623{
624 TEveElement* el = dynamic_cast<TEveElement*>(obj);
625 if (el && !el->IsPickable())
626 el = nullptr;
628}
629
630////////////////////////////////////////////////////////////////////////////////
631/// Slot for global TGLViewer::UnClicked().
632///
633/// The obj is dyn-casted to the TEveElement and global selection is
634/// updated accordingly.
635///
636/// If TEveElement::IsPickable() returns false, the element is not
637/// selected.
638
639void TEveViewerList::OnUnClicked(TObject *obj, UInt_t /*button*/, UInt_t /*state*/)
640{
641 TEveElement* el = dynamic_cast<TEveElement*>(obj);
642 if (el && !el->IsPickable())
643 el = nullptr;
645}
646
647////////////////////////////////////////////////////////////////////////////////
648/// Set color brightness.
649
651{
653}
654
655////////////////////////////////////////////////////////////////////////////////
656/// Switch background color.
657
659{
661 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
662 {
663 TGLViewer* glv = ((TEveViewer*)*i)->GetGLViewer();
665 glv->UseLightColorSet();
666 else
667 glv->UseDarkColorSet();
668
670 }
671}
const Mask_t kKeyControlMask
Definition GuiTypes.h:197
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
bool Bool_t
Definition RtypesCore.h:63
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
R__EXTERN TApplication * gApplication
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:229
R__EXTERN TEveManager * gEve
#define gClient
Definition TGClient.h:157
@ kNoCleanup
Definition TGFrame.h:40
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsNormal
Definition TGLayout.h:32
@ kLHintsExpandX
Definition TGLayout.h:30
R__EXTERN void * gTQSender
Definition TQObject.h:46
#define gVirtualX
Definition TVirtualX.h:338
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:491
A list of TEveElements.
void SetChildClass(TClass *c)
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
virtual void AddElement(TEveElement *el)
Add el to the list of children.
List_t fChildren
Definition TEveElement.h:81
virtual TString GetHighlightTooltip()
TEveElement * FirstChild() const
Returns the first child element or 0 if the list is empty.
Bool_t IsPickable() const
List_i EndChildren()
Int_t NumChildren() const
void DecParentIgnoreCnt()
Decrease number of parents ignored in reference-counting.
virtual void RemoveElement(TEveElement *el)
Remove el from the list of children.
virtual void RemoveElementLocal(TEveElement *el)
Perform additional local removal of el.
static const TGPicture * fgListTreeIcons[9]
Definition TEveElement.h:65
List_i BeginChildren()
List_t::iterator List_i
Definition TEveElement.h:72
virtual void RemoveElementsLocal()
Perform additional local removal of all elements.
void IncParentIgnoreCnt()
Increase number of parents ignored in reference-counting.
Exception class thrown by TEve classes and macros.
Definition TEveUtil.h:102
TEveSelection * GetSelection() const
TEveSelection * GetHighlight() const
TEveUtil representation of TGLSceneInfo.
static TClass * Class()
TEveScene * GetScene() const
Eve representation of TGLScene.
Definition TEveScene.h:27
TGLScenePad * GetGLScene() const
Definition TEveScene.h:60
virtual void UserRePickedElement(TEveElement *el)
Called when secondary selection becomes empty.
virtual void UserPickedElement(TEveElement *el, Bool_t multi=kFALSE)
Called when user picks/clicks on an element.
virtual void UserUnPickedElement(TEveElement *el)
Called when secondary selection becomes empty.
static void SetColorBrightness(Float_t value, Bool_t full_redraw=kFALSE)
Tweak all ROOT colors to become brighter (if value > 0) or darker (value < 0).
Definition TEveUtil.cxx:276
List of Viewers providing common operations on TEveViewer collections.
Definition TEveViewer.h:80
void SwitchColorSet()
Switch background color.
void RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint viewers that are tagged as changed.
~TEveViewerList() override
Destructor.
Bool_t fShowTooltip
Definition TEveViewer.h:86
void RemoveElementsLocal() override
Decompoundofy children, call base-class version.
void AddElement(TEveElement *el) override
Call base-class implementation.
void OnMouseOver(TObject *obj, UInt_t state)
Slot for global TGLViewer::MouseOver() signal.
void SetColorBrightness(Float_t b)
Set color brightness.
void OnClicked(TObject *obj, UInt_t button, UInt_t state)
Slot for global TGLViewer::Clicked().
void OnUnMouseOver(TObject *obj, UInt_t state)
Slot for global TGLViewer::UnMouseOver().
void OnReClicked(TObject *obj, UInt_t button, UInt_t state)
Slot for global TGLViewer::ReClicked().
void OnReMouseOver(TObject *obj, UInt_t state)
Slot for global TGLViewer::ReMouseOver().
void RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint all viewers.
void SceneDestructing(TEveScene *scene)
Callback done from a TEveScene destructor allowing proper removal of the scene from affected viewers.
void RemoveElementLocal(TEveElement *el) override
Decompoundofy el, call base-class version.
void HandleTooltip()
Show / hide tooltip for various MouseOver events.
Bool_t fUseLightColorSet
Definition TEveViewer.h:89
virtual void Disconnect()
Disconnect from TGLViewer class-signals.
virtual void Connect()
Connect to TGLViewer class-signals.
void OnUnClicked(TObject *obj, UInt_t button, UInt_t state)
Slot for global TGLViewer::UnClicked().
void DeleteAnnotations()
Delete annotations from all viewers.
TEveViewerList(const TEveViewerList &)
Eve representation of TGLViewer.
Definition TEveViewer.h:31
void SetGLViewer(TGLViewer *viewer, TGFrame *frame)
Set TGLViewer that is represented by this object.
static Bool_t fgInitInternal
Definition TEveViewer.h:40
void SwitchStereo()
Switch stereo mode.
TGLSAViewer * SpawnGLViewer(TGedEditor *ged=nullptr, Bool_t stereo=kFALSE, Bool_t quad_buf=kTRUE)
Spawn new GLViewer and adopt it.
void RemoveElementsLocal() override
Remove all children, forwarded to GLViewer.
TObject * GetEditorObject(const TEveException &eh="TEveViewer::GetEditorObject ") const override
Object to be edited when this is selected, returns the TGLViewer.
TGLEmbeddedViewer * SpawnGLEmbeddedViewer(TGedEditor *ged=nullptr, Int_t border=0)
Spawn new GLViewer and adopt it.
TEveViewer(const TEveViewer &)
void Redraw(Bool_t resetCameras=kFALSE)
Redraw viewer immediately.
virtual void AddScene(TEveScene *scene)
Add 'scene' to the list of scenes.
static Bool_t fgRecreateGlOnDockOps
Definition TEveViewer.h:41
Bool_t HandleElementPaste(TEveElement *el) override
Receive a pasted object.
TGLViewer * fGLViewer
Definition TEveViewer.h:37
void PreUndock() override
Virtual function called before a window is undocked.
static TClass * Class()
const TGPicture * GetListTreeIcon(Bool_t open=kFALSE) override
Return TEveViewer icon.
static void InitInternal()
Initialize static data-members according to running conditions.
TGFrame * fGLViewerFrame
Definition TEveViewer.h:38
void PostDock() override
Virtual function called after a window is docked.
~TEveViewer() override
Destructor.
void RemoveElementLocal(TEveElement *el) override
Remove element 'el' from the list of children and also remove appropriate GLScene from GLViewer's lis...
Encapsulates TGFrame into an eve-window.
Definition TEveWindow.h:336
TGFrame * fGUIFrame
Definition TEveWindow.h:342
TGCompositeFrame * GetGUICompositeFrame()
Returns the registered top-frame of this eve-window dynamic-casted to composite-frame.
virtual void PreUndock()
Virtual function called before a window is undocked.
TEveCompositeFrame * fEveFrame
Definition TEveWindow.h:218
virtual void PostDock()
Virtual function called after a window is docked.
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1149
void SetEditable(Bool_t on=kTRUE) override
Switch ON/OFF edit mode.
Definition TGFrame.cxx:948
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0) override
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
Definition TGFrame.h:202
void MapWindow() override
map window
Definition TGFrame.h:204
void UnmapWindow() override
unmap window
Definition TGFrame.h:206
virtual void SetCleanup(Int_t=kLocalCleanup)
Definition TGFrame.h:217
Minimal GL-viewer that can be embedded in a standard ROOT frames.
Base-class and default implementation of event-handler for TGLViewer.
virtual void TriggerTooltip(const char *text)
Trigger display of tooltip.
virtual void RemoveTooltip()
Hide the tooltip.
Encapsulation of format / contents of an OpenGL buffer.
Definition TGLFormat.h:36
void SetStereo(Bool_t db)
Set the surface as stereo/non-stereo buffered.
The top level standalone GL-viewer - created via plugin manager.
Definition TGLSAViewer.h:38
Base class for extended scene context.
TGLSceneInfo * AddScene(TGLSceneBase *scene)
Add new scene, appropriate scene-info is created.
void RemoveAllScenes()
Remove all scenes from the viewer, their scene-infos are deleted.
void RemoveScene(TGLSceneBase *scene)
Remove scene from the viewer, its scene-info is deleted.
virtual Bool_t IsChanged() const
virtual void DeleteOverlayAnnotations()
Delete overlay elements that are annotations.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition TGLViewer.h:55
virtual void SetEventHandler(TGEventHandler *handler)
Set the event-handler.
TGEventHandler * GetEventHandler() const
Definition TGLViewer.h:378
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...
virtual void CreateGLWidget()
Definition TGLViewer.h:225
void SetSmartRefresh(Bool_t smart_ref)
Definition TGLViewer.h:230
virtual void DestroyGLWidget()
Definition TGLViewer.h:226
void UseLightColorSet()
Use the light color-set.
virtual void PostSceneBuildSetup(Bool_t resetCameras)
Perform post scene-build setup.
void UseDarkColorSet()
Use the dark color-set.
TGLWidget * GetGLWidget()
Definition TGLViewer.h:223
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
Mother of all ROOT objects.
Definition TObject.h:41
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
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.
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:378
Bool_t IsNull() const
Definition TString.h:416
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
const Int_t n
Definition legend1.C:16