BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/BesVisLib/BesVisLib/BesTView.h
Go to the documentation of this file.
1// @(#)root/base:$Name: BesVisLib-00-05-04 $:$Id: BesTView.h,v 1.7 2018/11/06 00:35:15 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
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);
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
176inline void BesTView::Centered(){Centered3DImages();}
177inline void BesTView::Front() {FrontView();}
178inline void BesTView::ShowAxis(){ToggleRulers(); }
179inline void BesTView::Side() {SideView();}
180inline void BesTView::Top() {TopView();}
181inline void BesTView::ZoomMove(){ToggleZoom();}
182inline void BesTView::Zoom() {ZoomView();}
183inline void BesTView::UnZoom() {UnzoomView();}
184
185#endif
186
DOUBLE_PRECISION count[3]
XmlRpcServer s
Definition: HelloServer.cpp:11
BesTView(Int_t system)
virtual void FrontView(TVirtualPad *pad=0)
Definition: BesTView.cxx:1706
virtual void GetRange(Float_t *min, Float_t *max)
virtual void TopView(TVirtualPad *pad=0)
virtual void ToggleZoom(TVirtualPad *pad=0)
virtual void TopView(TVirtualPad *pad=0)
Definition: BesTView.cxx:1712
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)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)
virtual void UnzoomView(TVirtualPad *pad=0, Double_t unZoomFactor=1.25)
Definition: BesTView.cxx:1770
ClassDef(BesTView, 2)
Bool_t IsClippedNDC(Double_t *p) const
virtual void SetPerspective()
virtual void WCtoNDC(const Double_t *pw, Double_t *pn)
virtual void FindPhiSectors(Int_t iopt, Int_t &kphi, Double_t *aphi, Int_t &iphi1, Int_t &iphi2)
void SetWindow(Double_t u0, Double_t v0, Double_t du, Double_t dv)
virtual void PadRange(Int_t rback)
Double_t GetExtent() const
virtual void FindScope(Double_t *scale, Double_t *center, Int_t &irep)
virtual void ToggleRulers(TVirtualPad *pad=0)
Definition: BesTView.cxx:1718
virtual void RotateView(Double_t phi, Double_t theta, TVirtualPad *pad=0)
virtual void ToggleZoom(TVirtualPad *pad=0)
Definition: BesTView.cxx:1727
virtual void Centered3DImages(TVirtualPad *pad=0)
Definition: BesTView.cxx:1754
virtual void Front()
virtual void ZoomOut()
virtual void SetParallel()
void ResizePad()
virtual void Centered()
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)
virtual void SetOutlineToCube()
virtual void ToggleRulers(TVirtualPad *pad=0)
virtual void DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax)
virtual Int_t GetDistancetoAxis(Int_t axis, Int_t px, Int_t py, Double_t &ratio)
virtual void Top()
virtual void Zoom()
virtual void ZoomView(TVirtualPad *pad=0, Double_t zoomFactor=1.25)
Definition: BesTView.cxx:1778
virtual void AdjustScales(TVirtualPad *pad=0)
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)
virtual void NDCtoWC(const Double_t *pn, Double_t *pw)
virtual void ShowAxis()
virtual void FindNormal(Double_t x, Double_t y, Double_t z, Double_t &zn)
BesTView(const BesTView &)
Set to TRUE after ExecuteRotateView.
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)
virtual void SetRange(const Double_t *min, const Double_t *max)
virtual void UnZoom()
virtual void NDCtoWC(const Float_t *pn, Float_t *pw)
virtual void GetRange(Double_t *min, Double_t *max)
virtual void ExecuteRotateView(Int_t event, Int_t px, Int_t py)
virtual ~BesTView()
virtual void DefinePerspectiveView()
virtual void FindThetaSectors(Int_t iopt, Double_t phi, Int_t &kth, Double_t *ath, Int_t &ith1, Int_t &ith2)
virtual void ZoomMove()
virtual void SideView(TVirtualPad *pad=0)
void SetDefaultWindow()
BesTView(const Double_t *rmin, const Double_t *rmax, Int_t system=1)
virtual void MoveViewCommand(Char_t chCode, Int_t count=1)
BesTView(const Float_t *rmin, const Float_t *rmax, Int_t system=1)
virtual void Side()
void ResetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
virtual void SideView(TVirtualPad *pad=0)
Definition: BesTView.cxx:1700
static void AdjustPad(TVirtualPad *pad=0)
virtual void ZoomIn()
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)
virtual void NormalWCtoNDC(const Double_t *pw, Double_t *pn)
virtual void NormalWCtoNDC(const Float_t *pw, Float_t *pn)
virtual void UnzoomView(TVirtualPad *pad=0, Double_t unZoomFactor=1.25)
void MoveWindow(Char_t option)
virtual void Centered3DImages(TVirtualPad *pad=0)
virtual void FrontView(TVirtualPad *pad=0)
virtual void ZoomView(TVirtualPad *pad=0, Double_t zoomFactor=1.25)
void GetWindow(Double_t &u0, Double_t &v0, Double_t &du, Double_t &dv) const
virtual void SetAutoRange(Bool_t autorange=kTRUE)
BesTView & operator=(const BesTView &)