ROOT logo
// @(#)root/g3d:$Id: TNode.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Rene Brun   14/09/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TNode                                                                //
//                                                                      //
// Description of parameters to position a 3-D geometry object          //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TNode
#define ROOT_TNode

#ifndef ROOT_TShape
#include "TShape.h"
#endif
#ifndef ROOT_TAttLine
#include "TAttLine.h"
#endif
#ifndef ROOT_TAttFill
#include "TAttFill.h"
#endif
#ifndef ROOT_TAtt3D
#include "TAtt3D.h"
#endif

#ifndef ROOT_TRotMatrix
#include "TRotMatrix.h"
#endif

class TBrowser;

class TNode : public TNamed , public TAttLine, public TAttFill, public TAtt3D {

protected:
   enum { kSonsInvisible = BIT(17) };

   Double_t        fX;          //X offset with respect to parent object
   Double_t        fY;          //Y offset with respect to parent object
   Double_t        fZ;          //Z offset with respect to parent object
   TRotMatrix     *fMatrix;     //Pointer to rotation matrix
   TShape         *fShape;      //Pointer to shape definition
   TNode          *fParent;     //Pointer to parent positioned volume
   TList          *fNodes;      //List of son nodes (if any)
   TString         fOption;     //List of options if any
   Int_t           fVisibility; //Visibility flag

   TNode(const TNode&);
   TNode& operator=(const TNode&);

public:
   TNode();
   TNode(const char *name, const char *title, const char *shapename, Double_t x=0, Double_t y=0, Double_t z=0,
         const char *matrixname="", Option_t *option="");
   TNode(const char *name, const char *title, TShape *shape, Double_t x=0, Double_t y=0, Double_t z=0,
         TRotMatrix *matrix=0, Option_t *option="");
   virtual ~TNode();
   virtual void        Browse(TBrowser *b);
   virtual void        BuildListOfNodes();
   virtual void        cd(const char *path=0); // *MENU*
   virtual Int_t       DistancetoPrimitive(Int_t px, Int_t py);
   virtual void        Draw(Option_t *option=""); // *MENU*
   virtual void        DrawOnly(Option_t *option="");
   virtual void        ExecuteEvent(Int_t event, Int_t px, Int_t py);
   TList              *GetListOfNodes() const {return fNodes;}
   virtual TRotMatrix *GetMatrix() const {return fMatrix;}
   virtual TNode      *GetNode(const char *name) const;
   virtual char       *GetObjectInfo(Int_t px, Int_t py) const;
   const   Option_t   *GetOption() const { return fOption.Data();}
   virtual TNode      *GetParent() const {return fParent;}
   TShape             *GetShape() const {return fShape;}
   Int_t               GetVisibility() const {return fVisibility;}
   virtual Double_t    GetX() const {return fX;}
   virtual Double_t    GetY() const {return fY;}
   virtual Double_t    GetZ() const {return fZ;}
   virtual void        ImportShapeAttributes();
   Bool_t              IsFolder() const;
   virtual void        Local2Master(const Double_t *local, Double_t *master);
   virtual void        Local2Master(const Float_t *local, Float_t *master);
   virtual void        ls(Option_t *option="2") const; // *MENU*
   virtual void        Master2Local(const Double_t *master, Double_t *local);
   virtual void        Master2Local(const Float_t *master, Float_t *local);
   virtual void        Paint(Option_t *option="");
   virtual void        RecursiveRemove(TObject *obj);
   virtual void        SetMatrix(TRotMatrix *matrix=0) {fMatrix = matrix;}
   virtual void        SetName(const char *name);
   virtual void        SetParent(TNode *parent);
   virtual void        SetNameTitle(const char *name, const char *title);
   virtual void        SetPosition( Double_t x=0, Double_t y=0, Double_t z=0) {fX=x; fY=y; fZ=z;}
   virtual void        SetVisibility(Int_t vis=1); // *MENU*
   virtual void        Sizeof3D() const;
   virtual void        UpdateMatrix();
   virtual void        UpdateTempMatrix(const Double_t *dx1,const Double_t *rmat1,
                              Double_t x, Double_t y, Double_t z, Double_t *matrix,
                              Double_t *dxnew, Double_t *rmatnew);

   ClassDef(TNode,3)  //Description of parameters to position a 3-D geometry object
};

#endif
 TNode.h:1
 TNode.h:2
 TNode.h:3
 TNode.h:4
 TNode.h:5
 TNode.h:6
 TNode.h:7
 TNode.h:8
 TNode.h:9
 TNode.h:10
 TNode.h:11
 TNode.h:12
 TNode.h:13
 TNode.h:14
 TNode.h:15
 TNode.h:16
 TNode.h:17
 TNode.h:18
 TNode.h:19
 TNode.h:20
 TNode.h:21
 TNode.h:22
 TNode.h:23
 TNode.h:24
 TNode.h:25
 TNode.h:26
 TNode.h:27
 TNode.h:28
 TNode.h:29
 TNode.h:30
 TNode.h:31
 TNode.h:32
 TNode.h:33
 TNode.h:34
 TNode.h:35
 TNode.h:36
 TNode.h:37
 TNode.h:38
 TNode.h:39
 TNode.h:40
 TNode.h:41
 TNode.h:42
 TNode.h:43
 TNode.h:44
 TNode.h:45
 TNode.h:46
 TNode.h:47
 TNode.h:48
 TNode.h:49
 TNode.h:50
 TNode.h:51
 TNode.h:52
 TNode.h:53
 TNode.h:54
 TNode.h:55
 TNode.h:56
 TNode.h:57
 TNode.h:58
 TNode.h:59
 TNode.h:60
 TNode.h:61
 TNode.h:62
 TNode.h:63
 TNode.h:64
 TNode.h:65
 TNode.h:66
 TNode.h:67
 TNode.h:68
 TNode.h:69
 TNode.h:70
 TNode.h:71
 TNode.h:72
 TNode.h:73
 TNode.h:74
 TNode.h:75
 TNode.h:76
 TNode.h:77
 TNode.h:78
 TNode.h:79
 TNode.h:80
 TNode.h:81
 TNode.h:82
 TNode.h:83
 TNode.h:84
 TNode.h:85
 TNode.h:86
 TNode.h:87
 TNode.h:88
 TNode.h:89
 TNode.h:90
 TNode.h:91
 TNode.h:92
 TNode.h:93
 TNode.h:94
 TNode.h:95
 TNode.h:96
 TNode.h:97
 TNode.h:98
 TNode.h:99
 TNode.h:100
 TNode.h:101
 TNode.h:102
 TNode.h:103
 TNode.h:104
 TNode.h:105
 TNode.h:106
 TNode.h:107
 TNode.h:108
 TNode.h:109
 TNode.h:110