Logo ROOT   6.12/07
Reference Guide
TPointsArray3D.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 // //
13 // TPointsArray3D //
14 // //
15 // A 3-D PolyLine. //
16 // //
17 //////////////////////////////////////////////////////////////////////////
18 #ifndef ROOT_TPointsArray3D
19 #define ROOT_TPointsArray3D
20 
21 
22 #include "TPoints3DABC.h"
23 
24 #include "TString.h"
25 
26 
27 class TPointsArray3D : public TPoints3DABC {
28 
29 protected:
30  Int_t fN; // Number of points
31  Float_t *fP; // Array of 3-D coordinates (x,y,z)
32  TString fOption; // options
33  UInt_t fGLList; // The list number for OpenGL view
34  Int_t fLastPoint; // The index of the last filled point
35 
36 public:
38  TPointsArray3D(Int_t n, Option_t *option="");
39  TPointsArray3D(Int_t n, Float_t *p, Option_t *option="");
40  TPointsArray3D(Int_t n, Float_t *x, Float_t *y, Float_t *z, Option_t *option="");
42  virtual ~TPointsArray3D();
43 
44  virtual void Copy(TObject &points) const;
45  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
46  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
47  virtual Int_t GetLastPosition() const;
48  virtual Int_t GetN() const;
49  virtual Float_t *GetP() const;
50  virtual Float_t GetX(Int_t idx) const;
51  virtual Float_t GetY(Int_t idx) const;
52  virtual Float_t GetZ(Int_t idx) const;
53  virtual Float_t *GetXYZ(Float_t *xyz,Int_t idx,Int_t num=1) const;
54  virtual const Float_t *GetXYZ(Int_t idx);
55  virtual Option_t *GetOption() const ;
56  virtual Bool_t Is3D() const;
57  virtual void ls(Option_t *option="") const;
58  virtual void PaintPoints(Int_t , Float_t *,Option_t *){;}
59  virtual void Print(Option_t *option="") const;
60  virtual Int_t SetLastPosition(Int_t idx);
61  virtual void SetOption(Option_t *option="");
62  virtual Int_t SetPoint(Int_t point, Float_t x, Float_t y, Float_t z); // *MENU*
63  virtual Int_t SetPoints(Int_t n, Float_t *p=0, Option_t *option="");
64  virtual Int_t Size() const;
65 
66  ClassDef(TPointsArray3D,1) //A 3-D PolyLine
67 };
68 
69 
71 inline Int_t TPointsArray3D::GetN() const {return fN;}
72 inline Float_t *TPointsArray3D::GetP() const {return fP;}
73 inline Float_t TPointsArray3D::GetX(Int_t idx) const {return fP[3*idx+0];}
74 inline Float_t TPointsArray3D::GetY(Int_t idx) const {return fP[3*idx+1];}
75 inline Float_t TPointsArray3D::GetZ(Int_t idx) const {return fP[3*idx+2];}
76 inline const Float_t *TPointsArray3D::GetXYZ(Int_t idx) {return &fP[3*idx+0];}
77 inline Float_t *TPointsArray3D::GetXYZ(Float_t *xyz,Int_t idx,Int_t num) const
78  {return (Float_t *)memcpy(xyz,&fP[3*idx],3*num*sizeof(Float_t));}
79 inline Option_t *TPointsArray3D::GetOption() const {return fOption.Data();}
80 inline Bool_t TPointsArray3D::Is3D() const {return kTRUE;}
81 inline void TPointsArray3D::SetOption(Option_t *option) {fOption = option;}
82 
83 inline Int_t TPointsArray3D::Size() const {return fLastPoint+1;}
84 
85 #endif
virtual void SetOption(Option_t *option="")
virtual Int_t SetLastPosition(Int_t idx)
to be documented
float Float_t
Definition: RtypesCore.h:53
virtual Option_t * GetOption() const
const char Option_t
Definition: RtypesCore.h:62
virtual ~TPointsArray3D()
3-D PolyLine default destructor.
Abstract class to define Arrays of 3D points.
Definition: TPoints3DABC.h:25
virtual void PaintPoints(Int_t, Float_t *, Option_t *)
Basic string class.
Definition: TString.h:125
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual Int_t SetPoints(Int_t n, Float_t *p=0, Option_t *option="")
Set new values for this 3-D polyline.
virtual Float_t GetZ(Int_t idx) const
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual Float_t GetY(Int_t idx) const
virtual Float_t GetX(Int_t idx) const
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D points.
virtual Float_t * GetP() const
GetP() returns the pointer to the float point array of points if available The number of the availabl...
point * points
Definition: X3DBuffer.c:20
virtual Int_t GetLastPosition() const
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void Copy(TObject &points) const
Copy this TPointsArray3D to another.
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...
TPointsArray3D()
3-D PolyLine default constructor.
Double_t y[n]
Definition: legend1.C:17
virtual void Print(Option_t *option="") const
Dump this 3-D polyline with its attributes.
virtual void ls(Option_t *option="") const
List this 3-D polyline with its attributes.
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 SetPoint(Int_t point, Float_t x, Float_t y, Float_t z)
Initialize one point of the 3-D polyline.
virtual Bool_t Is3D() const
virtual Int_t GetN() const
GetN() returns the number of allocated cells if any.
const Bool_t kTRUE
Definition: RtypesCore.h:87
const Int_t n
Definition: legend1.C:16
virtual Int_t Size() const
const char * Data() const
Definition: TString.h:345