TVolume.h

Go to the documentation of this file.
00001 // @(#)root/table:$Id: TVolume.h 27157 2009-01-15 14:05:12Z brun $
00002 // Author: Valery Fine   10/12/98
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, 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 //////////////////////////////////////////////////////////////////////////
00013 //                                                                      //
00014 // TVolume                                                              //
00015 //                                                                      //
00016 // Description of parameters to position a 3-D geometry object          //
00017 //                                                                      //
00018 //////////////////////////////////////////////////////////////////////////
00019 
00020 #ifndef ROOT_TVolume
00021 #define ROOT_TVolume
00022 
00023 #include "TObjectSet.h"
00024 
00025 #include "TNode.h"
00026 
00027 #ifndef ROOT_TShape
00028 #include "TShape.h"
00029 #endif
00030 #ifndef ROOT_TAttLine
00031 #include "TAttLine.h"
00032 #endif
00033 #ifndef ROOT_TAttFill
00034 #include "TAttFill.h"
00035 #endif
00036 
00037 class TBrowser;
00038 class TVolumePosition;
00039 class TRotMatrix;
00040 class TList;
00041 
00042 class TVolume  : public TObjectSet, public TAttLine, public TAttFill, public TAtt3D {
00043 public:
00044    enum ENodeSEEN {kBothVisible  = 00,                 //'00'
00045       kSonUnvisible =  1,                              //'01'
00046       kThisUnvisible=  2,                              //'10'
00047       kNoneVisible  = kThisUnvisible | kSonUnvisible}; //'11'
00048 protected:
00049    TShape         *fShape;         //Pointer to the "master" shape definition
00050    TList          *fListOfShapes;  //Pointer to the list of the shape definitions
00051    TString         fOption;        //List of options if any
00052    ENodeSEEN       fVisibility;    //Visibility flag  00 - everything visible,
00053    //                 10 - this unvisible, but sons are visible
00054    //                 01 - this visible but sons
00055    //                 11 - neither this nor its sons are visible
00056 
00057    virtual void             Add(TDataSet *dataset);
00058    virtual void             Add(TVolumePosition *position);
00059    virtual TVolumePosition *Add(TVolume *node, TVolumePosition *nodePosition);
00060    virtual Int_t            DistancetoNodePrimitive(Int_t px, Int_t py,TVolumePosition *position=0);
00061    void             SetPositionsList(TList *list=0){AddObject((TObject *)list);}
00062    virtual void             PaintNodePosition(Option_t *option="",TVolumePosition *postion=0);
00063    friend class TPolyLineShape;
00064 public:
00065    TVolume();
00066    TVolume(const char *name, const char *title, const char *shapename, Option_t *option="");
00067    TVolume(const char *name, const char *title, TShape *shape, Option_t *option="");
00068    TVolume(TNode &node);
00069    virtual ~TVolume();
00070    virtual TVolumePosition *Add(TVolume *node, Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0, UInt_t id=0, Option_t *option="");
00071    virtual TVolumePosition *Add(TVolume *node, Double_t x, Double_t y, Double_t z,  const char *matrixname,  UInt_t id=0, Option_t *option="");
00072    static  Int_t       MapStNode2GEANTVis(ENodeSEEN  vis);
00073    static  Int_t       MapGEANT2StNodeVis(Int_t vis);
00074    virtual void        Add(TShape *shape, Bool_t IsMaster=kFALSE);
00075    virtual void        Browse(TBrowser *b);
00076    virtual TNode      *CreateTNode(const TVolumePosition *position=0);
00077    virtual void        DeletePosition(TVolumePosition *position);
00078    virtual Int_t       DistancetoPrimitive(Int_t px, Int_t py);
00079    virtual void        Draw(Option_t *depth="3"); // *MENU*
00080    virtual void        DrawOnly(Option_t *option="");
00081    virtual void        ExecuteEvent(Int_t event, Int_t px, Int_t py);
00082    static  TRotMatrix *GetIdentity();
00083    virtual char     *GetObjectInfo(Int_t px, Int_t py) const;
00084    const   Option_t   *GetOption() const { return fOption.Data();}
00085    TShape     *GetShape()  const {return fShape;}
00086    TList      *GetListOfShapes()  const {return fListOfShapes;}
00087    virtual void        GetLocalRange(Float_t *min, Float_t *max);
00088    virtual ENodeSEEN   GetVisibility() const {return fVisibility;}
00089    virtual TList      *GetListOfPositions()  { return (TList *)(GetObject());}
00090    virtual ULong_t     Hash() const { return TObject::Hash();}
00091    virtual void        ImportShapeAttributes();
00092    virtual Bool_t      IsMarked() const;
00093    virtual Bool_t      Is3D() const {return kTRUE;}
00094    virtual TList      *Nodes() const { return GetList(); }
00095    virtual void        Paint(Option_t *option="");
00096    virtual void        PaintShape(Option_t *option="");
00097    virtual void        SetVisibility(ENodeSEEN vis=TVolume::kBothVisible); // *MENU*
00098    virtual void        Sizeof3D() const;
00099 
00100    ClassDef(TVolume,1)  //Description of parameters to position a 3-D geometry object
00101 };
00102 
00103 inline void   TVolume::Add(TDataSet *dataset){ TDataSet::Add(dataset);}
00104 inline Bool_t TVolume::IsMarked() const { return TestBit(kMark); }
00105 
00106 #endif

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