Logo ROOT   6.08/07
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 #ifndef ROOT_TPoints3DABC
24 #include "TPoints3DABC.h"
25 #endif
26 
27 
28 class TPoints3D : public TPoints3DABC {
29 
30 protected:
31  enum EOwnerBits {
32  kIsOwner = BIT(23)
33  };
34 
36 
37  Bool_t IsOwner() const {return TestBit(kIsOwner);}
38  Bool_t DoOwner(Bool_t done=kTRUE);
39 
40 public:
42  TPoints3D(Int_t n, Option_t *option="");
43  TPoints3D(Int_t n, Float_t *p, Option_t *option="");
44  TPoints3D(Int_t n, Float_t *x, Float_t *y, Float_t *z, Option_t *option="");
45  TPoints3D(const TPoints3D &points);
46  virtual ~TPoints3D();
47 
48  virtual void Copy(TObject &points) const;
49  virtual void Delete(Option_t *);
50  virtual void Delete();
51  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
52  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
53  virtual Int_t GetLastPosition() const;
54  virtual Int_t GetN() const;
55  virtual Float_t *GetP() const;
56  virtual Float_t GetX(Int_t idx) const;
57  virtual Float_t GetY(Int_t idx) const;
58  virtual Float_t GetZ(Int_t idx) const;
59  virtual Float_t *GetXYZ(Float_t *xyz,Int_t idx,Int_t num=1) const;
60  virtual const Float_t *GetXYZ(Int_t idx);
61  virtual Option_t *GetOption() const ;
62  virtual void ls(Option_t *option="") const;
63  virtual void PaintPoints(Int_t, Float_t *,Option_t *){;}
64  virtual void Print(Option_t *option="") const;
65  virtual Int_t SetLastPosition(Int_t idx);
66  virtual void SetOption(Option_t *option="");
67  virtual Int_t SetPoint(Int_t point, Float_t x, Float_t y, Float_t z); // *MENU*
68  virtual Int_t SetPoints(Int_t n, Float_t *p=0, Option_t *option="");
69  virtual Int_t Size() const;
70 
71  ClassDef(TPoints3D,1) // Defines the abstract array of 3D points
72 };
73 
74 inline void TPoints3D::Delete(Option_t *opt){ TObject::Delete(opt);}
77 inline Int_t TPoints3D::GetN() const {return fPoints?fPoints->GetN():0;}
78 inline Float_t *TPoints3D::GetP() const {return fPoints?fPoints->GetP():0;}
79 inline Float_t TPoints3D::GetX(Int_t idx) const {return fPoints?fPoints->GetX(idx):0;}
80 inline Float_t TPoints3D::GetY(Int_t idx) const {return fPoints?fPoints->GetY(idx):0;}
81 inline Float_t TPoints3D::GetZ(Int_t idx) const {return fPoints?fPoints->GetZ(idx):0;}
82 inline const Float_t *TPoints3D::GetXYZ(Int_t idx) {return fPoints?fPoints->GetXYZ(idx):0;}
83 inline Float_t *TPoints3D::GetXYZ(Float_t *xyz,Int_t idx,Int_t num) const
84  {return fPoints?fPoints->GetXYZ(xyz,idx,num):0;}
85 inline Option_t *TPoints3D::GetOption() const {return fPoints?fPoints->GetOption():"";}
87 inline void TPoints3D::SetOption(Option_t *option){if (fPoints) fPoints->SetOption(option);}
88 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;}
89 inline Int_t TPoints3D::SetPoints(Int_t n, Float_t *p, Option_t *option){return fPoints?fPoints->SetPoints(n,p,option):0;}
90 
91 inline Int_t TPoints3D::Size() const {return fPoints?fPoints->Size():0;}
92 
93 #endif
94 
95 
virtual void Delete()
Delete only own object.
Definition: TPoints3D.cxx:143
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:85
virtual Float_t GetY(Int_t idx) const
Definition: TPoints3D.h:80
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:89
virtual Int_t GetLastPosition() const
Definition: TPoints3D.h:76
TPoints3DABC * fPoints
Definition: TPoints3D.h:35
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:157
#define BIT(n)
Definition: Rtypes.h:120
Abstract class to define Arrays of 3D points.
Definition: TPoints3DABC.h:27
virtual void PaintPoints(Int_t, Float_t *, Option_t *)
Definition: TPoints3D.h:63
virtual Int_t SetLastPosition(Int_t idx)=0
virtual void Copy(TObject &points) const
*-*-*-*-*-*-*-*-*-*-*-*-*Copy this TPoints3D to another *-*-*-*-*-*-*-*-*-*-*-* *-* =================...
Definition: TPoints3D.cxx:127
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:83
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:254
virtual void ls(Option_t *option="") const
-*-*-*-*-*-*-*-*-*List this 3-D polyline with its attributes-*-*-*-*-*-* *-* ========================...
Definition: TPoints3D.cxx:173
virtual Float_t GetX(Int_t idx) const
Definition: TPoints3D.h:79
virtual Int_t GetN() const
GetN() returns the number of allocated cells if any.
virtual Int_t SetLastPosition(Int_t idx)
Definition: TPoints3D.h:86
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:78
virtual void Delete(Option_t *option="")
Delete this object.
Definition: TObject.cxx:229
Bool_t DoOwner(Bool_t done=kTRUE)
to be documented
Definition: TPoints3D.cxx:152
TPoints3D(TPoints3DABC *points=0)
-*-*-*-*-*-*-*-*-*-*-*-*3-D PolyLine default constructor-*-*-*-*-*-*-*-*-*-* *-* ====================...
Definition: TPoints3D.cxx:62
virtual void SetOption(Option_t *option="")=0
virtual void SetOption(Option_t *option="")
Definition: TPoints3D.h:87
Bool_t IsOwner() const
Definition: TPoints3D.h:37
virtual Int_t GetN() const
GetN() returns the number of allocated cells if any.
Definition: TPoints3D.h:77
Double_t y[n]
Definition: legend1.C:17
virtual Float_t GetZ(Int_t idx) const
Definition: TPoints3D.h:81
virtual void Print(Option_t *option="") const
-*-*-*-*-*-*-*-*-*Dump this 3-D polyline with its attributes-*-*-*-*-*-*-*-* *-* ====================...
Definition: TPoints3D.cxx:184
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:75
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:112
virtual Int_t Size() const =0
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual Int_t Size() const
Definition: TPoints3D.h:91
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:88
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
-*-*-*-*-*-*-*-*-*Execute action corresponding to one event-*-*-*-*-*-*-*-*-* *-* ===================...
Definition: TPoints3D.cxx:163
virtual Float_t GetZ(Int_t idx) const =0
virtual Int_t GetLastPosition() const =0