Logo ROOT   6.16/01
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
26class TPoints3D : public TPoints3DABC {
27
28protected:
30 kIsOwner = BIT(23)
31 };
32
34
35 Bool_t IsOwner() const {return TestBit(kIsOwner);}
37
38public:
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="");
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
75inline Int_t TPoints3D::GetN() const {return fPoints?fPoints->GetN():0;}
76inline Float_t *TPoints3D::GetP() const {return fPoints?fPoints->GetP():0;}
77inline Float_t TPoints3D::GetX(Int_t idx) const {return fPoints?fPoints->GetX(idx):0;}
78inline Float_t TPoints3D::GetY(Int_t idx) const {return fPoints?fPoints->GetY(idx):0;}
79inline Float_t TPoints3D::GetZ(Int_t idx) const {return fPoints?fPoints->GetZ(idx):0;}
80inline const Float_t *TPoints3D::GetXYZ(Int_t idx) {return fPoints?fPoints->GetXYZ(idx):0;}
81inline Float_t *TPoints3D::GetXYZ(Float_t *xyz,Int_t idx,Int_t num) const
82 {return fPoints?fPoints->GetXYZ(xyz,idx,num):0;}
83inline Option_t *TPoints3D::GetOption() const {return fPoints?fPoints->GetOption():"";}
85inline void TPoints3D::SetOption(Option_t *option){if (fPoints) fPoints->SetOption(option);}
87inline Int_t TPoints3D::SetPoints(Int_t n, Float_t *p, Option_t *option){return fPoints?fPoints->SetPoints(n,p,option):0;}
88
89inline Int_t TPoints3D::Size() const {return fPoints?fPoints->Size():0;}
90
91#endif
92
93
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
#define BIT(n)
Definition: Rtypes.h:82
point * points
Definition: X3DBuffer.c:22
Mother of all ROOT objects.
Definition: TObject.h:37
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
virtual void Delete(Option_t *option="")
Delete this object.
Definition: TObject.cxx:169
Abstract class to define Arrays of 3D points.
Definition: TPoints3DABC.h:25
virtual Float_t GetX(Int_t idx) const =0
virtual void SetOption(Option_t *option="")=0
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="")=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 Int_t SetLastPosition(Int_t idx)=0
virtual Float_t GetZ(Int_t idx) const =0
virtual Int_t GetN() const
GetN() returns the number of allocated cells if any.
virtual Int_t Size() const =0
virtual Float_t * GetP() const
GetP() returns the pointer to the float point array of points if available The number of the availabl...
virtual Int_t SetPoint(Int_t point, Float_t x, Float_t y, Float_t z)=0
virtual Float_t GetY(Int_t idx) const =0
virtual Int_t GetLastPosition() const =0
virtual Option_t * GetOption() const =0
virtual void Print(Option_t *option="") const
Dump this 3-D polyline with its attributes.
Definition: TPoints3D.cxx:172
virtual Int_t Size() const
Definition: TPoints3D.h:89
virtual void PaintPoints(Int_t, Float_t *, Option_t *)
Definition: TPoints3D.h:61
virtual Option_t * GetOption() const
Definition: TPoints3D.h:83
virtual Int_t GetN() const
GetN() returns the number of allocated cells if any.
Definition: TPoints3D.h:75
virtual void Copy(TObject &points) const
Copy this TPoints3D to another.
Definition: TPoints3D.cxx:118
virtual void ls(Option_t *option="") const
List this 3-D polyline with its attributes.
Definition: TPoints3D.cxx:162
virtual Int_t GetLastPosition() const
Definition: TPoints3D.h:74
virtual Float_t GetZ(Int_t idx) const
Definition: TPoints3D.h:79
Bool_t DoOwner(Bool_t done=kTRUE)
to be documented
Definition: TPoints3D.cxx:143
Bool_t IsOwner() const
Definition: TPoints3D.h:35
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()
Delete only own object.
Definition: TPoints3D.cxx:134
virtual void SetOption(Option_t *option="")
Definition: TPoints3D.h:85
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 Float_t GetX(Int_t idx) const
Definition: TPoints3D.h:77
virtual Int_t SetPoint(Int_t point, Float_t x, Float_t y, Float_t z)
Definition: TPoints3D.h:86
TPoints3DABC * fPoints
Definition: TPoints3D.h:33
virtual ~TPoints3D()
3-D PolyLine default destructor.
Definition: TPoints3D.cxx:104
virtual Int_t SetLastPosition(Int_t idx)
Definition: TPoints3D.h:84
virtual Int_t SetPoints(Int_t n, Float_t *p=0, Option_t *option="")
Definition: TPoints3D.h:87
@ kIsOwner
Definition: TPoints3D.h:30
virtual Float_t GetY(Int_t idx) const
Definition: TPoints3D.h:78
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
Definition: TPoints3D.h:73
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TPoints3D.cxx:153
TPoints3D(TPoints3DABC *points=0)
3-D PolyLine default constructor.
Definition: TPoints3D.cxx:61
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16