TEveGeoNode.h

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveGeoNode.h 36373 2010-10-19 17:43:35Z matevz $
00002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
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 // Added here to ease transition - forward declaration should be used.
00023 // This include will be removed for 5.24.
00024 #include <TEveGeoShape.h>
00025 // class TGeoShape;
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&);            // Not implemented
00037    TEveGeoNode& operator=(const TEveGeoNode&); // Not implemented
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); // Wrapper for TGeoNode that allows it to be shown in GUI and controlled as a TEveElement.
00088 };
00089 
00090 //----------------------------------------------------------------
00091 
00092 class TEveGeoTopNode : public TEveGeoNode
00093 {
00094    TEveGeoTopNode(const TEveGeoTopNode&);            // Not implemented
00095    TEveGeoTopNode& operator=(const TEveGeoTopNode&); // Not implemented
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    // Signals from GeoManager.
00128    // These are not available any more ... colors in list-tree not refreshed
00129    // properly.
00130    void VolumeVisChanged(TGeoVolume* volume);
00131    void VolumeColChanged(TGeoVolume* volume);
00132    void NodeVisChanged(TGeoNode* node);
00133 
00134    ClassDef(TEveGeoTopNode, 1); // Top-level TEveGeoNode with a pointer to TGeoManager and controls for steering of TGeoPainter.
00135 };
00136 
00137 #endif

Generated on Tue Jul 5 14:14:56 2011 for ROOT_528-00b_version by  doxygen 1.5.1