Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TNode.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/g3d:$Id$
0002 // Author: Rene Brun   14/09/95
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 
0013 //////////////////////////////////////////////////////////////////////////
0014 //                                                                      //
0015 // TNode                                                                //
0016 //                                                                      //
0017 // Description of parameters to position a 3-D geometry object          //
0018 //                                                                      //
0019 //////////////////////////////////////////////////////////////////////////
0020 
0021 #ifndef ROOT_TNode
0022 #define ROOT_TNode
0023 
0024 #include "TShape.h"
0025 #include "TAttLine.h"
0026 #include "TAttFill.h"
0027 #include "TAtt3D.h"
0028 
0029 #include "TRotMatrix.h"
0030 
0031 class TBrowser;
0032 
0033 class TNode : public TNamed , public TAttLine, public TAttFill, public TAtt3D {
0034 
0035 protected:
0036    enum { kSonsInvisible = BIT(17) };
0037 
0038    Double_t        fX;          //X offset with respect to parent object
0039    Double_t        fY;          //Y offset with respect to parent object
0040    Double_t        fZ;          //Z offset with respect to parent object
0041    TRotMatrix     *fMatrix;     //Pointer to rotation matrix
0042    TShape         *fShape;      //Pointer to shape definition
0043    TNode          *fParent;     //Pointer to parent positioned volume
0044    TList          *fNodes;      //List of son nodes (if any)
0045    TString         fOption;     //List of options if any
0046    Int_t           fVisibility; //Visibility flag
0047 
0048    TNode(const TNode&);
0049    TNode& operator=(const TNode&);
0050 
0051 public:
0052    TNode();
0053    TNode(const char *name, const char *title, const char *shapename, Double_t x=0, Double_t y=0, Double_t z=0,
0054          const char *matrixname="", Option_t *option="");
0055    TNode(const char *name, const char *title, TShape *shape, Double_t x=0, Double_t y=0, Double_t z=0,
0056          TRotMatrix *matrix=nullptr, Option_t *option="");
0057    ~TNode() override;
0058    void        Browse(TBrowser *b) override;
0059    virtual void        BuildListOfNodes();
0060    virtual void        cd(const char *path=nullptr); // *MENU*
0061    Int_t       DistancetoPrimitive(Int_t px, Int_t py) override;
0062    void        Draw(Option_t *option="") override; // *MENU*
0063    virtual void        DrawOnly(Option_t *option="");
0064    void        ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0065    TList              *GetListOfNodes() const {return fNodes;}
0066    virtual TRotMatrix *GetMatrix() const {return fMatrix;}
0067    virtual TNode      *GetNode(const char *name) const;
0068    char       *GetObjectInfo(Int_t px, Int_t py) const override;
0069    const   Option_t   *GetOption() const override { return fOption.Data();}
0070    virtual TNode      *GetParent() const {return fParent;}
0071    TShape             *GetShape() const {return fShape;}
0072    Int_t               GetVisibility() const {return fVisibility;}
0073    virtual Double_t    GetX() const {return fX;}
0074    virtual Double_t    GetY() const {return fY;}
0075    virtual Double_t    GetZ() const {return fZ;}
0076    virtual void        ImportShapeAttributes();
0077    Bool_t              IsFolder() const override;
0078    virtual void        Local2Master(const Double_t *local, Double_t *master);
0079    virtual void        Local2Master(const Float_t *local, Float_t *master);
0080    void        ls(Option_t *option="2") const override; // *MENU*
0081    virtual void        Master2Local(const Double_t *master, Double_t *local);
0082    virtual void        Master2Local(const Float_t *master, Float_t *local);
0083    void        Paint(Option_t *option="") override;
0084    void        RecursiveRemove(TObject *obj) override;
0085    virtual void        SetMatrix(TRotMatrix *matrix=nullptr) {fMatrix = matrix;}
0086    void        SetName(const char *name) override;
0087    virtual void        SetParent(TNode *parent);
0088    void        SetNameTitle(const char *name, const char *title) override;
0089    virtual void        SetPosition( Double_t x=0, Double_t y=0, Double_t z=0) {fX=x; fY=y; fZ=z;}
0090    virtual void        SetVisibility(Int_t vis=1); // *MENU*
0091    void        Sizeof3D() const override;
0092    virtual void        UpdateMatrix();
0093    virtual void        UpdateTempMatrix(const Double_t *dx1,const Double_t *rmat1,
0094                               Double_t x, Double_t y, Double_t z, Double_t *matrix,
0095                               Double_t *dxnew, Double_t *rmatnew);
0096 
0097    ClassDefOverride(TNode,3)  //Description of parameters to position a 3-D geometry object
0098 };
0099 
0100 #endif