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