ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TEveElement.h
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 #ifndef ROOT_TEveElement
13 #define ROOT_TEveElement
14 
15 #include "TEveUtil.h"
16 #include "TEveProjectionBases.h"
17 
18 #include "TNamed.h"
19 #include "TRef.h"
20 
21 class TGListTree;
22 class TGListTreeItem;
23 class TGPicture;
24 
25 class TEveCompound;
26 class TEveTrans;
27 class TGeoMatrix;
28 
29 /******************************************************************************/
30 // TEveElement
31 /******************************************************************************/
32 
34 {
35  friend class TEveManager;
36 
37  TEveElement& operator=(const TEveElement&); // Not implemented
38 
39 public:
41  {
42  public:
45 
49  virtual ~TEveListTreeInfo() {}
50 
52  { fTree = l.fTree; fItem = l.fItem; return *this; }
53 
54  bool operator==(const TEveListTreeInfo& x) const
55  { return fTree == x.fTree && fItem == x.fItem; }
56  bool operator<(const TEveListTreeInfo& x) const
57  { return fTree == x.fTree ? fItem < x.fItem : fTree < x.fTree; }
58 
59  ClassDef(TEveListTreeInfo, 0); // Structure agregating data for a render element image in a list tree.
60  };
61 
62  static const TGPicture* fgRnrIcons[4];
63  static const TGPicture* fgListTreeIcons[9];
64 
65  typedef std::set<TEveListTreeInfo> sLTI_t;
66  typedef sLTI_t::iterator sLTI_i;
67  typedef sLTI_t::reverse_iterator sLTI_ri;
68 
69  typedef std::list<TEveElement*> List_t;
70  typedef List_t::iterator List_i;
71  typedef List_t::const_iterator List_ci;
72 
73  typedef std::set<TEveElement*> Set_t;
74  typedef Set_t::iterator Set_i;
75  typedef Set_t::const_iterator Set_ci;
76 
77 protected:
78  List_t fParents; // List of parents.
79  List_t fChildren; // List of children.
80  TEveCompound *fCompound; // Compound this object belongs to.
81  TEveElement *fVizModel; //! Element used as model from VizDB.
82  TString fVizTag; // Tag used to query VizDB for model element.
83 
85  Int_t fParentIgnoreCnt; //! Counter for parents that are ignored in ref-counting.
86  Int_t fTopItemCnt; //! Counter for top-level list-tree items that prevent automatic destruction.
87  Int_t fDenyDestroy; //! Deny-destroy count.
88  Bool_t fDestroyOnZeroRefCnt; // Auto-destruct when ref-count reaches zero.
89 
90  Bool_t fRnrSelf; // Render this element.
91  Bool_t fRnrChildren; // Render children of this element.
92  Bool_t fCanEditMainColor; // Allow editing of main color.
93  Bool_t fCanEditMainTransparency; // Allow editing of main transparency.
94  Bool_t fCanEditMainTrans; // Allow editing of main transformation.
95 
96  Char_t fMainTransparency; // Main-transparency variable.
97  Color_t *fMainColorPtr; // Pointer to main-color variable.
98  TEveTrans *fMainTrans; // Pointer to main transformation matrix.
99 
100  sLTI_t fItems; //! Set of list-tree-items.
101 
102  TRef fSource; // External object that is represented by this element.
103  void *fUserData; //! Externally assigned and controlled user data.
104 
105  virtual void PreDeleteElement();
106  virtual void RemoveElementsInternal();
107  virtual void AnnihilateRecursively();
108 
109  static const char* ToString(Bool_t b);
110 
111 public:
112  TEveElement();
113  TEveElement(Color_t& main_color);
114  TEveElement(const TEveElement& e);
115  virtual ~TEveElement();
116 
117  virtual TEveElement* CloneElement() const;
118  virtual TEveElement* CloneElementRecurse(Int_t level=0) const;
119  virtual void CloneChildrenRecurse(TEveElement* dest, Int_t level=0) const;
120 
121  virtual const char* GetElementName() const;
122  virtual const char* GetElementTitle() const;
124  virtual void SetElementName (const char* name);
125  virtual void SetElementTitle(const char* title);
126  virtual void SetElementNameTitle(const char* name, const char* title);
127  virtual void NameTitleChanged();
128 
129  const TString& GetVizTag() const { return fVizTag; }
130  void SetVizTag(const TString& tag) { fVizTag = tag; }
131 
132  TEveElement* GetVizModel() const { return fVizModel; }
133  void SetVizModel(TEveElement* model);
135 
136  Bool_t ApplyVizTag(const TString& tag, const TString& fallback_tag="");
137 
138  virtual void PropagateVizParamsToProjecteds();
139  virtual void PropagateVizParamsToElements(TEveElement* el=0);
140  virtual void CopyVizParams(const TEveElement* el);
141  virtual void CopyVizParamsFromDB();
142  void SaveVizParams (std::ostream& out, const TString& tag, const TString& var);
143  virtual void WriteVizParams(std::ostream& out, const TString& var);
144 
148 
149  virtual void AddParent(TEveElement* re);
150  virtual void RemoveParent(TEveElement* re);
151  virtual void CheckReferenceCount(const TEveException& eh="TEveElement::CheckReferenceCount ");
152  virtual void CollectSceneParents(List_t& scenes);
153  virtual void CollectSceneParentsFromChildren(List_t& scenes,
154  TEveElement* parent);
155 
156  List_i BeginParents() { return fParents.begin(); }
157  List_i EndParents() { return fParents.end(); }
158  List_ci BeginParents() const { return fParents.begin(); }
159  List_ci EndParents() const { return fParents.end(); }
160  Int_t NumParents() const { return fParents.size(); }
161  Bool_t HasParents() const { return !fParents.empty(); }
162 
163  const List_t& RefChildren() const { return fChildren; }
164  List_i BeginChildren() { return fChildren.begin(); }
165  List_i EndChildren() { return fChildren.end(); }
166  List_ci BeginChildren() const { return fChildren.begin(); }
167  List_ci EndChildren() const { return fChildren.end(); }
168  Int_t NumChildren() const { return fNumChildren; }
169  Bool_t HasChildren() const { return fNumChildren != 0; }
170 
172  TEveElement* FindChild(const TString& name, const TClass* cls=0);
173  TEveElement* FindChild(TPRegexp& regexp, const TClass* cls=0);
174  Int_t FindChildren(List_t& matches, const TString& name, const TClass* cls=0);
175  Int_t FindChildren(List_t& matches, TPRegexp& regexp, const TClass* cls=0);
176  TEveElement* FirstChild() const;
177  TEveElement* LastChild () const;
178 
179  void EnableListElements (Bool_t rnr_self=kTRUE, Bool_t rnr_children=kTRUE); // *MENU*
180  void DisableListElements(Bool_t rnr_self=kFALSE, Bool_t rnr_children=kFALSE); // *MENU*
181 
184 
185  Int_t GetDenyDestroy() const;
186  void IncDenyDestroy();
187  void DecDenyDestroy();
188 
189  Int_t GetParentIgnoreCnt() const;
190  void IncParentIgnoreCnt();
191  void DecParentIgnoreCnt();
192 
193  virtual void PadPaint(Option_t* option);
194  virtual void PaintStandard(TObject* id);
195 
196  virtual TObject* GetObject (const TEveException& eh) const;
197  virtual TObject* GetEditorObject(const TEveException& eh) const { return GetObject(eh); }
198  virtual TObject* GetRenderObject(const TEveException& eh) const { return GetObject(eh); }
199 
200  // --------------------------------
201 
202  virtual void ExpandIntoListTree(TGListTree* ltree, TGListTreeItem* parent);
203  virtual void DestroyListSubTree(TGListTree* ltree, TGListTreeItem* parent);
204 
205  virtual TGListTreeItem* AddIntoListTree(TGListTree* ltree,
206  TGListTreeItem* parent_lti);
207  virtual TGListTreeItem* AddIntoListTree(TGListTree* ltree,
208  TEveElement* parent);
209  virtual TGListTreeItem* AddIntoListTrees(TEveElement* parent);
210 
211  virtual Bool_t RemoveFromListTree(TGListTree* ltree,
212  TGListTreeItem* parent_lti);
213  virtual Int_t RemoveFromListTrees(TEveElement* parent);
214 
215  virtual sLTI_i FindItem(TGListTree* ltree);
216  virtual sLTI_i FindItem(TGListTree* ltree,
217  TGListTreeItem* parent_lti);
218  virtual TGListTreeItem* FindListTreeItem(TGListTree* ltree);
220  TGListTreeItem* parent_lti);
221 
222  virtual Int_t GetNItems() const { return fItems.size(); }
223 
224  void SpawnEditor(); // *MENU*
225  virtual void ExportToCINT(char* var_name); // *MENU*
226 
227  void DumpSourceObject() const; // *MENU*
228  void PrintSourceObject() const; // *MENU*
229  void ExportSourceObjectToCINT(char* var_name) const; // *MENU*
230 
231  virtual Bool_t AcceptElement(TEveElement* el);
232 
233  virtual void AddElement(TEveElement* el);
234  virtual void RemoveElement(TEveElement* el);
235  virtual void RemoveElementLocal(TEveElement* el);
236  virtual void RemoveElements();
237  virtual void RemoveElementsLocal();
238 
239  virtual void AnnihilateElements();
240  virtual void Annihilate();
241 
242  virtual void ProjectChild(TEveElement* el, Bool_t same_depth=kTRUE);
243  virtual void ProjectAllChildren(Bool_t same_depth=kTRUE);
244 
245  virtual void Destroy(); // *MENU*
246  virtual void DestroyOrWarn();
247  virtual void DestroyElements(); // *MENU*
248 
250  virtual void ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kFALSE);
251 
252  virtual Bool_t CanEditElement() const { return kTRUE; }
253  virtual Bool_t SingleRnrState() const { return kFALSE; }
254  virtual Bool_t GetRnrSelf() const { return fRnrSelf; }
255  virtual Bool_t GetRnrChildren() const { return fRnrChildren; }
256  virtual Bool_t GetRnrState() const { return fRnrSelf && fRnrChildren; }
257  virtual Bool_t GetRnrAnything() const { return fRnrSelf || (fRnrChildren && HasChildren()); }
258  virtual Bool_t SetRnrSelf(Bool_t rnr);
259  virtual Bool_t SetRnrChildren(Bool_t rnr);
260  virtual Bool_t SetRnrSelfChildren(Bool_t rnr_self, Bool_t rnr_children);
261  virtual Bool_t SetRnrState(Bool_t rnr);
262  virtual void PropagateRnrStateToProjecteds();
263 
264  virtual Bool_t CanEditMainColor() const { return fCanEditMainColor; }
266  Color_t* GetMainColorPtr() const { return fMainColorPtr; }
267  void SetMainColorPtr(Color_t* color) { fMainColorPtr = color; }
268 
269  virtual Bool_t HasMainColor() const { return fMainColorPtr != 0; }
270  virtual Color_t GetMainColor() const { return fMainColorPtr ? *fMainColorPtr : 0; }
271  virtual void SetMainColor(Color_t color);
272  void SetMainColorPixel(Pixel_t pixel);
275  virtual void PropagateMainColorToProjecteds(Color_t color, Color_t old_color);
276 
279  virtual Char_t GetMainTransparency() const { return fMainTransparency; }
280  virtual void SetMainTransparency(Char_t t);
281  void SetMainAlpha(Float_t alpha);
283 
284  virtual Bool_t CanEditMainTrans() const { return fCanEditMainTrans; }
285  virtual Bool_t HasMainTrans() const { return fMainTrans != 0; }
286  virtual TEveTrans* PtrMainTrans(Bool_t create=kTRUE);
287  virtual TEveTrans& RefMainTrans();
288  virtual void InitMainTrans(Bool_t can_edit=kTRUE);
289  virtual void DestroyMainTrans();
290 
291  virtual void SetTransMatrix(Double_t* carr);
292  virtual void SetTransMatrix(const TGeoMatrix& mat);
293 
294  TRef& GetSource() { return fSource; }
295  TObject* GetSourceObject() const { return fSource.GetObject(); }
296  void SetSourceObject(TObject* o) { fSource = o; }
297  /*
298  void DumpSourceObject(); // *MENU*
299  void InspectSourceObject(); // *MENU*
300  */
301 
302  void* GetUserData() const { return fUserData; }
303  void SetUserData(void* ud) { fUserData = ud; }
304 
305 
306  // Selection state and management
307  //--------------------------------
308 
309 protected:
315 
317  {
318  kCSCBImplySelectAllChildren = BIT(0), // compound will select all children
319  kCSCBTakeAnyParentAsMaster = BIT(1), // element will take any compound parent as master
320  kCSCBApplyMainColorToAllChildren = BIT(2), // compound will apply color change to all children
321  kCSCBApplyMainColorToMatchingChildren = BIT(3), // compound will apply color change to all children with matching color
322  kCSCBApplyMainTransparencyToAllChildren = BIT(4), // compound will apply transparency change to all children
323  kCSCBApplyMainTransparencyToMatchingChildren = BIT(5) // compound will apply transparency change to all children with matching color
324  };
325 
327  {
331  };
332 
334 
335 public:
338 
339  Bool_t IsPickable() const { return fPickable; }
340  void SetPickable(Bool_t p) { fPickable = p; }
342 
343  virtual TEveElement* ForwardSelection();
344  virtual TEveElement* ForwardEdit();
345 
346  virtual void SelectElement(Bool_t state);
347  virtual void IncImpliedSelected();
348  virtual void DecImpliedSelected();
349  virtual void UnSelected();
350 
351  virtual void HighlightElement(Bool_t state);
352  virtual void IncImpliedHighlighted();
353  virtual void DecImpliedHighlighted();
354  virtual void UnHighlighted();
355 
356  virtual void FillImpliedSelectedSet(Set_t& impSelSet);
357 
358  virtual UChar_t GetSelectedLevel() const;
359 
361 
362  void SetCSCBits(UChar_t f) { fCSCBits |= f; }
363  void ResetCSCBits(UChar_t f) { fCSCBits &= ~f; }
364  Bool_t TestCSCBits(UChar_t f) const { return (fCSCBits & f) != 0; }
365 
366  void ResetAllCSCBits() { fCSCBits = 0; }
373 
374 
375  // Change-stamping and change bits
376  //---------------------------------
377 
379  {
380  kCBColorSelection = BIT(0), // Main color or select/hilite state changed.
381  kCBTransBBox = BIT(1), // Transformation matrix or bounding-box changed.
382  kCBObjProps = BIT(2), // Object changed, requires dropping its display-lists.
383  kCBVisibility = BIT(3) // Rendering of self/children changed.
384  // kCBElementAdded = BIT(), // Element was added to a new parent.
385  // kCBElementRemoved = BIT() // Element was removed from a parent.
386 
387  // Deletions are handled in a special way in TEveManager::PreDeleteElement().
388  };
389 
390 protected:
393 
394 public:
399  // void StampElementAdded() { AddStamp(kCBElementAdded); }
400  // void StampElementRemoved() { AddStamp(kCBElementRemoved); }
401  virtual void AddStamp(UChar_t bits);
402  virtual void ClearStamps() { fChangeBits = 0; }
403 
404  UChar_t GetChangeBits() const { return fChangeBits; }
405 
406 
407  // List-tree icons
408  //-----------------
409 
410  virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);
411  virtual const TGPicture* GetListTreeCheckBoxIcon();
412 
413  // Menu entries for VizDB communication (here so they are last in the menu).
414 
415  void VizDB_Apply(const char* tag); // *MENU*
416  void VizDB_Reapply(); // *MENU*
417  void VizDB_UpdateModel(Bool_t update=kTRUE); // *MENU*
418  void VizDB_Insert(const char* tag, Bool_t replace=kTRUE, Bool_t update=kTRUE); // *MENU*
419 
420  ClassDef(TEveElement, 0); // Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and list-tree item management.
421 };
422 
423 
424 /******************************************************************************/
425 // TEveElementObjectPtr
426 /******************************************************************************/
427 
429  public TObject
430 {
431  TEveElementObjectPtr& operator=(const TEveElementObjectPtr&); // Not implemented
432 
433 protected:
434  TObject* fObject; // External object holding the visual data.
435  Bool_t fOwnObject; // Is object owned / should be deleted on destruction.
436 
437 public:
439  TEveElementObjectPtr(TObject* obj, Color_t& mainColor, Bool_t own=kTRUE);
441  virtual ~TEveElementObjectPtr();
442 
443  virtual TEveElementObjectPtr* CloneElement() const;
444 
445  virtual TObject* GetObject(const TEveException& eh="TEveElementObjectPtr::GetObject ") const;
446  virtual void ExportToCINT(char* var_name);
447 
448  Bool_t GetOwnObject() const { return fOwnObject; }
449  void SetOwnObject(Bool_t o) { fOwnObject = o; }
450 
451  ClassDef(TEveElementObjectPtr, 0); // TEveElement with external TObject as a holder of visualization data.
452 };
453 
454 
455 /******************************************************************************/
456 // TEveElementList
457 /******************************************************************************/
458 
460  public TNamed,
461  public TEveProjectable
462 {
463 private:
464  TEveElementList& operator=(const TEveElementList&); // Not implemented
465 
466 protected:
467  Color_t fColor; // Color of the object.
468  TClass *fChildClass; // Class of acceptable children, others are rejected.
469 
470 public:
471  TEveElementList(const char* n="TEveElementList", const char* t="",
472  Bool_t doColor=kFALSE, Bool_t doTransparency=kFALSE);
474  virtual ~TEveElementList() {}
475 
476  virtual TObject* GetObject(const TEveException& /*eh*/="TEveElementList::GetObject ") const
477  { const TObject* obj = this; return const_cast<TObject*>(obj); }
478 
479  virtual TEveElementList* CloneElement() const;
480 
481  virtual const char* GetElementName() const { return GetName(); }
482  virtual const char* GetElementTitle() const { return GetTitle(); }
483 
484  virtual void SetElementName (const char* name)
485  { TNamed::SetName(name); NameTitleChanged(); }
486 
487  virtual void SetElementTitle(const char* title)
488  { TNamed::SetTitle(title); NameTitleChanged(); }
489 
490  virtual void SetElementNameTitle(const char* name, const char* title)
491  { TNamed::SetNameTitle(name, title); NameTitleChanged(); }
492 
493  TClass* GetChildClass() const { return fChildClass; }
495 
496  virtual Bool_t AcceptElement(TEveElement* el);
497 
498  virtual TClass* ProjectedClass(const TEveProjection* p) const;
499 
500  ClassDef(TEveElementList, 0); // List of TEveElement objects with a possibility to limit the class of accepted elements.
501 };
502 
503 
504 /******************************************************************************/
505 // TEveElementListProjected
506 /******************************************************************************/
507 
509  public TEveProjected
510 {
511 private:
512  TEveElementListProjected(const TEveElementListProjected&); // Not implemented
513  TEveElementListProjected& operator=(const TEveElementListProjected&); // Not implemented
514 
515 public:
518 
519  virtual void UpdateProjection();
520  virtual TEveElement* GetProjectedAsElement() { return this; }
521 
522  ClassDef(TEveElementListProjected, 0); // Projected TEveElementList.
523 };
524 
525 #endif
TEveTrans is a 4x4 transformation matrix for homogeneous coordinates stored internally in a column-ma...
Definition: TEveTrans.h:26
Abstract base class for classes that hold results of a non-linear projection transformation.
virtual void SetElementName(const char *name)
Virtual function for setting of name of an element.
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52
List_ci BeginParents() const
Definition: TEveElement.h:158
void DecDenyDestroy()
Decreases the deny-destroy count of the element.
virtual Bool_t GetRnrState() const
Definition: TEveElement.h:256
virtual void PadPaint(Option_t *option)
Paint self and/or children into currently active pad.
sLTI_t::iterator sLTI_i
Definition: TEveElement.h:66
List_i EndChildren()
Definition: TEveElement.h:165
void SetVizModel(TEveElement *model)
Set visualization-parameter model element.
TRef fSource
Set of list-tree-items.
Definition: TEveElement.h:102
void DisableListElements(Bool_t rnr_self=kFALSE, Bool_t rnr_children=kFALSE)
Disable rendering of children and their list contents.
virtual void SelectElement(Bool_t state)
Set element's selection state. Stamp appropriately.
Int_t fDenyDestroy
Counter for top-level list-tree items that prevent automatic destruction.
Definition: TEveElement.h:87
TEveElement * fVizModel
Definition: TEveElement.h:81
virtual void AddParent(TEveElement *re)
Add re into the list parents.
virtual UChar_t GetSelectedLevel() const
Get selection level, needed for rendering selection and highlight feedback.
void * fUserData
Definition: TEveElement.h:103
void(TEveElement::* ImplySelect_foo)()
Definition: TEveElement.h:337
Bool_t fCanEditMainTrans
Definition: TEveElement.h:94
virtual sLTI_i FindItem(TGListTree *ltree)
Find any list-tree-item of this element in list-tree 'ltree'.
static const TGPicture * fgRnrIcons[4]
Definition: TEveElement.h:62
void SetUserData(void *ud)
Definition: TEveElement.h:303
virtual Bool_t HasMainTrans() const
Definition: TEveElement.h:285
virtual const char * GetElementTitle() const
Virtual function for retrieving title of the render-element.
virtual void CollectSceneParentsFromChildren(List_t &scenes, TEveElement *parent)
Collect scene-parents from all children.
Char_t fMainTransparency
Definition: TEveElement.h:96
TEveListTreeInfo(const TEveListTreeInfo &l)
Definition: TEveElement.h:48
float Float_t
Definition: RtypesCore.h:53
virtual TClass * ProjectedClass(const TEveProjection *p) const
Virtual from TEveProjectable, returns TEveCompoundProjected class.
Bool_t IsPickable() const
Definition: TEveElement.h:339
TClass * fChildClass
Definition: TEveElement.h:468
virtual void AddStamp(UChar_t bits)
Add (bitwise or) given stamps to fChangeBits.
return c
std::set< TEveElement * > Set_t
Definition: TEveElement.h:73
const char Option_t
Definition: RtypesCore.h:62
virtual ~TEveElementList()
Definition: TEveElement.h:474
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
Definition: TEveElement.h:481
virtual void DestroyMainTrans()
Destroy the main transformation matrix, it will always be taken as identity.
Int_t fParentIgnoreCnt
Definition: TEveElement.h:85
virtual Bool_t AcceptElement(TEveElement *el)
Check if TEveElement el is inherited from fChildClass.
void VizDB_Apply(const char *tag)
Set visual parameters for this object for given tag.
virtual ~TEveElementListProjected()
Definition: TEveElement.h:517
List_ci EndParents() const
Definition: TEveElement.h:159
List_t fChildren
Definition: TEveElement.h:79
Bool_t fPickable
Definition: TEveElement.h:310
void CSCApplyMainTransparencyToAllChildren()
Definition: TEveElement.h:371
virtual void RemoveParent(TEveElement *re)
Remove re from the list of parents.
virtual void NameTitleChanged()
Virtual function called when a name or title of the element has been changed.
virtual void SetName(const char *name)
Change (i.e.
Definition: TNamed.cxx:128
void regexp()
Definition: regexp.C:34
#define BIT(n)
Definition: Rtypes.h:120
void SetPickable(Bool_t p)
Definition: TEveElement.h:340
virtual const char * GetElementTitle() const
Virtual function for retrieving title of the render-element.
Definition: TEveElement.h:482
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
Definition: TEveElement.h:520
Bool_t fCanEditMainColor
Definition: TEveElement.h:92
Bool_t fRnrChildren
Definition: TEveElement.h:91
virtual void RemoveElementLocal(TEveElement *el)
Perform additional local removal of el.
static const TGPicture * fgListTreeIcons[9]
Definition: TEveElement.h:63
Int_t fTopItemCnt
Counter for parents that are ignored in ref-counting.
Definition: TEveElement.h:86
Int_t NumParents() const
Definition: TEveElement.h:160
List_t::iterator List_i
Definition: TEveElement.h:70
Bool_t fRnrSelf
Definition: TEveElement.h:90
TEveElement * LastChild() const
Returns the last child element or 0 if the list is empty.
void IncDenyDestroy()
Increases the deny-destroy count of the element.
virtual void PropagateMainColorToProjecteds(Color_t color, Color_t old_color)
Propagate color to projected elements.
virtual Bool_t SetRnrState(Bool_t rnr)
Set render state of this element and of its children to the same value.
virtual void ProjectAllChildren(Bool_t same_depth=kTRUE)
If this is a projectable, loop over all projected replicas and add the projected image of all childre...
virtual void PaintStandard(TObject *id)
Paint object – a generic implementation for EVE elements.
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
Basic string class.
Definition: TString.h:137
virtual void CollectSceneParents(List_t &scenes)
Collect all parents of class TEveScene.
virtual void Destroy()
Destroy this element.
bool operator==(const TEveListTreeInfo &x) const
Definition: TEveElement.h:54
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
ClassDef(TEveElementList, 0)
Int_t GetParentIgnoreCnt() const
Get number of parents that should be ignored in doing reference-counting.
virtual TObject * GetObject(const TEveException &="TEveElementList::GetObject ") const
Get a TObject associated with this render-element.
Definition: TEveElement.h:476
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
sLTI_t fItems
Definition: TEveElement.h:100
void DecParentIgnoreCnt()
Decrease number of parents ignored in reference-counting.
Bool_t FindVizModel()
Find model element in VizDB that corresponds to previously assigned fVizTag and set fVizModel accordi...
virtual void SetNameTitle(const char *name, const char *title)
Change (i.e. set) all the TNamed parameters (name and title).
Definition: TNamed.cxx:142
static const char * ToString(Bool_t b)
Convert Bool_t to string - kTRUE or kFALSE.
virtual void SetElementNameTitle(const char *name, const char *title)
Virtual function for setting of name and title of render element.
Definition: TEveElement.h:490
TEveElementList(const char *n="TEveElementList", const char *t="", Bool_t doColor=kFALSE, Bool_t doTransparency=kFALSE)
Constructor.
void CSCApplyMainColorToMatchingChildren()
Definition: TEveElement.h:370
virtual void PropagateVizParamsToProjecteds()
Propagate visualization parameters to dependent elements.
void SetChildClass(TClass *c)
Definition: TEveElement.h:494
TFile * f
virtual void RemoveElementsLocal()
Perform additional local removal of all elements.
TEveListTreeInfo & operator=(const TEveListTreeInfo &l)
Definition: TEveElement.h:51
TEveElement()
Default constructor.
Definition: TEveElement.cxx:61
void SetMainColorPtr(Color_t *color)
Definition: TEveElement.h:267
A list of TEveElements.
Definition: TEveElement.h:459
virtual TString GetHighlightTooltip()
Definition: TEveElement.h:123
void CSCImplySelectAllChildren()
Definition: TEveElement.h:367
TEveElementObjectPtr & operator=(const TEveElementObjectPtr &)
List_t fParents
Definition: TEveElement.h:78
TObject * GetSourceObject() const
Definition: TEveElement.h:295
void RecheckImpliedSelections()
Call this if it is possible that implied-selection or highlight has changed for this element or for i...
virtual TEveElementList * CloneElement() const
Clone the element via copy constructor.
void SetCSCBits(UChar_t f)
Definition: TEveElement.h:362
virtual void RemoveElement(TEveElement *el)
Remove el from the list of children.
Persistent Reference link to a TObject A TRef is a lightweight object pointing to any TObject...
Definition: TRef.h:34
void IncParentIgnoreCnt()
Increase number of parents ignored in reference-counting.
Color_t * fMainColorPtr
Definition: TEveElement.h:97
Description of TEveCompound.
Definition: TEveCompound.h:23
ClassDef(TEveElement, 0)
ECompoundSelectionColorBits
Definition: TEveElement.h:316
TEveElement * GetVizModel() const
Definition: TEveElement.h:132
virtual void SetElementTitle(const char *title)
Virtual function for setting of title of an element.
Definition: TEveElement.h:487
Double_t x[n]
Definition: legend1.C:17
void SetEditMainTransparency(Bool_t x)
Definition: TEveElement.h:278
Bool_t fDestroyOnZeroRefCnt
Deny-destroy count.
Definition: TEveElement.h:88
virtual void ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kFALSE)
Call this after an element has been changed so that the state can be propagated around the framework...
ULong_t Pixel_t
Definition: GuiTypes.h:41
Bool_t fCanEditMainTransparency
Definition: TEveElement.h:93
sLTI_t::reverse_iterator sLTI_ri
Definition: TEveElement.h:67
virtual void Annihilate()
Optimized destruction without check of reference-count.
void StampVisibility()
Definition: TEveElement.h:398
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void VizDB_Reapply()
Reset visual parameters for this object from VizDB.
TEveCompound * fCompound
Definition: TEveElement.h:80
Set_t::iterator Set_i
Definition: TEveElement.h:74
void SetVizTag(const TString &tag)
Definition: TEveElement.h:130
virtual TEveElement * CloneElementRecurse(Int_t level=0) const
Clone elements and recurse 'level' deep over children.
int d
Definition: tornado.py:11
virtual void DestroyListSubTree(TGListTree *ltree, TGListTreeItem *parent)
Destroy sub-tree under item 'parent' in list-tree 'ltree'.
TEveElementListProjected()
Constructor.
virtual Bool_t GetRnrChildren() const
Definition: TEveElement.h:255
virtual Color_t GetMainColor() const
Definition: TEveElement.h:270
Int_t FindChildren(List_t &matches, const TString &name, const TClass *cls=0)
Find all children with given name and append them to matches list.
void SetCompound(TEveCompound *c)
Definition: TEveElement.h:147
void SetEditMainColor(Bool_t x)
Definition: TEveElement.h:265
TEveElement & operator=(const TEveElement &)
virtual TObject * GetRenderObject(const TEveException &eh) const
Definition: TEveElement.h:198
virtual Bool_t CanEditMainTrans() const
Definition: TEveElement.h:284
void VizDB_Insert(const char *tag, Bool_t replace=kTRUE, Bool_t update=kTRUE)
Create a replica of element and insert it into VizDB with given tag.
virtual void SetElementTitle(const char *title)
Virtual function for setting of title of an element.
Base-class for non-linear projections.
Short_t fImpliedSelected
Definition: TEveElement.h:313
virtual void ExpandIntoListTree(TGListTree *ltree, TGListTreeItem *parent)
Populates parent with elements.
virtual Bool_t GetRnrSelf() const
Definition: TEveElement.h:254
const List_t & RefChildren() const
Definition: TEveElement.h:163
void SaveVizParams(std::ostream &out, const TString &tag, const TString &var)
Save visualization parameters for this element with given tag.
Bool_t HasChild(TEveElement *el)
Check if element el is a child of this element.
void(TEveElement::* Select_foo)(Bool_t)
Definition: TEveElement.h:336
virtual void DestroyElements()
Destroy all children of this element.
virtual void SetElementName(const char *name)
Virtual function for setting of name of an element.
Definition: TEveElement.h:484
char * out
Definition: TBase64.cxx:29
short Color_t
Definition: RtypesCore.h:79
virtual void ClearStamps()
Definition: TEveElement.h:402
void ResetAllCSCBits()
Definition: TEveElement.h:366
UChar_t fChangeBits
Definition: TEveElement.h:391
virtual ~TEveElement()
Destructor.
virtual Bool_t CanEditMainColor() const
Definition: TEveElement.h:264
Abstract base-class for non-linear projectable objects.
Bool_t GetOwnObject() const
Definition: TEveElement.h:448
virtual TEveElementObjectPtr * CloneElement() const
Clone the element via copy constructor.
virtual void InitMainTrans(Bool_t can_edit=kTRUE)
Initialize the main transformation to identity matrix.
Color_t * GetMainColorPtr() const
Definition: TEveElement.h:266
void SetPickableRecursively(Bool_t p)
Set pickable state on the element and all its children.
virtual TGListTreeItem * AddIntoListTrees(TEveElement *parent)
Add this render element into all list-trees and all items belonging to parent.
TThread * t[5]
Definition: threadsh1.C:13
virtual void PreDeleteElement()
Externally assigned and controlled user data.
List_t::const_iterator List_ci
Definition: TEveElement.h:71
void CSCApplyMainTransparencyToMatchingChildren()
Definition: TEveElement.h:372
virtual void CheckReferenceCount(const TEveException &eh="TEveElement::CheckReferenceCount ")
Check external references to this and eventually auto-destruct the render-element.
List_ci BeginChildren() const
Definition: TEveElement.h:166
ROOT::R::TRInterface & r
Definition: Object.C:4
TEveElement * GetMaster()
Returns the master element - that is:
virtual TGListTreeItem * AddIntoListTree(TGListTree *ltree, TGListTreeItem *parent_lti)
Add this element into ltree to an already existing item parent_lti.
List_i EndParents()
Definition: TEveElement.h:157
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
void SetSourceObject(TObject *o)
Definition: TEveElement.h:296
TEveTrans * fMainTrans
Definition: TEveElement.h:98
virtual ~TEveElementObjectPtr()
Destructor.
virtual void SetElementNameTitle(const char *name, const char *title)
Virtual function for setting of name and title of render element.
virtual void DecImpliedHighlighted()
Decrease element's implied-highlight count. Stamp appropriately.
Char_t fDestructing
Definition: TEveElement.h:392
virtual void PropagateMainTransparencyToProjecteds(Char_t t, Char_t old_t)
Propagate transparency to projected elements.
virtual void DecImpliedSelected()
Decrease element's implied-selection count. Stamp appropriately.
virtual const TGPicture * GetListTreeCheckBoxIcon()
Returns list-tree-item check-box picture appropriate for given rendering state.
void SetMainColorRGB(UChar_t r, UChar_t g, UChar_t b)
Convert RGB values to Color_t and call SetMainColor.
void SetMainAlpha(Float_t alpha)
Set main-transparency via float alpha variable.
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
void ResetCSCBits(UChar_t f)
Definition: TEveElement.h:363
virtual void AnnihilateRecursively()
Protected member function called from TEveElement::Annihilate().
virtual void IncImpliedSelected()
Increase element's implied-selection count. Stamp appropriately.
Bool_t fHighlighted
Definition: TEveElement.h:312
virtual void FillImpliedSelectedSet(Set_t &impSelSet)
Populate set impSelSet with derived / dependant elements.
virtual void IncImpliedHighlighted()
Increase element's implied-highlight count. Stamp appropriately.
virtual void ExportToCINT(char *var_name)
Export render-element to CINT with variable name var_name.
void StampObjProps()
Definition: TEveElement.h:397
TEveElement with external TObject as a holder of visualization data.
Definition: TEveElement.h:428
virtual TObject * GetObject(const TEveException &eh="TEveElementObjectPtr::GetObject ") const
Return external object.
virtual Bool_t SetRnrSelf(Bool_t rnr)
Set render state of this element, i.e.
short Short_t
Definition: RtypesCore.h:35
TLine * l
Definition: textangle.C:4
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
const TString & GetVizTag() const
Definition: TEveElement.h:129
bool operator<(const TEveListTreeInfo &x) const
Definition: TEveElement.h:56
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
virtual TObject * GetEditorObject(const TEveException &eh) const
Definition: TEveElement.h:197
virtual void AddElement(TEveElement *el)
Add el to the list of children.
virtual Int_t GetNItems() const
Definition: TEveElement.h:222
Bool_t GetDestroyOnZeroRefCnt() const
Returns state of flag determining if the element will be destroyed when reference count reaches zero...
List_i BeginParents()
Definition: TEveElement.h:156
void * GetUserData() const
Definition: TEveElement.h:302
virtual void SetMainColor(Color_t color)
Set main color of the element.
ClassDef(TEveElementListProjected, 0)
void StampColorSelection()
Definition: TEveElement.h:395
void ExportSourceObjectToCINT(char *var_name) const
Export source object to CINT with given name for the variable.
virtual Int_t RemoveFromListTrees(TEveElement *parent)
Remove element from all list-trees where 'parent' is the user-data of the parent list-tree-item.
virtual void SetMainTransparency(Char_t t)
Set main-transparency.
TEveElement * FirstChild() const
Returns the first child element or 0 if the list is empty.
virtual Bool_t RemoveFromListTree(TGListTree *ltree, TGListTreeItem *parent_lti)
Remove element from list-tree 'ltree' where its parent item is 'parent_lti'.
virtual TEveElement * ForwardEdit()
Returns element to be displayed in GUI editor on click.
Int_t fNumChildren
Definition: TEveElement.h:84
Bool_t fSelected
Definition: TEveElement.h:311
void StampTransBBox()
Definition: TEveElement.h:396
std::list< TEveElement * > List_t
Definition: TEveElement.h:69
virtual void DestroyOrWarn()
Destroy this element. Prints a warning if deny-destroy is in force.
Set_t::const_iterator Set_ci
Definition: TEveElement.h:75
void EnableListElements(Bool_t rnr_self=kTRUE, Bool_t rnr_children=kTRUE)
Enable rendering of children and their list contents.
virtual void RemoveElementsInternal()
Remove all elements.
double Double_t
Definition: RtypesCore.h:55
virtual void ExportToCINT(char *var_name)
Export external object to CINT with variable name var_name.
A projected element list – required for proper propagation of render state to projected views...
Definition: TEveElement.h:508
void DumpSourceObject() const
Call Dump() on source object.
Int_t GetDenyDestroy() const
Returns the number of times deny-destroy has been requested on the element.
Bool_t TestCSCBits(UChar_t f) const
Definition: TEveElement.h:364
virtual Bool_t SingleRnrState() const
Definition: TEveElement.h:253
void CSCTakeAnyParentAsMaster()
Definition: TEveElement.h:368
virtual Bool_t SetRnrChildren(Bool_t rnr)
Set render state of this element's children, i.e.
void CSCApplyMainColorToAllChildren()
Definition: TEveElement.h:369
virtual void HighlightElement(Bool_t state)
Set element's highlight state. Stamp appropriately.
Central application manager for Eve.
Definition: TEveManager.h:49
virtual TObject * GetObject(const TEveException &eh) const
Get a TObject associated with this render-element.
TRef & GetSource()
Definition: TEveElement.h:294
virtual void UnHighlighted()
Virtual function called when both fHighlighted is false and fImpliedHighlighted is 0...
virtual Bool_t GetRnrAnything() const
Definition: TEveElement.h:257
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Returns pointer to first listtreeicon.
Short_t fImpliedHighlighted
Definition: TEveElement.h:314
void SpawnEditor()
Show GUI editor for this object.
virtual void CopyVizParamsFromDB()
Copy visualization parameters from the model-element fVizModel.
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
Structure holding information about TGListTree and TGListTreeItem that represents given TEveElement...
Definition: TEveElement.h:40
char Char_t
Definition: RtypesCore.h:29
typedef void((*Func_t)())
TObject * GetObject() const
Return a pointer to the referenced object.
Definition: TRef.cxx:377
UChar_t GetChangeBits() const
Definition: TEveElement.h:404
Bool_t HasParents() const
Definition: TEveElement.h:161
Bool_t HasChildren() const
Definition: TEveElement.h:169
TEveElementObjectPtr(TObject *obj, Bool_t own=kTRUE)
Constructor.
virtual void RemoveElements()
Remove all elements.
virtual Bool_t AcceptElement(TEveElement *el)
Check if el can be added to this element.
#define dest(otri, vertexptr)
Definition: triangle.c:1040
void SetOwnObject(Bool_t o)
Definition: TEveElement.h:449
Bool_t ApplyVizTag(const TString &tag, const TString &fallback_tag="")
Set the VizTag, find model-element from the VizDB and copy visualization-parameters from it...
virtual void PropagateVizParamsToElements(TEveElement *el=0)
Propagate visualization parameters from element el (defaulting to this) to all elements (children)...
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write-out visual parameters for this object.
void SetMainColorPixel(Pixel_t pixel)
Convert pixel to Color_t and call SetMainColor().
List_i BeginChildren()
Definition: TEveElement.h:164
virtual TEveTrans & RefMainTrans()
Return reference to main transformation.
virtual Bool_t HasMainColor() const
Definition: TEveElement.h:269
virtual Bool_t SetRnrSelfChildren(Bool_t rnr_self, Bool_t rnr_children)
Set state for rendering of this element and its children.
Int_t NumChildren() const
Definition: TEveElement.h:168
virtual Char_t GetMainTransparency() const
Definition: TEveElement.h:279
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:102
virtual Bool_t CanEditElement() const
Definition: TEveElement.h:252
TEveElementListProjected & operator=(const TEveElementListProjected &)
virtual TEveElement * CloneElement() const
Clone the element via copy constructor.
ClassDef(TEveListTreeInfo, 0)
TEveElementList & operator=(const TEveElementList &)
virtual TGListTreeItem * FindListTreeItem(TGListTree *ltree)
Find any list-tree-item of this element in list-tree 'ltree'.
void VizDB_UpdateModel(Bool_t update=kTRUE)
Copy visual parameters from this element to viz-db model.
void SetDestroyOnZeroRefCnt(Bool_t d)
Sets the state of flag determining if the element will be destroyed when reference count reaches zero...
List_ci EndChildren() const
Definition: TEveElement.h:167
virtual void PropagateRnrStateToProjecteds()
Propagate render state to the projected replicas of this element.
unsigned char UChar_t
Definition: RtypesCore.h:34
virtual void AnnihilateElements()
Annihilate elements.
virtual TEveTrans * PtrMainTrans(Bool_t create=kTRUE)
Return pointer to main transformation.
TEveCompound * GetCompound()
Definition: TEveElement.h:146
TEveElement * FindChild(const TString &name, const TClass *cls=0)
Find the first child with given name.
virtual void UnSelected()
Virtual function called when both fSelected is false and fImpliedSelected is 0.
TClass * GetChildClass() const
Definition: TEveElement.h:493
virtual TEveElement * ForwardSelection()
Returns element to be selected on click.
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
Definition: TNamed.cxx:152
TObject * obj
virtual void ProjectChild(TEveElement *el, Bool_t same_depth=kTRUE)
If this is a projectable, loop over all projected replicas and add the projected image of child 'el' ...
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
const Int_t n
Definition: legend1.C:16
void PrintSourceObject() const
Call Print() on source object.
virtual Bool_t CanEditMainTransparency() const
Definition: TEveElement.h:277
TString fVizTag
Element used as model from VizDB.
Definition: TEveElement.h:82
virtual void CloneChildrenRecurse(TEveElement *dest, Int_t level=0) const
Clone children and attach them to the dest element.
std::set< TEveListTreeInfo > sLTI_t
Definition: TEveElement.h:65
virtual void SetTransMatrix(Double_t *carr)
Set transformation matrix from column-major array.
virtual void UpdateProjection()
This is abstract method from base-class TEveProjected.
ClassDef(TEveElementObjectPtr, 0)
UChar_t fCSCBits
Definition: TEveElement.h:333
virtual Bool_t HandleElementPaste(TEveElement *el)
React to element being pasted or dnd-ed.
TEveListTreeInfo(TGListTree *lt, TGListTreeItem *lti)
Definition: TEveElement.h:47