StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TTablePadView3D.h
1 // @(#)root/table:$Id$
2 // Author: Valery Fine(fine@vxcern.cern.ch) 30/05/97
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_TTablePadView3D
13 #define ROOT_TTablePadView3D
14 
15 
17 // //
18 // TTablePadView3D //
19 // //
20 // TTablePadView3D is a generic 3D viewer. //
21 // For a concrete viewer see TGLViewer. //
22 // //
24 
25 #include "TObject.h"
26 
27 
28 
29 class TVirtualPad;
30 class TPolyMarker3D;
31 class TPolyLine3D;
32 class TPoints3DABC;
33 class TNode;
34 class TRotMatrix;
35 
37 protected:
38  TVirtualPad *fParent; // Pointer to the original TPad object
39 
40  Double_t fViewBoxMin[3]; // Minimum of clip box
41  Double_t fViewBoxMax[3]; // Maximum of clip box
42  Double_t fTranslate[3]; // The vector to move object into the center of the scene
43  Double_t fExtraTranslate[3]; // The vector to move object with a mouse
44  Double_t fAngles[3]; // Latitude, Longitude, Psi
45  Double_t fExtraAngles[3]; // Latitude, Longitude, Psi
46  Double_t fAnglFactor[3]; // Latitude, Longitude, Psi
47  Float_t fScale; // The scale factor to control the border of the clip box
48 
49  void Init(TVirtualPad *pad) {
50  fParent = pad;
51  for(UInt_t i=0; i<3; ++i) {
52  fViewBoxMin[i] = 0;
53  fViewBoxMax[i] = 0;
54  fTranslate[i] = 0;
55  fExtraTranslate[i] = 0;
56  fAngles[i] = 0;
57  fExtraAngles[i] = 0;
58  fAnglFactor[i] = 0;
59  }
60  fScale = 1;
61  }
62 public:
63  TTablePadView3D() { Init(0); } //default ctor
64  TTablePadView3D(TVirtualPad *pad) { Init(pad); }
65  virtual ~TTablePadView3D();
66  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
67  TVirtualPad *GetPad() const { return fParent; }
68  virtual void Paint(Option_t *option="");
69  virtual void Size(Int_t width, Int_t height);
70  virtual void PaintBeginModel(Option_t *opt="");
71  virtual void PaintEnd(Option_t *opt="");
72  virtual void PaintScene(Option_t *opt="");
73  virtual void PaintPolyMarker(TPolyMarker3D *marker, Option_t *opt="");
74  virtual void PaintPolyLine(TPolyLine3D *line, Option_t *opt="");
75  virtual void PaintPoints3D(const TPoints3DABC *points,Option_t *opt="");
76  virtual void PushMatrix() { }
77  virtual void PopMatrix() { }
78  virtual void SetAttNode(TNode *node, Option_t *opt="");
79  virtual void SetLineAttr(Color_t color, Int_t width, Option_t *opt="");
80  void SetPad(TVirtualPad *pad=0) { fParent = pad; }
81  virtual void UpdateNodeMatrix(TNode *node, Option_t *opt="");
82  virtual void UpdatePosition(Double_t x,Double_t y,Double_t z,TRotMatrix *matrix, Option_t *opt="");
83  virtual void UpdateView() { }
84 
85 // Getter's / Setter's methods for the data-members
86 
87  virtual void GetRange(Double_t min[3], Double_t max[3]) const;
88  virtual void SetRange(Double_t min[3], Double_t max[3]);
89 
90  virtual void GetShift(Double_t main_shift[3], Double_t extra_shift[3]) const;
91  virtual void SetShift(Double_t main_shift[3], Double_t extra_shift[3]);
92 
93  virtual void GetAngles(Double_t main_angles[3], Double_t extra_angles[3]) const;
94  virtual void SetAngles(Double_t main_angles[3], Double_t extra_angles[3]);
95 
96  virtual void GetAnglesFactors(Double_t factors[3]) const;
97  virtual void SetAnglesFactors(Double_t factors[3]);
98 
99  virtual Float_t GetScale(){return fScale;}
100  virtual void SetScale(Float_t scale);
101 
102 
103 // ClassDef(TTablePadView3D,0); //Generic 3D viewer
104 };
105 
106 inline void TTablePadView3D::ExecuteEvent(Int_t, Int_t, Int_t) { }
107 inline void TTablePadView3D::Paint(Option_t *) { }
108 inline void TTablePadView3D::Size(Int_t, Int_t) { }
109 inline void TTablePadView3D::PaintBeginModel(Option_t *) { }
110 inline void TTablePadView3D::PaintEnd(Option_t *) { }
111 inline void TTablePadView3D::PaintScene(Option_t *) { }
112 inline void TTablePadView3D::PaintPolyMarker(TPolyMarker3D *, Option_t *) { }
113 inline void TTablePadView3D::PaintPolyLine(TPolyLine3D *, Option_t *) { }
114 inline void TTablePadView3D::PaintPoints3D(const TPoints3DABC *,Option_t *){ }
115 inline void TTablePadView3D::SetAttNode(TNode *, Option_t *) { }
116 inline void TTablePadView3D::SetLineAttr(Color_t ,Int_t ,Option_t *) { }
117 inline void TTablePadView3D::UpdateNodeMatrix(TNode *, Option_t *) { }
118 inline void TTablePadView3D::UpdatePosition(Double_t ,Double_t ,Double_t ,TRotMatrix *, Option_t *){ }
119 
120 #endif
virtual void SetAnglesFactors(Double_t factors[3])
set view angles factors
virtual void SetRange(Double_t min[3], Double_t max[3])
set view range
virtual void GetRange(Double_t min[3], Double_t max[3]) const
get view range
virtual void SetScale(Float_t scale)
set view scale
virtual ~TTablePadView3D()
Delete 3D viewer.
virtual void SetAngles(Double_t main_angles[3], Double_t extra_angles[3])
set view angles
virtual void SetShift(Double_t main_shift[3], Double_t extra_shift[3])
set shift parameters
virtual void GetAnglesFactors(Double_t factors[3]) const
get view angles factors
virtual void GetShift(Double_t main_shift[3], Double_t extra_shift[3]) const
get shift parameters
virtual void GetAngles(Double_t main_angles[3], Double_t extra_angles[3]) const
get view angles