BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTView Class Reference

#include <BesTView.h>

+ Inheritance diagram for BesTView:

Public Types

enum  { kPerspective = BIT(6) }
 

Public Member Functions

 BesTView ()
 
 BesTView (Int_t system)
 
 BesTView (const Float_t *rmin, const Float_t *rmax, Int_t system=1)
 
 BesTView (const Double_t *rmin, const Double_t *rmax, Int_t system=1)
 
virtual ~BesTView ()
 
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 DefinePerspectiveView ()
 
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 DrawOutlineCube (TList *outline, Double_t *rmin, Double_t *rmax)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void ExecuteRotateView (Int_t event, Int_t px, Int_t py)
 
virtual void FindScope (Double_t *scale, Double_t *center, Int_t &irep)
 
virtual Int_t GetDistancetoAxis (Int_t axis, Int_t px, Int_t py, Double_t &ratio)
 
Double_t GetDview () const
 
Double_t GetDproj () const
 
Double_t GetExtent () const
 
Bool_t GetAutoRange ()
 
Double_t GetLatitude ()
 
Double_t GetLongitude ()
 
Double_t GetPsi ()
 
virtual void GetRange (Float_t *min, Float_t *max)
 
virtual void GetRange (Double_t *min, Double_t *max)
 
Double_t * GetRmax ()
 
Double_t * GetRmin ()
 
TSeqCollection * GetOutline ()
 
Double_t * GetTback ()
 
Double_t * GetTN ()
 
Double_t * GetTnorm ()
 
Int_t GetSystem ()
 
void GetWindow (Double_t &u0, Double_t &v0, Double_t &du, Double_t &dv) const
 
Double_t GetWindowWidth () const
 
Double_t GetWindowHeight () const
 
virtual void FindNormal (Double_t x, Double_t y, Double_t z, Double_t &zn)
 
virtual void FindPhiSectors (Int_t iopt, Int_t &kphi, Double_t *aphi, Int_t &iphi1, Int_t &iphi2)
 
virtual void FindThetaSectors (Int_t iopt, Double_t phi, Int_t &kth, Double_t *ath, Int_t &ith1, Int_t &ith2)
 
Bool_t IsClippedNDC (Double_t *p) const
 
Bool_t IsPerspective () const
 
Bool_t IsViewChanged () const
 
virtual void NDCtoWC (const Float_t *pn, Float_t *pw)
 
virtual void NDCtoWC (const Double_t *pn, Double_t *pw)
 
virtual void NormalWCtoNDC (const Float_t *pw, Float_t *pn)
 
virtual void NormalWCtoNDC (const Double_t *pw, Double_t *pn)
 
virtual void PadRange (Int_t rback)
 
void ResizePad ()
 
virtual void SetAutoRange (Bool_t autorange=kTRUE)
 
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)
 
void SetDefaultWindow ()
 
void SetDview (Double_t dview)
 
void SetDproj (Double_t dproj)
 
void SetLatitude (Double_t latitude)
 
void SetLongitude (Double_t longitude)
 
void SetPsi (Double_t psi)
 
virtual void SetOutlineToCube ()
 
virtual void SetParallel ()
 
virtual void SetPerspective ()
 
virtual void SetRange (const Double_t *min, const Double_t *max)
 
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 SetSystem (Int_t system)
 
virtual void SetView (Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
 
void SetViewChanged (Bool_t flag=kTRUE)
 
void SetWindow (Double_t u0, Double_t v0, Double_t du, Double_t dv)
 
virtual void WCtoNDC (const Float_t *pw, Float_t *pn)
 
virtual void WCtoNDC (const Double_t *pw, Double_t *pn)
 
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 MoveViewCommand (Char_t chCode, Int_t count=1)
 
void MoveWindow (Char_t option)
 
virtual void AdjustScales (TVirtualPad *pad=0)
 
virtual void Centered3DImages (TVirtualPad *pad=0)
 
virtual void Centered ()
 
virtual void FrontView (TVirtualPad *pad=0)
 
virtual void Front ()
 
virtual void ZoomIn ()
 
virtual void ZoomOut ()
 
virtual void ZoomView (TVirtualPad *pad=0, Double_t zoomFactor=1.25)
 
virtual void UnzoomView (TVirtualPad *pad=0, Double_t unZoomFactor=1.25)
 
virtual void RotateView (Double_t phi, Double_t theta, TVirtualPad *pad=0)
 
virtual void SideView (TVirtualPad *pad=0)
 
virtual void Side ()
 
virtual void TopView (TVirtualPad *pad=0)
 
virtual void Top ()
 
virtual void ToggleRulers (TVirtualPad *pad=0)
 
virtual void ShowAxis ()
 
virtual void ToggleZoom (TVirtualPad *pad=0)
 
virtual void ZoomMove ()
 
virtual void Zoom ()
 
virtual void UnZoom ()
 
 ClassDef (BesTView, 2)
 

Static Public Member Functions

static void AdjustPad (TVirtualPad *pad=0)
 

Protected Member Functions

 BesTView (const BesTView &)
 Set to TRUE after ExecuteRotateView.
 
BesTViewoperator= (const BesTView &)
 
void ResetView (Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
 

Protected Attributes

Double_t fLatitude
 
Double_t fLongitude
 
Double_t fPsi
 
Double_t fDview
 
Double_t fDproj
 
Double_t fUpix
 
Double_t fVpix
 
Double_t fTN [16]
 
Double_t fTB [16]
 
Double_t fRmax [3]
 
Double_t fRmin [3]
 
Double_t fUVcoord [4]
 
Double_t fTnorm [16]
 
Double_t fTback [16]
 
Double_t fX1 [3]
 
Double_t fX2 [3]
 
Double_t fY1 [3]
 
Double_t fY2 [3]
 
Double_t fZ1 [3]
 
Double_t fZ2 [3]
 
Int_t fSystem
 
TSeqCollection * fOutline
 
Bool_t fDefaultOutline
 
Bool_t fAutoRange
 
Bool_t fChanged
 

Detailed Description

Definition at line 31 of file BesTView.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kPerspective 

Definition at line 68 of file BesTView.h.

68 {
69 kPerspective = BIT(6)
70 };
@ kPerspective
Definition: BesTView.h:69

Constructor & Destructor Documentation

◆ BesTView() [1/5]

BesTView::BesTView ( const BesTView tv)
protected

Set to TRUE after ExecuteRotateView.

Definition at line 55 of file BesTView.cxx.

56 :TView(tv),
59 fPsi(tv.fPsi),
60 fDview(tv.fDview),
61 fDproj(tv.fDproj),
62 fUpix(tv.fUpix),
63 fVpix(tv.fVpix),
64 fSystem(tv.fSystem),
69{
70 // Copy constructor.
71
72 for (Int_t i=0; i<16; i++) {
73 fTN[i]=tv.fTN[i];
74 fTB[i]=tv.fTB[i];
75 fTnorm[i]=tv.fTnorm[i];
76 fTback[i]=tv.fTback[i];
77 }
78 for(Int_t i=0; i<3; i++) {
79 fRmax[i]=tv.fRmax[i];
80 fRmin[i]=tv.fRmin[i];
81 fX1[i]=tv.fX1[i];
82 fX2[i]=tv.fX2[i];
83 fY1[i]=tv.fY1[i];
84 fY2[i]=tv.fY2[i];
85 fZ1[i]=tv.fZ1[i];
86 fZ2[i]=tv.fZ2[i];
87 }
88 for(Int_t i=0; i<4; i++)
89 fUVcoord[i]=tv.fUVcoord[i];
90}
Double_t fZ2[3]
Definition: BesTView.h:53
Double_t fRmin[3]
Definition: BesTView.h:44
Double_t fVpix
Definition: BesTView.h:40
Double_t fUpix
Definition: BesTView.h:39
Double_t fRmax[3]
Definition: BesTView.h:43
Int_t fSystem
Definition: BesTView.h:54
Bool_t fChanged
Definition: BesTView.h:58
Double_t fY2[3]
Definition: BesTView.h:51
Double_t fPsi
Definition: BesTView.h:36
TSeqCollection * fOutline
Definition: BesTView.h:55
Double_t fLatitude
Definition: BesTView.h:34
Double_t fDproj
Definition: BesTView.h:38
Double_t fDview
Definition: BesTView.h:37
Double_t fTB[16]
Definition: BesTView.h:42
Double_t fX1[3]
Definition: BesTView.h:48
Bool_t fDefaultOutline
Definition: BesTView.h:56
Double_t fTN[16]
Definition: BesTView.h:41
Bool_t fAutoRange
Definition: BesTView.h:57
Double_t fTback[16]
Definition: BesTView.h:47
Double_t fX2[3]
Definition: BesTView.h:49
Double_t fZ1[3]
Definition: BesTView.h:52
Double_t fUVcoord[4]
Definition: BesTView.h:45
Double_t fTnorm[16]
Definition: BesTView.h:46
Double_t fLongitude
Definition: BesTView.h:35
Double_t fY1[3]
Definition: BesTView.h:50

◆ BesTView() [2/5]

BesTView::BesTView ( )

Definition at line 39 of file BesTView.cxx.

39 :TView()
40{
41 // Default constructor
42
43 fSystem = 1;
44 fOutline = 0;
45 fDefaultOutline = kFALSE;
46 fAutoRange = kFALSE;
47 fChanged = kFALSE;
48 SetBit(kMustCleanup);
49 for (Int_t i=0;i<3;i++) {
50 fX1[i] = fX2[i] = fY1[i] = fY2[i] = fZ1[i] = fZ2[i] = 0;
51 }
52}

◆ BesTView() [3/5]

BesTView::BesTView ( Int_t  system)

Definition at line 145 of file BesTView.cxx.

146{
147//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*View constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
148//*-* ================
149//*-* Creates a 3-D view in the current pad
150//*-* By default pad range in 3-D view is (-1,-1,1,1), so ...
151//*-*
152//*-* Before drawing a 3-D object in a pad, a 3-D view must be created.
153//*-* Note that a view is automatically created when drawing legos or surfaces.
154//*-*
155//*-* The coordinate system is selected via system:
156//*-* system = 1 Cartesian
157//*-* system = 2 Polar
158//*-* system = 3 Cylindrical
159//*-* system = 4 Spherical
160//*-* system = 5 PseudoRapidity/Phi
161//*-* system = 11 Perspective view
162//*-*
163//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
164 Int_t irep;
165
166 //create the 3d utility manager (a plugin)
167 if (!gROOT->GetListOfSpecials()->FindObject("R__TVirtualUtil3D")) {
168 TPluginHandler *h;
169 if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualUtil3D"))) {
170 if (h->LoadPlugin() == -1)
171 return;
172 h->ExecPlugin(0);
173 }
174 }
175
176 SetBit(kMustCleanup);
177
178 fSystem = system;
179 fOutline = 0;
180 fDefaultOutline = kFALSE;
181 fAutoRange = kFALSE;
182 fChanged = kFALSE;
183
184 if (system == kCARTESIAN || system == kPOLAR || system == 11) fPsi = 0;
185 else fPsi = 90;
186
187 //By default pad range in 3-D view is (-1,-1,1,1), so ...
188 if (gPad) {
189 gPad->Range(-1, -1, 1, 1);
190
191 Int_t i;
192 for (i = 0; i < 3; fRmin[i] = 0, fRmax[i] = 1, i++);
193 for (i=0;i<3;i++) {
194 fX1[i] = fX2[i] = fY1[i] = fY2[i] = fZ1[i] = fZ2[i] = 0;
195 }
196
197 fLongitude = -90 - gPad->GetPhi();
198 fLatitude = 90 - gPad->GetTheta();
200
201 gPad->SetView(this);
202 }
203 if (system == 11) SetPerspective();
204}
const Int_t kPOLAR
Definition: BesTView.cxx:33
void ResetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
Definition: BesTView.cxx:1553
virtual void SetPerspective()
Definition: BesTView.cxx:1442

◆ BesTView() [4/5]

BesTView::BesTView ( const Float_t *  rmin,
const Float_t *  rmax,
Int_t  system = 1 
)

Definition at line 208 of file BesTView.cxx.

209{
210//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*View constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
211//*-* ================
212//*-* Creates a 3-D view in the current pad
213//*-* rmin[3], rmax[3] are the limits of the object depending on
214//*-* the selected coordinate system
215//*-*
216//*-* Before drawing a 3-D object in a pad, a 3-D view must be created.
217//*-* Note that a view is automatically created when drawing legos or surfaces.
218//*-*
219//*-* The coordinate system is selected via system:
220//*-* system = 1 Cartesian
221//*-* system = 2 Polar
222//*-* system = 3 Cylindrical
223//*-* system = 4 Spherical
224//*-* system = 5 PseudoRapidity/Phi
225//*-*
226//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
227
228 Int_t irep;
229
230 //create the 3d utility manager (a plugin)
231 if (!gROOT->GetListOfSpecials()->FindObject("R__TVirtualUtil3D")) {
232 TPluginHandler *h;
233 if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualUtil3D"))) {
234 if (h->LoadPlugin() == -1)
235 return;
236 h->ExecPlugin(0);
237 }
238 }
239
240 SetBit(kMustCleanup);
241
242 fSystem = system;
243 fOutline = 0;
244 fDefaultOutline = kFALSE;
245 fChanged = kFALSE;
246
247 if (system == kCARTESIAN || system == kPOLAR || system == 11) fPsi = 0;
248 else fPsi = 90;
249
250 //By default pad range in 3-D view is (-1,-1,1,1), so ...
251 gPad->Range(-1, -1, 1, 1);
252 fAutoRange = kFALSE;
253
254 Int_t i;
255 for (i = 0; i < 3; fRmin[i] = rmin[i], fRmax[i] = rmax[i], i++);
256 for (i=0;i<3;i++) {
257 fX1[i] = fX2[i] = fY1[i] = fY2[i] = fZ1[i] = fZ2[i] = 0;
258 }
259
260 fLongitude = -90 - gPad->GetPhi();
261 fLatitude = 90 - gPad->GetTheta();
263
264 if (gPad) gPad->SetView(this);
265 if (system == 11) SetPerspective();
266}

◆ BesTView() [5/5]

BesTView::BesTView ( const Double_t *  rmin,
const Double_t *  rmax,
Int_t  system = 1 
)

Definition at line 270 of file BesTView.cxx.

271{
272//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*View constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
273//*-* ================
274//*-* Creates a 3-D view in the current pad
275//*-* rmin[3], rmax[3] are the limits of the object depending on
276//*-* the selected coordinate system
277//*-*
278//*-* Before drawing a 3-D object in a pad, a 3-D view must be created.
279//*-* Note that a view is automatically created when drawing legos or surfaces.
280//*-*
281//*-* The coordinate system is selected via system:
282//*-* system = 1 Cartesian
283//*-* system = 2 Polar
284//*-* system = 3 Cylindrical
285//*-* system = 4 Spherical
286//*-* system = 5 PseudoRapidity/Phi
287//*-*
288//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
289
290 Int_t irep;
291
292 //create the 3d utility manager (a plugin)
293 if (!gROOT->GetListOfSpecials()->FindObject("R__TVirtualUtil3D")) {
294 TPluginHandler *h;
295 if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualUtil3D"))) {
296 if (h->LoadPlugin() == -1)
297 return;
298 h->ExecPlugin(0);
299 }
300 }
301
302 SetBit(kMustCleanup);
303
304 fSystem = system;
305 fOutline = 0;
306 fDefaultOutline = kFALSE;
307 fChanged = kFALSE;
308
309 if (system == kCARTESIAN || system == kPOLAR || system == 11) fPsi = 0;
310 else fPsi = 90;
311
312 //By default pad range in 3-D view is (-1,-1,1,1), so ...
313 gPad->Range(-1, -1, 1, 1);
314 fAutoRange = kFALSE;
315
316 Int_t i;
317 for (i = 0; i < 3; fRmin[i] = rmin[i], fRmax[i] = rmax[i], i++);
318 for (i=0;i<3;i++) {
319 fX1[i] = fX2[i] = fY1[i] = fY2[i] = fZ1[i] = fZ2[i] = 0;
320 }
321
322 fLongitude = -90 - gPad->GetPhi();
323 fLatitude = 90 - gPad->GetTheta();
325
326 if (gPad) gPad->SetView(this);
327 if (system == 11) SetPerspective();
328}

◆ ~BesTView()

BesTView::~BesTView ( )
virtual

Definition at line 134 of file BesTView.cxx.

135{
136//*-*-*-*-*-*-*-*-*-*-*-*-*-*View default destructor*-*-*-*-*-*-*-*-*-*-*-*-*
137//*-* =======================
138
139 if (fOutline) fOutline->Delete();
140 delete fOutline;
141 fOutline = 0;
142}

Member Function Documentation

◆ AdjustPad()

void BesTView::AdjustPad ( TVirtualPad *  pad = 0)
static

Definition at line 1667 of file BesTView.cxx.

1668{
1669 // Force the current pad to be updated
1670 TVirtualPad *thisPad = pad;
1671 if (!thisPad) thisPad = gPad;
1672 if (thisPad) {
1673 thisPad->Modified();
1674 thisPad->Update();
1675 }
1676}

Referenced by AdjustScales(), Centered3DImages(), and ZoomView().

◆ AdjustScales()

void BesTView::AdjustScales ( TVirtualPad *  pad = 0)
virtual

Reimplemented in Bes2DView, and BesView.

Definition at line 1736 of file BesTView.cxx.

1737{
1738 // Adjust all sides of view in respect of the biggest one
1739 Double_t min[3],max[3];
1740 GetRange(min,max);
1741 int i;
1742 Double_t maxSide = 0;
1743 // Find the largest side
1744 for (i=0;i<3; i++) maxSide = TMath::Max(maxSide,max[i]-min[i]);
1745 //Adjust scales:
1746 for (i=0;i<3; i++) max[i] += maxSide - (max[i]-min[i]);
1747 SetRange(min,max);
1748
1749 AdjustPad(pad);
1750}
virtual void SetRange(const Double_t *min, const Double_t *max)
Definition: BesTView.cxx:1453
static void AdjustPad(TVirtualPad *pad=0)
Definition: BesTView.cxx:1667
virtual void GetRange(Float_t *min, Float_t *max)
Definition: BesTView.cxx:1137

Referenced by Bes2DView::AdjustScales(), and BesView::AdjustScales().

◆ AxisVertex()

void BesTView::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

Definition at line 332 of file BesTView.cxx.

333{
334//*-*-*-*-*-*-*-*-*-*-*-*-*Define axis vertices*-*-*-*-*-*-*-*-*-*-*-*-*-*
335//*-* ===================== *
336//*-* *
337//*-* Input ANG - angle between X and Y axis *
338//*-* *
339//*-* Output: AV(3,8) - axis vertixes *
340//*-* IX1 - 1st point of X-axis *
341//*-* IX2 - 2nd point of X-axis *
342//*-* IY1 - 1st point of Y-axis *
343//*-* IY2 - 2nd point of Y-axis *
344//*-* IZ1 - 1st point of Z-axis *
345//*-* IZ2 - 2nd point of Z-axis *
346//*-* *
347//*-* 8 6 *
348//*-* / \ /|\ *
349//*-* 5 / \ 7 5 / | \ 7 *
350//*-* |\ /| | | | *
351//*-* THETA < 90 | \6/ | THETA > 90 | /2\ | *
352//*-* (Top view) | | | (Bottom view) |/ \| *
353//*-* 1 \ | /3 1 \ /3 *
354//*-* \|/ \ / *
355//*-* 2 4 *
356//*-* *
357//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
358 /* Local variables */
359 Double_t cosa, sina;
360 Int_t i, k;
361 Double_t p[8] /* was [2][4] */;
362 Int_t i1, i2, i3, i4, ix, iy;
363 ix = 0;
364
365 /* Parameter adjustments */
366 av -= 4;
367
368 sina = TMath::Sin(ang*kRad);
369 cosa = TMath::Cos(ang*kRad);
370 p[0] = fRmin[0];
371 p[1] = fRmin[1];
372 p[2] = fRmax[0];
373 p[3] = fRmin[1];
374 p[4] = fRmax[0];
375 p[5] = fRmax[1];
376 p[6] = fRmin[0];
377 p[7] = fRmax[1];
378//*-*- F I N D T H E M O S T L E F T P O I N T */
379 i1 = 1;
380 if (fTN[0] < 0) i1 = 2;
381 if (fTN[0]*cosa + fTN[1]*sina < 0) i1 = 5 - i1;
382
383//*-*- S E T O T H E R P O I N T S */
384 i2 = i1 % 4 + 1;
385 i3 = i2 % 4 + 1;
386 i4 = i3 % 4 + 1;
387
388//*-*- S E T A X I S V E R T I X E S */
389
390 av[4] = p[(i1 << 1) - 2];
391 av[5] = p[(i1 << 1) - 1];
392 av[7] = p[(i2 << 1) - 2];
393 av[8] = p[(i2 << 1) - 1];
394 av[10] = p[(i3 << 1) - 2];
395 av[11] = p[(i3 << 1) - 1];
396 av[13] = p[(i4 << 1) - 2];
397 av[14] = p[(i4 << 1) - 1];
398 for (i = 1; i <= 4; ++i) {
399 av[i*3 + 3] = fRmin[2];
400 av[i*3 + 13] = av[i*3 + 1];
401 av[i*3 + 14] = av[i*3 + 2];
402 av[i*3 + 15] = fRmax[2];
403 }
404
405//*-*- S E T A X I S
406
407 if (av[4] == av[7]) ix = 2;
408 if (av[5] == av[8]) ix = 1;
409 iy = 3 - ix;
410//*-*- X - A X I S
411 ix1 = ix;
412 if (av[ix*3 + 1] > av[(ix + 1)*3 + 1]) ix1 = ix + 1;
413 ix2 = (ix << 1) - ix1 + 1;
414//*-*- Y - A X I S
415 iy1 = iy;
416 if (av[iy*3 + 2] > av[(iy + 1)*3 + 2]) iy1 = iy + 1;
417 iy2 = (iy << 1) - iy1 + 1;
418//*-*- Z - A X I S
419 iz1 = 1;
420 iz2 = 5;
421
422 if (fTN[10] >= 0) return;
423 k = (ix1 - 1)*3 + ix2;
424 if (k%2) return;
425 if (k == 2) {
426 ix1 = 4;
427 ix2 = 3;
428 }
429 if (k == 4) {
430 ix1 = 3;
431 ix2 = 4;
432 }
433 if (k == 6) {
434 ix1 = 1;
435 ix2 = 4;
436 }
437 if (k == 8) {
438 ix1 = 4;
439 ix2 = 1;
440 }
441
442 k = (iy1 - 1)*3 + iy2;
443 if (k%2) return;
444 if (k == 2) {
445 iy1 = 4;
446 iy2 = 3;
447 return;
448 }
449 if (k == 4) {
450 iy1 = 3;
451 iy2 = 4;
452 return;
453 }
454 if (k == 6) {
455 iy1 = 1;
456 iy2 = 4;
457 return;
458 }
459 if (k == 8) {
460 iy1 = 4;
461 iy2 = 1;
462 }
463}
const Double_t kRad
Definition: BesTView.cxx:34

◆ Centered()

void BesTView::Centered ( )
inlinevirtual

Reimplemented in Bes2DView, and BesView.

Definition at line 176 of file BesTView.h.

virtual void Centered3DImages(TVirtualPad *pad=0)
Definition: BesTView.cxx:1753

Referenced by Bes2DView::Centered(), and BesView::Centered().

◆ Centered3DImages()

void BesTView::Centered3DImages ( TVirtualPad *  pad = 0)
virtual

Definition at line 1753 of file BesTView.cxx.

1754{
1755 // Move view into the center of the scene
1756
1757 Double_t min[3],max[3];
1758 GetRange(min,max);
1759 int i;
1760 for (i=0;i<3; i++) {
1761 if (max[i] > 0) min[i] = -max[i];
1762 else max[i] = -min[i];
1763 }
1764 SetRange(min,max);
1765 AdjustPad(pad);
1766}

Referenced by Centered().

◆ ClassDef()

BesTView::ClassDef ( BesTView  ,
 
)

◆ DefinePerspectiveView()

void BesTView::DefinePerspectiveView ( )
virtual

Definition at line 466 of file BesTView.cxx.

467{
468//*-*-*-*-*-*-*-*-*-*-*-*-*-*Define perspective view *-*-*-*-*-*-*-*-*-*-*
469//*-* ================================================ *
470//*-* *
471//*-* Compute transformation matrix from world coordinates *
472//*-* to normalised coordinates (-1 to +1) *
473// Input :
474// theta, phi - spherical angles giving the direction of projection
475// psi - screen rotation angle
476// cov[3] - center of view
477// dview - distance from COV to COP (center of projection)
478// umin, umax, vmin, vmax - view window in projection plane
479// dproj - distance from COP to projection plane
480// bcut, fcut - backward/forward range w.r.t projection plane (fcut<=0)
481// Output :
482// nper[16] - normalizing transformation
483// compute tr+rot to get COV in origin, view vector parallel to -Z axis, up vector
484// parallel to Y.
485// ^Yv UP ^ proj. plane
486// | | /|
487// | | / |
488// | dproj / x--- center of window (COW)
489// COV |----------|--x--|------------> Zv
490// / | VRP'z
491// / ---> | /
492// / VPN |/
493// Xv
494//
495// 1 - translate COP to origin of MARS : Tper = T(-copx, -copy, -copz)
496// 2 - rotate VPN : R = Rz(-psi)*Rx(-theta)*Rz(-phi) (inverse Euler)
497// 3 - left-handed screen reference to right-handed one of MARS : Trl
498//
499// T12 = Tper*R*Trl
500//
501 Double_t t12[16];
502 Double_t cov[3];
503 Int_t i;
504 for (i=0; i<3; i++) cov[i] = 0.5*(fRmax[i]+fRmin[i]);
505
506 Double_t c1 = TMath::Cos(fPsi*kRad);
507 Double_t s1 = TMath::Sin(fPsi*kRad);
508 Double_t c2 = TMath::Cos(fLatitude*kRad);
509 Double_t s2 = TMath::Sin(fLatitude*kRad);
510 Double_t s3 = TMath::Cos(fLongitude*kRad);
511 Double_t c3 = -TMath::Sin(fLongitude*kRad);
512
513 t12[0] = c1*c3 - s1*c2*s3;
514 t12[4] = c1*s3 + s1*c2*c3;
515 t12[8] = s1*s2;
516 t12[3] = 0;
517
518 t12[1] = -s1*c3 - c1*c2*s3;
519 t12[5] = -s1*s3 + c1*c2*c3;
520 t12[9] = c1*s2;
521 t12[7] = 0;
522
523 t12[2] = s2*s3;
524 t12[6] = -s2*c3;
525 t12[10] = c2; // contains Trl
526 t12[11] = 0;
527
528 // translate with -COP (before rotation):
529 t12[12] = -(cov[0]*t12[0]+cov[1]*t12[4]+cov[2]*t12[8]);
530 t12[13] = -(cov[0]*t12[1]+cov[1]*t12[5]+cov[2]*t12[9]);
531 t12[14] = -(cov[0]*t12[2]+cov[1]*t12[6]+cov[2]*t12[10]);
532 t12[15] = 1;
533
534 // translate with (0, 0, -dview) after rotation
535
536 t12[14] -= fDview;
537
538 // reflection on Z :
539 t12[2] *= -1;
540 t12[6] *= -1;
541 t12[10] *= -1;
542 t12[14] *= -1;
543
544 // Now we shear the center of window from (0.5*(umin+umax), 0.5*(vmin+vmax), dproj)
545 // to (0, 0, dproj)
546
547 Double_t a2 = -fUVcoord[0]/fDproj; // shear coef. on x
548 Double_t b2 = -fUVcoord[1]/fDproj; // shear coef. on y
549
550 // | 1 0 0 0 |
551 // SHz(a2,b2) = | 0 1 0 0 |
552 // | a2 b2 1 0 |
553 // | 0 0 0 1 |
554
555 fTnorm[0] = t12[0] + a2*t12[2];
556 fTnorm[1] = t12[1] + b2*t12[2];
557 fTnorm[2] = t12[2];
558 fTnorm[3] = 0;
559
560 fTnorm[4] = t12[4] + a2*t12[6];
561 fTnorm[5] = t12[5] + b2*t12[6];
562 fTnorm[6] = t12[6];
563 fTnorm[7] = 0;
564
565 fTnorm[8] = t12[8] + a2*t12[10];
566 fTnorm[9] = t12[9] + b2*t12[10];
567 fTnorm[10] = t12[10];
568 fTnorm[11] = 0;
569
570 fTnorm[12] = t12[12] + a2*t12[14];
571 fTnorm[13] = t12[13] + b2*t12[14];
572 fTnorm[14] = t12[14];
573 fTnorm[15] = 1;
574
575 // Scale so that the view volume becomes the canonical one
576 //
577 // Sper = (2/(umax-umin), 2/(vmax-vmin), 1/dproj
578 //
579 Double_t sz = 1./fDproj;
580 Double_t sx = 1./fUVcoord[2];
581 Double_t sy = 1./fUVcoord[3];
582
583 fTnorm[0] *= sx;
584 fTnorm[4] *= sx;
585 fTnorm[8] *= sx;
586 fTnorm[1] *= sy;
587 fTnorm[5] *= sy;
588 fTnorm[9] *= sy;
589 fTnorm[2] *= sz;
590 fTnorm[6] *= sz;
591 fTnorm[10] *= sz;
592 fTnorm[12] *= sx;
593 fTnorm[13] *= sy;
594 fTnorm[14] *= sz;
595}
TCanvas * c1
Definition: tau_mode.c:75

Referenced by DefineViewDirection(), MoveFocus(), MoveWindow(), ResetView(), ResizePad(), ZoomIn(), and ZoomOut().

◆ DefineViewDirection()

void BesTView::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

Definition at line 600 of file BesTView.cxx.

605{
606//*-*-*-*-*-*-*-*-*Define view direction (in spherical coordinates)-*-*-*-*
607//*-* ================================================ *
608//*-* *
609//*-* Compute transformation matrix from world coordinates *
610//*-* to normalised coordinates (-1 to +1) *
611//*-* *
612//*-* Input: S(3) - scale factors *
613//*-* C(3) - centre of scope *
614//*-* COSPHI - longitude COS *
615//*-* SINPHI - longitude SIN *
616//*-* COSTHE - latitude COS (angle between +Z and view direc.) *
617//*-* SINTHE - latitude SIN *
618//*-* COSPSI - screen plane rotation angle COS *
619//*-* SINPSI - screen plane rotation angle SIN *
620//*-* *
621//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
622
623 if (IsPerspective()) {
625 return;
626 }
627 Int_t i, k;
628 Double_t tran[16] /* was [4][4] */, rota[16] /* was [4][4] */;
629 Double_t c1, c2, c3, s1, s2, s3, scalex, scaley, scalez;
630
631 /* Parameter adjustments */
632 tback -= 5;
633 tnorm -= 5;
634
635 scalex = s[0];
636 scaley = s[1];
637 scalez = s[2];
638
639//*-*- S E T T R A N S L A T I O N M A T R I X
640
641 tran[0] = 1 / scalex;
642 tran[1] = 0;
643 tran[2] = 0;
644 tran[3] = -c[0] / scalex;
645
646 tran[4] = 0;
647 tran[5] = 1 / scaley;
648 tran[6] = 0;
649 tran[7] = -c[1] / scaley;
650
651 tran[8] = 0;
652 tran[9] = 0;
653 tran[10] = 1 / scalez;
654 tran[11] = -c[2] / scalez;
655
656 tran[12] = 0;
657 tran[13] = 0;
658 tran[14] = 0;
659 tran[15] = 1;
660
661//*-*- S E T R O T A T I O N M A T R I X
662
663// ( C(PSI) S(PSI) 0) (1 0 0 ) ( C(90+PHI) S(90+PHI) 0)
664// (-S(PSI) C(PSI) 0) * (0 C(THETA) S(THETA)) * (-S(90+PHI) C(90+PHI) 0)
665// ( 0 0 1) (0 -S(THETA) C(THETA)) ( 0 0 1)
666
667 c1 = cospsi;
668 s1 = sinpsi;
669 c2 = costhe;
670 s2 = sinthe;
671 c3 = -sinphi;
672 s3 = cosphi;
673
674 rota[0] = c1*c3 - s1*c2*s3;
675 rota[1] = c1*s3 + s1*c2*c3;
676 rota[2] = s1*s2;
677 rota[3] = 0;
678
679 rota[4] = -s1*c3 - c1* c2*s3;
680 rota[5] = -s1*s3 + c1* c2*c3;
681 rota[6] = c1*s2;
682 rota[7] = 0;
683
684 rota[8] = s2*s3;
685 rota[9] = -s2*c3;
686 rota[10] = c2;
687 rota[11] = 0;
688
689 rota[12] = 0;
690 rota[13] = 0;
691 rota[14] = 0;
692 rota[15] = 1;
693
694//*-*- F I N D T R A N S F O R M A T I O N M A T R I X
695
696 for (i = 1; i <= 3; ++i) {
697 for (k = 1; k <= 4; ++k) {
698 tnorm[k + (i << 2)] = rota[(i << 2) - 4]*tran[k - 1] + rota[(i
699 << 2) - 3]*tran[k + 3] + rota[(i << 2) - 2]*tran[k +7]
700 + rota[(i << 2) - 1]*tran[k + 11];
701 }
702 }
703
704//*-*- S E T B A C K T R A N S L A T I O N M A T R I X
705
706 tran[0] = scalex;
707 tran[3] = c[0];
708
709 tran[5] = scaley;
710 tran[7] = c[1];
711
712 tran[10] = scalez;
713 tran[11] = c[2];
714
715//*-*- F I N D B A C K T R A N S F O R M A T I O N
716
717 for (i = 1; i <= 3; ++i) {
718 for (k = 1; k <= 4; ++k) {
719 tback[k + (i << 2)] = tran[(i << 2) - 4]*rota[(k << 2) - 4] +
720 tran[(i << 2) - 3]*rota[(k << 2) - 3] + tran[(i << 2) -2]
721 *rota[(k << 2) - 2] + tran[(i << 2) - 1]*rota[(k <<2) - 1];
722 }
723 }
724}
XmlRpcServer s
Definition: HelloServer.cpp:11
virtual void DefinePerspectiveView()
Definition: BesTView.cxx:466
Bool_t IsPerspective() const
Definition: BesTView.h:113

Referenced by ResetView().

◆ DrawOutlineCube()

void BesTView::DrawOutlineCube ( TList *  outline,
Double_t *  rmin,
Double_t *  rmax 
)
virtual

Definition at line 728 of file BesTView.cxx.

729{
730 // Draw the outline of a cube while rotaing a 3-d object in the pad.
731
732 TPolyLine3D::DrawOutlineCube(outline,rmin,rmax);
733}

Referenced by SetOutlineToCube().

◆ ExecuteEvent()

void BesTView::ExecuteEvent ( Int_t  event,
Int_t  px,
Int_t  py 
)
virtual

Reimplemented in Bes2DView, and BesView.

Definition at line 737 of file BesTView.cxx.

738{
739//*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*-*-*-*-*-*
740
741 ExecuteRotateView(event,px,py);
742}
virtual void ExecuteRotateView(Int_t event, Int_t px, Int_t py)
Definition: BesTView.cxx:745

◆ ExecuteRotateView()

void BesTView::ExecuteRotateView ( Int_t  event,
Int_t  px,
Int_t  py 
)
virtual

Definition at line 745 of file BesTView.cxx.

746{
747//*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*-*-*-*-*-*-*
748//*-* ========================================= *
749//*-* This member function is called when a object is clicked with the locator *
750//*-* *
751//*-* If Left button clicked in the object area, while the button is kept down *
752//*-* the cube representing the surrounding frame for the corresponding *
753//*-* new latitude and longitude position is drawn. *
754//*-* *
755//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
756 static Int_t system, framewasdrawn;
757 static Double_t xrange, yrange, xmin, ymin, longitude1, latitude1, longitude2, latitude2;
758 static Double_t newlatitude, newlongitude, oldlatitude, oldlongitude;
759 Double_t dlatitude, dlongitude, x, y;
760 Int_t irep = 0;
761 Double_t psideg;
762
763 // all coordinate transformation are from absolute to relative
764
765 if (!gPad->IsEditable()) return;
766 gPad->AbsCoordinates(kTRUE);
767
768 switch (event) {
769
770 case kKeyPress :
771 fChanged = kTRUE;
772 MoveViewCommand(Char_t(px), py);
773 break;
774
775 case kMouseMotion:
776 gPad->SetCursor(kRotate);
777 break;
778
779 case kButton1Down:
780
781 // remember position of the cube
782 xmin = gPad->GetX1();
783 ymin = gPad->GetY1();
784 xrange = gPad->GetX2() - xmin;
785 yrange = gPad->GetY2() - ymin;
786 x = gPad->PixeltoX(px);
787 y = gPad->PixeltoY(py);
788 system = GetSystem();
789 framewasdrawn = 0;
790 if (system == kCARTESIAN || system == kPOLAR || IsPerspective()) {
791 longitude1 = 180*(x-xmin)/xrange;
792 latitude1 = 90*(y-ymin)/yrange;
793 } else {
794 latitude1 = 90*(x-xmin)/xrange;
795 longitude1 = 180*(y-ymin)/yrange;
796 }
797 newlongitude = oldlongitude = -90 - gPad->GetPhi();
798 newlatitude = oldlatitude = 90 - gPad->GetTheta();
799 psideg = GetPsi();
800
801 // if outline isn't set, make it look like a cube
802 if(!fOutline)
804 break;
805
806 case kButton1Motion:
807 {
808 // draw the surrounding frame for the current mouse position
809 // first: Erase old frame
810 fChanged = kTRUE;
811 if (framewasdrawn) fOutline->Paint();
812 framewasdrawn = 1;
813 x = gPad->PixeltoX(px);
814 y = gPad->PixeltoY(py);
815 if (system == kCARTESIAN || system == kPOLAR || IsPerspective()) {
816 longitude2 = 180*(x-xmin)/xrange;
817 latitude2 = 90*(y-ymin)/yrange;
818 } else {
819 latitude2 = 90*(x-xmin)/xrange;
820 longitude2 = 180*(y-ymin)/yrange;
821 }
822 dlongitude = longitude2 - longitude1;
823 dlatitude = latitude2 - latitude1;
824 newlatitude = oldlatitude + dlatitude;
825 newlongitude = oldlongitude - dlongitude;
826 psideg = GetPsi();
827 ResetView(newlongitude, newlatitude, psideg, irep);
828 fOutline->Paint();
829
830 break;
831 }
832 case kButton1Up:
833 if (gROOT->IsEscaped()) {
834 gROOT->SetEscape(kFALSE);
835 break;
836 }
837
838 // Temporary fix for 2D drawing problems on pad. fOutline contains
839 // a TPolyLine3D object for the rotation box. This will be painted
840 // through a newly created TViewer3DPad instance, which is left
841 // behind on pad. This remaining creates 2D drawing problems.
842 //
843 // This is a TEMPORARY fix - will be removed when proper multiple viewers
844 // on pad problems are resolved.
845 if (gPad) {
846 TVirtualViewer3D *viewer = gPad->GetViewer3D();
847 if (viewer && !strcmp(viewer->IsA()->GetName(),"TView3Der3DPad")) {
848 gPad->ReleaseViewer3D();
849 delete viewer;
850 }
851 }
852 // End fix
853
854 // Recompute new view matrix and redraw
855 psideg = GetPsi();
856 SetView(newlongitude, newlatitude, psideg, irep);
857 gPad->SetPhi(-90-newlongitude);
858 gPad->SetTheta(90-newlatitude);
859 gPad->Modified(kTRUE);
860
861 // Set line color, style and width
862 gVirtualX->SetLineColor(-1);
863 gVirtualX->SetLineStyle(-1);
864 gVirtualX->SetLineWidth(-1);
865 break;
866 }
867
868 // set back to default transformation mode
869 gPad->AbsCoordinates(kFALSE);
870}
Double_t x[10]
Int_t GetSystem()
Definition: BesTView.h:105
virtual void SetOutlineToCube()
Definition: BesTView.cxx:1396
Double_t GetPsi()
Definition: BesTView.h:96
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
Definition: BesTView.cxx:1525
virtual void MoveViewCommand(Char_t chCode, Int_t count=1)
Definition: BesTView.cxx:1853

Referenced by ExecuteEvent(), and BesView::ExecuteEvent().

◆ FindNormal()

void BesTView::FindNormal ( Double_t  x,
Double_t  y,
Double_t  z,
Double_t &  zn 
)
virtual

Definition at line 874 of file BesTView.cxx.

875{
876//*-*-*-*-*-*-*Find Z component of NORMAL in normalized coordinates-*-*-*-*
877//*-* ==================================================== *
878//*-* *
879//*-* Input: X - X-component of NORMAL *
880//*-* Y - Y-component of NORMAL *
881//*-* Z - Z-component of NORMAL *
882//*-* *
883//*-* Output: ZN - Z-component of NORMAL in normalized coordinates *
884//*-* *
885//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
886
887 zn = x*(fTN[1] * fTN[6] - fTN[2] * fTN[5]) + y*(fTN[2] * fTN[4] -
888 fTN[0] * fTN[6]) + z*(fTN[0] * fTN[5] - fTN[1] * fTN[4]);
889}

Referenced by FindThetaSectors().

◆ FindPhiSectors()

void BesTView::FindPhiSectors ( Int_t  iopt,
Int_t &  kphi,
Double_t *  aphi,
Int_t &  iphi1,
Int_t &  iphi2 
)
virtual

Definition at line 892 of file BesTView.cxx.

893{
894//*-*-*-*-*-*-*-*-*-*-*-*-*Find critical PHI sectors*-*-*-*-*-*-*-*-*-*-*-*
895//*-* ========================= *
896//*-* *
897//*-* Input: IOPT - options: 1 - from BACK to FRONT 'BF' *
898//*-* 2 - from FRONT to BACK 'FB' *
899//*-* KPHI - number of phi sectors *
900//*-* APHI(*) - PHI separators (modified internally) *
901//*-* *
902//*-* Output: IPHI1 - initial sector *
903//*-* IPHI2 - final sector *
904//*-* *
905//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
906
907 Int_t iphi[2], i, k;
908 Double_t dphi;
909 Double_t x1, x2, z1, z2, phi1, phi2;
910
911 /* Parameter adjustments */
912 --aphi;
913
914 if (aphi[kphi + 1] == aphi[1]) aphi[kphi + 1] += 360;
915 dphi = TMath::Abs(aphi[kphi + 1] - aphi[1]);
916 if (dphi != 360) {
917 aphi[kphi + 2] = (aphi[1] + aphi[kphi + 1]) / (float)2. + 180;
918 aphi[kphi + 3] = aphi[1] + 360;
919 kphi += 2;
920 }
921
922 //*-*- F I N D C R I T I C A L S E C T O R S
923
924 k = 0;
925 for (i = 1; i <= kphi; ++i) {
926 phi1 = kRad*aphi[i];
927 phi2 = kRad*aphi[i + 1];
928 x1 = fTN[0]*TMath::Cos(phi1) + fTN[1]*TMath::Sin(phi1);
929 x2 = fTN[0]*TMath::Cos(phi2) + fTN[1]*TMath::Sin(phi2);
930 if (x1 >= 0 && x2 > 0) continue;
931 if (x1 <= 0 && x2 < 0) continue;
932 ++k;
933 if (k == 3) break;
934 iphi[k - 1] = i;
935 }
936 if (k != 2) {
937 Error("FindPhiSectors", "something strange: num. of critical sector not equal 2");
938 iphi1 = 1;
939 iphi2 = 2;
940 return;
941 }
942
943 //*-*- F I N D O R D E R O F C R I T I C A L S E C T O R S
944
945 phi1 = kRad*(aphi[iphi[0]] + aphi[iphi[0] + 1]) / (float)2.;
946 phi2 = kRad*(aphi[iphi[1]] + aphi[iphi[1] + 1]) / (float)2.;
947 z1 = fTN[8]*TMath::Cos(phi1) + fTN[9]*TMath::Sin(phi1);
948 z2 = fTN[8]*TMath::Cos(phi2) + fTN[9]*TMath::Sin(phi2);
949 if ((z1 <= z2 && iopt == 1) || (z1 > z2 && iopt == 2)) {
950 iphi1 = iphi[0];
951 iphi2 = iphi[1];
952 } else {
953 iphi1 = iphi[1];
954 iphi2 = iphi[0];
955 }
956}
Double_t phi2
Double_t phi1

◆ FindScope()

void BesTView::FindScope ( Double_t *  scale,
Double_t *  center,
Int_t &  irep 
)
virtual

Definition at line 1030 of file BesTView.cxx.

1031{
1032//*-*-*-*-*-*-*-*Find centre of a MIN-MAX scope and scale factors-*-*-*-*-*
1033//*-* ================================================ *
1034//*-* *
1035//*-* Output: SCALE(3) - scale factors *
1036//*-* CENTER(3) - centre *
1037//*-* IREP - reply (-1 if error in min-max) *
1038//*-* *
1039//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1040
1041 irep = 0;
1042 Double_t sqrt3 = 0.5*TMath::Sqrt(3.0);
1043
1044 for (Int_t i = 0; i < 3; i++) {
1045 if (fRmin[i] >= fRmax[i]) { irep = -1; return;}
1046 scale[i] = sqrt3*(fRmax[i] - fRmin[i]);
1047 center[i] = 0.5*(fRmax[i] + fRmin[i]);
1048 }
1049}

Referenced by ResetView().

◆ FindThetaSectors()

void BesTView::FindThetaSectors ( Int_t  iopt,
Double_t  phi,
Int_t &  kth,
Double_t *  ath,
Int_t &  ith1,
Int_t &  ith2 
)
virtual

Definition at line 959 of file BesTView.cxx.

960{
961//*-*-*-*-*-*-*-Find critical THETA sectors for given PHI sector*-*-*-*-*-*
962//*-* ================================================ *
963//*-* *
964//*-* Input: IOPT - options: 1 - from BACK to FRONT 'BF' *
965//*-* 2 - from FRONT to BACK 'FB' *
966//*-* PHI - PHI sector *
967//*-* KTH - number of THETA sectors *
968//*-* ATH(*) - THETA separators (modified internally) *
969//*-* *
970//*-* Output: ITH1 - initial sector *
971//*-* ITH2 - final sector *
972//*-* *
973//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
974
975 Int_t i, k, ith[2];
976 Double_t z1, z2, cosphi, sinphi, tncons, th1, th2, dth;
977
978 /* Parameter adjustments */
979 --ath;
980
981 /* Function Body */
982 dth = TMath::Abs(ath[kth + 1] - ath[1]);
983 if (dth != 360) {
984 ath[kth + 2] = 0.5*(ath[1] + ath[kth + 1]) + 180;
985 ath[kth + 3] = ath[1] + 360;
986 kth += 2;
987 }
988
989 //*-*- F I N D C R I T I C A L S E C T O R S
990
991 cosphi = TMath::Cos(phi*kRad);
992 sinphi = TMath::Sin(phi*kRad);
993 k = 0;
994 for (i = 1; i <= kth; ++i) {
995 th1 = kRad*ath[i];
996 th2 = kRad*ath[i + 1];
997 FindNormal(TMath::Cos(th1)*cosphi, TMath::Cos(th1)*sinphi, -TMath::Sin(th1), z1);
998 FindNormal(TMath::Cos(th2)*cosphi, TMath::Cos(th2)*sinphi, -TMath::Sin(th2), z2);
999 if (z1 >= 0 && z2 > 0) continue;
1000 if (z1 <= 0 && z2 < 0) continue;
1001 ++k;
1002 if (k == 3) break;
1003 ith[k - 1] = i;
1004 }
1005 if (k != 2) {
1006 Error("FindThetaSectors", "Something strange: num. of critical sectors not equal 2");
1007 ith1 = 1;
1008 ith2 = 2;
1009 return;
1010 }
1011
1012 //*-*- F I N D O R D E R O F C R I T I C A L S E C T O R S
1013
1014 tncons = fTN[8]*TMath::Cos(phi*kRad) + fTN[9]*TMath::Sin(phi*kRad);
1015 th1 = kRad*(ath[ith[0]] + ath[ith[0] + 1]) / (float)2.;
1016 th2 = kRad*(ath[ith[1]] + ath[ith[1] + 1]) / (float)2.;
1017 z1 = tncons*TMath::Sin(th1) + fTN[10]*TMath::Cos(th1);
1018 z2 = tncons*TMath::Sin(th2) + fTN[10]*TMath::Cos(th2);
1019 if ((z1 <= z2 && iopt == 1) || (z1 > z2 && iopt == 2)) {
1020 ith1 = ith[0];
1021 ith2 = ith[1];
1022 } else {
1023 ith1 = ith[1];
1024 ith2 = ith[0];
1025 }
1026}
virtual void FindNormal(Double_t x, Double_t y, Double_t z, Double_t &zn)
Definition: BesTView.cxx:874

◆ Front()

void BesTView::Front ( )
inlinevirtual

Reimplemented in Bes2DView, and BesView.

Definition at line 177 of file BesTView.h.

177{FrontView();}
virtual void FrontView(TVirtualPad *pad=0)
Definition: BesTView.cxx:1705

Referenced by Bes2DView::Top(), and BesView::Top().

◆ FrontView()

void BesTView::FrontView ( TVirtualPad *  pad = 0)
virtual

Definition at line 1705 of file BesTView.cxx.

1706{
1707 // Set to front view.
1708 RotateView(270.0,90.0,pad);
1709}
virtual void RotateView(Double_t phi, Double_t theta, TVirtualPad *pad=0)
Definition: BesTView.cxx:1678

Referenced by Front().

◆ GetAutoRange()

Bool_t BesTView::GetAutoRange ( )
inline

Definition at line 93 of file BesTView.h.

93{return fAutoRange;}

◆ GetDistancetoAxis()

Int_t BesTView::GetDistancetoAxis ( Int_t  axis,
Int_t  px,
Int_t  py,
Double_t &  ratio 
)
virtual

Definition at line 1052 of file BesTView.cxx.

1053{
1054//*-*-*-*-*-*-*-*-*-*-*-*-*Return distance to axis from point px,py*-*-*-*
1055//*-* ========================================
1056//*-*
1057//*-*
1058//*-* Algorithm:
1059//*-*
1060//*-* A(x1,y1) P B(x2,y2)
1061//*-* ------------------------------------------------
1062//*-* I
1063//*-* I
1064//*-* I
1065//*-* I
1066//*-* M(x,y)
1067//*-*
1068//*-* Let us call a = distance AM A=a**2
1069//*-* b = distance BM B=b**2
1070//*-* c = distance AB C=c**2
1071//*-* d = distance PM D=d**2
1072//*-* u = distance AP U=u**2
1073//*-* v = distance BP V=v**2 c = u + v
1074//*-*
1075//*-* D = A - U
1076//*-* D = B - V = B -(c-u)**2
1077//*-* ==> u = (A -B +C)/2c
1078//*-*
1079//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1080
1081 Double_t x1,y1,x2,y2;
1082 Double_t x = px;
1083 Double_t y = py;
1084 ratio = 0;
1085
1086 if (fSystem != 1) return 9998; // only implemented for Cartesian coordinates
1087 if (axis == 1) {
1088 x1 = gPad->XtoAbsPixel(fX1[0]);
1089 y1 = gPad->YtoAbsPixel(fX1[1]);
1090 x2 = gPad->XtoAbsPixel(fX2[0]);
1091 y2 = gPad->YtoAbsPixel(fX2[1]);
1092 } else if (axis == 2) {
1093 x1 = gPad->XtoAbsPixel(fY1[0]);
1094 y1 = gPad->YtoAbsPixel(fY1[1]);
1095 x2 = gPad->XtoAbsPixel(fY2[0]);
1096 y2 = gPad->YtoAbsPixel(fY2[1]);
1097 } else {
1098 x1 = gPad->XtoAbsPixel(fZ1[0]);
1099 y1 = gPad->YtoAbsPixel(fZ1[1]);
1100 x2 = gPad->XtoAbsPixel(fZ2[0]);
1101 y2 = gPad->YtoAbsPixel(fZ2[1]);
1102 }
1103 Double_t xx1 = x - x1;
1104 Double_t xx2 = x - x2;
1105 Double_t x1x2 = x1 - x2;
1106 Double_t yy1 = y - y1;
1107 Double_t yy2 = y - y2;
1108 Double_t y1y2 = y1 - y2;
1109 Double_t a = xx1*xx1 + yy1*yy1;
1110 Double_t b = xx2*xx2 + yy2*yy2;
1111 Double_t c = x1x2*x1x2 + y1y2*y1y2;
1112 if (c <= 0) return 9999;
1113 Double_t v = TMath::Sqrt(c);
1114 Double_t u = (a - b + c)/(2*v);
1115 Double_t d = TMath::Abs(a - u*u);
1116
1117 Int_t dist = Int_t(TMath::Sqrt(d) - 0.5);
1118 ratio = u/v;
1119 return dist;
1120}
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35

◆ GetDproj()

Double_t BesTView::GetDproj ( ) const
inline

Definition at line 91 of file BesTView.h.

91{return fDproj;}

◆ GetDview()

Double_t BesTView::GetDview ( ) const
inline

Definition at line 90 of file BesTView.h.

90{return fDview;}

◆ GetExtent()

Double_t BesTView::GetExtent ( ) const

Definition at line 1123 of file BesTView.cxx.

1124{
1125//*-*-*-*-*-*-*-*-*-*-*-*-*-*Get maximum view extent-*-*-*-*-*-*-*-*-*-*-*-*-*
1126//*-* =======================
1127//*-*
1128 Double_t dx = 0.5*(fRmax[0]-fRmin[0]);
1129 Double_t dy = 0.5*(fRmax[1]-fRmin[1]);
1130 Double_t dz = 0.5*(fRmax[2]-fRmin[2]);
1131 Double_t extent = TMath::Sqrt(dx*dx+dy*dy+dz*dz);
1132 return extent;
1133}

Referenced by BesView::GetZoomRatio(), SetDefaultWindow(), ZoomIn(), and ZoomOut().

◆ GetLatitude()

Double_t BesTView::GetLatitude ( )
inline

◆ GetLongitude()

◆ GetOutline()

TSeqCollection * BesTView::GetOutline ( )
inline

Definition at line 101 of file BesTView.h.

101{return fOutline; }

◆ GetPsi()

◆ GetRange() [1/2]

void BesTView::GetRange ( Double_t *  min,
Double_t *  max 
)
virtual

Definition at line 1147 of file BesTView.cxx.

1148{
1149 // Get Range function.
1150
1151 for (Int_t i = 0; i < 3; max[i] = fRmax[i], min[i] = fRmin[i], i++) { }
1152}

◆ GetRange() [2/2]

void BesTView::GetRange ( Float_t *  min,
Float_t *  max 
)
virtual

Definition at line 1137 of file BesTView.cxx.

1138{
1139//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Get Range function-*-*-*-*-*-*-*-*-*-*-*-*-*
1140//*-* ==================
1141//*-*
1142 for (Int_t i = 0; i < 3; max[i] = fRmax[i], min[i] = fRmin[i], i++);
1143}

Referenced by AdjustScales(), Centered3DImages(), BesClient::GoHome(), Muc2DStrip::Paint(), BesClient::SetHome(), SetRange(), and ZoomView().

◆ GetRmax()

Double_t * BesTView::GetRmax ( )
inline

Definition at line 99 of file BesTView.h.

99{return fRmax;}

◆ GetRmin()

Double_t * BesTView::GetRmin ( )
inline

Definition at line 100 of file BesTView.h.

100{return fRmin;}

◆ GetSystem()

Int_t BesTView::GetSystem ( )
inline

Definition at line 105 of file BesTView.h.

105{return fSystem;}

Referenced by ExecuteRotateView().

◆ GetTback()

Double_t * BesTView::GetTback ( )
inline

Definition at line 102 of file BesTView.h.

102{return fTback;}

◆ GetTN()

Double_t * BesTView::GetTN ( )
inline

Definition at line 103 of file BesTView.h.

103{return fTN;}

◆ GetTnorm()

Double_t * BesTView::GetTnorm ( )
inline

Definition at line 104 of file BesTView.h.

104{return fTnorm;}

◆ GetWindow()

void BesTView::GetWindow ( Double_t &  u0,
Double_t &  v0,
Double_t &  du,
Double_t &  dv 
) const

Definition at line 1155 of file BesTView.cxx.

1156{
1157// Get current window extent.
1158 u0 = fUVcoord[0];
1159 v0 = fUVcoord[1];
1160 du = fUVcoord[2];
1161 dv = fUVcoord[3];
1162}

◆ GetWindowHeight()

Double_t BesTView::GetWindowHeight ( ) const
inline

Definition at line 108 of file BesTView.h.

108{return 0.5*(fUVcoord[3]-fUVcoord[2]);}

◆ GetWindowWidth()

Double_t BesTView::GetWindowWidth ( ) const
inline

Definition at line 107 of file BesTView.h.

107{return 0.5*(fUVcoord[1]-fUVcoord[0]);}

◆ IsClippedNDC()

Bool_t BesTView::IsClippedNDC ( Double_t *  p) const

Definition at line 1165 of file BesTView.cxx.

1166{
1167 //*-*-*-*-*-*-*Check if point is clipped in perspective view-*-*-*-*-*-*-*-*
1168 //*-* =============================================
1169 //*-*
1170 if (TMath::Abs(p[0])>p[2]) return kTRUE;
1171 if (TMath::Abs(p[1])>p[2]) return kTRUE;
1172 return kFALSE;
1173}

◆ IsPerspective()

◆ IsViewChanged()

Bool_t BesTView::IsViewChanged ( ) const
inline

Definition at line 114 of file BesTView.h.

114{return fChanged;}

◆ MoveFocus()

void BesTView::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 at line 1798 of file BesTView.cxx.

1800{
1801 // Move focus to a different box position and extent in nsteps. Perform rotation
1802// with dlat,dlong,dpsi at each step.
1803 if (!IsPerspective()) return;
1804 if (nsteps<1) return;
1805 Double_t fc = 1./Double_t(nsteps);
1806 Double_t oc[3], od[3], dir[3];
1807 dir[0] = 0;
1808 dir[1] = 0;
1809 dir[2] = 1.;
1810 Int_t i, j;
1811 for (i=0; i<3; i++) {
1812 oc[i] = 0.5*(fRmin[i]+fRmax[i]);
1813 od[i] = 0.5*(fRmax[i]-fRmin[i]);
1814 }
1815 Double_t dox = cov[0]-oc[0];
1816 Double_t doy = cov[1]-oc[1];
1817 Double_t doz = cov[2]-oc[2];
1818
1819 Double_t dd = TMath::Sqrt(dox*dox+doy*doy+doz*doz);
1820 if (dd!=0) {;
1821 dir[0] = dox/dd;
1822 dir[1] = doy/dd;
1823 dir[2] = doz/dd;
1824 }
1825 dd *= fc;
1826 dox = fc*(dx-od[0]);
1827 doy = fc*(dy-od[1]);
1828 doz = fc*(dz-od[2]);
1829 for (i=0; i<nsteps; i++) {
1830 oc[0] += dd*dir[0];
1831 oc[1] += dd*dir[1];
1832 oc[2] += dd*dir[2];
1833 od[0] += dox;
1834 od[1] += doy;
1835 od[2] += doz;
1836 for (j=0; j<3; j++) {
1837 fRmin[j] = oc[j]-od[j];
1838 fRmax[j] = oc[j]+od[j];
1839 }
1841 fLatitude += dlat;
1842 fLongitude += dlong;
1843 fPsi += dpsi;
1845 if (gPad) {
1846 gPad->Modified();
1847 gPad->Update();
1848 }
1849 }
1850}
void SetDefaultWindow()
Definition: BesTView.cxx:1375

◆ MoveViewCommand()

void BesTView::MoveViewCommand ( Char_t  chCode,
Int_t  count = 1 
)
virtual

Definition at line 1853 of file BesTView.cxx.

1854{
1855 //
1856 //*-* 'a' //*-* increase scale factor (clip cube borders)
1857 //*-* 's' //*-* decrease scale factor (clip cube borders)
1858 //
1859 if (count <= 0) count = 1;
1860 switch (option) {
1861 case '+':
1862 ZoomView();
1863 break;
1864 case '-':
1865 UnzoomView();
1866 break;
1867 case 's':
1868 case 'S':
1869 UnzoomView();
1870 break;
1871 case 'a':
1872 case 'A':
1873 ZoomView();
1874 break;
1875 case 'l':
1876 case 'L':
1877 case 'h':
1878 case 'H':
1879 case 'u':
1880 case 'U':
1881 case 'i':
1882 case 'I':
1883 MoveWindow(option);
1884 break;
1885 case 'j':
1886 case 'J':
1887 ZoomIn();
1888 break;
1889 case 'k':
1890 case 'K':
1891 ZoomOut();
1892 break;
1893 default:
1894 break;
1895 }
1896}
virtual void UnzoomView(TVirtualPad *pad=0, Double_t unZoomFactor=1.25)
Definition: BesTView.cxx:1769
virtual void ZoomView(TVirtualPad *pad=0, Double_t zoomFactor=1.25)
Definition: BesTView.cxx:1777
virtual void ZoomOut()
Definition: BesTView.cxx:1956
void MoveWindow(Char_t option)
Definition: BesTView.cxx:1899
virtual void ZoomIn()
Definition: BesTView.cxx:1937
uint32_t count(const node_t &list)
Definition: node.cxx:42

Referenced by ExecuteRotateView().

◆ MoveWindow()

void BesTView::MoveWindow ( Char_t  option)

Definition at line 1899 of file BesTView.cxx.

1900{
1901 // Move view window :
1902 // l,L - left
1903 // h,H - right
1904 // u,U - down
1905 // i,I - up
1906 if (!IsPerspective()) return;
1907 Double_t shiftu = 0.1*fUVcoord[2];
1908 Double_t shiftv = 0.1*fUVcoord[3];
1909 switch (option) {
1910 case 'l':
1911 case 'L':
1912 fUVcoord[0] += shiftu;
1913 break;
1914 case 'h':
1915 case 'H':
1916 fUVcoord[0] -= shiftu;
1917 break;
1918 case 'u':
1919 case 'U':
1920 fUVcoord[1] += shiftv;
1921 break;
1922 case 'i':
1923 case 'I':
1924 fUVcoord[1] -= shiftv;
1925 break;
1926 default:
1927 return;
1928 }
1930 if (gPad) {
1931 gPad->Modified();
1932 gPad->Update();
1933 }
1934}

Referenced by MoveViewCommand().

◆ NDCtoWC() [1/2]

void BesTView::NDCtoWC ( const Double_t *  pn,
Double_t *  pw 
)
virtual

Reimplemented in Bes2DView, and BesView.

Definition at line 1192 of file BesTView.cxx.

1193{
1194 //*-*-*-*-*-*-*Transfer point from normalized to world coordinates*-*-*-*-*
1195 //*-* =================================================== *
1196 //*-* *
1197 //*-* Input: PN(3) - point in world coordinate system *
1198 //*-* PW(3) - point in normalized coordinate system *
1199 //*-* *
1200 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1201
1202 pw[0] = fTback[0]*pn[0] + fTback[1]*pn[1] + fTback[2]*pn[2] + fTback[3];
1203 pw[1] = fTback[4]*pn[0] + fTback[5]*pn[1] + fTback[6]*pn[2] + fTback[7];
1204 pw[2] = fTback[8]*pn[0] + fTback[9]*pn[1] + fTback[10]*pn[2] + fTback[11];
1205}

◆ NDCtoWC() [2/2]

void BesTView::NDCtoWC ( const Float_t *  pn,
Float_t *  pw 
)
virtual

Reimplemented in Bes2DView, and BesView.

Definition at line 1176 of file BesTView.cxx.

1177{
1178 //*-*-*-*-*-*-*Transfer point from normalized to world coordinates*-*-*-*-*
1179 //*-* =================================================== *
1180 //*-* *
1181 //*-* Input: PN(3) - point in world coordinate system *
1182 //*-* PW(3) - point in normalized coordinate system *
1183 //*-* *
1184 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1185
1186 pw[0] = fTback[0]*pn[0] + fTback[1]*pn[1] + fTback[2]*pn[2] + fTback[3];
1187 pw[1] = fTback[4]*pn[0] + fTback[5]*pn[1] + fTback[6]*pn[2] + fTback[7];
1188 pw[2] = fTback[8]*pn[0] + fTback[9]*pn[1] + fTback[10]*pn[2] + fTback[11];
1189}

Referenced by Bes2DView::NDCtoWC(), and BesView::NDCtoWC().

◆ NormalWCtoNDC() [1/2]

void BesTView::NormalWCtoNDC ( const Double_t *  pw,
Double_t *  pn 
)
virtual

Definition at line 1238 of file BesTView.cxx.

1239{
1240 //*-*-*Transfer vector of NORMAL from word to normalized coodinates-*-*-*-*
1241 //*-* ============================================================
1242 //*-*
1243 //*-* Input: PW(3) - vector of NORMAL in word coordinate system
1244 //*-* PN(3) - vector of NORMAL in normalized coordinate system
1245 //*-*
1246 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1247
1248 Double_t x, y, z, a1, a2, a3, b1, b2, b3, c1, c2, c3;
1249
1250 x = pw[0];
1251 y = pw[1];
1252 z = pw[2];
1253 a1 = fTnorm[0];
1254 a2 = fTnorm[1];
1255 a3 = fTnorm[2];
1256 b1 = fTnorm[4];
1257 b2 = fTnorm[5];
1258 b3 = fTnorm[6];
1259 c1 = fTnorm[8];
1260 c2 = fTnorm[9];
1261 c3 = fTnorm[10];
1262 pn[0] = x*(b2*c3 - b3*c2) + y*(b3*c1 - b1*c3) + z*(b1*c2 - b2*c1);
1263 pn[1] = x*(c2*a3 - c3*a2) + y*(c3*a1 - c1*a3) + z*(c1*a2 - c2*a1);
1264 pn[2] = x*(a2*b3 - a3*b2) + y*(a3*b1 - a1*b3) + z*(a1*b2 - a2*b1);
1265}

◆ NormalWCtoNDC() [2/2]

void BesTView::NormalWCtoNDC ( const Float_t *  pw,
Float_t *  pn 
)
virtual

Definition at line 1208 of file BesTView.cxx.

1209{
1210 //*-*-*Transfer vector of NORMAL from word to normalized coodinates-*-*-*-*
1211 //*-* ============================================================
1212 //*-*
1213 //*-* Input: PW(3) - vector of NORMAL in word coordinate system
1214 //*-* PN(3) - vector of NORMAL in normalized coordinate system
1215 //*-*
1216 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1217
1218 Double_t x, y, z, a1, a2, a3, b1, b2, b3, c1, c2, c3;
1219
1220 x = pw[0];
1221 y = pw[1];
1222 z = pw[2];
1223 a1 = fTnorm[0];
1224 a2 = fTnorm[1];
1225 a3 = fTnorm[2];
1226 b1 = fTnorm[4];
1227 b2 = fTnorm[5];
1228 b3 = fTnorm[6];
1229 c1 = fTnorm[8];
1230 c2 = fTnorm[9];
1231 c3 = fTnorm[10];
1232 pn[0] = x*(b2*c3 - b3*c2) + y*(b3*c1 - b1*c3) + z*(b1*c2 - b2*c1);
1233 pn[1] = x*(c2*a3 - c3*a2) + y*(c3*a1 - c1*a3) + z*(c1*a2 - c2*a1);
1234 pn[2] = x*(a2*b3 - a3*b2) + y*(a3*b1 - a1*b3) + z*(a1*b2 - a2*b1);
1235}

◆ operator=()

BesTView & BesTView::operator= ( const BesTView tv)
protected

Definition at line 93 of file BesTView.cxx.

94{
95 // Assignment operator.
96
97 if (this!=&tv) {
98 TView::operator=(tv);
101 fPsi=tv.fPsi;
102 fDview=tv.fDview;
103 fDproj=tv.fDproj;
104 fUpix=tv.fUpix;
105 fVpix=tv.fVpix;
106 fSystem=tv.fSystem;
111 for(Int_t i=0; i<16; i++) {
112 fTN[i]=tv.fTN[i];
113 fTB[i]=tv.fTB[i];
114 fTnorm[i]=tv.fTnorm[i];
115 fTback[i]=tv.fTback[i];
116 }
117 for(Int_t i=0; i<3; i++) {
118 fRmax[i]=tv.fRmax[i];
119 fRmin[i]=tv.fRmin[i];
120 fX1[i]=tv.fX1[i];
121 fX2[i]=tv.fX2[i];
122 fY1[i]=tv.fY1[i];
123 fY2[i]=tv.fY2[i];
124 fZ1[i]=tv.fZ1[i];
125 fZ2[i]=tv.fZ2[i];
126 }
127 for(Int_t i=0; i<4; i++)
128 fUVcoord[i]=tv.fUVcoord[i];
129 }
130 return *this;
131}

◆ PadRange()

void BesTView::PadRange ( Int_t  rback)
virtual

Definition at line 1268 of file BesTView.cxx.

1269{
1270 //*-*-*-*-*Set the correct window size for lego and surface plots*-*-*-*-*
1271 //*-* ======================================================
1272 //*-*
1273 //*-* Set the correct window size for lego and surface plots.
1274 //*-* And draw the background if necessary.
1275 //*-*
1276 //*-* Input parameters:
1277 //*-*
1278 //*-* RBACK : Background colour
1279 //*-*
1280 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1281
1282 Int_t i, k;
1283 Double_t x, y, z, r1, r2, r3, xx, yy, smax[2];
1284 Double_t xgraf[6], ygraf[6];
1285
1286 for (i = 1; i <= 2; ++i) {
1287 smax[i - 1] = fTnorm[(i << 2) - 1];
1288 for (k = 1; k <= 3; ++k) {
1289 if (fTnorm[k + (i << 2) - 5] < 0) {
1290 smax[i - 1] += fTnorm[k + (i << 2) - 5]*fRmin[k-1];
1291 } else {
1292 smax[i - 1] += fTnorm[k + (i << 2) - 5]*fRmax[k-1];
1293 }
1294 }
1295 }
1296
1297 //*-*- Compute x,y range
1298 Double_t xmin = -smax[0];
1299 Double_t xmax = smax[0];
1300 Double_t ymin = -smax[1];
1301 Double_t ymax = smax[1];
1302 Double_t dx = xmax-xmin;
1303 Double_t dy = ymax-ymin;
1304 Double_t dxr = dx/(1 - gPad->GetLeftMargin() - gPad->GetRightMargin());
1305 Double_t dyr = dy/(1 - gPad->GetBottomMargin() - gPad->GetTopMargin());
1306
1307 // Range() could change the size of the pad pixmap and therefore should
1308 // be called before the other paint routines
1309 gPad->Range(xmin - dxr*gPad->GetLeftMargin(),
1310 ymin - dyr*gPad->GetBottomMargin(),
1311 xmax + dxr*gPad->GetRightMargin(),
1312 ymax + dyr*gPad->GetTopMargin());
1313 gPad->RangeAxis(xmin, ymin, xmax, ymax);
1314
1315 //*-*- Draw the background if necessary
1316
1317 if (rback > 0) {
1318 r1 = -1;
1319 r2 = -1;
1320 r3 = -1;
1321 xgraf[0] = -smax[0];
1322 xgraf[1] = -smax[0];
1323 xgraf[2] = -smax[0];
1324 xgraf[3] = -smax[0];
1325 xgraf[4] = smax[0];
1326 xgraf[5] = smax[0];
1327 ygraf[0] = -smax[1];
1328 ygraf[1] = smax[1];
1329 ygraf[2] = -smax[1];
1330 ygraf[3] = smax[1];
1331 ygraf[5] = smax[1];
1332 ygraf[4] = -smax[1];
1333 for (i = 1; i <= 8; ++i) {
1334 x = 0.5*((1 - r1)*fRmin[0] + (r1 + 1)*fRmax[0]);
1335 y = 0.5*((1 - r2)*fRmin[1] + (r2 + 1)*fRmax[1]);
1336 z = 0.5*((1 - r3)*fRmin[2] + (r3 + 1)*fRmax[2]);
1337 xx = fTnorm[0]*x + fTnorm[1]*y + fTnorm[2]*z + fTnorm[3];
1338 yy = fTnorm[4]*x + fTnorm[5]*y + fTnorm[6]*z + fTnorm[7];
1339 if (TMath::Abs(xx - xgraf[1]) <= 1e-4) {
1340 if (ygraf[1] >= yy) ygraf[1] = yy;
1341 if (ygraf[2] <= yy) ygraf[2] = yy;
1342 }
1343 if (TMath::Abs(xx - xgraf[5]) <= 1e-4) {
1344 if (ygraf[5] >= yy) ygraf[5] = yy;
1345 if (ygraf[4] <= yy) ygraf[4] = yy;
1346 }
1347 if (TMath::Abs(yy - ygraf[0]) <= 1e-4) xgraf[0] = xx;
1348 if (TMath::Abs(yy - ygraf[3]) <= 1e-4) xgraf[3] = xx;
1349 r1 = -r1;
1350 if (i % 2 == 0) r2 = -r2;
1351 if (i >= 4) r3 = 1;
1352 }
1353 gPad->PaintFillArea(6, xgraf, ygraf);
1354 }
1355}

◆ ResetView()

void BesTView::ResetView ( Double_t  longitude,
Double_t  latitude,
Double_t  psi,
Int_t &  irep 
)
protected

Definition at line 1553 of file BesTView.cxx.

1554{
1555 //*-*-*-*-*-*-*-*-*Set view direction (in spherical coordinates)*-*-*-*-*-*
1556 //*-* ============================================= *
1557 //*-* *
1558 //*-* Input PHI - longitude *
1559 //*-* THETA - latitude (angle between +Z and view direction) *
1560 //*-* PSI - rotation in screen plane *
1561 //*-* *
1562 //*-* Output: IREP - reply (-1 if error in min-max) *
1563 //*-* *
1564 //*-* Errors: error in min-max scope *
1565 //*-* *
1566 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1567
1568 Double_t scale[3], centre[3];
1569 Double_t c1, c2, c3, s1, s2, s3;
1570
1571 //*-*- F I N D C E N T E R O F S C O P E A N D
1572 //*-*- S C A L E F A C T O R S
1573
1574 FindScope(scale, centre, irep);
1575 if (irep < 0) {
1576 Error("ResetView", "Error in min-max scope");
1577 return;
1578 }
1579
1580 //*-*- S E T T R A N S F O R M A T I O N M A T R I C E S
1581
1582
1583 fLongitude = longitude;
1584 fPsi = psi;
1585 fLatitude = latitude;
1586
1587 if (IsPerspective()) {
1589 return;
1590 }
1591
1592 c1 = TMath::Cos(longitude*kRad);
1593 s1 = TMath::Sin(longitude*kRad);
1594 c2 = TMath::Cos(latitude*kRad);
1595 s2 = TMath::Sin(latitude*kRad);
1596 c3 = TMath::Cos(psi*kRad);
1597 s3 = TMath::Sin(psi*kRad);
1598 DefineViewDirection(scale, centre, c1, s1, c2, s2, c3, s3, fTnorm, fTback);
1599 c3 = 1;
1600 s3 = 0;
1601 DefineViewDirection(scale, centre, c1, s1, c2, s2, c3, s3, fTN, fTB);
1602}
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 FindScope(Double_t *scale, Double_t *center, Int_t &irep)
Definition: BesTView.cxx:1030

Referenced by BesTView(), ExecuteRotateView(), SetParallel(), SetPerspective(), SetRange(), and SetView().

◆ ResizePad()

void BesTView::ResizePad ( )

Definition at line 1533 of file BesTView.cxx.

1534{
1535 // Recompute window for perspective view
1536
1537 if (!IsPerspective()) return;
1538 Double_t upix = fUpix;
1539 Double_t vpix = fVpix;
1540 // widh in pixels
1541 fUpix = gPad->GetWw()*gPad->GetAbsWNDC();
1542 // height in pixels
1543 fVpix = gPad->GetWh()*gPad->GetAbsHNDC();
1544 Double_t u0 = fUVcoord[0]*fUpix/upix;
1545 Double_t v0 = fUVcoord[1]*fVpix/vpix;
1546 Double_t du = fUVcoord[2]*fUpix/upix;
1547 Double_t dv = fUVcoord[3]*fVpix/vpix;
1548 SetWindow(u0, v0, du, dv);
1550}
void SetWindow(Double_t u0, Double_t v0, Double_t du, Double_t dv)
Definition: BesTView.cxx:1515

◆ RotateView()

void BesTView::RotateView ( Double_t  phi,
Double_t  theta,
TVirtualPad *  pad = 0 
)
virtual

Definition at line 1678 of file BesTView.cxx.

1679{
1680 // API to rotate view and adjust the pad provided it the current one.
1681
1682 Int_t iret;
1683 Double_t p = phi;
1684 Double_t t = theta;
1685 SetView(p, t, 0, iret);
1686
1687 // Adjust current pad too
1688 TVirtualPad *thisPad = pad;
1689 if (!thisPad) thisPad = gPad;
1690 if (thisPad) {
1691 thisPad->SetPhi(-90-p);
1692 thisPad->SetTheta(90-t);
1693 thisPad->Modified();
1694 thisPad->Update();
1695 }
1696}
int t()
Definition: t.c:1

Referenced by FrontView(), SideView(), and TopView().

◆ SetAutoRange()

virtual void BesTView::SetAutoRange ( Bool_t  autorange = kTRUE)
inlinevirtual

Definition at line 121 of file BesTView.h.

121{fAutoRange=autorange;}

◆ SetAxisNDC()

void BesTView::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

Definition at line 1358 of file BesTView.cxx.

1359{
1360 //*-*-*-*-*-*-*-*-*-*-*-*-*Store axis coordinates in the NDC system*-*-*-*
1361 //*-* ========================================
1362 //*-*
1363
1364 for (Int_t i=0;i<3;i++) {
1365 fX1[i] = x1[i];
1366 fX2[i] = x2[i];
1367 fY1[i] = y1[i];
1368 fY2[i] = y2[i];
1369 fZ1[i] = z1[i];
1370 fZ2[i] = z2[i];
1371 }
1372}

◆ SetDefaultWindow()

void BesTView::SetDefaultWindow ( )

Definition at line 1375 of file BesTView.cxx.

1376{
1377 // Set default viewing window
1378 if (!gPad) return;
1379 Double_t screen_factor = 1.;
1380 Double_t du, dv;
1381 Double_t extent = GetExtent();
1382 fDview = 3*extent;
1383 fDproj = 0.5*extent;
1384
1385 // widh in pixels
1386 fUpix = gPad->GetWw()*gPad->GetAbsWNDC();
1387
1388 // height in pixels
1389 fVpix = gPad->GetWh()*gPad->GetAbsHNDC();
1390 du = 0.5*screen_factor*fDproj;
1391 dv = du*fVpix/fUpix; // keep aspect ratio
1392 SetWindow(0, 0, du, dv);
1393}
Double_t GetExtent() const
Definition: BesTView.cxx:1123

Referenced by MoveFocus(), SetPerspective(), and SetRange().

◆ SetDproj()

void BesTView::SetDproj ( Double_t  dproj)
inline

Definition at line 125 of file BesTView.h.

125{fDproj=dproj;}

◆ SetDview()

void BesTView::SetDview ( Double_t  dview)
inline

Definition at line 124 of file BesTView.h.

124{fDview=dview;}

◆ SetLatitude()

void BesTView::SetLatitude ( Double_t  latitude)
inline

Definition at line 126 of file BesTView.h.

126{fLatitude = latitude;}

◆ SetLongitude()

void BesTView::SetLongitude ( Double_t  longitude)
inline

Definition at line 127 of file BesTView.h.

127{fLongitude = longitude;}

◆ SetOutlineToCube()

void BesTView::SetOutlineToCube ( )
virtual

Definition at line 1396 of file BesTView.cxx.

1397{
1398 //*-*-*-*-*-*-*This is a function which creates default outline*-*-*-*-*-*
1399 //*-* ================================================ *
1400 //*-* *
1401 //*-* x = fRmin[0] X = fRmax[0] *
1402 //*-* y = fRmin[1] Y = fRmax[1] *
1403 //*-* z = fRmin[2] Z = fRmax[2] *
1404 //*-* *
1405 //*-* *
1406 //*-* (x,Y,Z) +---------+ (X,Y,Z) *
1407 //*-* / /| *
1408 //*-* / / | *
1409 //*-* / / | *
1410 //*-* (x,y,Z) +---------+ | *
1411 //*-* | | + (X,Y,z) *
1412 //*-* | | / *
1413 //*-* | | / *
1414 //*-* | |/ *
1415 //*-* +---------+ *
1416 //*-* (x,y,z) (X,y,z) *
1417 //*-* *
1418 //*-* *
1419 //*-* *
1420 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**
1421
1422 if (!fOutline) {
1423 fDefaultOutline = kTRUE;
1424 fOutline = new TList();
1425 }
1427 //TVirtualUtil3D *util = (TVirtualUtil3D*)gROOT->GetListOfSpecials()->FindObject("R__TVirtualUtil3D");
1428 //if (util) util->DrawOutlineCube((TList*)fOutline,fRmin,fRmax);
1429}
virtual void DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax)
Definition: BesTView.cxx:728

Referenced by ExecuteRotateView(), and SetRange().

◆ SetParallel()

void BesTView::SetParallel ( )
virtual

Definition at line 1432 of file BesTView.cxx.

1433{
1434 //set the parallel option (default)
1435 if (!IsPerspective()) return;
1436 SetBit(kPerspective, kFALSE);
1437 Int_t irep;
1439}

Referenced by BesVisDisplay::DrawView(), BesClient::HandleButtons(), and BesView::SetViewType().

◆ SetPerspective()

void BesTView::SetPerspective ( )
virtual

Definition at line 1442 of file BesTView.cxx.

1443{
1444 //set perspective option
1445 if (IsPerspective()) return;
1446 SetBit(kPerspective, kTRUE);
1447 Int_t irep;
1450}

Referenced by BesTView(), BesClient::HandleButtons(), and BesView::SetViewType().

◆ SetPsi()

void BesTView::SetPsi ( Double_t  psi)
inline

Definition at line 128 of file BesTView.h.

128{fPsi = psi;}

◆ SetRange() [1/2]

void BesTView::SetRange ( const Double_t *  min,
const Double_t *  max 
)
virtual

Definition at line 1453 of file BesTView.cxx.

1454{
1455 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Set Range function-*-*-*-*-*-*-*-*-*-*-*-*-*
1456 //*-* ==================
1457 //*-*
1458 Int_t irep;
1459 for (Int_t i = 0; i < 3; fRmax[i] = max[i], fRmin[i] = min[i], i++) { }
1462 if(irep < 0)
1463 Error("SetRange", "problem setting view");
1465}

Referenced by AdjustScales(), Centered3DImages(), BesView::DefaultRange(), BesVisDisplay::DrawView(), Bes2DView::Reset(), SetRange(), and ZoomView().

◆ SetRange() [2/2]

void BesTView::SetRange ( Double_t  x0,
Double_t  y0,
Double_t  z0,
Double_t  x1,
Double_t  y1,
Double_t  z1,
Int_t  flag = 0 
)
virtual

Definition at line 1469 of file BesTView.cxx.

1470{
1471 //*-*-*-*-*-*-*-*-*-*-*-*Set 3-D View range*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1472 //*-* ==================
1473 //*-*
1474 //*-* Input: x0, y0, z0 are minimum coordinates
1475 //*-* x1, y1, z1 are maximum coordinates
1476 //*-*
1477 //*-* flag values are: 0 (set always) <- default
1478 //*-* 1 (shrink view)
1479 //*-* 2 (expand view)
1480 //*-*
1481
1482
1483 Double_t rmax[3], rmin[3];
1484
1485 switch (flag) {
1486 case 2: // expand view
1487 GetRange(rmin, rmax);
1488 rmin[0] = x0 < rmin[0] ? x0 : rmin[0];
1489 rmin[1] = y0 < rmin[1] ? y0 : rmin[1];
1490 rmin[2] = z0 < rmin[2] ? z0 : rmin[2];
1491 rmax[0] = x1 > rmax[0] ? x1 : rmax[0];
1492 rmax[1] = y1 > rmax[1] ? y1 : rmax[1];
1493 rmax[2] = z1 > rmax[2] ? z1 : rmax[2];
1494 break;
1495
1496 case 1: // shrink view
1497 GetRange(rmin, rmax);
1498 rmin[0] = x0 > rmin[0] ? x0 : rmin[0];
1499 rmin[1] = y0 > rmin[1] ? y0 : rmin[1];
1500 rmin[2] = z0 > rmin[2] ? z0 : rmin[2];
1501 rmax[0] = x1 < rmax[0] ? x1 : rmax[0];
1502 rmax[1] = y1 < rmax[1] ? y1 : rmax[1];
1503 rmax[2] = z1 < rmax[2] ? z1 : rmax[2];
1504 break;
1505
1506 default:
1507 rmin[0] = x0; rmax[0] = x1;
1508 rmin[1] = y0; rmax[1] = y1;
1509 rmin[2] = z0; rmax[2] = z1;
1510 }
1511 SetRange(rmin, rmax);
1512}

◆ SetSystem()

virtual void BesTView::SetSystem ( Int_t  system)
inlinevirtual

Definition at line 134 of file BesTView.h.

134{fSystem = system;}

◆ SetView()

void BesTView::SetView ( Double_t  longitude,
Double_t  latitude,
Double_t  psi,
Int_t &  irep 
)
virtual

◆ SetViewChanged()

void BesTView::SetViewChanged ( Bool_t  flag = kTRUE)
inline

Definition at line 136 of file BesTView.h.

136{fChanged = flag;}

◆ SetWindow()

void BesTView::SetWindow ( Double_t  u0,
Double_t  v0,
Double_t  du,
Double_t  dv 
)

Definition at line 1515 of file BesTView.cxx.

1516{
1517 // Set viewing window.
1518 fUVcoord[0] = u0;
1519 fUVcoord[1] = v0;
1520 fUVcoord[2] = du;
1521 fUVcoord[3] = dv;
1522}

Referenced by ResizePad(), and SetDefaultWindow().

◆ ShowAxis()

void BesTView::ShowAxis ( )
inlinevirtual

Definition at line 178 of file BesTView.h.

178{ToggleRulers(); }
virtual void ToggleRulers(TVirtualPad *pad=0)
Definition: BesTView.cxx:1717

Referenced by BesGeometry::Draw2DXY(), and BesGeometry::Draw2DZR().

◆ Side()

void BesTView::Side ( )
inlinevirtual

Reimplemented in Bes2DView, and BesView.

Definition at line 179 of file BesTView.h.

179{SideView();}
virtual void SideView(TVirtualPad *pad=0)
Definition: BesTView.cxx:1699

Referenced by Bes2DView::Side(), and BesView::Side().

◆ SideView()

void BesTView::SideView ( TVirtualPad *  pad = 0)
virtual

Definition at line 1699 of file BesTView.cxx.

1700{
1701 // Set to side view.
1702 RotateView(0,90.0,pad);
1703}

Referenced by Side().

◆ ToggleRulers()

void BesTView::ToggleRulers ( TVirtualPad *  pad = 0)
virtual

Definition at line 1717 of file BesTView.cxx.

1718{
1719 // Turn on /off 3D axis
1720 //TVirtualUtil3D *util = (TVirtualUtil3D*)gROOT->GetListOfSpecials()->FindObject("R__TVirtualUtil3D");
1721 //if (util) util->ToggleRulers(pad);
1722 TAxis3D::ToggleRulers(pad);
1723}

Referenced by ShowAxis().

◆ ToggleZoom()

void BesTView::ToggleZoom ( TVirtualPad *  pad = 0)
virtual

Definition at line 1726 of file BesTView.cxx.

1727{
1728 // Turn on /off the interactive option to
1729 // Zoom / Move / Change attributes of 3D axis correspond this view
1730 //TVirtualUtil3D *util = (TVirtualUtil3D*)gROOT->GetListOfSpecials()->FindObject("R__TVirtualUtil3D");
1731 //if (util) util->ToggleZoom(pad);
1732 TAxis3D::ToggleZoom(pad);
1733}

Referenced by ZoomMove().

◆ Top()

void BesTView::Top ( )
inlinevirtual

Reimplemented in Bes2DView, and BesView.

Definition at line 180 of file BesTView.h.

180{TopView();}
virtual void TopView(TVirtualPad *pad=0)
Definition: BesTView.cxx:1711

Referenced by Bes2DView::Front(), and BesView::Front().

◆ TopView()

void BesTView::TopView ( TVirtualPad *  pad = 0)
virtual

Definition at line 1711 of file BesTView.cxx.

1712{
1713 // Set to top view.
1714 RotateView(270.0,0.0,pad);
1715}

Referenced by Top().

◆ UnZoom()

void BesTView::UnZoom ( )
inlinevirtual

Reimplemented in Bes2DView.

Definition at line 183 of file BesTView.h.

183{UnzoomView();}

◆ UnzoomView()

void BesTView::UnzoomView ( TVirtualPad *  pad = 0,
Double_t  unZoomFactor = 1.25 
)
virtual

Definition at line 1769 of file BesTView.cxx.

1770{
1771 // unZOOM this view
1772 if (TMath::Abs(unZoomFactor) < 0.001) return;
1773 ZoomView(pad,1./unZoomFactor);
1774}

Referenced by MoveViewCommand(), Bes2DView::UnZoom(), UnZoom(), and BesView::ZoomOut().

◆ WCtoNDC() [1/2]

void BesTView::WCtoNDC ( const Double_t *  pw,
Double_t *  pn 
)
virtual

Reimplemented in Bes2DView, and BesView.

Definition at line 1637 of file BesTView.cxx.

1638{
1639 //*-*-*-*-*-*-*Transfer point from world to normalized coordinates*-*-*-*-*
1640 //*-* =================================================== *
1641 //*-* *
1642 //*-* Input: PW(3) - point in world coordinate system *
1643 //*-* PN(3) - point in normalized coordinate system *
1644 //*-* *
1645 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1646
1647 // perspective view
1648 if (IsPerspective()) {
1649 for (Int_t i=0; i<3; i++)
1650 pn[i] = pw[0]*fTnorm[i]+pw[1]*fTnorm[i+4]+pw[2]*fTnorm[i+8]+fTnorm[i+12];
1651 if (pn[2]>0) {
1652 pn[0] /= pn[2];
1653 pn[1] /= pn[2];
1654 } else {
1655 pn[0] *= 1000.;
1656 pn[1] *= 1000.;
1657 }
1658 return;
1659 }
1660 // parallel view
1661 pn[0] = fTnorm[0]*pw[0] + fTnorm[1]*pw[1] + fTnorm[2]*pw[2] + fTnorm[3];
1662 pn[1] = fTnorm[4]*pw[0] + fTnorm[5]*pw[1] + fTnorm[6]*pw[2] + fTnorm[7];
1663 pn[2] = fTnorm[8]*pw[0] + fTnorm[9]*pw[1] + fTnorm[10]*pw[2] + fTnorm[11];
1664}

◆ WCtoNDC() [2/2]

void BesTView::WCtoNDC ( const Float_t *  pw,
Float_t *  pn 
)
virtual

Reimplemented in Bes2DView, and BesView.

Definition at line 1606 of file BesTView.cxx.

1607{
1608 //*-*-*-*-*-*-*Transfer point from world to normalized coordinates*-*-*-*-*
1609 //*-* =================================================== *
1610 //*-* *
1611 //*-* Input: PW(3) - point in world coordinate system *
1612 //*-* PN(3) - point in normalized coordinate system *
1613 //*-* *
1614 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1615
1616 // perspective view
1617 if (IsPerspective()) {
1618 for (Int_t i=0; i<3; i++)
1619 pn[i] = pw[0]*fTnorm[i]+pw[1]*fTnorm[i+4]+pw[2]*fTnorm[i+8]+fTnorm[i+12];
1620 if (pn[2]>0) {
1621 pn[0] /= pn[2];
1622 pn[1] /= pn[2];
1623 } else {
1624 pn[0] *= 1000.;
1625 pn[1] *= 1000.;
1626 }
1627 return;
1628 }
1629 // parallel view
1630 pn[0] = fTnorm[0]*pw[0] + fTnorm[1]*pw[1] + fTnorm[2]*pw[2] + fTnorm[3];
1631 pn[1] = fTnorm[4]*pw[0] + fTnorm[5]*pw[1] + fTnorm[6]*pw[2] + fTnorm[7];
1632 pn[2] = fTnorm[8]*pw[0] + fTnorm[9]*pw[1] + fTnorm[10]*pw[2] + fTnorm[11];
1633}

Referenced by Bes2DView::NDCtoWC(), BesView::NDCtoWC(), Bes2DView::WCtoNDC(), and BesView::WCtoNDC().

◆ Zoom()

void BesTView::Zoom ( )
inlinevirtual

Reimplemented in Bes2DView.

Definition at line 182 of file BesTView.h.

182{ZoomView();}

◆ ZoomIn()

void BesTView::ZoomIn ( )
virtual

Reimplemented in BesView.

Definition at line 1937 of file BesTView.cxx.

1938{
1939 // Zoom in.
1940 if (!IsPerspective()) return;
1941 Double_t extent = GetExtent();
1942 Double_t fc = 0.1;
1943 if (fDview<extent) {
1944 fDview -= fc*extent;
1945 } else {
1946 fDview /= 1.25;
1947 }
1949 if (gPad) {
1950 gPad->Modified();
1951 gPad->Update();
1952 }
1953}

Referenced by MoveViewCommand().

◆ ZoomMove()

void BesTView::ZoomMove ( )
inlinevirtual

Reimplemented in Bes2DView, and BesView.

Definition at line 181 of file BesTView.h.

181{ToggleZoom();}
virtual void ToggleZoom(TVirtualPad *pad=0)
Definition: BesTView.cxx:1726

Referenced by Bes2DView::ZoomMove(), and BesView::ZoomMove().

◆ ZoomOut()

void BesTView::ZoomOut ( )
virtual

Reimplemented in BesView.

Definition at line 1956 of file BesTView.cxx.

1957{
1958 // Zoom out.
1959 if (!IsPerspective()) return;
1960 Double_t extent = GetExtent();
1961 Double_t fc = 0.1;
1962 if (fDview<extent) {
1963 fDview += fc*extent;
1964 } else {
1965 fDview *= 1.25;
1966 }
1968 if (gPad) {
1969 gPad->Modified();
1970 gPad->Update();
1971 }
1972}

Referenced by MoveViewCommand().

◆ ZoomView()

void BesTView::ZoomView ( TVirtualPad *  pad = 0,
Double_t  zoomFactor = 1.25 
)
virtual

Definition at line 1777 of file BesTView.cxx.

1778{
1779 // ZOOM this view
1780
1781 if (TMath::Abs(zoomFactor) < 0.001) return;
1782 Double_t min[3],max[3];
1783 GetRange(min,max);
1784 int i;
1785 for (i=0;i<3; i++) {
1786 // Find center
1787 Double_t c = (max[i]+min[i])/2;
1788 // Find a new size
1789 Double_t s = (max[i]-min[i])/(2*zoomFactor);
1790 // Set a new size
1791 max[i] = c + s;
1792 min[i] = c - s;
1793 }
1794 SetRange(min,max);
1795 AdjustPad(pad);
1796}

Referenced by BesVisDisplay::DrawView(), MoveViewCommand(), Bes2DView::Reset(), BesView::SetViewType(), BesView::SetZoomRatio(), UnzoomView(), Bes2DView::Zoom(), Zoom(), and BesView::ZoomIn().

Member Data Documentation

◆ fAutoRange

Bool_t BesTView::fAutoRange
protected

Definition at line 57 of file BesTView.h.

Referenced by BesTView(), GetAutoRange(), operator=(), and SetAutoRange().

◆ fChanged

Bool_t BesTView::fChanged
protected

Definition at line 58 of file BesTView.h.

Referenced by BesTView(), ExecuteRotateView(), IsViewChanged(), operator=(), and SetViewChanged().

◆ fDefaultOutline

Bool_t BesTView::fDefaultOutline
protected

Definition at line 56 of file BesTView.h.

Referenced by BesTView(), operator=(), SetOutlineToCube(), and SetRange().

◆ fDproj

Double_t BesTView::fDproj
protected

Definition at line 38 of file BesTView.h.

Referenced by DefinePerspectiveView(), GetDproj(), operator=(), SetDefaultWindow(), and SetDproj().

◆ fDview

Double_t BesTView::fDview
protected

◆ fLatitude

Double_t BesTView::fLatitude
protected

◆ fLongitude

Double_t BesTView::fLongitude
protected

◆ fOutline

TSeqCollection* BesTView::fOutline
protected

◆ fPsi

Double_t BesTView::fPsi
protected

◆ fRmax

Double_t BesTView::fRmax[3]
protected

◆ fRmin

Double_t BesTView::fRmin[3]
protected

◆ fSystem

Int_t BesTView::fSystem
protected

Definition at line 54 of file BesTView.h.

Referenced by BesTView(), GetDistancetoAxis(), GetSystem(), operator=(), and SetSystem().

◆ fTB

Double_t BesTView::fTB[16]
protected

Definition at line 42 of file BesTView.h.

Referenced by BesTView(), operator=(), and ResetView().

◆ fTback

Double_t BesTView::fTback[16]
protected

Definition at line 47 of file BesTView.h.

Referenced by BesTView(), GetTback(), NDCtoWC(), operator=(), and ResetView().

◆ fTN

Double_t BesTView::fTN[16]
protected

◆ fTnorm

Double_t BesTView::fTnorm[16]
protected

◆ fUpix

Double_t BesTView::fUpix
protected

Definition at line 39 of file BesTView.h.

Referenced by operator=(), ResizePad(), and SetDefaultWindow().

◆ fUVcoord

Double_t BesTView::fUVcoord[4]
protected

◆ fVpix

Double_t BesTView::fVpix
protected

Definition at line 40 of file BesTView.h.

Referenced by operator=(), ResizePad(), and SetDefaultWindow().

◆ fX1

Double_t BesTView::fX1[3]
protected

Definition at line 48 of file BesTView.h.

Referenced by BesTView(), GetDistancetoAxis(), operator=(), and SetAxisNDC().

◆ fX2

Double_t BesTView::fX2[3]
protected

Definition at line 49 of file BesTView.h.

Referenced by BesTView(), GetDistancetoAxis(), operator=(), and SetAxisNDC().

◆ fY1

Double_t BesTView::fY1[3]
protected

Definition at line 50 of file BesTView.h.

Referenced by BesTView(), GetDistancetoAxis(), operator=(), and SetAxisNDC().

◆ fY2

Double_t BesTView::fY2[3]
protected

Definition at line 51 of file BesTView.h.

Referenced by BesTView(), GetDistancetoAxis(), operator=(), and SetAxisNDC().

◆ fZ1

Double_t BesTView::fZ1[3]
protected

Definition at line 52 of file BesTView.h.

Referenced by BesTView(), GetDistancetoAxis(), operator=(), and SetAxisNDC().

◆ fZ2

Double_t BesTView::fZ2[3]
protected

Definition at line 53 of file BesTView.h.

Referenced by BesTView(), GetDistancetoAxis(), operator=(), and SetAxisNDC().


The documentation for this class was generated from the following files: