StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TPoints3D.h
1 // @(#)root/table:$Id$
2 // Author: Valery Fine(fine@mail.cern.ch) 24/04/99
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_TPoints3D
13 #define ROOT_TPoints3D
14 
16 // //
17 // TPoints3D //
18 // //
19 // A 3-D PolyLine. //
20 // //
22 
23 #include "TPoints3DABC.h"
24 
25 
26 class TPoints3D : public TPoints3DABC {
27 
28 protected:
29  enum EOwnerBits {
30  kIsOwner = BIT(23)
31  };
32 
33  TPoints3DABC *fPoints;
34 
35  Bool_t IsOwner() const {return TestBit(kIsOwner);}
36  Bool_t DoOwner(Bool_t done=kTRUE);
37 
38 public:
39  TPoints3D(TPoints3DABC *points=0);
40  TPoints3D(Int_t n, Option_t *option="");
41  TPoints3D(Int_t n, Float_t *p, Option_t *option="");
42  TPoints3D(Int_t n, Float_t *x, Float_t *y, Float_t *z, Option_t *option="");
43  TPoints3D(const TPoints3D &points);
44  virtual ~TPoints3D();
45 
46  virtual void Copy(TObject &points) const;
47  virtual void Delete(Option_t *);
48  virtual void Delete();
49  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
50  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
51  virtual Int_t GetLastPosition() const;
52  virtual Int_t GetN() const;
53  virtual Float_t *GetP() const;
54  virtual Float_t GetX(Int_t idx) const;
55  virtual Float_t GetY(Int_t idx) const;
56  virtual Float_t GetZ(Int_t idx) const;
57  virtual Float_t *GetXYZ(Float_t *xyz,Int_t idx,Int_t num=1) const;
58  virtual const Float_t *GetXYZ(Int_t idx);
59  virtual Option_t *GetOption() const ;
60  virtual void ls(Option_t *option="") const;
61  virtual void PaintPoints(Int_t, Float_t *,Option_t *){;}
62  virtual void Print(Option_t *option="") const;
63  virtual Int_t SetLastPosition(Int_t idx);
64  virtual void SetOption(Option_t *option="");
65  virtual Int_t SetPoint(Int_t point, Float_t x, Float_t y, Float_t z); // *MENU*
66  virtual Int_t SetPoints(Int_t n, Float_t *p=0, Option_t *option="");
67  virtual Int_t Size() const;
68 
69  ClassDef(TPoints3D,1) // Defines the abstract array of 3D points
70 };
71 
72 inline void TPoints3D::Delete(Option_t *opt){ TObject::Delete(opt);}
73 inline Int_t TPoints3D::DistancetoPrimitive(Int_t px, Int_t py) {return fPoints?fPoints->DistancetoPrimitive(px,py):99999;}
74 inline Int_t TPoints3D::GetLastPosition() const {return fPoints?fPoints->GetLastPosition():0;}
75 inline Int_t TPoints3D::GetN() const {return fPoints?fPoints->GetN():0;}
76 inline Float_t *TPoints3D::GetP() const {return fPoints?fPoints->GetP():0;}
77 inline Float_t TPoints3D::GetX(Int_t idx) const {return fPoints?fPoints->GetX(idx):0;}
78 inline Float_t TPoints3D::GetY(Int_t idx) const {return fPoints?fPoints->GetY(idx):0;}
79 inline Float_t TPoints3D::GetZ(Int_t idx) const {return fPoints?fPoints->GetZ(idx):0;}
80 inline const Float_t *TPoints3D::GetXYZ(Int_t idx) {return fPoints?fPoints->GetXYZ(idx):0;}
81 inline Float_t *TPoints3D::GetXYZ(Float_t *xyz,Int_t idx,Int_t num) const
82  {return fPoints?fPoints->GetXYZ(xyz,idx,num):0;}
83 inline Option_t *TPoints3D::GetOption() const {return fPoints?fPoints->GetOption():"";}
84 inline Int_t TPoints3D::SetLastPosition(Int_t idx) {return fPoints?fPoints->SetLastPosition(idx):0;}
85 inline void TPoints3D::SetOption(Option_t *option){if (fPoints) fPoints->SetOption(option);}
86 inline Int_t TPoints3D::SetPoint(Int_t point, Float_t x, Float_t y, Float_t z){return fPoints?fPoints->SetPoint(point,x,y,z):0;}
87 inline Int_t TPoints3D::SetPoints(Int_t n, Float_t *p, Option_t *option){return fPoints?fPoints->SetPoints(n,p,option):0;}
88 
89 inline Int_t TPoints3D::Size() const {return fPoints?fPoints->Size():0;}
90 
91 #endif
92 
93 
virtual void Delete()
Delete only own object.
Definition: TPoints3D.cxx:134
virtual void Print(Option_t *option="") const
Dump this 3-D polyline with its attributes.
Definition: TPoints3D.cxx:172
virtual void Copy(TObject &points) const
Copy this TPoints3D to another.
Definition: TPoints3D.cxx:118
Bool_t DoOwner(Bool_t done=kTRUE)
to be documented
Definition: TPoints3D.cxx:143
TPoints3D(TPoints3DABC *points=0)
3-D PolyLine default constructor.
Definition: TPoints3D.cxx:61
virtual void ls(Option_t *option="") const
List this 3-D polyline with its attributes.
Definition: TPoints3D.cxx:162
virtual ~TPoints3D()
3-D PolyLine default destructor.
Definition: TPoints3D.cxx:104
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TPoints3D.cxx:153