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