ROOT  6.06/09
Reference Guide
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 "TSystem.h"
29 
30 /** \class TEveViewer
31 \ingroup TEve
32 Eve representation of TGLViewer.
33 
34 The gl-viewer is owned by this class and is deleted in destructor.
35 
36 The frame is not deleted, it is expected that the gl-viewer implementation
37 will delete that. TGLSAViewer and TGEmbeddedViewer both do so.
38 This could be an optional argument to SetGLViewer. A frame could be
39 passed as well.
40 
41 When stand-alone viewer is requested, it will come up with menu-hiding
42 enabled by default. If you dislike this, add the following line to rootrc
43 file (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 
62 TEveViewer::TEveViewer(const char* n, const char* t) :
63  TEveWindowFrame(0, n, t),
64  fGLViewer (0),
65  fGLViewerFrame (0)
66 {
68  fGUIFrame->SetCleanup(kNoCleanup); // the gl-viewer's frame deleted elsewhere.
69 
70  if (!fgInitInternal)
71  {
72  InitInternal();
73  }
74 }
75 
76 ////////////////////////////////////////////////////////////////////////////////
77 /// Destructor.
78 
80 {
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 {
125  if (fgRecreateGlOnDockOps) {
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 = 0;
162  if (stereo && quad_buf)
163  {
164  form = new TGLFormat;
165  form->SetStereo(kTRUE);
166  }
167 
168  cf->SetEditable(kTRUE);
169  TGLSAViewer* v = 0;
170  try
171  {
172  v = new TGLSAViewer(cf, 0, 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();
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 == 0)
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, 0, ged, border);
207  SetGLViewer(v, v->GetFrame());
208 
210 
212 
213  if (fEveFrame == 0)
214  PreUndock();
215 
216  return v;
217 }
218 
219 ////////////////////////////////////////////////////////////////////////////////
220 /// Redraw viewer immediately.
221 
222 void 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();
244 switch_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 != 0) {
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 != 0) {
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
325 List of Viewers providing common operations on TEveViewer collections.
326 */
327 
329 
330 ////////////////////////////////////////////////////////////////////////////////
331 
332 TEveViewerList::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 
437 void TEveViewerList::RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals)
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 
457 void 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 = 0;
544 
545  void *qsender = gTQSender;
547  gTQSender = qsender;
548 
549  HandleTooltip();
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 = 0;
566 
567  void *qsender = gTQSender;
569  gTQSender = qsender;
570 
571  HandleTooltip();
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 = 0;
588 
589  void *qsender = gTQSender;
591  gTQSender = qsender;
592 
593  HandleTooltip();
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 
606 {
607  TEveElement* el = dynamic_cast<TEveElement*>(obj);
608  if (el && !el->IsPickable())
609  el = 0;
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 
622 void 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 = 0;
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 
639 void 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 = 0;
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();
664  if ( fUseLightColorSet)
665  glv->UseLightColorSet();
666  else
667  glv->UseDarkColorSet();
668 
670  }
671 }
virtual void PostDock()
Virtual function called after a window is docked.
Definition: TEveViewer.cxx:123
void ToggleEditObject()
Toggle state of the 'Edit Object' menu entry.
virtual void RemoveElementLocal(TEveElement *el)
Remove element 'el' from the list of children and also remove appropriate GLScene from GLViewer's lis...
Definition: TEveViewer.cxx:279
List_i EndChildren()
Definition: TEveElement.h:165
virtual void PostDock()
Virtual function called after a window is docked.
Definition: TEveWindow.cxx:703
ClassImp(TEveViewer)
void OnUnMouseOver(TObject *obj, UInt_t state)
Slot for global TGLViewer::UnMouseOver().
Definition: TEveViewer.cxx:583
virtual void UserUnPickedElement(TEveElement *el)
Called when secondary selection becomes empty.
TEveCompositeFrame * fEveFrame
Definition: TEveWindow.h:218
Eve representation of TGLScene.
Definition: TEveScene.h:26
List of Viewers providing common operations on TEveViewer collections.
Definition: TEveViewer.h:79
virtual void RemoveElementsLocal()
Remove all children, forwarded to GLViewer.
Definition: TEveViewer.cxx:288
float Float_t
Definition: RtypesCore.h:53
Bool_t IsPickable() const
Definition: TEveElement.h:339
virtual Bool_t HandleElementPaste(TEveElement *el)
Receive a pasted object.
Definition: TEveViewer.cxx:309
TGFrame * fGUIFrame
Definition: TEveWindow.h:342
R__EXTERN void * gTQSender
Definition: TQObject.h:49
virtual ~TEveViewer()
Destructor.
Definition: TEveViewer.cxx:79
List_t fChildren
Definition: TEveElement.h:79
virtual void UserPickedElement(TEveElement *el, Bool_t multi=kFALSE)
Called when user picks/clicks on an element.
TGFrame * fGLViewerFrame
Definition: TEveViewer.h:38
void SetColorBrightness(Float_t b)
Set color brightness.
Definition: TEveViewer.cxx:650
virtual void RemoveElementLocal(TEveElement *el)
Perform additional local removal of el.
virtual void SetEventHandler(TGEventHandler *handler)
Set the event-handler.
Definition: TGLViewer.cxx:2263
static const TGPicture * fgListTreeIcons[9]
Definition: TEveElement.h:63
List_t::iterator List_i
Definition: TEveElement.h:70
This is the ROOT implementation of the Qt object communication mechanism (see also http://www...
Definition: TQObject.h:53
virtual void Disconnect()
Disconnect from TGLViewer class-signals.
Definition: TEveViewer.cxx:413
TGLFormat * GetFormat() const
Definition: TGLSAViewer.h:124
Basic string class.
Definition: TString.h:137
#define gClient
Definition: TGClient.h:174
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:254
void Redraw(Bool_t resetCameras=kFALSE)
Redraw viewer immediately.
Definition: TEveViewer.cxx:222
TEveScene * GetScene() const
Definition: TEveSceneInfo.h:40
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void OnUnClicked(TObject *obj, UInt_t button, UInt_t state)
Slot for global TGLViewer::UnClicked().
Definition: TEveViewer.cxx:639
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
TGCompositeFrame * GetFrame() const
R__EXTERN TApplication * gApplication
Definition: TApplication.h:171
void HandleTooltip()
Show / hide tooltip for various MouseOver events.
Definition: TEveViewer.cxx:508
TEveSelection * GetSelection() const
Definition: TEveManager.h:129
void DecParentIgnoreCnt()
Decrease number of parents ignored in reference-counting.
static Bool_t fgInitInternal
Definition: TEveViewer.h:40
TEveUtil representation of TGLSceneInfo.
Definition: TEveSceneInfo.h:23
void SetChildClass(TClass *c)
Definition: TEveElement.h:494
void UseLightColorSet()
Use the light color-set.
Definition: TGLViewer.cxx:1615
TGEventHandler * GetEventHandler() const
Definition: TGLViewer.h:377
virtual void RemoveElementsLocal()
Perform additional local removal of all elements.
void SwitchColorSet()
Switch background color.
Definition: TEveViewer.cxx:658
A list of TEveElements.
Definition: TEveElement.h:459
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1131
virtual TString GetHighlightTooltip()
Definition: TEveElement.h:123
Minimal GL-viewer that can be embedded in a standard ROOT frames.
virtual void PreUndock()
Virtual function called before a window is undocked.
Definition: TEveWindow.cxx:690
const char * Data() const
Definition: TString.h:349
virtual void RemoveElement(TEveElement *el)
Remove el from the list of children.
virtual void RemoveElementLocal(TEveElement *el)
Decompoundofy el, call base-class version.
Definition: TEveViewer.cxx:367
void IncParentIgnoreCnt()
Increase number of parents ignored in reference-counting.
void SetGLViewer(TGLViewer *viewer, TGFrame *frame)
Set TGLViewer that is represented by this object.
Definition: TEveViewer.cxx:143
void Class()
Definition: Class.C:29
virtual void PostSceneBuildSetup(Bool_t resetCameras)
Perform post scene-build setup.
Definition: TGLViewer.cxx:390
TGLScenePad * GetGLScene() const
Definition: TEveScene.h:60
virtual Bool_t IsChanged() const
virtual void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0)
Reparent window, make p the new parent and position the window at position (x,y) in new parent...
Definition: TGFrame.h:265
TGCompositeFrame * GetGUICompositeFrame()
Returns the registered top-frame of this eve-window dynamic-casted to composite-frame.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
TGCompositeFrame * GetFrame() const
Return the main-frame.
void RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint all viewers.
Definition: TEveViewer.cxx:457
Bool_t fShowTooltip
Definition: TEveViewer.h:86
Encapsulation of format / contents of an OpenGL buffer.
Definition: TGLFormat.h:35
Bool_t IsStereo() const
Check, if the surface is stereo buffered.
Definition: TGLFormat.cxx:195
void SetSmartRefresh(Bool_t smart_ref)
Definition: TGLViewer.h:230
virtual void UserRePickedElement(TEveElement *el)
Called when secondary selection becomes empty.
void OnClicked(TObject *obj, UInt_t button, UInt_t state)
Slot for global TGLViewer::Clicked().
Definition: TEveViewer.cxx:605
The top level standalone GL-viewer - created via plugin manager.
Definition: TGLSAViewer.h:37
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:1135
void RequestDraw(Short_t LOD=TGLRnrCtx::kLODMed)
Post request for redraw of viewer at level of detail 'LOD' Request is directed via cross thread gVirt...
Definition: TGLViewer.cxx:436
virtual void RemoveElementsLocal()
Decompoundofy children, call base-class version.
Definition: TEveViewer.cxx:376
TEveViewerList(const TEveViewerList &)
void DisableCloseMenuEntries()
Deactivate menu entries for closing the GL window and exiting ROOT.
SVector< double, 2 > v
Definition: Dict.h:5
virtual void CreateGLWidget()
Create a GLwidget, it is an error if it is already created.
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
Definition: TEnv.cxx:494
void EnableMenuBarHiding()
Enable hiding of menu bar.
TGLEmbeddedViewer * SpawnGLEmbeddedViewer(TGedEditor *ged=0, Int_t border=0)
Spawn new GLViewer and adopt it.
Definition: TEveViewer.cxx:200
Bool_t fUseLightColorSet
Definition: TEveViewer.h:89
virtual void CreateGLWidget()
Definition: TGLViewer.h:225
unsigned int UInt_t
Definition: RtypesCore.h:42
void OnReMouseOver(TObject *obj, UInt_t state)
Slot for global TGLViewer::ReMouseOver().
Definition: TEveViewer.cxx:561
static void InitInternal()
Initialize static data-members according to running conditions.
Definition: TEveViewer.cxx:92
void UseDarkColorSet()
Use the dark color-set.
Definition: TGLViewer.cxx:1606
void OnReClicked(TObject *obj, UInt_t button, UInt_t state)
Slot for global TGLViewer::ReClicked().
Definition: TEveViewer.cxx:622
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition: TGLViewer.h:53
virtual void AddElement(TEveElement *el)
Add el to the list of children.
void SetStereo(Bool_t stereo, Bool_t quad_buf=kTRUE)
Enable stereo rendering.
Definition: TGLViewer.cxx:1996
#define gVirtualX
Definition: TVirtualX.h:362
void SwitchStereo()
Switch stereo mode.
Definition: TEveViewer.cxx:233
void DeleteAnnotations()
Delete annotations from all viewers.
Definition: TEveViewer.cxx:475
TEveElement * FirstChild() const
Returns the first child element or 0 if the list is empty.
virtual void TriggerTooltip(const char *text)
Trigger display of tooltip.
double f(double x)
TGLSceneInfo * AddScene(TGLSceneBase *scene)
Add new scene, appropriate scene-info is created.
void OnMouseOver(TObject *obj, UInt_t state)
Slot for global TGLViewer::MouseOver() signal.
Definition: TEveViewer.cxx:539
R__EXTERN TEnv * gEnv
Definition: TEnv.h:174
void SetStereo(Bool_t db)
Set the surface as stereo/non-stereo buffered.
Definition: TGLFormat.cxx:203
Base-class and default implementation of event-handler for TGLViewer.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1293
virtual void SetCleanup(Int_t=kLocalCleanup)
Definition: TGFrame.h:280
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
void RemoveAllScenes()
Remove all scenes from the viewer, their scene-infos are deleted.
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Return TEveViewer icon.
Definition: TEveViewer.cxx:134
Mother of all ROOT objects.
Definition: TObject.h:58
virtual void UnmapWindow()
Definition: TGFrame.h:269
void RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint viewers that are tagged as changed.
Definition: TEveViewer.cxx:437
void SceneDestructing(TEveScene *scene)
Callback done from a TEveScene destructor allowing proper removal of the scene from affected viewers...
Definition: TEveViewer.cxx:488
virtual void DestroyGLWidget()
Definition: TGLViewer.h:226
virtual void MapWindow()
Definition: TGFrame.h:267
virtual void DeleteOverlayAnnotations()
Delete overlay elements that are annotations.
void RemoveScene(TGLSceneBase *scene)
Remove scene from the viewer, its scene-info is deleted.
List_i BeginChildren()
Definition: TEveElement.h:164
virtual void AddElement(TEveElement *el)
Call base-class implementation.
Definition: TEveViewer.cxx:358
virtual TObject * GetEditorObject(const TEveException &eh="TEveViewer::GetEditorObject ") const
Object to be edited when this is selected, returns the TGLViewer.
Definition: TEveViewer.cxx:297
Int_t NumChildren() const
Definition: TEveElement.h:168
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:280
Base class for extended scene context.
Definition: TGLSceneInfo.h:26
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:102
ClassImp(TSlaveInfo) Int_t TSlaveInfo const TSlaveInfo * si
Used to sort slaveinfos by ordinal.
Definition: TProof.cxx:167
TGLViewer * fGLViewer
Definition: TEveViewer.h:37
const Mask_t kKeyControlMask
Definition: GuiTypes.h:198
virtual void Connect()
Connect to TGLViewer class-signals.
Definition: TEveViewer.cxx:389
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition: TGFrame.cxx:930
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
virtual void DestroyGLWidget()
Destroy the GLwidget, it is an error if it does not exist.
virtual void PreUndock()
Virtual function called before a window is undocked.
Definition: TEveViewer.cxx:105
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
virtual ~TEveViewerList()
Destructor.
Definition: TEveViewer.cxx:348
const Int_t n
Definition: legend1.C:16
Encapsulates TGFrame into an eve-window.
Definition: TEveWindow.h:335
TEveViewer(const TEveViewer &)
Eve representation of TGLViewer.
Definition: TEveViewer.h:30
virtual void RemoveTooltip()
Hide the tooltip.
TEveSelection * GetHighlight() const
Definition: TEveManager.h:130
static Bool_t fgRecreateGlOnDockOps
Definition: TEveViewer.h:41
TGLSAViewer * SpawnGLViewer(TGedEditor *ged=0, Bool_t stereo=kFALSE, Bool_t quad_buf=kTRUE)
Spawn new GLViewer and adopt it.
Definition: TEveViewer.cxx:155
TGLWidget * GetGLWidget()
Definition: TGLViewer.h:223
virtual void AddScene(TEveScene *scene)
Add 'scene' to the list of scenes.
Definition: TEveViewer.cxx:261
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:904