StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TPointsArray3D.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  *************************************************************************/
12 // //
13 // TPointsArray3D //
14 // //
15 // A 3-D PolyLine. //
16 // //
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="");
41  TPointsArray3D(const TPointsArray3D &points);
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 
70 inline Int_t TPointsArray3D::GetLastPosition() const {return fLastPoint;}
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 Int_t SetLastPosition(Int_t idx)
to be documented
virtual ~TPointsArray3D()
3-D PolyLine default destructor.
virtual void ls(Option_t *option="") const
List this 3-D polyline with its attributes.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual Int_t SetPoints(Int_t n, Float_t *p=0, Option_t *option="")
virtual void Print(Option_t *option="") const
Dump this 3-D polyline with its attributes.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
TPointsArray3D()
3-D PolyLine default constructor.
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)