00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TEveGeoNode
00013 #define ROOT_TEveGeoNode
00014
00015 #include "TEveElement.h"
00016
00017 class TGeoVolume;
00018 class TGeoNode;
00019 class TGeoHMatrix;
00020 class TGeoManager;
00021
00022
00023
00024 #include <TEveGeoShape.h>
00025
00026
00027 class TEveGeoShapeExtract;
00028
00029
00030
00031 class TEveGeoNode : public TEveElement,
00032 public TObject
00033 {
00034 friend class TEveGeoNodeEditor;
00035
00036 TEveGeoNode(const TEveGeoNode&);
00037 TEveGeoNode& operator=(const TEveGeoNode&);
00038
00039 protected:
00040 TGeoNode *fNode;
00041 TEveGeoShapeExtract* DumpShapeTree(TEveGeoNode* geon, TEveGeoShapeExtract* parent=0, Bool_t leafs_only=kFALSE);
00042
00043 static Int_t fgCSGExportNSeg;
00044 static std::list<TGeoShape*> fgTemporaryStore;
00045
00046 public:
00047 TEveGeoNode(TGeoNode* node);
00048
00049 virtual TObject* GetObject(const TEveException&) const
00050 { const TObject* obj = this; return const_cast<TObject*>(obj); }
00051
00052 virtual const char* GetName() const;
00053 virtual const char* GetTitle() const;
00054 virtual const char* GetElementName() const;
00055 virtual const char* GetElementTitle() const;
00056
00057 TGeoNode* GetNode() const { return fNode; }
00058
00059 virtual void ExpandIntoListTree(TGListTree* ltree, TGListTreeItem* parent);
00060
00061 virtual void ExpandIntoListTrees();
00062 virtual void ExpandIntoListTreesRecursively();
00063
00064 virtual Bool_t CanEditElement() const { return kFALSE; }
00065
00066 virtual void AddStamp(UChar_t bits);
00067
00068 virtual Bool_t CanEditMainColor() const;
00069 virtual void SetMainColor(Color_t color);
00070
00071 virtual Bool_t CanEditMainTransparency() const;
00072 virtual Char_t GetMainTransparency() const;
00073 virtual void SetMainTransparency(Char_t t);
00074
00075 void UpdateNode(TGeoNode* node);
00076 void UpdateVolume(TGeoVolume* volume);
00077
00078 void Save(const char* file, const char* name="Extract", Bool_t leafs_only=kFALSE);
00079 void SaveExtract(const char* file, const char* name, Bool_t leafs_only);
00080 void WriteExtract(const char* name, Bool_t leafs_only);
00081
00082 virtual void Draw(Option_t* option="");
00083
00084 static Int_t GetCSGExportNSeg();
00085 static void SetCSGExportNSeg(Int_t nseg);
00086
00087 ClassDef(TEveGeoNode, 1);
00088 };
00089
00090
00091
00092 class TEveGeoTopNode : public TEveGeoNode
00093 {
00094 TEveGeoTopNode(const TEveGeoTopNode&);
00095 TEveGeoTopNode& operator=(const TEveGeoTopNode&);
00096
00097 protected:
00098 TGeoManager* fManager;
00099 Int_t fVisOption;
00100 Int_t fVisLevel;
00101 Int_t fMaxVisNodes;
00102
00103 public:
00104 TEveGeoTopNode(TGeoManager* manager, TGeoNode* node, Int_t visopt=1,
00105 Int_t vislvl=3, Int_t maxvisnds=10000);
00106 virtual ~TEveGeoTopNode() {}
00107
00108 void UseNodeTrans();
00109
00110 TGeoManager* GetGeoManager() const { return fManager; }
00111
00112 Int_t GetVisOption() const { return fVisOption; }
00113 void SetVisOption(Int_t vo) { fVisOption = vo; }
00114 Int_t GetVisLevel() const { return fVisLevel; }
00115 void SetVisLevel(Int_t vl) { fVisLevel = vl; }
00116 Int_t GetMaxVisNodes() const { return fMaxVisNodes; }
00117 void SetMaxVisNodes(Int_t mvn) { fMaxVisNodes = mvn; }
00118
00119 virtual Bool_t CanEditElement() const { return kTRUE; }
00120 virtual Bool_t SingleRnrState() const { return kTRUE; }
00121
00122 virtual void AddStamp(UChar_t bits);
00123
00124 virtual void Draw(Option_t* option="");
00125 virtual void Paint(Option_t* option="");
00126
00127
00128
00129
00130 void VolumeVisChanged(TGeoVolume* volume);
00131 void VolumeColChanged(TGeoVolume* volume);
00132 void NodeVisChanged(TGeoNode* node);
00133
00134 ClassDef(TEveGeoTopNode, 1);
00135 };
00136
00137 #endif