ROOT  6.06/09
Reference Guide
TEveGeoNode.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_TEveGeoNode
13 #define ROOT_TEveGeoNode
14 
15 #include "TEveElement.h"
16 
17 class TGeoVolume;
18 class TGeoNode;
19 class TGeoHMatrix;
20 class TGeoManager;
21 
22 // Added here to ease transition - forward declaration should be used.
23 // This include will be removed for 5.24.
24 #include <TEveGeoShape.h>
25 // class TGeoShape;
26 
28 
29 //----------------------------------------------------------------
30 
31 class TEveGeoNode : public TEveElement,
32  public TObject
33 {
34  friend class TEveGeoNodeEditor;
35 
36  TEveGeoNode(const TEveGeoNode&); // Not implemented
37  TEveGeoNode& operator=(const TEveGeoNode&); // Not implemented
38 
39 protected:
42 
43  static Int_t fgCSGExportNSeg; //!
44  static std::list<TGeoShape*> fgTemporaryStore; //!
45 
46 public:
47  TEveGeoNode(TGeoNode* node);
48 
49  virtual TObject* GetObject(const TEveException&) const
50  { const TObject* obj = this; return const_cast<TObject*>(obj); }
51 
52  virtual const char* GetName() const;
53  virtual const char* GetTitle() const;
54  virtual const char* GetElementName() const;
55  virtual const char* GetElementTitle() const;
56 
57  TGeoNode* GetNode() const { return fNode; }
58 
59  virtual void ExpandIntoListTree(TGListTree* ltree, TGListTreeItem* parent);
60 
61  virtual void ExpandIntoListTrees();
62  virtual void ExpandIntoListTreesRecursively();
63 
64  virtual Bool_t CanEditElement() const { return kFALSE; }
65 
66  virtual void AddStamp(UChar_t bits);
67 
68  virtual Bool_t CanEditMainColor() const;
69  virtual void SetMainColor(Color_t color);
70 
71  virtual Bool_t CanEditMainTransparency() const;
72  virtual Char_t GetMainTransparency() const;
73  virtual void SetMainTransparency(Char_t t);
74 
75  void UpdateNode(TGeoNode* node);
76  void UpdateVolume(TGeoVolume* volume);
77 
78  void Save(const char* file, const char* name="Extract", Bool_t leafs_only=kFALSE);
79  void SaveExtract(const char* file, const char* name, Bool_t leafs_only);
80  void WriteExtract(const char* name, Bool_t leafs_only);
81 
82  virtual void Draw(Option_t* option="");
83 
84  static Int_t GetCSGExportNSeg();
85  static void SetCSGExportNSeg(Int_t nseg);
86 
87  ClassDef(TEveGeoNode, 1); // Wrapper for TGeoNode that allows it to be shown in GUI and controlled as a TEveElement.
88 };
89 
90 //----------------------------------------------------------------
91 
93 {
94  TEveGeoTopNode(const TEveGeoTopNode&); // Not implemented
95  TEveGeoTopNode& operator=(const TEveGeoTopNode&); // Not implemented
96 
97 protected:
102 
103 public:
104  TEveGeoTopNode(TGeoManager* manager, TGeoNode* node, Int_t visopt=1,
105  Int_t vislvl=3, Int_t maxvisnds=10000);
106  virtual ~TEveGeoTopNode() {}
107 
108  void UseNodeTrans();
109 
110  TGeoManager* GetGeoManager() const { return fManager; }
111 
112  Int_t GetVisOption() const { return fVisOption; }
113  void SetVisOption(Int_t vo) { fVisOption = vo; }
114  Int_t GetVisLevel() const { return fVisLevel; }
115  void SetVisLevel(Int_t vl) { fVisLevel = vl; }
116  Int_t GetMaxVisNodes() const { return fMaxVisNodes; }
117  void SetMaxVisNodes(Int_t mvn) { fMaxVisNodes = mvn; }
118 
119  virtual Bool_t CanEditElement() const { return kTRUE; }
120  virtual Bool_t SingleRnrState() const { return kTRUE; }
121 
122  virtual void AddStamp(UChar_t bits);
123 
124  virtual void Draw(Option_t* option="");
125  virtual void Paint(Option_t* option="");
126 
127  // Signals from GeoManager.
128  // These are not available any more ... colors in list-tree not refreshed
129  // properly.
130  void VolumeVisChanged(TGeoVolume* volume);
131  void VolumeColChanged(TGeoVolume* volume);
132  void NodeVisChanged(TGeoNode* node);
133 
134  ClassDef(TEveGeoTopNode, 1); // Top-level TEveGeoNode with a pointer to TGeoManager and controls for steering of TGeoPainter.
135 };
136 
137 #endif
virtual void AddStamp(UChar_t bits)
Revert from TEveGeoNode back to standard behaviour, that is, do not pass visibility changes to fNode ...
virtual void ExpandIntoListTrees()
Expand children into all list-trees.
Int_t GetVisOption() const
Definition: TEveGeoNode.h:112
void VolumeColChanged(TGeoVolume *volume)
Callback for propagating volume parameter changes.
virtual void ExpandIntoListTree(TGListTree *ltree, TGListTreeItem *parent)
Checks if child-nodes have been imported ...
Globally positioned TGeoShape with rendering attributes and an optional list of daughter shape-extrac...
virtual void SetMainTransparency(Char_t t)
Set transparency, propagate to volume's transparency.
void SaveExtract(const char *file, const char *name, Bool_t leafs_only)
Save the shape tree as TEveGeoShapeExtract.
const char Option_t
Definition: RtypesCore.h:62
virtual Bool_t CanEditMainTransparency() const
Can edit main transparency – not available for assemblies.
virtual void Paint(Option_t *option="")
Paint the enclosed TGeo hierarchy with visibility level and option given in data-members.
void UpdateNode(TGeoNode *node)
Updates all reve-browsers having the node in their contents.
virtual const char * GetElementName() const
Return name, taken from geo-node. Used via TEveElement.
Definition: TEveGeoNode.cxx:99
static std::list< TGeoShape * > fgTemporaryStore
Definition: TEveGeoNode.h:44
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGeoManager * fManager
Definition: TEveGeoNode.h:98
const Bool_t kFALSE
Definition: Rtypes.h:92
void WriteExtract(const char *name, Bool_t leafs_only)
Write the shape tree as TEveGeoShapeExtract to current directory.
Wrapper for TGeoNode that allows it to be shown in GUI and controlled as a TEveElement.
Definition: TEveGeoNode.h:31
void UseNodeTrans()
Use transformation matrix from the TGeoNode.
virtual void SetMainColor(Color_t color)
Set color, propagate to volume's line color.
virtual Bool_t CanEditElement() const
Definition: TEveGeoNode.h:119
Int_t fMaxVisNodes
Definition: TEveGeoNode.h:101
virtual void AddStamp(UChar_t bits)
Override from TEveElement.
void Save(const char *file, const char *name="Extract", Bool_t leafs_only=kFALSE)
Save TEveGeoShapeExtract tree starting at this node.
virtual Bool_t CanEditElement() const
Definition: TEveGeoNode.h:64
static Int_t fgCSGExportNSeg
Definition: TEveGeoNode.h:43
TEveGeoNode & operator=(const TEveGeoNode &)
virtual TObject * GetObject(const TEveException &) const
Get a TObject associated with this render-element.
Definition: TEveGeoNode.h:49
short Color_t
Definition: RtypesCore.h:79
virtual void Draw(Option_t *option="")
Draw the top-node.
A wrapper over a TGeoNode, possibly displaced with a global trasformation stored in TEveElement...
Definition: TEveGeoNode.h:92
TEveGeoTopNode & operator=(const TEveGeoTopNode &)
virtual Bool_t SingleRnrState() const
Definition: TEveGeoNode.h:120
Int_t GetMaxVisNodes() const
Definition: TEveGeoNode.h:116
void VolumeVisChanged(TGeoVolume *volume)
Callback for propagating volume visibility changes.
ClassDef(TEveGeoTopNode, 1)
virtual Char_t GetMainTransparency() const
Get transparency – it is taken from the geo node.
Int_t GetVisLevel() const
Definition: TEveGeoNode.h:114
virtual void Draw(Option_t *option="")
Draw the object.
virtual ~TEveGeoTopNode()
Definition: TEveGeoNode.h:106
TEveGeoShapeExtract * DumpShapeTree(TEveGeoNode *geon, TEveGeoShapeExtract *parent=0, Bool_t leafs_only=kFALSE)
Export the node hierarchy into tree of TEveGeoShapeExtract objects.
void SetVisLevel(Int_t vl)
Definition: TEveGeoNode.h:115
void NodeVisChanged(TGeoNode *node)
Callback for propagating node visibility changes.
TEveGeoNode(const TEveGeoNode &)
static void SetCSGExportNSeg(Int_t nseg)
Sets number of segments used for CSG export.
Definition: TEveGeoNode.cxx:59
TGeoNode * fNode
Definition: TEveGeoNode.h:40
TEveGeoTopNode(const TEveGeoTopNode &)
#define name(a, b)
Definition: linkTestLib0.cpp:5
void SetVisOption(Int_t vo)
Definition: TEveGeoNode.h:113
void SetMaxVisNodes(Int_t mvn)
Definition: TEveGeoNode.h:117
Mother of all ROOT objects.
Definition: TObject.h:58
TGeoManager * GetGeoManager() const
Definition: TEveGeoNode.h:110
virtual Bool_t CanEditMainColor() const
Can edit main-color – not available for assemblies.
char Char_t
Definition: RtypesCore.h:29
Editor for TEveGeoNode class.
TGeoNode * GetNode() const
Definition: TEveGeoNode.h:57
virtual const char * GetTitle() const
Return title, taken from geo-node. Used via TObject.
Definition: TEveGeoNode.cxx:91
static Int_t GetCSGExportNSeg()
Returns number of segments used for CSG export.
Definition: TEveGeoNode.cxx:51
virtual const char * GetElementTitle() const
Return title, taken from geo-node. Used via TEveElement.
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:102
virtual const char * GetName() const
Return name, taken from geo-node. Used via TObject.
Definition: TEveGeoNode.cxx:83
unsigned char UChar_t
Definition: RtypesCore.h:34
Int_t fVisOption
Definition: TEveGeoNode.h:99
ClassDef(TEveGeoNode, 1)
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
virtual void ExpandIntoListTreesRecursively()
Expand children into all list-trees recursively.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
void UpdateVolume(TGeoVolume *volume)
Updates all reve-browsers having the volume in their contents.