Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TPolyLine3D.h
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Nenad Buncic 17/08/95
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_TPolyLine3D
13 #define ROOT_TPolyLine3D
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPolyLine3D //
19 // //
20 // A 3-D polyline. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TObject.h"
25 #include "TList.h"
26 #include "TString.h"
27 #include "TAttLine.h"
28 #include "TAtt3D.h"
29 
30 
31 class TPolyLine3D : public TObject, public TAttLine, public TAtt3D
32 {
33 protected:
34  Int_t fN; ///< Number of points
35  Float_t *fP; ///< [3*fN] Array of 3-D coordinates (x,y,z)
36  TString fOption; ///< options
37  Int_t fLastPoint; ///< The index of the last filled point
38 
39 public:
40  TPolyLine3D();
41  TPolyLine3D(Int_t n, Option_t *option="");
42  TPolyLine3D(Int_t n, Float_t *p, Option_t *option="");
43  TPolyLine3D(Int_t n, Double_t *p, Option_t *option="");
44  TPolyLine3D(Int_t n, Float_t *x, Float_t *y, Float_t *z, Option_t *option="");
45  TPolyLine3D(Int_t n, Double_t *x, Double_t *y, Double_t *z, Option_t *option="");
46  TPolyLine3D(const TPolyLine3D &polylin);
47  TPolyLine3D& operator=(const TPolyLine3D &polylin);
48  virtual ~TPolyLine3D();
49 
50  virtual void Copy(TObject &polyline) const;
51  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
52  virtual void Draw(Option_t *option="");
53  virtual void DrawPolyLine(Int_t n, Float_t *p, Option_t *option="");
54  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
55  Int_t GetLastPoint() const {return fLastPoint;}
56  Int_t GetN() const {return fN;}
57  Float_t *GetP() const {return fP;}
58  Option_t *GetOption() const {return fOption.Data();}
59  virtual void ls(Option_t *option="") const;
60  virtual Int_t Merge(TCollection *list);
61  virtual void Paint(Option_t *option="");
62  virtual void Print(Option_t *option="") const;
63  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
64  virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z); // *MENU*
65  virtual void SetOption(Option_t *option="") {fOption = option;}
66  virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z); // *MENU*
67  virtual void SetPolyLine(Int_t n, Option_t *option="");
68  virtual void SetPolyLine(Int_t n, Float_t *p, Option_t *option="");
69  virtual void SetPolyLine(Int_t n, Double_t *p, Option_t *option="");
70  virtual Int_t Size() const { return fLastPoint+1;}
71 
72  static void DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax);
73 
74  ClassDef(TPolyLine3D,1) //A 3-D polyline
75 };
76 
77 #endif