CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTView.h
Go to the documentation of this file.
1// @(#)root/base:$Name: BesVisLib-00-06-12 $:$Id: BesTView.h,v 1.6 2019/06/14 06:05:23 longpx Exp $
2// Author: Rene Brun, Nenad Buncic, Evgueni Tcherniaev, Olivier Couet 18/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
13#ifndef ROOT_BesTView
14#define ROOT_BesTView
15
16
17/////////////////////////////////////////////////////////////////////////
18// //
19// BesTView //
20// //
21/////////////////////////////////////////////////////////////////////////
22
23
24#ifndef ROOT_TView
25#include "TView.h"
26#endif
27
28class TSeqCollection;
29class TVirtualPad;
30
31class BesTView : public TView {
32
33protected:
34 Double_t fLatitude; //View angle latitude
35 Double_t fLongitude; //View angle longitude
36 Double_t fPsi; //View angle psi
37 Double_t fDview; //Distance from COP to COV
38 Double_t fDproj; //Distance from COP to projection plane
39 Double_t fUpix; // pad X size in pixels
40 Double_t fVpix; // pad Y size in pixels
41 Double_t fTN[16]; //
42 Double_t fTB[16]; //
43 Double_t fRmax[3]; //Upper limits of object
44 Double_t fRmin[3]; //Lower limits of object
45 Double_t fUVcoord[4]; //Viewing window limits
46 Double_t fTnorm[16]; //Transformation matrix
47 Double_t fTback[16]; //Back transformation matrix
48 Double_t fX1[3]; //First coordinate of X axis
49 Double_t fX2[3]; //Second coordinate of X axis
50 Double_t fY1[3]; //First coordinate of Y axis
51 Double_t fY2[3]; //Second coordinate of Y axis
52 Double_t fZ1[3]; //First coordinate of Z axis
53 Double_t fZ2[3]; //Second coordinate of Z axis
54 Int_t fSystem; //Coordinate system
55 TSeqCollection *fOutline; //Collection of outline's objects
56 Bool_t fDefaultOutline; //Set to TRUE if outline is default cube
57 Bool_t fAutoRange; //Set to TRUE if range computed automatically
58 Bool_t fChanged; //! Set to TRUE after ExecuteRotateView
59
60 BesTView(const BesTView&); // Not implemented
61 BesTView& operator=(const BesTView&); // Not implemented
62
63 void ResetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep);
64
65
66public:
67 // BesTView status bits
68 enum {
69 kPerspective = BIT(6)
70 };
71
72 BesTView();
73 BesTView(Int_t system);
74 BesTView(const Float_t *rmin, const Float_t *rmax, Int_t system = 1);
75 BesTView(const Double_t *rmin, const Double_t *rmax, Int_t system = 1);
76 virtual ~BesTView();
77
78 virtual void AxisVertex(Double_t ang, Double_t *av, Int_t &ix1, Int_t &ix2, Int_t &iy1, Int_t &iy2, Int_t &iz1, Int_t &iz2);
79 virtual void DefinePerspectiveView();
80 virtual void DefineViewDirection(const Double_t *s, const Double_t *c,
81 Double_t cosphi, Double_t sinphi,
82 Double_t costhe, Double_t sinthe,
83 Double_t cospsi, Double_t sinpsi,
84 Double_t *tnorm, Double_t *tback);
85 virtual void DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax);
86 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
87 virtual void ExecuteRotateView(Int_t event, Int_t px, Int_t py);
88 virtual void FindScope(Double_t *scale, Double_t *center, Int_t &irep);
89 virtual Int_t GetDistancetoAxis(Int_t axis, Int_t px, Int_t py, Double_t &ratio);
90 Double_t GetDview() const {return fDview;}
91 Double_t GetDproj() const {return fDproj;}
92 Double_t GetExtent() const;
93 Bool_t GetAutoRange() {return fAutoRange;}
94 Double_t GetLatitude() {return fLatitude;}
95 Double_t GetLongitude() {return fLongitude;}
96 Double_t GetPsi() {return fPsi;}
97 virtual void GetRange (Float_t *min, Float_t *max);
98 virtual void GetRange (Double_t *min, Double_t *max);
99 Double_t *GetRmax() {return fRmax;}
100 Double_t *GetRmin() {return fRmin;}
101 TSeqCollection *GetOutline() {return fOutline; }
102 Double_t *GetTback() {return fTback;}
103 Double_t *GetTN() {return fTN;}
104 Double_t *GetTnorm() {return fTnorm;}
105 Int_t GetSystem() {return fSystem;}
106 void GetWindow(Double_t &u0, Double_t &v0, Double_t &du, Double_t &dv) const;
107 Double_t GetWindowWidth() const {return 0.5*(fUVcoord[1]-fUVcoord[0]);}
108 Double_t GetWindowHeight() const {return 0.5*(fUVcoord[3]-fUVcoord[2]);}
109 virtual void FindNormal(Double_t x, Double_t y, Double_t z, Double_t &zn);
110 virtual void FindPhiSectors(Int_t iopt, Int_t &kphi, Double_t *aphi, Int_t &iphi1, Int_t &iphi2);
111 virtual void FindThetaSectors(Int_t iopt, Double_t phi, Int_t &kth, Double_t *ath, Int_t &ith1, Int_t &ith2);
112 Bool_t IsClippedNDC(Double_t *p) const;
113 Bool_t IsPerspective() const {return TestBit(kPerspective);}
114 Bool_t IsViewChanged() const {return fChanged;}
115 virtual void NDCtoWC(const Float_t *pn, Float_t *pw);
116 virtual void NDCtoWC(const Double_t *pn, Double_t *pw);
117 virtual void NormalWCtoNDC(const Float_t *pw, Float_t *pn);
118 virtual void NormalWCtoNDC(const Double_t *pw, Double_t *pn);
119 virtual void PadRange(Int_t rback);
120 void ResizePad();
121 virtual void SetAutoRange(Bool_t autorange=kTRUE) {fAutoRange=autorange;}
122 virtual void SetAxisNDC(const Double_t *x1, const Double_t *x2, const Double_t *y1, const Double_t *y2, const Double_t *z1, const Double_t *z2);
123 void SetDefaultWindow();
124 void SetDview(Double_t dview) {fDview=dview;}
125 void SetDproj(Double_t dproj) {fDproj=dproj;}
126 void SetLatitude(Double_t latitude) {fLatitude = latitude;}
127 void SetLongitude(Double_t longitude) {fLongitude = longitude;}
128 void SetPsi(Double_t psi) {fPsi = psi;}
129 virtual void SetOutlineToCube();
130 virtual void SetParallel(); // *MENU*
131 virtual void SetPerspective(); // *MENU*
132 virtual void SetRange(const Double_t *min, const Double_t *max);
133 virtual void SetRange(Double_t x0, Double_t y0, Double_t z0, Double_t x1, Double_t y1, Double_t z1, Int_t flag=0);
134 virtual void SetSystem(Int_t system) {fSystem = system;}
135 virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep);
136 void SetViewChanged(Bool_t flag=kTRUE) {fChanged = flag;}
137 void SetWindow(Double_t u0, Double_t v0, Double_t du, Double_t dv);
138 virtual void WCtoNDC(const Float_t *pw, Float_t *pn);
139 virtual void WCtoNDC(const Double_t *pw, Double_t *pn);
140
141//--
142 void MoveFocus(Double_t *center, Double_t dx, Double_t dy, Double_t dz, Int_t nsteps=10,
143 Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0);
144 virtual void MoveViewCommand(Char_t chCode, Int_t count=1);
145 void MoveWindow(Char_t option);
146
147 static void AdjustPad(TVirtualPad *pad=0);
148 virtual void AdjustScales(TVirtualPad *pad=0); // *MENU*
149 virtual void Centered3DImages(TVirtualPad *pad=0);
150 virtual void Centered(); // *MENU*
151 virtual void FrontView(TVirtualPad *pad=0);
152 virtual void Front(); // *MENU*
153
154 virtual void ZoomIn(); // *MENU*
155 virtual void ZoomOut(); // *MENU*
156 virtual void ZoomView(TVirtualPad *pad=0, Double_t zoomFactor = 1.25 );
157 virtual void UnzoomView(TVirtualPad *pad=0,Double_t unZoomFactor = 1.25);
158
159 virtual void RotateView(Double_t phi, Double_t theta, TVirtualPad *pad=0);
160 virtual void SideView(TVirtualPad *pad=0);
161 virtual void Side(); // *MENU*
162 virtual void TopView(TVirtualPad *pad=0);
163 virtual void Top(); // *MENU*
164
165 virtual void ToggleRulers(TVirtualPad *pad=0);
166 virtual void ShowAxis(); // *MENU*
167 virtual void ToggleZoom(TVirtualPad *pad=0);
168 virtual void ZoomMove(); // *MENU*
169 virtual void Zoom(); // *MENU*
170 virtual void UnZoom(); // *MENU*
171
172 ClassDef(BesTView,2); //3-D View
173};
174
175// Shortcuts for menus
177inline void BesTView::Front() {FrontView();}
179inline void BesTView::Side() {SideView();}
180inline void BesTView::Top() {TopView();}
182inline void BesTView::Zoom() {ZoomView();}
183inline void BesTView::UnZoom() {UnzoomView();}
184
185#endif
186
float Float_t
XmlRpcServer s
Definition: HelloServer.cpp:11
Double_t fZ2[3]
Definition: BesTView.h:53
Int_t GetSystem()
Definition: BesTView.h:105
virtual void FrontView(TVirtualPad *pad=0)
Definition: BesTView.cxx:1706
virtual Int_t GetDistancetoAxis(Int_t axis, Int_t px, Int_t py, Double_t &ratio)
Definition: BesTView.cxx:1053
Double_t fRmin[3]
Definition: BesTView.h:44
Double_t fVpix
Definition: BesTView.h:40
virtual void TopView(TVirtualPad *pad=0)
Definition: BesTView.cxx:1712
Double_t fUpix
Definition: BesTView.h:39
virtual void SetOutlineToCube()
Definition: BesTView.cxx:1397
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)
Definition: BesTView.cxx:1607
virtual void UnzoomView(TVirtualPad *pad=0, Double_t unZoomFactor=1.25)
Definition: BesTView.cxx:1770
void SetPsi(Double_t psi)
Definition: BesTView.h:128
Double_t GetLatitude()
Definition: BesTView.h:94
Bool_t IsViewChanged() const
Definition: BesTView.h:114
virtual void SetAxisNDC(const Double_t *x1, const Double_t *x2, const Double_t *y1, const Double_t *y2, const Double_t *z1, const Double_t *z2)
Definition: BesTView.cxx:1359
@ kPerspective
Definition: BesTView.h:69
ClassDef(BesTView, 2)
Double_t fRmax[3]
Definition: BesTView.h:43
Int_t fSystem
Definition: BesTView.h:54
Bool_t IsClippedNDC(Double_t *p) const
Definition: BesTView.cxx:1166
virtual void FindNormal(Double_t x, Double_t y, Double_t z, Double_t &zn)
Definition: BesTView.cxx:875
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Definition: BesTView.cxx:737
virtual void AdjustScales(TVirtualPad *pad=0)
Definition: BesTView.cxx:1737
virtual void FindPhiSectors(Int_t iopt, Int_t &kphi, Double_t *aphi, Int_t &iphi1, Int_t &iphi2)
Definition: BesTView.cxx:893
void SetWindow(Double_t u0, Double_t v0, Double_t du, Double_t dv)
Definition: BesTView.cxx:1516
Bool_t fChanged
Definition: BesTView.h:58
virtual void ZoomMove()
Definition: BesTView.h:181
Double_t GetExtent() const
Definition: BesTView.cxx:1124
virtual void ToggleRulers(TVirtualPad *pad=0)
Definition: BesTView.cxx:1718
Double_t fY2[3]
Definition: BesTView.h:51
virtual void DefinePerspectiveView()
Definition: BesTView.cxx:466
TSeqCollection * GetOutline()
Definition: BesTView.h:101
virtual void ToggleZoom(TVirtualPad *pad=0)
Definition: BesTView.cxx:1727
Double_t fPsi
Definition: BesTView.h:36
virtual void Centered3DImages(TVirtualPad *pad=0)
Definition: BesTView.cxx:1754
void SetDproj(Double_t dproj)
Definition: BesTView.h:125
virtual void NDCtoWC(const Float_t *pn, Float_t *pw)
Definition: BesTView.cxx:1177
TSeqCollection * fOutline
Definition: BesTView.h:55
Double_t GetWindowWidth() const
Definition: BesTView.h:107
void ResizePad()
Definition: BesTView.cxx:1534
virtual void AxisVertex(Double_t ang, Double_t *av, Int_t &ix1, Int_t &ix2, Int_t &iy1, Int_t &iy2, Int_t &iz1, Int_t &iz2)
Definition: BesTView.cxx:332
virtual void SetSystem(Int_t system)
Definition: BesTView.h:134
Bool_t GetAutoRange()
Definition: BesTView.h:93
void SetViewChanged(Bool_t flag=kTRUE)
Definition: BesTView.h:136
Double_t fLatitude
Definition: BesTView.h:34
virtual void Top()
Definition: BesTView.h:180
Double_t * GetTback()
Definition: BesTView.h:102
Double_t * GetTN()
Definition: BesTView.h:103
Double_t fDproj
Definition: BesTView.h:38
virtual void ZoomView(TVirtualPad *pad=0, Double_t zoomFactor=1.25)
Definition: BesTView.cxx:1778
virtual void SetRange(const Double_t *min, const Double_t *max)
Definition: BesTView.cxx:1454
Double_t * GetRmin()
Definition: BesTView.h:100
virtual void RotateView(Double_t phi, Double_t theta, TVirtualPad *pad=0)
Definition: BesTView.cxx:1679
virtual void NormalWCtoNDC(const Float_t *pw, Float_t *pn)
Definition: BesTView.cxx:1209
virtual void UnZoom()
Definition: BesTView.h:183
Double_t fDview
Definition: BesTView.h:37
Bool_t IsPerspective() const
Definition: BesTView.h:113
Double_t fTB[16]
Definition: BesTView.h:42
void SetLatitude(Double_t latitude)
Definition: BesTView.h:126
static void AdjustPad(TVirtualPad *pad=0)
Definition: BesTView.cxx:1668
virtual void ZoomOut()
Definition: BesTView.cxx:1958
void MoveFocus(Double_t *center, Double_t dx, Double_t dy, Double_t dz, Int_t nsteps=10, Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0)
Definition: BesTView.cxx:1800
Double_t fX1[3]
Definition: BesTView.h:48
Bool_t fDefaultOutline
Definition: BesTView.h:56
Double_t GetPsi()
Definition: BesTView.h:96
virtual void Zoom()
Definition: BesTView.h:182
Double_t fTN[16]
Definition: BesTView.h:41
Bool_t fAutoRange
Definition: BesTView.h:57
Double_t * GetTnorm()
Definition: BesTView.h:104
Double_t fTback[16]
Definition: BesTView.h:47
virtual void Front()
Definition: BesTView.h:177
Double_t * GetRmax()
Definition: BesTView.h:99
virtual void PadRange(Int_t rback)
Definition: BesTView.cxx:1269
BesTView()
Definition: BesTView.cxx:39
virtual void ShowAxis()
Definition: BesTView.h:178
Double_t fX2[3]
Definition: BesTView.h:49
Double_t GetWindowHeight() const
Definition: BesTView.h:108
virtual void SetParallel()
Definition: BesTView.cxx:1433
void SetDefaultWindow()
Definition: BesTView.cxx:1376
Double_t GetLongitude()
Definition: BesTView.h:95
virtual void GetRange(Float_t *min, Float_t *max)
Definition: BesTView.cxx:1138
void SetLongitude(Double_t longitude)
Definition: BesTView.h:127
Double_t fZ1[3]
Definition: BesTView.h:52
void SetDview(Double_t dview)
Definition: BesTView.h:124
void ResetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
Definition: BesTView.cxx:1554
virtual void SideView(TVirtualPad *pad=0)
Definition: BesTView.cxx:1700
Double_t GetDproj() const
Definition: BesTView.h:91
virtual void DefineViewDirection(const Double_t *s, const Double_t *c, Double_t cosphi, Double_t sinphi, Double_t costhe, Double_t sinthe, Double_t cospsi, Double_t sinpsi, Double_t *tnorm, Double_t *tback)
Definition: BesTView.cxx:600
virtual void Centered()
Definition: BesTView.h:176
Double_t GetDview() const
Definition: BesTView.h:90
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
Definition: BesTView.cxx:1526
Double_t fUVcoord[4]
Definition: BesTView.h:45
virtual void ExecuteRotateView(Int_t event, Int_t px, Int_t py)
Definition: BesTView.cxx:745
virtual void Side()
Definition: BesTView.h:179
Double_t fTnorm[16]
Definition: BesTView.h:46
virtual void SetPerspective()
Definition: BesTView.cxx:1443
virtual void MoveViewCommand(Char_t chCode, Int_t count=1)
Definition: BesTView.cxx:1855
void MoveWindow(Char_t option)
Definition: BesTView.cxx:1901
virtual void ZoomIn()
Definition: BesTView.cxx:1939
virtual void DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax)
Definition: BesTView.cxx:728
Double_t fLongitude
Definition: BesTView.h:35
virtual void FindThetaSectors(Int_t iopt, Double_t phi, Int_t &kth, Double_t *ath, Int_t &ith1, Int_t &ith2)
Definition: BesTView.cxx:960
void GetWindow(Double_t &u0, Double_t &v0, Double_t &du, Double_t &dv) const
Definition: BesTView.cxx:1156
virtual void FindScope(Double_t *scale, Double_t *center, Int_t &irep)
Definition: BesTView.cxx:1031
Double_t fY1[3]
Definition: BesTView.h:50
virtual void SetAutoRange(Bool_t autorange=kTRUE)
Definition: BesTView.h:121
virtual ~BesTView()
Definition: BesTView.cxx:134
BesTView & operator=(const BesTView &)
Definition: BesTView.cxx:93