Logo ROOT   6.14/05
Reference Guide
TPoints3D.h
Go to the documentation of this file.
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 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TPoints3D //
18 // //
19 // A 3-D PolyLine. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "TPoints3DABC.h"
24 
25 
26 class TPoints3D : public TPoints3DABC {
27 
28 protected:
29  enum EOwnerBits {
30  kIsOwner = BIT(23)
31  };
32 
34 
35  Bool_t IsOwner() const {return TestBit(kIsOwner);}
36  Bool_t DoOwner(Bool_t done=kTRUE);
37 
38 public:
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);}
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():"";}
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 Int_t SetPoint(Int_t point, Float_t x, Float_t y, Float_t z)=0
virtual Float_t * GetXYZ(Float_t *xyz, Int_t idx, Int_t num=1) const
GetXYZ(Float_t *xyz,Int_t idx,Int_t num=1) fills the buffer supplied by the calling code with the poi...
virtual Option_t * GetOption() const
Definition: TPoints3D.h:83
virtual Float_t GetY(Int_t idx) const
Definition: TPoints3D.h:78
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)=0
Computes distance from point (px,py) to the object.
virtual Int_t SetPoints(Int_t n, Float_t *p=0, Option_t *option="")
Definition: TPoints3D.h:87
virtual Int_t GetLastPosition() const
Definition: TPoints3D.h:74
TPoints3DABC * fPoints
Definition: TPoints3D.h:33
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define BIT(n)
Definition: Rtypes.h:78
Abstract class to define Arrays of 3D points.
Definition: TPoints3DABC.h:25
virtual void PaintPoints(Int_t, Float_t *, Option_t *)
Definition: TPoints3D.h:61
virtual Int_t SetLastPosition(Int_t idx)=0
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
virtual void Copy(TObject &points) const
Copy this TPoints3D to another.
Definition: TPoints3D.cxx:118
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual Float_t GetY(Int_t idx) const =0
virtual Float_t * GetXYZ(Float_t *xyz, Int_t idx, Int_t num=1) const
GetXYZ(Float_t *xyz,Int_t idx,Int_t num=1) fills the buffer supplied by the calling code with the poi...
Definition: TPoints3D.h:81
virtual Int_t SetPoints(Int_t n, Float_t *p=0, Option_t *option="")=0
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual void ls(Option_t *option="") const
List this 3-D polyline with its attributes.
Definition: TPoints3D.cxx:162
virtual Float_t GetX(Int_t idx) const
Definition: TPoints3D.h:77
virtual Int_t GetN() const
GetN() returns the number of allocated cells if any.
virtual Int_t SetLastPosition(Int_t idx)
Definition: TPoints3D.h:84
virtual Float_t GetX(Int_t idx) const =0
point * points
Definition: X3DBuffer.c:20
virtual Float_t * GetP() const
GetP() returns the pointer to the float point array of points if available The number of the availabl...
Definition: TPoints3D.h:76
virtual void Delete(Option_t *option="")
Delete this object.
Definition: TObject.cxx:169
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 SetOption(Option_t *option="")=0
virtual void SetOption(Option_t *option="")
Definition: TPoints3D.h:85
Bool_t IsOwner() const
Definition: TPoints3D.h:35
virtual Int_t GetN() const
GetN() returns the number of allocated cells if any.
Definition: TPoints3D.h:75
Double_t y[n]
Definition: legend1.C:17
virtual Float_t GetZ(Int_t idx) const
Definition: TPoints3D.h:79
virtual void Print(Option_t *option="") const
Dump this 3-D polyline with its attributes.
Definition: TPoints3D.cxx:172
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
Definition: TPoints3D.h:73
virtual Float_t * GetP() const
GetP() returns the pointer to the float point array of points if available The number of the availabl...
virtual Option_t * GetOption() const =0
virtual ~TPoints3D()
3-D PolyLine default destructor.
Definition: TPoints3D.cxx:104
virtual Int_t Size() const =0
const Bool_t kTRUE
Definition: RtypesCore.h:87
virtual Int_t Size() const
Definition: TPoints3D.h:89
const Int_t n
Definition: legend1.C:16
virtual Int_t SetPoint(Int_t point, Float_t x, Float_t y, Float_t z)
Definition: TPoints3D.h:86
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TPoints3D.cxx:153
virtual Float_t GetZ(Int_t idx) const =0
virtual Int_t GetLastPosition() const =0