Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TShape.h
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Nenad Buncic 17/09/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TShape
13 #define ROOT_TShape
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TShape //
19 // //
20 // Basic shape class //
21 // //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TNamed.h"
26 #include "TMaterial.h"
27 #include "TAttLine.h"
28 #include "TAttFill.h"
29 #include "TAtt3D.h"
30 #include "X3DBuffer.h"
31 
32 class TBuffer3D;
33 class TNode;
34 
35 class TShape : public TNamed, public TAttLine, public TAttFill, public TAtt3D {
36 
37 protected:
38  Int_t fNumber; //Shape number
39  Int_t fVisibility; //Visibility flag
40  TMaterial *fMaterial; //Pointer to material
41 
42  virtual void FillBuffer3D(TBuffer3D & buffer, Int_t reqSections) const;
43  Int_t GetBasicColor() const;
44 
45  Int_t ShapeDistancetoPrimitive(Int_t numPoints, Int_t px, Int_t py);
46 
47 
48 public:
49  TShape();
50  TShape(const char *name, const char *title, const char *material);
51  TShape(const TShape&);
52  TShape& operator=(const TShape&);
53  virtual ~TShape();
54 
55  virtual const TBuffer3D &GetBuffer3D(Int_t reqSections) const;
56  TMaterial *GetMaterial() const {return fMaterial;}
57  virtual Int_t GetNumber() const {return fNumber;}
58  Int_t GetVisibility() const {return fVisibility;}
59  virtual void Paint(Option_t *option="");
60  virtual void SetName(const char *name);
61  virtual void SetPoints(Double_t *points) const ;
62  virtual void SetVisibility(Int_t vis) {fVisibility = vis;} // *MENU*
63  void TransformPoints(Double_t *points, UInt_t NbPnts) const;
64 
65  ClassDef(TShape,2) //Basic shape
66 };
67 
68 R__EXTERN TNode *gNode;
69 
70 inline void TShape::SetName(const char *) { }
71 
72 #endif