// @(#)root/table:$Id$
// Author: Valery Fine   10/12/98

/*************************************************************************
 * 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.             *
 *************************************************************************/

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

#ifndef ROOT_TVolume
#define ROOT_TVolume

#include "TObjectSet.h"

#include "TNode.h"

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

class TBrowser;
class TVolumePosition;
class TRotMatrix;
class TList;

class TVolume  : public TObjectSet, public TAttLine, public TAttFill, public TAtt3D {
public:
   enum ENodeSEEN {kBothVisible  = 00,                 //'00'
      kSonUnvisible =  1,                              //'01'
      kThisUnvisible=  2,                              //'10'
      kNoneVisible  = kThisUnvisible | kSonUnvisible}; //'11'
protected:
   TShape         *fShape;         //Pointer to the "master" shape definition
   TList          *fListOfShapes;  //Pointer to the list of the shape definitions
   TString         fOption;        //List of options if any
   ENodeSEEN       fVisibility;    //Visibility flag  00 - everything visible,
   //                 10 - this unvisible, but sons are visible
   //                 01 - this visible but sons
   //                 11 - neither this nor its sons are visible

   virtual void             Add(TDataSet *dataset);
   virtual void             Add(TVolumePosition *position);
   virtual TVolumePosition *Add(TVolume *node, TVolumePosition *nodePosition);
   virtual Int_t            DistancetoNodePrimitive(Int_t px, Int_t py,TVolumePosition *position=0);
   void             SetPositionsList(TList *list=0){AddObject((TObject *)list);}
   virtual void             PaintNodePosition(Option_t *option="",TVolumePosition *postion=0);
   friend class TPolyLineShape;
public:
   TVolume();
   TVolume(const char *name, const char *title, const char *shapename, Option_t *option="");
   TVolume(const char *name, const char *title, TShape *shape, Option_t *option="");
   TVolume(TNode &node);
   virtual ~TVolume();
   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="");
   virtual TVolumePosition *Add(TVolume *node, Double_t x, Double_t y, Double_t z,  const char *matrixname,  UInt_t id=0, Option_t *option="");
   static  Int_t       MapStNode2GEANTVis(ENodeSEEN  vis);
   static  Int_t       MapGEANT2StNodeVis(Int_t vis);
   virtual void        Add(TShape *shape, Bool_t IsMaster=kFALSE);
   virtual void        Browse(TBrowser *b);
   virtual TNode      *CreateTNode(const TVolumePosition *position=0);
   virtual void        DeletePosition(TVolumePosition *position);
   virtual Int_t       DistancetoPrimitive(Int_t px, Int_t py);
   virtual void        Draw(Option_t *depth="3"); // *MENU*
   virtual void        DrawOnly(Option_t *option="");
   virtual void        ExecuteEvent(Int_t event, Int_t px, Int_t py);
   static  TRotMatrix *GetIdentity();
   virtual char     *GetObjectInfo(Int_t px, Int_t py) const;
   const   Option_t   *GetOption() const { return fOption.Data();}
   TShape     *GetShape()  const {return fShape;}
   TList      *GetListOfShapes()  const {return fListOfShapes;}
   virtual void        GetLocalRange(Float_t *min, Float_t *max);
   virtual ENodeSEEN   GetVisibility() const {return fVisibility;}
   virtual TList      *GetListOfPositions()  { return (TList *)(GetObject());}
   virtual ULong_t     Hash() const { return TObject::Hash();}
   virtual void        ImportShapeAttributes();
   virtual Bool_t      IsMarked() const;
   virtual Bool_t      Is3D() const {return kTRUE;}
   virtual TList      *Nodes() const { return GetList(); }
   virtual void        Paint(Option_t *option="");
   virtual void        PaintShape(Option_t *option="");
   virtual void        SetVisibility(ENodeSEEN vis=TVolume::kBothVisible); // *MENU*
   virtual void        Sizeof3D() const;

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

inline void   TVolume::Add(TDataSet *dataset){ TDataSet::Add(dataset);}
inline Bool_t TVolume::IsMarked() const { return TestBit(kMark); }

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