#include <Bes2DView.h>
Inheritance diagram for Bes2DView:
Public Types | |
kPerspective = BIT(6) | |
enum | { kPerspective = BIT(6) } |
Public Member Functions | |
Bes2DView () | |
virtual | ~Bes2DView () |
virtual void | ClearPad () |
virtual void | DrawLabel () |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
virtual Int_t | GetRSign (Float_t Phi) |
virtual void | UpdateView (Bool_t resetview=kFALSE) |
virtual void | WCtoNDC (const Float_t *pw, Float_t *pn) |
virtual void | WCtoNDC (const Double_t *pw, Double_t *pn) |
virtual void | NDCtoWC (const Float_t *pn, Float_t *pw) |
virtual void | NDCtoWC (const Double_t *pn, Double_t *pw) |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
void | Set2DViewType (Int_t viewType) |
Int_t | Get2DViewType () |
Float_t | GetMarkerSize () |
void | Zoom () |
void | UnZoom () |
void | Center () |
void | Move (Int_t px, Int_t py) |
void | Reset () |
void | SetMarkerSize (Float_t size) |
Bool_t | GetFishEyeStatus () |
Bool_t | GetFishEye () |
void | SetFishEye (Bool_t input=0) |
void | PrintCurrent () |
virtual void | Centered () |
virtual void | Front () |
virtual void | Side () |
virtual void | Top () |
virtual void | ZoomMove () |
virtual void | AdjustScales (TVirtualPad *pad=0) |
virtual void | Delete (Option_t *option) |
virtual void | DrawClass () |
virtual TObject * | DrawClone (Option_t *option) |
virtual void | Dump () |
virtual void | Inspect () |
virtual void | SetDrawOption (Option_t *option) |
virtual void | SetLineAttributes () |
virtual void | SetZoomFactor (Double_t factor) |
virtual Double_t | GetZoomFactor () |
BesStatus * | GetStatusCurrent () |
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 | 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 | 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) |
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 | Centered3DImages (TVirtualPad *pad=0) |
virtual void | FrontView (TVirtualPad *pad=0) |
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 | TopView (TVirtualPad *pad=0) |
virtual void | ToggleRulers (TVirtualPad *pad=0) |
virtual void | ShowAxis () |
virtual void | ToggleZoom (TVirtualPad *pad=0) |
ClassDef (BesTView, 2) | |
Static Public Member Functions | |
static void | AdjustPad (TVirtualPad *pad=0) |
Protected Member Functions | |
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 |
Private Attributes | |
Bool_t | fFishEye |
Int_t | f2DViewType |
Float_t | fPhiRangeMin |
Float_t | fPhiRangeMax |
TPaveLabel * | fLabel |
Float_t | fMarkerSize |
BesStatus * | fStatus3D |
BesStatus * | fStatusXY |
BesStatus * | fStatusZR |
BesStatus * | fStatusCurrent |
Double_t | fZoomFactor |
Definition at line 25 of file Bes2DView.h.
anonymous enum [inherited] |
Bes2DView::Bes2DView | ( | ) |
Bes2DView::~Bes2DView | ( | ) | [virtual] |
Definition at line 83 of file Bes2DView.cxx.
References fLabel, fStatus3D, fStatusCurrent, fStatusXY, and fStatusZR.
00083 { 00084 // 00085 // Bes2DView default destructor 00086 if ( gDebug ) cout << "Bes2DView default dtor called" << endl; 00087 00088 delete fLabel; 00089 00090 delete fStatus3D; 00091 delete fStatusXY; 00092 delete fStatusZR; 00093 delete fStatusCurrent; 00094 00095 }
void BesTView::AdjustPad | ( | TVirtualPad * | pad = 0 |
) | [static, inherited] |
Definition at line 1667 of file BesTView.cxx.
Referenced by BesTView::AdjustScales(), BesTView::Centered3DImages(), G__BesVisLib_rootcint_175_0_69(), G__setup_memfuncBesTView(), and BesTView::ZoomView().
01668 { 01669 // Force the current pad to be updated 01670 TVirtualPad *thisPad = pad; 01671 if (!thisPad) thisPad = gPad; 01672 if (thisPad) { 01673 thisPad->Modified(); 01674 thisPad->Update(); 01675 } 01676 }
virtual void Bes2DView::AdjustScales | ( | TVirtualPad * | pad = 0 |
) | [inline, virtual] |
Reimplemented from BesTView.
Definition at line 112 of file Bes2DView.h.
References BesTView::AdjustScales().
00112 { BesTView::AdjustScales(pad); }
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, inherited] |
Definition at line 332 of file BesTView.cxx.
References BesTView::fRmax, BesTView::fRmin, BesTView::fTN, genRecEmupikp::i, and kRad.
00333 { 00334 //*-*-*-*-*-*-*-*-*-*-*-*-*Define axis vertices*-*-*-*-*-*-*-*-*-*-*-*-*-* 00335 //*-* ===================== * 00336 //*-* * 00337 //*-* Input ANG - angle between X and Y axis * 00338 //*-* * 00339 //*-* Output: AV(3,8) - axis vertixes * 00340 //*-* IX1 - 1st point of X-axis * 00341 //*-* IX2 - 2nd point of X-axis * 00342 //*-* IY1 - 1st point of Y-axis * 00343 //*-* IY2 - 2nd point of Y-axis * 00344 //*-* IZ1 - 1st point of Z-axis * 00345 //*-* IZ2 - 2nd point of Z-axis * 00346 //*-* * 00347 //*-* 8 6 * 00348 //*-* / \ /|\ * 00349 //*-* 5 / \ 7 5 / | \ 7 * 00350 //*-* |\ /| | | | * 00351 //*-* THETA < 90 | \6/ | THETA > 90 | /2\ | * 00352 //*-* (Top view) | | | (Bottom view) |/ \| * 00353 //*-* 1 \ | /3 1 \ /3 * 00354 //*-* \|/ \ / * 00355 //*-* 2 4 * 00356 //*-* * 00357 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 00358 /* Local variables */ 00359 Double_t cosa, sina; 00360 Int_t i, k; 00361 Double_t p[8] /* was [2][4] */; 00362 Int_t i1, i2, i3, i4, ix, iy; 00363 ix = 0; 00364 00365 /* Parameter adjustments */ 00366 av -= 4; 00367 00368 sina = TMath::Sin(ang*kRad); 00369 cosa = TMath::Cos(ang*kRad); 00370 p[0] = fRmin[0]; 00371 p[1] = fRmin[1]; 00372 p[2] = fRmax[0]; 00373 p[3] = fRmin[1]; 00374 p[4] = fRmax[0]; 00375 p[5] = fRmax[1]; 00376 p[6] = fRmin[0]; 00377 p[7] = fRmax[1]; 00378 //*-*- F I N D T H E M O S T L E F T P O I N T */ 00379 i1 = 1; 00380 if (fTN[0] < 0) i1 = 2; 00381 if (fTN[0]*cosa + fTN[1]*sina < 0) i1 = 5 - i1; 00382 00383 //*-*- S E T O T H E R P O I N T S */ 00384 i2 = i1 % 4 + 1; 00385 i3 = i2 % 4 + 1; 00386 i4 = i3 % 4 + 1; 00387 00388 //*-*- S E T A X I S V E R T I X E S */ 00389 00390 av[4] = p[(i1 << 1) - 2]; 00391 av[5] = p[(i1 << 1) - 1]; 00392 av[7] = p[(i2 << 1) - 2]; 00393 av[8] = p[(i2 << 1) - 1]; 00394 av[10] = p[(i3 << 1) - 2]; 00395 av[11] = p[(i3 << 1) - 1]; 00396 av[13] = p[(i4 << 1) - 2]; 00397 av[14] = p[(i4 << 1) - 1]; 00398 for (i = 1; i <= 4; ++i) { 00399 av[i*3 + 3] = fRmin[2]; 00400 av[i*3 + 13] = av[i*3 + 1]; 00401 av[i*3 + 14] = av[i*3 + 2]; 00402 av[i*3 + 15] = fRmax[2]; 00403 } 00404 00405 //*-*- S E T A X I S 00406 00407 if (av[4] == av[7]) ix = 2; 00408 if (av[5] == av[8]) ix = 1; 00409 iy = 3 - ix; 00410 //*-*- X - A X I S 00411 ix1 = ix; 00412 if (av[ix*3 + 1] > av[(ix + 1)*3 + 1]) ix1 = ix + 1; 00413 ix2 = (ix << 1) - ix1 + 1; 00414 //*-*- Y - A X I S 00415 iy1 = iy; 00416 if (av[iy*3 + 2] > av[(iy + 1)*3 + 2]) iy1 = iy + 1; 00417 iy2 = (iy << 1) - iy1 + 1; 00418 //*-*- Z - A X I S 00419 iz1 = 1; 00420 iz2 = 5; 00421 00422 if (fTN[10] >= 0) return; 00423 k = (ix1 - 1)*3 + ix2; 00424 if (k%2) return; 00425 if (k == 2) { 00426 ix1 = 4; 00427 ix2 = 3; 00428 } 00429 if (k == 4) { 00430 ix1 = 3; 00431 ix2 = 4; 00432 } 00433 if (k == 6) { 00434 ix1 = 1; 00435 ix2 = 4; 00436 } 00437 if (k == 8) { 00438 ix1 = 4; 00439 ix2 = 1; 00440 } 00441 00442 k = (iy1 - 1)*3 + iy2; 00443 if (k%2) return; 00444 if (k == 2) { 00445 iy1 = 4; 00446 iy2 = 3; 00447 return; 00448 } 00449 if (k == 4) { 00450 iy1 = 3; 00451 iy2 = 4; 00452 return; 00453 } 00454 if (k == 6) { 00455 iy1 = 1; 00456 iy2 = 4; 00457 return; 00458 } 00459 if (k == 8) { 00460 iy1 = 4; 00461 iy2 = 1; 00462 } 00463 }
void Bes2DView::Center | ( | ) |
Definition at line 189 of file Bes2DView.cxx.
Referenced by Reset().
00189 { 00190 // 00191 // Center view 00192 /* 00193 if ( fViewType & k3DView ){ 00194 this->Centered(); 00195 } else { 00196 */ 00197 Double_t xrange, yrange; 00198 xrange = gPad->GetX2() - gPad->GetX1(); 00199 yrange = gPad->GetY2() - gPad->GetY1(); 00200 gPad->Range(-xrange/2, -yrange/2, xrange/2, yrange/2); 00201 gPad->Modified(); 00202 }
virtual void Bes2DView::Centered | ( | ) | [inline, virtual] |
Reimplemented from BesTView.
Definition at line 106 of file Bes2DView.h.
References BesTView::Centered().
00106 { BesTView::Centered(); }
void BesTView::Centered3DImages | ( | TVirtualPad * | pad = 0 |
) | [virtual, inherited] |
Definition at line 1753 of file BesTView.cxx.
References BesTView::AdjustPad(), BesTView::GetRange(), genRecEmupikp::i, and BesTView::SetRange().
Referenced by BesTView::Centered().
01754 { 01755 // Move view into the center of the scene 01756 01757 Double_t min[3],max[3]; 01758 GetRange(min,max); 01759 int i; 01760 for (i=0;i<3; i++) { 01761 if (max[i] > 0) min[i] = -max[i]; 01762 else max[i] = -min[i]; 01763 } 01764 SetRange(min,max); 01765 AdjustPad(pad); 01766 }
BesTView::ClassDef | ( | BesTView | , | |
2 | ||||
) | [inherited] |
void Bes2DView::ClearPad | ( | ) | [virtual] |
Definition at line 99 of file Bes2DView.cxx.
00099 { 00100 // 00101 // Clear current without deleting this view 00102 // 00103 // Probably this doesn't work for the postscript output 00104 // Look at TPad::Clear() for more details 00105 if ( gDebug ) cout << "Bes2DView::ClearPad called" << endl; 00106 if ( gPad->GetListOfPrimitives() ) gPad->GetListOfPrimitives()->Clear(); 00107 }
void BesTView::DefinePerspectiveView | ( | ) | [virtual, inherited] |
Definition at line 466 of file BesTView.cxx.
References BesTView::fDproj, BesTView::fDview, BesTView::fLatitude, BesTView::fLongitude, BesTView::fPsi, BesTView::fRmax, BesTView::fRmin, BesTView::fTnorm, BesTView::fUVcoord, genRecEmupikp::i, and kRad.
Referenced by BesTView::DefineViewDirection(), BesTView::MoveFocus(), BesTView::MoveWindow(), BesTView::ResetView(), BesTView::ResizePad(), BesTView::ZoomIn(), and BesTView::ZoomOut().
00467 { 00468 //*-*-*-*-*-*-*-*-*-*-*-*-*-*Define perspective view *-*-*-*-*-*-*-*-*-*-* 00469 //*-* ================================================ * 00470 //*-* * 00471 //*-* Compute transformation matrix from world coordinates * 00472 //*-* to normalised coordinates (-1 to +1) * 00473 // Input : 00474 // theta, phi - spherical angles giving the direction of projection 00475 // psi - screen rotation angle 00476 // cov[3] - center of view 00477 // dview - distance from COV to COP (center of projection) 00478 // umin, umax, vmin, vmax - view window in projection plane 00479 // dproj - distance from COP to projection plane 00480 // bcut, fcut - backward/forward range w.r.t projection plane (fcut<=0) 00481 // Output : 00482 // nper[16] - normalizing transformation 00483 // compute tr+rot to get COV in origin, view vector parallel to -Z axis, up vector 00484 // parallel to Y. 00485 // ^Yv UP ^ proj. plane 00486 // | | /| 00487 // | | / | 00488 // | dproj / x--- center of window (COW) 00489 // COV |----------|--x--|------------> Zv 00490 // / | VRP'z 00491 // / ---> | / 00492 // / VPN |/ 00493 // Xv 00494 // 00495 // 1 - translate COP to origin of MARS : Tper = T(-copx, -copy, -copz) 00496 // 2 - rotate VPN : R = Rz(-psi)*Rx(-theta)*Rz(-phi) (inverse Euler) 00497 // 3 - left-handed screen reference to right-handed one of MARS : Trl 00498 // 00499 // T12 = Tper*R*Trl 00500 // 00501 Double_t t12[16]; 00502 Double_t cov[3]; 00503 Int_t i; 00504 for (i=0; i<3; i++) cov[i] = 0.5*(fRmax[i]+fRmin[i]); 00505 00506 Double_t c1 = TMath::Cos(fPsi*kRad); 00507 Double_t s1 = TMath::Sin(fPsi*kRad); 00508 Double_t c2 = TMath::Cos(fLatitude*kRad); 00509 Double_t s2 = TMath::Sin(fLatitude*kRad); 00510 Double_t s3 = TMath::Cos(fLongitude*kRad); 00511 Double_t c3 = -TMath::Sin(fLongitude*kRad); 00512 00513 t12[0] = c1*c3 - s1*c2*s3; 00514 t12[4] = c1*s3 + s1*c2*c3; 00515 t12[8] = s1*s2; 00516 t12[3] = 0; 00517 00518 t12[1] = -s1*c3 - c1*c2*s3; 00519 t12[5] = -s1*s3 + c1*c2*c3; 00520 t12[9] = c1*s2; 00521 t12[7] = 0; 00522 00523 t12[2] = s2*s3; 00524 t12[6] = -s2*c3; 00525 t12[10] = c2; // contains Trl 00526 t12[11] = 0; 00527 00528 // translate with -COP (before rotation): 00529 t12[12] = -(cov[0]*t12[0]+cov[1]*t12[4]+cov[2]*t12[8]); 00530 t12[13] = -(cov[0]*t12[1]+cov[1]*t12[5]+cov[2]*t12[9]); 00531 t12[14] = -(cov[0]*t12[2]+cov[1]*t12[6]+cov[2]*t12[10]); 00532 t12[15] = 1; 00533 00534 // translate with (0, 0, -dview) after rotation 00535 00536 t12[14] -= fDview; 00537 00538 // reflection on Z : 00539 t12[2] *= -1; 00540 t12[6] *= -1; 00541 t12[10] *= -1; 00542 t12[14] *= -1; 00543 00544 // Now we shear the center of window from (0.5*(umin+umax), 0.5*(vmin+vmax), dproj) 00545 // to (0, 0, dproj) 00546 00547 Double_t a2 = -fUVcoord[0]/fDproj; // shear coef. on x 00548 Double_t b2 = -fUVcoord[1]/fDproj; // shear coef. on y 00549 00550 // | 1 0 0 0 | 00551 // SHz(a2,b2) = | 0 1 0 0 | 00552 // | a2 b2 1 0 | 00553 // | 0 0 0 1 | 00554 00555 fTnorm[0] = t12[0] + a2*t12[2]; 00556 fTnorm[1] = t12[1] + b2*t12[2]; 00557 fTnorm[2] = t12[2]; 00558 fTnorm[3] = 0; 00559 00560 fTnorm[4] = t12[4] + a2*t12[6]; 00561 fTnorm[5] = t12[5] + b2*t12[6]; 00562 fTnorm[6] = t12[6]; 00563 fTnorm[7] = 0; 00564 00565 fTnorm[8] = t12[8] + a2*t12[10]; 00566 fTnorm[9] = t12[9] + b2*t12[10]; 00567 fTnorm[10] = t12[10]; 00568 fTnorm[11] = 0; 00569 00570 fTnorm[12] = t12[12] + a2*t12[14]; 00571 fTnorm[13] = t12[13] + b2*t12[14]; 00572 fTnorm[14] = t12[14]; 00573 fTnorm[15] = 1; 00574 00575 // Scale so that the view volume becomes the canonical one 00576 // 00577 // Sper = (2/(umax-umin), 2/(vmax-vmin), 1/dproj 00578 // 00579 Double_t sz = 1./fDproj; 00580 Double_t sx = 1./fUVcoord[2]; 00581 Double_t sy = 1./fUVcoord[3]; 00582 00583 fTnorm[0] *= sx; 00584 fTnorm[4] *= sx; 00585 fTnorm[8] *= sx; 00586 fTnorm[1] *= sy; 00587 fTnorm[5] *= sy; 00588 fTnorm[9] *= sy; 00589 fTnorm[2] *= sz; 00590 fTnorm[6] *= sz; 00591 fTnorm[10] *= sz; 00592 fTnorm[12] *= sx; 00593 fTnorm[13] *= sy; 00594 fTnorm[14] *= sz; 00595 }
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, inherited] |
Definition at line 600 of file BesTView.cxx.
References BesTView::DefinePerspectiveView(), genRecEmupikp::i, and BesTView::IsPerspective().
Referenced by BesTView::ResetView().
00605 { 00606 //*-*-*-*-*-*-*-*-*Define view direction (in spherical coordinates)-*-*-*-* 00607 //*-* ================================================ * 00608 //*-* * 00609 //*-* Compute transformation matrix from world coordinates * 00610 //*-* to normalised coordinates (-1 to +1) * 00611 //*-* * 00612 //*-* Input: S(3) - scale factors * 00613 //*-* C(3) - centre of scope * 00614 //*-* COSPHI - longitude COS * 00615 //*-* SINPHI - longitude SIN * 00616 //*-* COSTHE - latitude COS (angle between +Z and view direc.) * 00617 //*-* SINTHE - latitude SIN * 00618 //*-* COSPSI - screen plane rotation angle COS * 00619 //*-* SINPSI - screen plane rotation angle SIN * 00620 //*-* * 00621 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 00622 00623 if (IsPerspective()) { 00624 DefinePerspectiveView(); 00625 return; 00626 } 00627 Int_t i, k; 00628 Double_t tran[16] /* was [4][4] */, rota[16] /* was [4][4] */; 00629 Double_t c1, c2, c3, s1, s2, s3, scalex, scaley, scalez; 00630 00631 /* Parameter adjustments */ 00632 tback -= 5; 00633 tnorm -= 5; 00634 00635 scalex = s[0]; 00636 scaley = s[1]; 00637 scalez = s[2]; 00638 00639 //*-*- S E T T R A N S L A T I O N M A T R I X 00640 00641 tran[0] = 1 / scalex; 00642 tran[1] = 0; 00643 tran[2] = 0; 00644 tran[3] = -c[0] / scalex; 00645 00646 tran[4] = 0; 00647 tran[5] = 1 / scaley; 00648 tran[6] = 0; 00649 tran[7] = -c[1] / scaley; 00650 00651 tran[8] = 0; 00652 tran[9] = 0; 00653 tran[10] = 1 / scalez; 00654 tran[11] = -c[2] / scalez; 00655 00656 tran[12] = 0; 00657 tran[13] = 0; 00658 tran[14] = 0; 00659 tran[15] = 1; 00660 00661 //*-*- S E T R O T A T I O N M A T R I X 00662 00663 // ( C(PSI) S(PSI) 0) (1 0 0 ) ( C(90+PHI) S(90+PHI) 0) 00664 // (-S(PSI) C(PSI) 0) * (0 C(THETA) S(THETA)) * (-S(90+PHI) C(90+PHI) 0) 00665 // ( 0 0 1) (0 -S(THETA) C(THETA)) ( 0 0 1) 00666 00667 c1 = cospsi; 00668 s1 = sinpsi; 00669 c2 = costhe; 00670 s2 = sinthe; 00671 c3 = -sinphi; 00672 s3 = cosphi; 00673 00674 rota[0] = c1*c3 - s1*c2*s3; 00675 rota[1] = c1*s3 + s1*c2*c3; 00676 rota[2] = s1*s2; 00677 rota[3] = 0; 00678 00679 rota[4] = -s1*c3 - c1* c2*s3; 00680 rota[5] = -s1*s3 + c1* c2*c3; 00681 rota[6] = c1*s2; 00682 rota[7] = 0; 00683 00684 rota[8] = s2*s3; 00685 rota[9] = -s2*c3; 00686 rota[10] = c2; 00687 rota[11] = 0; 00688 00689 rota[12] = 0; 00690 rota[13] = 0; 00691 rota[14] = 0; 00692 rota[15] = 1; 00693 00694 //*-*- F I N D T R A N S F O R M A T I O N M A T R I X 00695 00696 for (i = 1; i <= 3; ++i) { 00697 for (k = 1; k <= 4; ++k) { 00698 tnorm[k + (i << 2)] = rota[(i << 2) - 4]*tran[k - 1] + rota[(i 00699 << 2) - 3]*tran[k + 3] + rota[(i << 2) - 2]*tran[k +7] 00700 + rota[(i << 2) - 1]*tran[k + 11]; 00701 } 00702 } 00703 00704 //*-*- S E T B A C K T R A N S L A T I O N M A T R I X 00705 00706 tran[0] = scalex; 00707 tran[3] = c[0]; 00708 00709 tran[5] = scaley; 00710 tran[7] = c[1]; 00711 00712 tran[10] = scalez; 00713 tran[11] = c[2]; 00714 00715 //*-*- F I N D B A C K T R A N S F O R M A T I O N 00716 00717 for (i = 1; i <= 3; ++i) { 00718 for (k = 1; k <= 4; ++k) { 00719 tback[k + (i << 2)] = tran[(i << 2) - 4]*rota[(k << 2) - 4] + 00720 tran[(i << 2) - 3]*rota[(k << 2) - 3] + tran[(i << 2) -2] 00721 *rota[(k << 2) - 2] + tran[(i << 2) - 1]*rota[(k <<2) - 1]; 00722 } 00723 } 00724 }
virtual void Bes2DView::Delete | ( | Option_t * | option | ) | [inline, virtual] |
virtual void Bes2DView::DrawClass | ( | ) | [inline, virtual] |
virtual TObject* Bes2DView::DrawClone | ( | Option_t * | option | ) | [inline, virtual] |
void Bes2DView::DrawLabel | ( | ) | [virtual] |
Definition at line 257 of file Bes2DView.cxx.
References f2DViewType, and fLabel.
00257 { 00258 // 00259 // Draw label for current view 00260 00261 fLabel->SetX1NDC(0.05); 00262 fLabel->SetX2NDC(0.20); 00263 fLabel->SetY1NDC(0.05); 00264 fLabel->SetY2NDC(0.12); 00265 00266 switch (f2DViewType) { 00267 //case k3DView: 00268 //fLabel->SetLabel("3D View"); 00269 //break; 00270 case 0: 00271 fLabel->SetLabel("XY View"); 00272 break; 00273 case 1: 00274 fLabel->SetLabel("ZR View"); 00275 break; 00276 } 00277 fLabel->Draw("BR,NDC,SAME"); 00278 }
void BesTView::DrawOutlineCube | ( | TList * | outline, | |
Double_t * | rmin, | |||
Double_t * | rmax | |||
) | [virtual, inherited] |
Definition at line 728 of file BesTView.cxx.
Referenced by BesTView::SetOutlineToCube().
00729 { 00730 // Draw the outline of a cube while rotaing a 3-d object in the pad. 00731 00732 TPolyLine3D::DrawOutlineCube(outline,rmin,rmax); 00733 }
virtual void Bes2DView::Dump | ( | ) | [inline, virtual] |
void Bes2DView::ExecuteEvent | ( | Int_t | event, | |
Int_t | px, | |||
Int_t | py | |||
) | [virtual] |
Reimplemented from BesTView.
Definition at line 111 of file Bes2DView.cxx.
References x.
00111 { 00112 // 00113 // Execute mouse events 00114 if ( gDebug ) cout << "Bes2DView::ExecuteEvent called" << endl; 00115 //cout << "f2DViewType " << f2DViewType << " k3DView " << k3DView << endl; 00116 00117 /* 00118 if ( fViewType & k3DView ) { 00119 ExecuteRotateView(event, px, py); 00120 } else { 00121 */ 00122 00123 // Editor mode 00124 if (gROOT->GetEditorMode()) { 00125 cout << "ROOT" << endl; 00126 gPad->ExecuteEvent(event,px,py); 00127 return; 00128 } 00129 00130 static Double_t xmin, ymin, xmax, ymax, x0, y0; 00131 Double_t dx, dy, x, y; 00132 switch (event) { 00133 00134 case kButton1Down: 00135 gPad->SetCursor(kMove); 00136 // Remember position of pointer 00137 xmin = gPad->GetX1(); 00138 ymin = gPad->GetY1(); 00139 xmax = gPad->GetX2(); 00140 ymax = gPad->GetY2(); 00141 x0 = gPad->AbsPixeltoX(px); 00142 y0 = gPad->AbsPixeltoY(py); 00143 break; 00144 00145 case kButton1Motion: 00146 gPad->SetCursor(kMove); 00147 00148 case kButton1Up: 00149 // Set new pad range 00150 x = gPad->AbsPixeltoX(px); 00151 y = gPad->AbsPixeltoY(py); 00152 dx = -(x - x0); 00153 dy = -(y - y0); 00154 //((TPad*)gPad)->SetNoAspect(kTRUE); 00155 gPad->Range(xmin+dx, ymin+dy, xmax+dx, ymax+dy); 00156 //((TPad*)gPad)->SetNoAspect(kFALSE); 00157 gPad->Modified(); 00158 break; 00159 00160 default: 00161 gPad->SetCursor(kCross); 00162 } 00163 }
void BesTView::ExecuteRotateView | ( | Int_t | event, | |
Int_t | px, | |||
Int_t | py | |||
) | [virtual, inherited] |
Definition at line 745 of file BesTView.cxx.
References BesTView::fChanged, BesTView::fOutline, BesTView::GetPsi(), BesTView::GetSystem(), BesTView::IsPerspective(), kPOLAR, BesTView::MoveViewCommand(), BesTView::ResetView(), BesTView::SetOutlineToCube(), BesTView::SetView(), and x.
Referenced by BesView::ExecuteEvent(), and BesTView::ExecuteEvent().
00746 { 00747 //*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*-*-*-*-*-*-* 00748 //*-* ========================================= * 00749 //*-* This member function is called when a object is clicked with the locator * 00750 //*-* * 00751 //*-* If Left button clicked in the object area, while the button is kept down * 00752 //*-* the cube representing the surrounding frame for the corresponding * 00753 //*-* new latitude and longitude position is drawn. * 00754 //*-* * 00755 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 00756 static Int_t system, framewasdrawn; 00757 static Double_t xrange, yrange, xmin, ymin, longitude1, latitude1, longitude2, latitude2; 00758 static Double_t newlatitude, newlongitude, oldlatitude, oldlongitude; 00759 Double_t dlatitude, dlongitude, x, y; 00760 Int_t irep = 0; 00761 Double_t psideg; 00762 00763 // all coordinate transformation are from absolute to relative 00764 00765 if (!gPad->IsEditable()) return; 00766 gPad->AbsCoordinates(kTRUE); 00767 00768 switch (event) { 00769 00770 case kKeyPress : 00771 fChanged = kTRUE; 00772 MoveViewCommand(Char_t(px), py); 00773 break; 00774 00775 case kMouseMotion: 00776 gPad->SetCursor(kRotate); 00777 break; 00778 00779 case kButton1Down: 00780 00781 // remember position of the cube 00782 xmin = gPad->GetX1(); 00783 ymin = gPad->GetY1(); 00784 xrange = gPad->GetX2() - xmin; 00785 yrange = gPad->GetY2() - ymin; 00786 x = gPad->PixeltoX(px); 00787 y = gPad->PixeltoY(py); 00788 system = GetSystem(); 00789 framewasdrawn = 0; 00790 if (system == kCARTESIAN || system == kPOLAR || IsPerspective()) { 00791 longitude1 = 180*(x-xmin)/xrange; 00792 latitude1 = 90*(y-ymin)/yrange; 00793 } else { 00794 latitude1 = 90*(x-xmin)/xrange; 00795 longitude1 = 180*(y-ymin)/yrange; 00796 } 00797 newlongitude = oldlongitude = -90 - gPad->GetPhi(); 00798 newlatitude = oldlatitude = 90 - gPad->GetTheta(); 00799 psideg = GetPsi(); 00800 00801 // if outline isn't set, make it look like a cube 00802 if(!fOutline) 00803 SetOutlineToCube(); 00804 break; 00805 00806 case kButton1Motion: 00807 { 00808 // draw the surrounding frame for the current mouse position 00809 // first: Erase old frame 00810 fChanged = kTRUE; 00811 if (framewasdrawn) fOutline->Paint(); 00812 framewasdrawn = 1; 00813 x = gPad->PixeltoX(px); 00814 y = gPad->PixeltoY(py); 00815 if (system == kCARTESIAN || system == kPOLAR || IsPerspective()) { 00816 longitude2 = 180*(x-xmin)/xrange; 00817 latitude2 = 90*(y-ymin)/yrange; 00818 } else { 00819 latitude2 = 90*(x-xmin)/xrange; 00820 longitude2 = 180*(y-ymin)/yrange; 00821 } 00822 dlongitude = longitude2 - longitude1; 00823 dlatitude = latitude2 - latitude1; 00824 newlatitude = oldlatitude + dlatitude; 00825 newlongitude = oldlongitude - dlongitude; 00826 psideg = GetPsi(); 00827 ResetView(newlongitude, newlatitude, psideg, irep); 00828 fOutline->Paint(); 00829 00830 break; 00831 } 00832 case kButton1Up: 00833 if (gROOT->IsEscaped()) { 00834 gROOT->SetEscape(kFALSE); 00835 break; 00836 } 00837 00838 // Temporary fix for 2D drawing problems on pad. fOutline contains 00839 // a TPolyLine3D object for the rotation box. This will be painted 00840 // through a newly created TViewer3DPad instance, which is left 00841 // behind on pad. This remaining creates 2D drawing problems. 00842 // 00843 // This is a TEMPORARY fix - will be removed when proper multiple viewers 00844 // on pad problems are resolved. 00845 if (gPad) { 00846 TVirtualViewer3D *viewer = gPad->GetViewer3D(); 00847 if (viewer && !strcmp(viewer->IsA()->GetName(),"TView3Der3DPad")) { 00848 gPad->ReleaseViewer3D(); 00849 delete viewer; 00850 } 00851 } 00852 // End fix 00853 00854 // Recompute new view matrix and redraw 00855 psideg = GetPsi(); 00856 SetView(newlongitude, newlatitude, psideg, irep); 00857 gPad->SetPhi(-90-newlongitude); 00858 gPad->SetTheta(90-newlatitude); 00859 gPad->Modified(kTRUE); 00860 00861 // Set line color, style and width 00862 gVirtualX->SetLineColor(-1); 00863 gVirtualX->SetLineStyle(-1); 00864 gVirtualX->SetLineWidth(-1); 00865 break; 00866 } 00867 00868 // set back to default transformation mode 00869 gPad->AbsCoordinates(kFALSE); 00870 }
void BesTView::FindNormal | ( | Double_t | x, | |
Double_t | y, | |||
Double_t | z, | |||
Double_t & | zn | |||
) | [virtual, inherited] |
Definition at line 874 of file BesTView.cxx.
References BesTView::fTN.
Referenced by BesTView::FindThetaSectors().
00875 { 00876 //*-*-*-*-*-*-*Find Z component of NORMAL in normalized coordinates-*-*-*-* 00877 //*-* ==================================================== * 00878 //*-* * 00879 //*-* Input: X - X-component of NORMAL * 00880 //*-* Y - Y-component of NORMAL * 00881 //*-* Z - Z-component of NORMAL * 00882 //*-* * 00883 //*-* Output: ZN - Z-component of NORMAL in normalized coordinates * 00884 //*-* * 00885 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 00886 00887 zn = x*(fTN[1] * fTN[6] - fTN[2] * fTN[5]) + y*(fTN[2] * fTN[4] - 00888 fTN[0] * fTN[6]) + z*(fTN[0] * fTN[5] - fTN[1] * fTN[4]); 00889 }
void BesTView::FindPhiSectors | ( | Int_t | iopt, | |
Int_t & | kphi, | |||
Double_t * | aphi, | |||
Int_t & | iphi1, | |||
Int_t & | iphi2 | |||
) | [virtual, inherited] |
Definition at line 892 of file BesTView.cxx.
References BesTView::fTN, genRecEmupikp::i, kRad, phi1, and phi2.
00893 { 00894 //*-*-*-*-*-*-*-*-*-*-*-*-*Find critical PHI sectors*-*-*-*-*-*-*-*-*-*-*-* 00895 //*-* ========================= * 00896 //*-* * 00897 //*-* Input: IOPT - options: 1 - from BACK to FRONT 'BF' * 00898 //*-* 2 - from FRONT to BACK 'FB' * 00899 //*-* KPHI - number of phi sectors * 00900 //*-* APHI(*) - PHI separators (modified internally) * 00901 //*-* * 00902 //*-* Output: IPHI1 - initial sector * 00903 //*-* IPHI2 - final sector * 00904 //*-* * 00905 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 00906 00907 Int_t iphi[2], i, k; 00908 Double_t dphi; 00909 Double_t x1, x2, z1, z2, phi1, phi2; 00910 00911 /* Parameter adjustments */ 00912 --aphi; 00913 00914 if (aphi[kphi + 1] == aphi[1]) aphi[kphi + 1] += 360; 00915 dphi = TMath::Abs(aphi[kphi + 1] - aphi[1]); 00916 if (dphi != 360) { 00917 aphi[kphi + 2] = (aphi[1] + aphi[kphi + 1]) / (float)2. + 180; 00918 aphi[kphi + 3] = aphi[1] + 360; 00919 kphi += 2; 00920 } 00921 00922 //*-*- F I N D C R I T I C A L S E C T O R S 00923 00924 k = 0; 00925 for (i = 1; i <= kphi; ++i) { 00926 phi1 = kRad*aphi[i]; 00927 phi2 = kRad*aphi[i + 1]; 00928 x1 = fTN[0]*TMath::Cos(phi1) + fTN[1]*TMath::Sin(phi1); 00929 x2 = fTN[0]*TMath::Cos(phi2) + fTN[1]*TMath::Sin(phi2); 00930 if (x1 >= 0 && x2 > 0) continue; 00931 if (x1 <= 0 && x2 < 0) continue; 00932 ++k; 00933 if (k == 3) break; 00934 iphi[k - 1] = i; 00935 } 00936 if (k != 2) { 00937 Error("FindPhiSectors", "something strange: num. of critical sector not equal 2"); 00938 iphi1 = 1; 00939 iphi2 = 2; 00940 return; 00941 } 00942 00943 //*-*- 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 00944 00945 phi1 = kRad*(aphi[iphi[0]] + aphi[iphi[0] + 1]) / (float)2.; 00946 phi2 = kRad*(aphi[iphi[1]] + aphi[iphi[1] + 1]) / (float)2.; 00947 z1 = fTN[8]*TMath::Cos(phi1) + fTN[9]*TMath::Sin(phi1); 00948 z2 = fTN[8]*TMath::Cos(phi2) + fTN[9]*TMath::Sin(phi2); 00949 if ((z1 <= z2 && iopt == 1) || (z1 > z2 && iopt == 2)) { 00950 iphi1 = iphi[0]; 00951 iphi2 = iphi[1]; 00952 } else { 00953 iphi1 = iphi[1]; 00954 iphi2 = iphi[0]; 00955 } 00956 }
void BesTView::FindScope | ( | Double_t * | scale, | |
Double_t * | center, | |||
Int_t & | irep | |||
) | [virtual, inherited] |
Definition at line 1030 of file BesTView.cxx.
References BesTView::fRmax, BesTView::fRmin, and genRecEmupikp::i.
Referenced by BesTView::ResetView().
01031 { 01032 //*-*-*-*-*-*-*-*Find centre of a MIN-MAX scope and scale factors-*-*-*-*-* 01033 //*-* ================================================ * 01034 //*-* * 01035 //*-* Output: SCALE(3) - scale factors * 01036 //*-* CENTER(3) - centre * 01037 //*-* IREP - reply (-1 if error in min-max) * 01038 //*-* * 01039 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 01040 01041 irep = 0; 01042 Double_t sqrt3 = 0.5*TMath::Sqrt(3.0); 01043 01044 for (Int_t i = 0; i < 3; i++) { 01045 if (fRmin[i] >= fRmax[i]) { irep = -1; return;} 01046 scale[i] = sqrt3*(fRmax[i] - fRmin[i]); 01047 center[i] = 0.5*(fRmax[i] + fRmin[i]); 01048 } 01049 }
void BesTView::FindThetaSectors | ( | Int_t | iopt, | |
Double_t | phi, | |||
Int_t & | kth, | |||
Double_t * | ath, | |||
Int_t & | ith1, | |||
Int_t & | ith2 | |||
) | [virtual, inherited] |
Definition at line 959 of file BesTView.cxx.
References BesTView::FindNormal(), BesTView::fTN, genRecEmupikp::i, and kRad.
00960 { 00961 //*-*-*-*-*-*-*-Find critical THETA sectors for given PHI sector*-*-*-*-*-* 00962 //*-* ================================================ * 00963 //*-* * 00964 //*-* Input: IOPT - options: 1 - from BACK to FRONT 'BF' * 00965 //*-* 2 - from FRONT to BACK 'FB' * 00966 //*-* PHI - PHI sector * 00967 //*-* KTH - number of THETA sectors * 00968 //*-* ATH(*) - THETA separators (modified internally) * 00969 //*-* * 00970 //*-* Output: ITH1 - initial sector * 00971 //*-* ITH2 - final sector * 00972 //*-* * 00973 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 00974 00975 Int_t i, k, ith[2]; 00976 Double_t z1, z2, cosphi, sinphi, tncons, th1, th2, dth; 00977 00978 /* Parameter adjustments */ 00979 --ath; 00980 00981 /* Function Body */ 00982 dth = TMath::Abs(ath[kth + 1] - ath[1]); 00983 if (dth != 360) { 00984 ath[kth + 2] = 0.5*(ath[1] + ath[kth + 1]) + 180; 00985 ath[kth + 3] = ath[1] + 360; 00986 kth += 2; 00987 } 00988 00989 //*-*- F I N D C R I T I C A L S E C T O R S 00990 00991 cosphi = TMath::Cos(phi*kRad); 00992 sinphi = TMath::Sin(phi*kRad); 00993 k = 0; 00994 for (i = 1; i <= kth; ++i) { 00995 th1 = kRad*ath[i]; 00996 th2 = kRad*ath[i + 1]; 00997 FindNormal(TMath::Cos(th1)*cosphi, TMath::Cos(th1)*sinphi, -TMath::Sin(th1), z1); 00998 FindNormal(TMath::Cos(th2)*cosphi, TMath::Cos(th2)*sinphi, -TMath::Sin(th2), z2); 00999 if (z1 >= 0 && z2 > 0) continue; 01000 if (z1 <= 0 && z2 < 0) continue; 01001 ++k; 01002 if (k == 3) break; 01003 ith[k - 1] = i; 01004 } 01005 if (k != 2) { 01006 Error("FindThetaSectors", "Something strange: num. of critical sectors not equal 2"); 01007 ith1 = 1; 01008 ith2 = 2; 01009 return; 01010 } 01011 01012 //*-*- 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 01013 01014 tncons = fTN[8]*TMath::Cos(phi*kRad) + fTN[9]*TMath::Sin(phi*kRad); 01015 th1 = kRad*(ath[ith[0]] + ath[ith[0] + 1]) / (float)2.; 01016 th2 = kRad*(ath[ith[1]] + ath[ith[1] + 1]) / (float)2.; 01017 z1 = tncons*TMath::Sin(th1) + fTN[10]*TMath::Cos(th1); 01018 z2 = tncons*TMath::Sin(th2) + fTN[10]*TMath::Cos(th2); 01019 if ((z1 <= z2 && iopt == 1) || (z1 > z2 && iopt == 2)) { 01020 ith1 = ith[0]; 01021 ith2 = ith[1]; 01022 } else { 01023 ith1 = ith[1]; 01024 ith2 = ith[0]; 01025 } 01026 }
virtual void Bes2DView::Front | ( | ) | [inline, virtual] |
Reimplemented from BesTView.
Definition at line 107 of file Bes2DView.h.
References BesTView::Top().
00107 { BesTView::Top(); }
void BesTView::FrontView | ( | TVirtualPad * | pad = 0 |
) | [virtual, inherited] |
Definition at line 1705 of file BesTView.cxx.
References BesTView::RotateView().
Referenced by BesTView::Front().
01706 { 01707 // Set to front view. 01708 RotateView(270.0,90.0,pad); 01709 }
Int_t Bes2DView::Get2DViewType | ( | ) | [inline] |
Bool_t BesTView::GetAutoRange | ( | ) | [inline, inherited] |
Definition at line 93 of file BesTView.h.
References BesTView::fAutoRange.
00093 {return fAutoRange;}
Int_t BesTView::GetDistancetoAxis | ( | Int_t | axis, | |
Int_t | px, | |||
Int_t | py, | |||
Double_t & | ratio | |||
) | [virtual, inherited] |
Definition at line 1052 of file BesTView.cxx.
References check_raw_filter::dist, BesTView::fSystem, BesTView::fX1, BesTView::fX2, BesTView::fY1, BesTView::fY2, BesTView::fZ1, BesTView::fZ2, v, and x.
01053 { 01054 //*-*-*-*-*-*-*-*-*-*-*-*-*Return distance to axis from point px,py*-*-*-* 01055 //*-* ======================================== 01056 //*-* 01057 //*-* 01058 //*-* Algorithm: 01059 //*-* 01060 //*-* A(x1,y1) P B(x2,y2) 01061 //*-* ------------------------------------------------ 01062 //*-* I 01063 //*-* I 01064 //*-* I 01065 //*-* I 01066 //*-* M(x,y) 01067 //*-* 01068 //*-* Let us call a = distance AM A=a**2 01069 //*-* b = distance BM B=b**2 01070 //*-* c = distance AB C=c**2 01071 //*-* d = distance PM D=d**2 01072 //*-* u = distance AP U=u**2 01073 //*-* v = distance BP V=v**2 c = u + v 01074 //*-* 01075 //*-* D = A - U 01076 //*-* D = B - V = B -(c-u)**2 01077 //*-* ==> u = (A -B +C)/2c 01078 //*-* 01079 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 01080 01081 Double_t x1,y1,x2,y2; 01082 Double_t x = px; 01083 Double_t y = py; 01084 ratio = 0; 01085 01086 if (fSystem != 1) return 9998; // only implemented for Cartesian coordinates 01087 if (axis == 1) { 01088 x1 = gPad->XtoAbsPixel(fX1[0]); 01089 y1 = gPad->YtoAbsPixel(fX1[1]); 01090 x2 = gPad->XtoAbsPixel(fX2[0]); 01091 y2 = gPad->YtoAbsPixel(fX2[1]); 01092 } else if (axis == 2) { 01093 x1 = gPad->XtoAbsPixel(fY1[0]); 01094 y1 = gPad->YtoAbsPixel(fY1[1]); 01095 x2 = gPad->XtoAbsPixel(fY2[0]); 01096 y2 = gPad->YtoAbsPixel(fY2[1]); 01097 } else { 01098 x1 = gPad->XtoAbsPixel(fZ1[0]); 01099 y1 = gPad->YtoAbsPixel(fZ1[1]); 01100 x2 = gPad->XtoAbsPixel(fZ2[0]); 01101 y2 = gPad->YtoAbsPixel(fZ2[1]); 01102 } 01103 Double_t xx1 = x - x1; 01104 Double_t xx2 = x - x2; 01105 Double_t x1x2 = x1 - x2; 01106 Double_t yy1 = y - y1; 01107 Double_t yy2 = y - y2; 01108 Double_t y1y2 = y1 - y2; 01109 Double_t a = xx1*xx1 + yy1*yy1; 01110 Double_t b = xx2*xx2 + yy2*yy2; 01111 Double_t c = x1x2*x1x2 + y1y2*y1y2; 01112 if (c <= 0) return 9999; 01113 Double_t v = TMath::Sqrt(c); 01114 Double_t u = (a - b + c)/(2*v); 01115 Double_t d = TMath::Abs(a - u*u); 01116 01117 Int_t dist = Int_t(TMath::Sqrt(d) - 0.5); 01118 ratio = u/v; 01119 return dist; 01120 }
Double_t BesTView::GetDproj | ( | ) | const [inline, inherited] |
Double_t BesTView::GetDview | ( | ) | const [inline, inherited] |
Double_t BesTView::GetExtent | ( | ) | const [inherited] |
Definition at line 1123 of file BesTView.cxx.
References BesTView::fRmax, and BesTView::fRmin.
Referenced by BesView::GetZoomRatio(), BesTView::SetDefaultWindow(), BesTView::ZoomIn(), and BesTView::ZoomOut().
01124 { 01125 //*-*-*-*-*-*-*-*-*-*-*-*-*-*Get maximum view extent-*-*-*-*-*-*-*-*-*-*-*-*-* 01126 //*-* ======================= 01127 //*-* 01128 Double_t dx = 0.5*(fRmax[0]-fRmin[0]); 01129 Double_t dy = 0.5*(fRmax[1]-fRmin[1]); 01130 Double_t dz = 0.5*(fRmax[2]-fRmin[2]); 01131 Double_t extent = TMath::Sqrt(dx*dx+dy*dy+dz*dz); 01132 return extent; 01133 }
Bool_t Bes2DView::GetFishEye | ( | ) | [inline] |
Bool_t Bes2DView::GetFishEyeStatus | ( | ) | [inline] |
Definition at line 88 of file Bes2DView.h.
References BesStatus::fFishEye, and fStatusCurrent.
00088 { return fStatusCurrent->fFishEye; }
Double_t BesTView::GetLatitude | ( | ) | [inline, inherited] |
Definition at line 94 of file BesTView.h.
References BesTView::fLatitude.
Referenced by BesClient::ExecuteReturn(), BesClient::HandleSliders(), BesClient::RotatePhi(), BesClient::RotatePsi(), BesClient::RotateTheta(), and BesClient::UpdateBesInputFields().
00094 {return fLatitude;}
Double_t BesTView::GetLongitude | ( | ) | [inline, inherited] |
Definition at line 95 of file BesTView.h.
References BesTView::fLongitude.
Referenced by BesClient::ExecuteReturn(), BesClient::HandleSliders(), Tof2DScin::HasZRSection(), Mdc2DWire::HasZRSection(), Emc2DCrystal::HasZRSection(), Emc2DCrystal::IsSideVisible(), Muc2DStrip::IsZRVisible(), MucROOTGeo::IsZRVisible(), BesPolygon2D::Paint(), BesGeoTrack::Paint(), BesClient::RotatePhi(), BesClient::RotatePsi(), BesClient::RotateTheta(), and BesClient::UpdateBesInputFields().
00095 {return fLongitude;}
Float_t Bes2DView::GetMarkerSize | ( | ) | [inline] |
char * Bes2DView::GetObjectInfo | ( | Int_t | px, | |
Int_t | py | |||
) | const [virtual] |
Definition at line 426 of file Bes2DView.cxx.
References f2DViewType.
00426 { 00427 // 00428 // Returns string containing info about the object at position (px,py). 00429 Double_t pw[3]; 00430 //((TPad*)gPad)->PixeltoWC(px, py, pw); 00431 00432 static char info[64]; 00433 if ( f2DViewType == 1 ) { 00434 sprintf(info, "z=%-.3fcm, r=%-.3fcm", pw[0], pw[1]); 00435 return info; 00436 } else { 00437 sprintf(info, "x=%-.3fcm, y=%-.3fcm", pw[0], pw[1]); 00438 return info; 00439 } 00440 }
TSeqCollection* BesTView::GetOutline | ( | ) | [inline, inherited] |
Double_t BesTView::GetPsi | ( | ) | [inline, inherited] |
Definition at line 96 of file BesTView.h.
References BesTView::fPsi.
Referenced by BesTView::ExecuteRotateView(), BesClient::HandleSliders(), BesClient::RotatePhi(), BesClient::RotatePsi(), BesClient::RotateTheta(), and BesClient::UpdateBesInputFields().
00096 {return fPsi;}
void BesTView::GetRange | ( | Double_t * | min, | |
Double_t * | max | |||
) | [virtual, inherited] |
Definition at line 1147 of file BesTView.cxx.
References BesTView::fRmax, BesTView::fRmin, and genRecEmupikp::i.
01148 { 01149 // Get Range function. 01150 01151 for (Int_t i = 0; i < 3; max[i] = fRmax[i], min[i] = fRmin[i], i++) { } 01152 }
void BesTView::GetRange | ( | Float_t * | min, | |
Float_t * | max | |||
) | [virtual, inherited] |
Definition at line 1137 of file BesTView.cxx.
References BesTView::fRmax, BesTView::fRmin, and genRecEmupikp::i.
Referenced by BesTView::AdjustScales(), BesTView::Centered3DImages(), Muc2DStrip::Paint(), BesTView::SetRange(), and BesTView::ZoomView().
01138 { 01139 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Get Range function-*-*-*-*-*-*-*-*-*-*-*-*-* 01140 //*-* ================== 01141 //*-* 01142 for (Int_t i = 0; i < 3; max[i] = fRmax[i], min[i] = fRmin[i], i++); 01143 }
Double_t* BesTView::GetRmax | ( | ) | [inline, inherited] |
Double_t* BesTView::GetRmin | ( | ) | [inline, inherited] |
Int_t Bes2DView::GetRSign | ( | Float_t | Phi | ) | [virtual] |
Definition at line 224 of file Bes2DView.cxx.
References fPhiRangeMax, BesStatus::fPhiRangeMin, and fStatusCurrent.
00224 { 00225 // 00226 // Get sign of the R coordinate (ZR view) 00227 // for a given phi (in radians) 00228 Int_t Sign; 00229 00230 // Convert to deg, because phi range is given in degrees 00231 Float_t Phi2 = (Phi - 2*TMath::Pi()*Int_t(Phi/(2*TMath::Pi()))) 00232 * 180./TMath::Pi(); 00233 if ( Phi2 < 0 ) Phi2 += 360; 00234 if ( Phi2 >= fStatusCurrent->fPhiRangeMin && Phi2 < fStatusCurrent->fPhiRangeMax ) { 00235 Sign = 1; 00236 } else { 00237 Sign = -1; 00238 } 00239 return Sign; 00240 }
BesStatus* Bes2DView::GetStatusCurrent | ( | ) | [inline] |
Definition at line 127 of file Bes2DView.h.
References fStatusCurrent.
00127 { return fStatusCurrent; };
Int_t BesTView::GetSystem | ( | ) | [inline, inherited] |
Definition at line 105 of file BesTView.h.
References BesTView::fSystem.
Referenced by BesTView::ExecuteRotateView().
00105 {return fSystem;}
Double_t* BesTView::GetTback | ( | ) | [inline, inherited] |
Double_t* BesTView::GetTN | ( | ) | [inline, inherited] |
Double_t* BesTView::GetTnorm | ( | ) | [inline, inherited] |
void BesTView::GetWindow | ( | Double_t & | u0, | |
Double_t & | v0, | |||
Double_t & | du, | |||
Double_t & | dv | |||
) | const [inherited] |
Definition at line 1155 of file BesTView.cxx.
References BesTView::fUVcoord.
01156 { 01157 // Get current window extent. 01158 u0 = fUVcoord[0]; 01159 v0 = fUVcoord[1]; 01160 du = fUVcoord[2]; 01161 dv = fUVcoord[3]; 01162 }
Double_t BesTView::GetWindowHeight | ( | ) | const [inline, inherited] |
Double_t BesTView::GetWindowWidth | ( | ) | const [inline, inherited] |
virtual Double_t Bes2DView::GetZoomFactor | ( | ) | [inline, virtual] |
virtual void Bes2DView::Inspect | ( | ) | [inline, virtual] |
Bool_t BesTView::IsClippedNDC | ( | Double_t * | p | ) | const [inherited] |
Definition at line 1165 of file BesTView.cxx.
01166 { 01167 //*-*-*-*-*-*-*Check if point is clipped in perspective view-*-*-*-*-*-*-*-* 01168 //*-* ============================================= 01169 //*-* 01170 if (TMath::Abs(p[0])>p[2]) return kTRUE; 01171 if (TMath::Abs(p[1])>p[2]) return kTRUE; 01172 return kFALSE; 01173 }
Bool_t BesTView::IsPerspective | ( | ) | const [inline, inherited] |
Definition at line 113 of file BesTView.h.
References BesTView::kPerspective.
Referenced by BesTView::DefineViewDirection(), BesTView::ExecuteRotateView(), BesClient::HandleButtons(), BesTView::MoveFocus(), BesTView::MoveWindow(), BesTView::ResetView(), BesTView::ResizePad(), BesTView::SetParallel(), BesTView::SetPerspective(), BesTView::SetRange(), BesView::SetViewType(), BesClient::UpdateStatus(), BesTView::WCtoNDC(), BesTView::ZoomIn(), and BesTView::ZoomOut().
00113 {return TestBit(kPerspective);}
Bool_t BesTView::IsViewChanged | ( | ) | const [inline, inherited] |
void Bes2DView::Move | ( | Int_t | px, | |
Int_t | py | |||
) |
Definition at line 167 of file Bes2DView.cxx.
References x.
00167 { 00168 // 00169 // Move (px, py in pixel coordinates) 00170 Double_t x1, y1, x2, y2, dx, dy, x, y, x0, y0; 00171 x1 = gPad->GetX1(); 00172 y1 = gPad->GetY1(); 00173 x2 = gPad->GetX2(); 00174 y2 = gPad->GetY2(); 00175 x0 = gPad->PixeltoX(0); 00176 y0 = gPad->PixeltoY(0); 00177 x = gPad->PixeltoX(px); 00178 y = gPad->PixeltoY(py); 00179 dx = -(x - x0); 00180 dy = -(y - y0); 00181 //((TPad*)gPad)->SetNoAspect(kTRUE); 00182 gPad->Range(x1+dx, y1+dy, x2+dx, y2+dy); 00183 //((TPad*)gPad)->SetNoAspect(kFALSE); 00184 gPad->Modified(); 00185 }
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 | |||
) | [inherited] |
Definition at line 1798 of file BesTView.cxx.
References BesTView::DefinePerspectiveView(), BesTView::fLatitude, BesTView::fLongitude, BesTView::fPsi, BesTView::fRmax, genRecEmupikp::i, BesTView::IsPerspective(), ganga-rec::j, and BesTView::SetDefaultWindow().
01800 { 01801 // Move focus to a different box position and extent in nsteps. Perform rotation 01802 // with dlat,dlong,dpsi at each step. 01803 if (!IsPerspective()) return; 01804 if (nsteps<1) return; 01805 Double_t fc = 1./Double_t(nsteps); 01806 Double_t oc[3], od[3], dir[3]; 01807 dir[0] = 0; 01808 dir[1] = 0; 01809 dir[2] = 1.; 01810 Int_t i, j; 01811 for (i=0; i<3; i++) { 01812 oc[i] = 0.5*(fRmin[i]+fRmax[i]); 01813 od[i] = 0.5*(fRmax[i]-fRmin[i]); 01814 } 01815 Double_t dox = cov[0]-oc[0]; 01816 Double_t doy = cov[1]-oc[1]; 01817 Double_t doz = cov[2]-oc[2]; 01818 01819 Double_t dd = TMath::Sqrt(dox*dox+doy*doy+doz*doz); 01820 if (dd!=0) {; 01821 dir[0] = dox/dd; 01822 dir[1] = doy/dd; 01823 dir[2] = doz/dd; 01824 } 01825 dd *= fc; 01826 dox = fc*(dx-od[0]); 01827 doy = fc*(dy-od[1]); 01828 doz = fc*(dz-od[2]); 01829 for (i=0; i<nsteps; i++) { 01830 oc[0] += dd*dir[0]; 01831 oc[1] += dd*dir[1]; 01832 oc[2] += dd*dir[2]; 01833 od[0] += dox; 01834 od[1] += doy; 01835 od[2] += doz; 01836 for (j=0; j<3; j++) { 01837 fRmin[j] = oc[j]-od[j]; 01838 fRmax[j] = oc[j]+od[j]; 01839 } 01840 SetDefaultWindow(); 01841 fLatitude += dlat; 01842 fLongitude += dlong; 01843 fPsi += dpsi; 01844 DefinePerspectiveView(); 01845 if (gPad) { 01846 gPad->Modified(); 01847 gPad->Update(); 01848 } 01849 } 01850 }
void BesTView::MoveViewCommand | ( | Char_t | chCode, | |
Int_t | count = 1 | |||
) | [virtual, inherited] |
Definition at line 1853 of file BesTView.cxx.
References BesTView::MoveWindow(), BesTView::UnzoomView(), BesTView::ZoomIn(), BesTView::ZoomOut(), and BesTView::ZoomView().
Referenced by BesTView::ExecuteRotateView().
01854 { 01855 // 01856 //*-* 'a' //*-* increase scale factor (clip cube borders) 01857 //*-* 's' //*-* decrease scale factor (clip cube borders) 01858 // 01859 if (count <= 0) count = 1; 01860 switch (option) { 01861 case '+': 01862 ZoomView(); 01863 break; 01864 case '-': 01865 UnzoomView(); 01866 break; 01867 case 's': 01868 case 'S': 01869 UnzoomView(); 01870 break; 01871 case 'a': 01872 case 'A': 01873 ZoomView(); 01874 break; 01875 case 'l': 01876 case 'L': 01877 case 'h': 01878 case 'H': 01879 case 'u': 01880 case 'U': 01881 case 'i': 01882 case 'I': 01883 MoveWindow(option); 01884 break; 01885 case 'j': 01886 case 'J': 01887 ZoomIn(); 01888 break; 01889 case 'k': 01890 case 'K': 01891 ZoomOut(); 01892 break; 01893 default: 01894 break; 01895 } 01896 }
void BesTView::MoveWindow | ( | Char_t | option | ) | [inherited] |
Definition at line 1899 of file BesTView.cxx.
References BesTView::DefinePerspectiveView(), BesTView::fUVcoord, and BesTView::IsPerspective().
Referenced by BesTView::MoveViewCommand().
01900 { 01901 // Move view window : 01902 // l,L - left 01903 // h,H - right 01904 // u,U - down 01905 // i,I - up 01906 if (!IsPerspective()) return; 01907 Double_t shiftu = 0.1*fUVcoord[2]; 01908 Double_t shiftv = 0.1*fUVcoord[3]; 01909 switch (option) { 01910 case 'l': 01911 case 'L': 01912 fUVcoord[0] += shiftu; 01913 break; 01914 case 'h': 01915 case 'H': 01916 fUVcoord[0] -= shiftu; 01917 break; 01918 case 'u': 01919 case 'U': 01920 fUVcoord[1] += shiftv; 01921 break; 01922 case 'i': 01923 case 'I': 01924 fUVcoord[1] -= shiftv; 01925 break; 01926 default: 01927 return; 01928 } 01929 DefinePerspectiveView(); 01930 if (gPad) { 01931 gPad->Modified(); 01932 gPad->Update(); 01933 } 01934 }
void Bes2DView::NDCtoWC | ( | const Double_t * | pn, | |
Double_t * | pw | |||
) | [virtual] |
Reimplemented from BesTView.
Definition at line 387 of file Bes2DView.cxx.
References f2DViewType, BesStatus::fFishEye, fStatusCurrent, BesTView::NDCtoWC(), and BesTView::WCtoNDC().
00387 { 00388 // 00389 // Transform back from NDCs 00390 Double_t p[3]; 00391 if (f2DViewType == 0) { // XYView 00392 p[0] = pn[0]; 00393 p[1] = pn[1]; 00394 p[2] = pn[2]; 00395 } 00396 else { // ZRView 00397 p[0] = pn[2]; 00398 p[1] = pn[1]; 00399 p[2] = pn[0]; 00400 } 00401 00402 if ( fStatusCurrent->fFishEye == kTRUE ) { 00403 Double_t r; 00404 if ( f2DViewType == 1 ) { 00405 Double_t pvWC[3], pvNDC[3]; 00406 pvWC[0] = +4; 00407 pvWC[1] = 0; 00408 pvWC[2] = 0; 00409 BesTView::WCtoNDC(pvWC, pvNDC); 00410 p[0] = TMath::Sign((pn[0] - pvNDC[0])*(pn[0] - pvNDC[0]), 00411 pn[0] - pvNDC[0]) + pvNDC[0]; 00412 p[1] = TMath::Sign((pn[1] - pvNDC[1])*(pn[1] - pvNDC[1]), 00413 pn[1] - pvNDC[1]) + pvNDC[1]; 00414 } else { 00415 r = TMath::Sqrt(TMath::Power(p[0],2) 00416 +TMath::Power(p[1],2)); 00417 p[0] *= r; 00418 p[1] *= r; 00419 } 00420 } 00421 BesTView::NDCtoWC(p, pw); 00422 }
void Bes2DView::NDCtoWC | ( | const Float_t * | pn, | |
Float_t * | pw | |||
) | [virtual] |
Reimplemented from BesTView.
Definition at line 348 of file Bes2DView.cxx.
References f2DViewType, BesStatus::fFishEye, fStatusCurrent, BesTView::NDCtoWC(), and BesTView::WCtoNDC().
00348 { 00349 // 00350 // Transform back from NDCs 00351 Float_t p[3]; 00352 if (f2DViewType == 0) { // XYView 00353 p[0] = pn[0]; 00354 p[1] = pn[1]; 00355 p[2] = pn[2]; 00356 } 00357 else { // ZRView 00358 p[0] = pn[2]; 00359 p[1] = pn[1]; 00360 p[2] = pn[0]; 00361 } 00362 00363 if ( fStatusCurrent->fFishEye == kTRUE ) { 00364 Float_t r; 00365 if ( f2DViewType == 1 ) { 00366 Float_t pvWC[3], pvNDC[3]; 00367 pvWC[0] = +4; 00368 pvWC[1] = 0; 00369 pvWC[2] = 0; 00370 BesTView::WCtoNDC(pvWC, pvNDC); 00371 p[0] = TMath::Sign((pn[0] - pvNDC[0])*(pn[0] - pvNDC[0]), 00372 pn[0] - pvNDC[0]) + pvNDC[0]; 00373 p[1] = TMath::Sign((pn[1] - pvNDC[1])*(pn[1] - pvNDC[1]), 00374 pn[1] - pvNDC[1]) + pvNDC[1]; 00375 } else { 00376 r = TMath::Sqrt(TMath::Power(p[0],2) 00377 +TMath::Power(p[1],2)); 00378 p[0] *= r; 00379 p[1] *= r; 00380 } 00381 } 00382 BesTView::NDCtoWC(p, pw); 00383 }
void BesTView::NormalWCtoNDC | ( | const Double_t * | pw, | |
Double_t * | pn | |||
) | [virtual, inherited] |
Definition at line 1238 of file BesTView.cxx.
References BesTView::fTnorm, and x.
01239 { 01240 //*-*-*Transfer vector of NORMAL from word to normalized coodinates-*-*-*-* 01241 //*-* ============================================================ 01242 //*-* 01243 //*-* Input: PW(3) - vector of NORMAL in word coordinate system 01244 //*-* PN(3) - vector of NORMAL in normalized coordinate system 01245 //*-* 01246 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 01247 01248 Double_t x, y, z, a1, a2, a3, b1, b2, b3, c1, c2, c3; 01249 01250 x = pw[0]; 01251 y = pw[1]; 01252 z = pw[2]; 01253 a1 = fTnorm[0]; 01254 a2 = fTnorm[1]; 01255 a3 = fTnorm[2]; 01256 b1 = fTnorm[4]; 01257 b2 = fTnorm[5]; 01258 b3 = fTnorm[6]; 01259 c1 = fTnorm[8]; 01260 c2 = fTnorm[9]; 01261 c3 = fTnorm[10]; 01262 pn[0] = x*(b2*c3 - b3*c2) + y*(b3*c1 - b1*c3) + z*(b1*c2 - b2*c1); 01263 pn[1] = x*(c2*a3 - c3*a2) + y*(c3*a1 - c1*a3) + z*(c1*a2 - c2*a1); 01264 pn[2] = x*(a2*b3 - a3*b2) + y*(a3*b1 - a1*b3) + z*(a1*b2 - a2*b1); 01265 }
void BesTView::NormalWCtoNDC | ( | const Float_t * | pw, | |
Float_t * | pn | |||
) | [virtual, inherited] |
Definition at line 1208 of file BesTView.cxx.
References BesTView::fTnorm, and x.
01209 { 01210 //*-*-*Transfer vector of NORMAL from word to normalized coodinates-*-*-*-* 01211 //*-* ============================================================ 01212 //*-* 01213 //*-* Input: PW(3) - vector of NORMAL in word coordinate system 01214 //*-* PN(3) - vector of NORMAL in normalized coordinate system 01215 //*-* 01216 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 01217 01218 Double_t x, y, z, a1, a2, a3, b1, b2, b3, c1, c2, c3; 01219 01220 x = pw[0]; 01221 y = pw[1]; 01222 z = pw[2]; 01223 a1 = fTnorm[0]; 01224 a2 = fTnorm[1]; 01225 a3 = fTnorm[2]; 01226 b1 = fTnorm[4]; 01227 b2 = fTnorm[5]; 01228 b3 = fTnorm[6]; 01229 c1 = fTnorm[8]; 01230 c2 = fTnorm[9]; 01231 c3 = fTnorm[10]; 01232 pn[0] = x*(b2*c3 - b3*c2) + y*(b3*c1 - b1*c3) + z*(b1*c2 - b2*c1); 01233 pn[1] = x*(c2*a3 - c3*a2) + y*(c3*a1 - c1*a3) + z*(c1*a2 - c2*a1); 01234 pn[2] = x*(a2*b3 - a3*b2) + y*(a3*b1 - a1*b3) + z*(a1*b2 - a2*b1); 01235 }
void BesTView::PadRange | ( | Int_t | rback | ) | [virtual, inherited] |
Definition at line 1268 of file BesTView.cxx.
References BesTView::fRmax, BesTView::fRmin, BesTView::fTnorm, genRecEmupikp::i, and x.
01269 { 01270 //*-*-*-*-*Set the correct window size for lego and surface plots*-*-*-*-* 01271 //*-* ====================================================== 01272 //*-* 01273 //*-* Set the correct window size for lego and surface plots. 01274 //*-* And draw the background if necessary. 01275 //*-* 01276 //*-* Input parameters: 01277 //*-* 01278 //*-* RBACK : Background colour 01279 //*-* 01280 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 01281 01282 Int_t i, k; 01283 Double_t x, y, z, r1, r2, r3, xx, yy, smax[2]; 01284 Double_t xgraf[6], ygraf[6]; 01285 01286 for (i = 1; i <= 2; ++i) { 01287 smax[i - 1] = fTnorm[(i << 2) - 1]; 01288 for (k = 1; k <= 3; ++k) { 01289 if (fTnorm[k + (i << 2) - 5] < 0) { 01290 smax[i - 1] += fTnorm[k + (i << 2) - 5]*fRmin[k-1]; 01291 } else { 01292 smax[i - 1] += fTnorm[k + (i << 2) - 5]*fRmax[k-1]; 01293 } 01294 } 01295 } 01296 01297 //*-*- Compute x,y range 01298 Double_t xmin = -smax[0]; 01299 Double_t xmax = smax[0]; 01300 Double_t ymin = -smax[1]; 01301 Double_t ymax = smax[1]; 01302 Double_t dx = xmax-xmin; 01303 Double_t dy = ymax-ymin; 01304 Double_t dxr = dx/(1 - gPad->GetLeftMargin() - gPad->GetRightMargin()); 01305 Double_t dyr = dy/(1 - gPad->GetBottomMargin() - gPad->GetTopMargin()); 01306 01307 // Range() could change the size of the pad pixmap and therefore should 01308 // be called before the other paint routines 01309 gPad->Range(xmin - dxr*gPad->GetLeftMargin(), 01310 ymin - dyr*gPad->GetBottomMargin(), 01311 xmax + dxr*gPad->GetRightMargin(), 01312 ymax + dyr*gPad->GetTopMargin()); 01313 gPad->RangeAxis(xmin, ymin, xmax, ymax); 01314 01315 //*-*- Draw the background if necessary 01316 01317 if (rback > 0) { 01318 r1 = -1; 01319 r2 = -1; 01320 r3 = -1; 01321 xgraf[0] = -smax[0]; 01322 xgraf[1] = -smax[0]; 01323 xgraf[2] = -smax[0]; 01324 xgraf[3] = -smax[0]; 01325 xgraf[4] = smax[0]; 01326 xgraf[5] = smax[0]; 01327 ygraf[0] = -smax[1]; 01328 ygraf[1] = smax[1]; 01329 ygraf[2] = -smax[1]; 01330 ygraf[3] = smax[1]; 01331 ygraf[5] = smax[1]; 01332 ygraf[4] = -smax[1]; 01333 for (i = 1; i <= 8; ++i) { 01334 x = 0.5*((1 - r1)*fRmin[0] + (r1 + 1)*fRmax[0]); 01335 y = 0.5*((1 - r2)*fRmin[1] + (r2 + 1)*fRmax[1]); 01336 z = 0.5*((1 - r3)*fRmin[2] + (r3 + 1)*fRmax[2]); 01337 xx = fTnorm[0]*x + fTnorm[1]*y + fTnorm[2]*z + fTnorm[3]; 01338 yy = fTnorm[4]*x + fTnorm[5]*y + fTnorm[6]*z + fTnorm[7]; 01339 if (TMath::Abs(xx - xgraf[1]) <= 1e-4) { 01340 if (ygraf[1] >= yy) ygraf[1] = yy; 01341 if (ygraf[2] <= yy) ygraf[2] = yy; 01342 } 01343 if (TMath::Abs(xx - xgraf[5]) <= 1e-4) { 01344 if (ygraf[5] >= yy) ygraf[5] = yy; 01345 if (ygraf[4] <= yy) ygraf[4] = yy; 01346 } 01347 if (TMath::Abs(yy - ygraf[0]) <= 1e-4) xgraf[0] = xx; 01348 if (TMath::Abs(yy - ygraf[3]) <= 1e-4) xgraf[3] = xx; 01349 r1 = -r1; 01350 if (i % 2 == 0) r2 = -r2; 01351 if (i >= 4) r3 = 1; 01352 } 01353 gPad->PaintFillArea(6, xgraf, ygraf); 01354 } 01355 }
void Bes2DView::PrintCurrent | ( | ) | [inline] |
Definition at line 103 of file Bes2DView.h.
References fStatusCurrent.
00103 { fStatusCurrent->Print(); }
void Bes2DView::Reset | ( | ) |
Definition at line 444 of file Bes2DView.cxx.
References Center(), fZoomFactor, BesTView::SetRange(), and BesTView::ZoomView().
00444 { 00445 // 00446 // reset view to default values 00447 00448 // reset status instances of views 00449 //fStatus3D->Default(k3DView); 00450 //fStatusXY->Default(kXYView); 00451 //fStatusZR->Default(kZRView); 00452 fZoomFactor = 1.5; 00453 00454 // reset current status instance tp fViewType 00455 //fStatusCurrent->Default(fViewType); 00456 00457 // center the view 00458 this->Center(); 00459 this->SetRange(-2635,-2635,-2875,2635,2635,2875); 00460 //int iret; 00461 //this->SetView(0,0,270,iret); 00462 this->ZoomView(gPad, 1.5); 00463 00464 // reset phirange 00465 // this->SetPhiRange(0,180); 00466 //this->UpdateView(); 00467 gPad->Update(); 00468 }
void BesTView::ResetView | ( | Double_t | longitude, | |
Double_t | latitude, | |||
Double_t | psi, | |||
Int_t & | irep | |||
) | [protected, inherited] |
Definition at line 1553 of file BesTView.cxx.
References BesTView::DefinePerspectiveView(), BesTView::DefineViewDirection(), BesTView::FindScope(), BesTView::fLatitude, BesTView::fLongitude, BesTView::fPsi, BesTView::fTB, BesTView::fTback, BesTView::fTN, BesTView::fTnorm, BesTView::IsPerspective(), and kRad.
Referenced by BesTView::BesTView(), BesTView::ExecuteRotateView(), BesTView::SetParallel(), BesTView::SetPerspective(), BesTView::SetRange(), and BesTView::SetView().
01554 { 01555 //*-*-*-*-*-*-*-*-*Set view direction (in spherical coordinates)*-*-*-*-*-* 01556 //*-* ============================================= * 01557 //*-* * 01558 //*-* Input PHI - longitude * 01559 //*-* THETA - latitude (angle between +Z and view direction) * 01560 //*-* PSI - rotation in screen plane * 01561 //*-* * 01562 //*-* Output: IREP - reply (-1 if error in min-max) * 01563 //*-* * 01564 //*-* Errors: error in min-max scope * 01565 //*-* * 01566 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 01567 01568 Double_t scale[3], centre[3]; 01569 Double_t c1, c2, c3, s1, s2, s3; 01570 01571 //*-*- F I N D C E N T E R O F S C O P E A N D 01572 //*-*- S C A L E F A C T O R S 01573 01574 FindScope(scale, centre, irep); 01575 if (irep < 0) { 01576 Error("ResetView", "Error in min-max scope"); 01577 return; 01578 } 01579 01580 //*-*- 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 01581 01582 01583 fLongitude = longitude; 01584 fPsi = psi; 01585 fLatitude = latitude; 01586 01587 if (IsPerspective()) { 01588 DefinePerspectiveView(); 01589 return; 01590 } 01591 01592 c1 = TMath::Cos(longitude*kRad); 01593 s1 = TMath::Sin(longitude*kRad); 01594 c2 = TMath::Cos(latitude*kRad); 01595 s2 = TMath::Sin(latitude*kRad); 01596 c3 = TMath::Cos(psi*kRad); 01597 s3 = TMath::Sin(psi*kRad); 01598 DefineViewDirection(scale, centre, c1, s1, c2, s2, c3, s3, fTnorm, fTback); 01599 c3 = 1; 01600 s3 = 0; 01601 DefineViewDirection(scale, centre, c1, s1, c2, s2, c3, s3, fTN, fTB); 01602 }
void BesTView::ResizePad | ( | ) | [inherited] |
Definition at line 1533 of file BesTView.cxx.
References BesTView::DefinePerspectiveView(), BesTView::fUpix, BesTView::fUVcoord, BesTView::fVpix, BesTView::IsPerspective(), and BesTView::SetWindow().
01534 { 01535 // Recompute window for perspective view 01536 01537 if (!IsPerspective()) return; 01538 Double_t upix = fUpix; 01539 Double_t vpix = fVpix; 01540 // widh in pixels 01541 fUpix = gPad->GetWw()*gPad->GetAbsWNDC(); 01542 // height in pixels 01543 fVpix = gPad->GetWh()*gPad->GetAbsHNDC(); 01544 Double_t u0 = fUVcoord[0]*fUpix/upix; 01545 Double_t v0 = fUVcoord[1]*fVpix/vpix; 01546 Double_t du = fUVcoord[2]*fUpix/upix; 01547 Double_t dv = fUVcoord[3]*fVpix/vpix; 01548 SetWindow(u0, v0, du, dv); 01549 DefinePerspectiveView(); 01550 }
void BesTView::RotateView | ( | Double_t | phi, | |
Double_t | theta, | |||
TVirtualPad * | pad = 0 | |||
) | [virtual, inherited] |
Definition at line 1678 of file BesTView.cxx.
References BesTView::SetView(), and t().
Referenced by BesTView::FrontView(), BesTView::SideView(), and BesTView::TopView().
01679 { 01680 // API to rotate view and adjust the pad provided it the current one. 01681 01682 Int_t iret; 01683 Double_t p = phi; 01684 Double_t t = theta; 01685 SetView(p, t, 0, iret); 01686 01687 // Adjust current pad too 01688 TVirtualPad *thisPad = pad; 01689 if (!thisPad) thisPad = gPad; 01690 if (thisPad) { 01691 thisPad->SetPhi(-90-p); 01692 thisPad->SetTheta(90-t); 01693 thisPad->Modified(); 01694 thisPad->Update(); 01695 } 01696 }
void Bes2DView::Set2DViewType | ( | Int_t | viewType | ) | [inline] |
virtual void BesTView::SetAutoRange | ( | Bool_t | autorange = kTRUE |
) | [inline, virtual, inherited] |
Definition at line 121 of file BesTView.h.
References BesTView::fAutoRange.
00121 {fAutoRange=autorange;}
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, inherited] |
Definition at line 1358 of file BesTView.cxx.
References BesTView::fX1, BesTView::fX2, BesTView::fY1, BesTView::fY2, BesTView::fZ1, BesTView::fZ2, and genRecEmupikp::i.
01359 { 01360 //*-*-*-*-*-*-*-*-*-*-*-*-*Store axis coordinates in the NDC system*-*-*-* 01361 //*-* ======================================== 01362 //*-* 01363 01364 for (Int_t i=0;i<3;i++) { 01365 fX1[i] = x1[i]; 01366 fX2[i] = x2[i]; 01367 fY1[i] = y1[i]; 01368 fY2[i] = y2[i]; 01369 fZ1[i] = z1[i]; 01370 fZ2[i] = z2[i]; 01371 } 01372 }
void BesTView::SetDefaultWindow | ( | ) | [inherited] |
Definition at line 1375 of file BesTView.cxx.
References BesTView::fDproj, BesTView::fDview, BesTView::fUpix, BesTView::fVpix, BesTView::GetExtent(), and BesTView::SetWindow().
Referenced by BesTView::MoveFocus(), BesTView::SetPerspective(), and BesTView::SetRange().
01376 { 01377 // Set default viewing window 01378 if (!gPad) return; 01379 Double_t screen_factor = 1.; 01380 Double_t du, dv; 01381 Double_t extent = GetExtent(); 01382 fDview = 3*extent; 01383 fDproj = 0.5*extent; 01384 01385 // widh in pixels 01386 fUpix = gPad->GetWw()*gPad->GetAbsWNDC(); 01387 01388 // height in pixels 01389 fVpix = gPad->GetWh()*gPad->GetAbsHNDC(); 01390 du = 0.5*screen_factor*fDproj; 01391 dv = du*fVpix/fUpix; // keep aspect ratio 01392 SetWindow(0, 0, du, dv); 01393 }
void BesTView::SetDproj | ( | Double_t | dproj | ) | [inline, inherited] |
virtual void Bes2DView::SetDrawOption | ( | Option_t * | option | ) | [inline, virtual] |
void BesTView::SetDview | ( | Double_t | dview | ) | [inline, inherited] |
void Bes2DView::SetFishEye | ( | Bool_t | input = 0 |
) | [inline] |
Definition at line 90 of file Bes2DView.h.
References BesStatus::fFishEye, fFishEye, fStatusCurrent, and showlog::input.
00090 { 00091 /* 00092 if ( fViewType & k3DView ) { 00093 fFishEye = 0; 00094 fStatusCurrent->fFishEye = 0; 00095 } else { 00096 */ 00097 fFishEye = input; 00098 fStatusCurrent->fFishEye = input; 00099 00100 } // *TOGGLE*
void BesTView::SetLatitude | ( | Double_t | latitude | ) | [inline, inherited] |
Definition at line 126 of file BesTView.h.
References BesTView::fLatitude.
00126 {fLatitude = latitude;}
virtual void Bes2DView::SetLineAttributes | ( | ) | [inline, virtual] |
void BesTView::SetLongitude | ( | Double_t | longitude | ) | [inline, inherited] |
Definition at line 127 of file BesTView.h.
References BesTView::fLongitude.
00127 {fLongitude = longitude;}
void Bes2DView::SetMarkerSize | ( | Float_t | size | ) | [inline] |
void BesTView::SetOutlineToCube | ( | ) | [virtual, inherited] |
Definition at line 1396 of file BesTView.cxx.
References BesTView::DrawOutlineCube(), BesTView::fDefaultOutline, BesTView::fOutline, BesTView::fRmax, and BesTView::fRmin.
Referenced by BesTView::ExecuteRotateView(), and BesTView::SetRange().
01397 { 01398 //*-*-*-*-*-*-*This is a function which creates default outline*-*-*-*-*-* 01399 //*-* ================================================ * 01400 //*-* * 01401 //*-* x = fRmin[0] X = fRmax[0] * 01402 //*-* y = fRmin[1] Y = fRmax[1] * 01403 //*-* z = fRmin[2] Z = fRmax[2] * 01404 //*-* * 01405 //*-* * 01406 //*-* (x,Y,Z) +---------+ (X,Y,Z) * 01407 //*-* / /| * 01408 //*-* / / | * 01409 //*-* / / | * 01410 //*-* (x,y,Z) +---------+ | * 01411 //*-* | | + (X,Y,z) * 01412 //*-* | | / * 01413 //*-* | | / * 01414 //*-* | |/ * 01415 //*-* +---------+ * 01416 //*-* (x,y,z) (X,y,z) * 01417 //*-* * 01418 //*-* * 01419 //*-* * 01420 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-** 01421 01422 if (!fOutline) { 01423 fDefaultOutline = kTRUE; 01424 fOutline = new TList(); 01425 } 01426 DrawOutlineCube((TList*)fOutline,fRmin,fRmax); 01427 //TVirtualUtil3D *util = (TVirtualUtil3D*)gROOT->GetListOfSpecials()->FindObject("R__TVirtualUtil3D"); 01428 //if (util) util->DrawOutlineCube((TList*)fOutline,fRmin,fRmax); 01429 }
void BesTView::SetParallel | ( | ) | [virtual, inherited] |
Definition at line 1432 of file BesTView.cxx.
References BesTView::fLatitude, BesTView::fLongitude, BesTView::fPsi, BesTView::IsPerspective(), BesTView::kPerspective, and BesTView::ResetView().
Referenced by BesVisDisplay::DrawView(), BesClient::HandleButtons(), and BesView::SetViewType().
01433 { 01434 //set the parallel option (default) 01435 if (!IsPerspective()) return; 01436 SetBit(kPerspective, kFALSE); 01437 Int_t irep; 01438 ResetView(fLongitude, fLatitude, fPsi, irep); 01439 }
void BesTView::SetPerspective | ( | ) | [virtual, inherited] |
Definition at line 1442 of file BesTView.cxx.
References BesTView::fLatitude, BesTView::fLongitude, BesTView::fPsi, BesTView::IsPerspective(), BesTView::kPerspective, BesTView::ResetView(), and BesTView::SetDefaultWindow().
Referenced by BesTView::BesTView(), BesClient::HandleButtons(), and BesView::SetViewType().
01443 { 01444 //set perspective option 01445 if (IsPerspective()) return; 01446 SetBit(kPerspective, kTRUE); 01447 Int_t irep; 01448 SetDefaultWindow(); 01449 ResetView(fLongitude, fLatitude, fPsi, irep); 01450 }
void BesTView::SetPsi | ( | Double_t | psi | ) | [inline, inherited] |
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, inherited] |
Definition at line 1469 of file BesTView.cxx.
References BesTView::GetRange(), and BesTView::SetRange().
01470 { 01471 //*-*-*-*-*-*-*-*-*-*-*-*Set 3-D View range*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 01472 //*-* ================== 01473 //*-* 01474 //*-* Input: x0, y0, z0 are minimum coordinates 01475 //*-* x1, y1, z1 are maximum coordinates 01476 //*-* 01477 //*-* flag values are: 0 (set always) <- default 01478 //*-* 1 (shrink view) 01479 //*-* 2 (expand view) 01480 //*-* 01481 01482 01483 Double_t rmax[3], rmin[3]; 01484 01485 switch (flag) { 01486 case 2: // expand view 01487 GetRange(rmin, rmax); 01488 rmin[0] = x0 < rmin[0] ? x0 : rmin[0]; 01489 rmin[1] = y0 < rmin[1] ? y0 : rmin[1]; 01490 rmin[2] = z0 < rmin[2] ? z0 : rmin[2]; 01491 rmax[0] = x1 > rmax[0] ? x1 : rmax[0]; 01492 rmax[1] = y1 > rmax[1] ? y1 : rmax[1]; 01493 rmax[2] = z1 > rmax[2] ? z1 : rmax[2]; 01494 break; 01495 01496 case 1: // shrink view 01497 GetRange(rmin, rmax); 01498 rmin[0] = x0 > rmin[0] ? x0 : rmin[0]; 01499 rmin[1] = y0 > rmin[1] ? y0 : rmin[1]; 01500 rmin[2] = z0 > rmin[2] ? z0 : rmin[2]; 01501 rmax[0] = x1 < rmax[0] ? x1 : rmax[0]; 01502 rmax[1] = y1 < rmax[1] ? y1 : rmax[1]; 01503 rmax[2] = z1 < rmax[2] ? z1 : rmax[2]; 01504 break; 01505 01506 default: 01507 rmin[0] = x0; rmax[0] = x1; 01508 rmin[1] = y0; rmax[1] = y1; 01509 rmin[2] = z0; rmax[2] = z1; 01510 } 01511 SetRange(rmin, rmax); 01512 }
void BesTView::SetRange | ( | const Double_t * | min, | |
const Double_t * | max | |||
) | [virtual, inherited] |
Definition at line 1453 of file BesTView.cxx.
References BesTView::fDefaultOutline, BesTView::fLatitude, BesTView::fLongitude, BesTView::fPsi, BesTView::fRmax, BesTView::fRmin, genRecEmupikp::i, BesTView::IsPerspective(), BesTView::ResetView(), BesTView::SetDefaultWindow(), and BesTView::SetOutlineToCube().
Referenced by BesTView::AdjustScales(), BesTView::Centered3DImages(), BesView::DefaultRange(), BesVisDisplay::DrawView(), Reset(), BesTView::SetRange(), and BesTView::ZoomView().
01454 { 01455 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Set Range function-*-*-*-*-*-*-*-*-*-*-*-*-* 01456 //*-* ================== 01457 //*-* 01458 Int_t irep; 01459 for (Int_t i = 0; i < 3; fRmax[i] = max[i], fRmin[i] = min[i], i++) { } 01460 if (IsPerspective()) SetDefaultWindow(); 01461 ResetView(fLongitude, fLatitude, fPsi, irep); 01462 if(irep < 0) 01463 Error("SetRange", "problem setting view"); 01464 if(fDefaultOutline) SetOutlineToCube(); 01465 }
virtual void BesTView::SetSystem | ( | Int_t | system | ) | [inline, virtual, inherited] |
void BesTView::SetView | ( | Double_t | longitude, | |
Double_t | latitude, | |||
Double_t | psi, | |||
Int_t & | irep | |||
) | [virtual, inherited] |
Definition at line 1525 of file BesTView.cxx.
References BesTView::ResetView().
Referenced by BesVisDisplay::DrawView(), BesClient::ExecuteReturn(), BesTView::ExecuteRotateView(), BesClient::HandleButtons(), BesClient::HandleSliders(), BesClient::RotatePhi(), BesClient::RotatePsi(), BesClient::RotateTheta(), BesTView::RotateView(), BesView::SetViewType(), BesView::Side3D(), and BesView::Top3D().
01526 { 01527 //set view parameters 01528 01529 ResetView(longitude, latitude, psi, irep); 01530 }
void BesTView::SetViewChanged | ( | Bool_t | flag = kTRUE |
) | [inline, inherited] |
void BesTView::SetWindow | ( | Double_t | u0, | |
Double_t | v0, | |||
Double_t | du, | |||
Double_t | dv | |||
) | [inherited] |
Definition at line 1515 of file BesTView.cxx.
References BesTView::fUVcoord.
Referenced by BesTView::ResizePad(), and BesTView::SetDefaultWindow().
01516 { 01517 // Set viewing window. 01518 fUVcoord[0] = u0; 01519 fUVcoord[1] = v0; 01520 fUVcoord[2] = du; 01521 fUVcoord[3] = dv; 01522 }
virtual void Bes2DView::SetZoomFactor | ( | Double_t | factor | ) | [inline, virtual] |
void BesTView::ShowAxis | ( | ) | [inline, virtual, inherited] |
Definition at line 178 of file BesTView.h.
References BesTView::ToggleRulers().
Referenced by BesGeometry::Draw2DXY(), and BesGeometry::Draw2DZR().
00178 {ToggleRulers(); }
virtual void Bes2DView::Side | ( | ) | [inline, virtual] |
Reimplemented from BesTView.
Definition at line 108 of file Bes2DView.h.
References BesTView::Side().
00108 { BesTView::Side(); }
void BesTView::SideView | ( | TVirtualPad * | pad = 0 |
) | [virtual, inherited] |
Definition at line 1699 of file BesTView.cxx.
References BesTView::RotateView().
Referenced by BesTView::Side().
01700 { 01701 // Set to side view. 01702 RotateView(0,90.0,pad); 01703 }
void BesTView::ToggleRulers | ( | TVirtualPad * | pad = 0 |
) | [virtual, inherited] |
Definition at line 1717 of file BesTView.cxx.
Referenced by BesTView::ShowAxis().
01718 { 01719 // Turn on /off 3D axis 01720 //TVirtualUtil3D *util = (TVirtualUtil3D*)gROOT->GetListOfSpecials()->FindObject("R__TVirtualUtil3D"); 01721 //if (util) util->ToggleRulers(pad); 01722 TAxis3D::ToggleRulers(pad); 01723 }
void BesTView::ToggleZoom | ( | TVirtualPad * | pad = 0 |
) | [virtual, inherited] |
Definition at line 1726 of file BesTView.cxx.
Referenced by BesTView::ZoomMove().
01727 { 01728 // Turn on /off the interactive option to 01729 // Zoom / Move / Change attributes of 3D axis correspond this view 01730 //TVirtualUtil3D *util = (TVirtualUtil3D*)gROOT->GetListOfSpecials()->FindObject("R__TVirtualUtil3D"); 01731 //if (util) util->ToggleZoom(pad); 01732 TAxis3D::ToggleZoom(pad); 01733 }
virtual void Bes2DView::Top | ( | ) | [inline, virtual] |
Reimplemented from BesTView.
Definition at line 109 of file Bes2DView.h.
References BesTView::Front().
00109 { BesTView::Front(); }
void BesTView::TopView | ( | TVirtualPad * | pad = 0 |
) | [virtual, inherited] |
Definition at line 1711 of file BesTView.cxx.
References BesTView::RotateView().
Referenced by BesTView::Top().
01712 { 01713 // Set to top view. 01714 RotateView(270.0,0.0,pad); 01715 }
void Bes2DView::UnZoom | ( | ) | [virtual] |
Reimplemented from BesTView.
Definition at line 215 of file Bes2DView.cxx.
References fMarkerSize, fZoomFactor, and BesTView::UnzoomView().
00215 { 00216 // 00217 // Demagnify 00218 fMarkerSize = fMarkerSize / fZoomFactor; 00219 UnzoomView(gPad, fZoomFactor); 00220 }
void BesTView::UnzoomView | ( | TVirtualPad * | pad = 0 , |
|
Double_t | unZoomFactor = 1.25 | |||
) | [virtual, inherited] |
Definition at line 1769 of file BesTView.cxx.
References BesTView::ZoomView().
Referenced by BesTView::MoveViewCommand(), UnZoom(), BesTView::UnZoom(), and BesView::ZoomOut().
01770 { 01771 // unZOOM this view 01772 if (TMath::Abs(unZoomFactor) < 0.001) return; 01773 ZoomView(pad,1./unZoomFactor); 01774 }
void Bes2DView::UpdateView | ( | Bool_t | resetview = kFALSE |
) | [virtual] |
Definition at line 245 of file Bes2DView.cxx.
00245 { 00246 // 00247 // Update current view 00248 if ( !gGeometry ) return; 00249 00250 // Redraw 00251 //SetViewType(fViewType,resetview); 00252 }
void Bes2DView::WCtoNDC | ( | const Double_t * | pw, | |
Double_t * | pn | |||
) | [virtual] |
Reimplemented from BesTView.
Definition at line 315 of file Bes2DView.cxx.
References f2DViewType, BesStatus::fFishEye, fStatusCurrent, s, and BesTView::WCtoNDC().
00315 { 00316 // 00317 // Transform world coordinates to 00318 // normalised device coordinates. 00319 // This method was taken from BesTView 00320 // and extended by FishEye view 00321 BesTView::WCtoNDC(pw, pn); 00322 00323 if ( fStatusCurrent->fFishEye == kTRUE ) { 00324 Double_t r, s; 00325 if ( f2DViewType == 1 ) { 00326 Double_t pvWC[3], pvNDC[3]; 00327 pvWC[0] = +4; 00328 pvWC[1] = 0; 00329 pvWC[2] = 0; 00330 BesTView::WCtoNDC(pvWC, pvNDC); 00331 pn[0] = TMath::Sign(TMath::Sqrt(TMath::Abs(pn[0] - pvNDC[0])), 00332 pn[0] - pvNDC[0]) + pvNDC[0]; 00333 pn[1] = TMath::Sign(TMath::Sqrt(TMath::Abs(pn[1] - pvNDC[1])), 00334 pn[1] - pvNDC[1]) + pvNDC[1]; 00335 } else { 00336 00337 r = TMath::Sqrt(TMath::Power(pn[0],2) 00338 +TMath::Power(pn[1],2)); 00339 s = TMath::Sqrt(r)/r; 00340 pn[0] *= s; 00341 pn[1] *= s; 00342 } 00343 } 00344 }
void Bes2DView::WCtoNDC | ( | const Float_t * | pw, | |
Float_t * | pn | |||
) | [virtual] |
Reimplemented from BesTView.
Definition at line 282 of file Bes2DView.cxx.
References f2DViewType, BesStatus::fFishEye, fStatusCurrent, s, and BesTView::WCtoNDC().
00282 { 00283 // 00284 // Transform world coordinates to 00285 // normalised device coordinates. 00286 // This method was taken from BesTView 00287 // and extended by FishEye view 00288 BesTView::WCtoNDC(pw, pn); 00289 //cout << "fFishEye " << fFishEye << endl; 00290 00291 if ( fStatusCurrent->fFishEye == kTRUE ) { 00292 Float_t r, s; 00293 if ( f2DViewType == 1) { 00294 Float_t pvWC[3], pvNDC[3]; 00295 pvWC[0] = +4; 00296 pvWC[1] = 0; 00297 pvWC[2] = 0; 00298 BesTView::WCtoNDC(pvWC, pvNDC); 00299 pn[0] = TMath::Sign(Double_t(TMath::Sqrt(TMath::Abs(pn[0] - pvNDC[0]))), 00300 Double_t(pn[0] - pvNDC[0])) + pvNDC[0]; 00301 pn[1] = TMath::Sign(Double_t(TMath::Sqrt(TMath::Abs(pn[1] - pvNDC[1]))), 00302 Double_t(pn[1] - pvNDC[1])) + pvNDC[1]; 00303 } else { 00304 r = TMath::Sqrt(TMath::Power(pn[0],2) 00305 +TMath::Power(pn[1],2)); 00306 s = TMath::Sqrt(r)/r; 00307 pn[0] *= s; 00308 pn[1] *= s; 00309 } 00310 } 00311 }
void Bes2DView::Zoom | ( | ) | [virtual] |
Reimplemented from BesTView.
Definition at line 206 of file Bes2DView.cxx.
References fMarkerSize, fZoomFactor, and BesTView::ZoomView().
00206 { 00207 // 00208 // Magnify 00209 fMarkerSize = fMarkerSize * fZoomFactor; 00210 ZoomView(gPad, fZoomFactor); 00211 }
void BesTView::ZoomIn | ( | ) | [virtual, inherited] |
Reimplemented in BesView.
Definition at line 1937 of file BesTView.cxx.
References BesTView::DefinePerspectiveView(), BesTView::fDview, BesTView::GetExtent(), and BesTView::IsPerspective().
Referenced by BesTView::MoveViewCommand().
01938 { 01939 // Zoom in. 01940 if (!IsPerspective()) return; 01941 Double_t extent = GetExtent(); 01942 Double_t fc = 0.1; 01943 if (fDview<extent) { 01944 fDview -= fc*extent; 01945 } else { 01946 fDview /= 1.25; 01947 } 01948 DefinePerspectiveView(); 01949 if (gPad) { 01950 gPad->Modified(); 01951 gPad->Update(); 01952 } 01953 }
virtual void Bes2DView::ZoomMove | ( | ) | [inline, virtual] |
Reimplemented from BesTView.
Definition at line 111 of file Bes2DView.h.
References BesTView::ZoomMove().
00111 { BesTView::ZoomMove(); }
void BesTView::ZoomOut | ( | ) | [virtual, inherited] |
Reimplemented in BesView.
Definition at line 1956 of file BesTView.cxx.
References BesTView::DefinePerspectiveView(), BesTView::fDview, BesTView::GetExtent(), and BesTView::IsPerspective().
Referenced by BesTView::MoveViewCommand().
01957 { 01958 // Zoom out. 01959 if (!IsPerspective()) return; 01960 Double_t extent = GetExtent(); 01961 Double_t fc = 0.1; 01962 if (fDview<extent) { 01963 fDview += fc*extent; 01964 } else { 01965 fDview *= 1.25; 01966 } 01967 DefinePerspectiveView(); 01968 if (gPad) { 01969 gPad->Modified(); 01970 gPad->Update(); 01971 } 01972 }
void BesTView::ZoomView | ( | TVirtualPad * | pad = 0 , |
|
Double_t | zoomFactor = 1.25 | |||
) | [virtual, inherited] |
Definition at line 1777 of file BesTView.cxx.
References BesTView::AdjustPad(), BesTView::GetRange(), genRecEmupikp::i, s, and BesTView::SetRange().
Referenced by BesVisDisplay::DrawView(), BesTView::MoveViewCommand(), Reset(), BesView::SetZoomRatio(), BesTView::UnzoomView(), Zoom(), BesTView::Zoom(), and BesView::ZoomIn().
01778 { 01779 // ZOOM this view 01780 01781 if (TMath::Abs(zoomFactor) < 0.001) return; 01782 Double_t min[3],max[3]; 01783 GetRange(min,max); 01784 int i; 01785 for (i=0;i<3; i++) { 01786 // Find center 01787 Double_t c = (max[i]+min[i])/2; 01788 // Find a new size 01789 Double_t s = (max[i]-min[i])/(2*zoomFactor); 01790 // Set a new size 01791 max[i] = c + s; 01792 min[i] = c - s; 01793 } 01794 SetRange(min,max); 01795 AdjustPad(pad); 01796 }
Int_t Bes2DView::f2DViewType [private] |
Definition at line 29 of file Bes2DView.h.
Referenced by DrawLabel(), Get2DViewType(), GetObjectInfo(), NDCtoWC(), Set2DViewType(), and WCtoNDC().
Bool_t BesTView::fAutoRange [protected, inherited] |
Definition at line 57 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::GetAutoRange(), BesTView::operator=(), and BesTView::SetAutoRange().
Bool_t BesTView::fChanged [protected, inherited] |
Definition at line 58 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::ExecuteRotateView(), BesTView::IsViewChanged(), BesTView::operator=(), and BesTView::SetViewChanged().
Bool_t BesTView::fDefaultOutline [protected, inherited] |
Definition at line 56 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::operator=(), BesTView::SetOutlineToCube(), and BesTView::SetRange().
Double_t BesTView::fDproj [protected, inherited] |
Definition at line 38 of file BesTView.h.
Referenced by BesTView::DefinePerspectiveView(), BesTView::GetDproj(), BesTView::operator=(), BesTView::SetDefaultWindow(), and BesTView::SetDproj().
Double_t BesTView::fDview [protected, inherited] |
Definition at line 37 of file BesTView.h.
Referenced by BesTView::DefinePerspectiveView(), BesTView::GetDview(), BesTView::operator=(), BesTView::SetDefaultWindow(), BesTView::SetDview(), BesTView::ZoomIn(), and BesTView::ZoomOut().
Bool_t Bes2DView::fFishEye [private] |
TPaveLabel* Bes2DView::fLabel [private] |
Double_t BesTView::fLatitude [protected, inherited] |
Definition at line 34 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::DefinePerspectiveView(), BesTView::GetLatitude(), BesTView::MoveFocus(), BesTView::operator=(), BesTView::ResetView(), BesTView::SetLatitude(), BesTView::SetParallel(), BesTView::SetPerspective(), and BesTView::SetRange().
Double_t BesTView::fLongitude [protected, inherited] |
Definition at line 35 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::DefinePerspectiveView(), BesTView::GetLongitude(), BesTView::MoveFocus(), BesTView::operator=(), BesTView::ResetView(), BesTView::SetLongitude(), BesTView::SetParallel(), BesTView::SetPerspective(), and BesTView::SetRange().
Float_t Bes2DView::fMarkerSize [private] |
Definition at line 33 of file Bes2DView.h.
Referenced by GetMarkerSize(), SetMarkerSize(), UnZoom(), and Zoom().
TSeqCollection* BesTView::fOutline [protected, inherited] |
Definition at line 55 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::ExecuteRotateView(), BesTView::GetOutline(), BesTView::operator=(), BesTView::SetOutlineToCube(), and BesTView::~BesTView().
Float_t Bes2DView::fPhiRangeMax [private] |
Float_t Bes2DView::fPhiRangeMin [private] |
Definition at line 30 of file Bes2DView.h.
Double_t BesTView::fPsi [protected, inherited] |
Definition at line 36 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::DefinePerspectiveView(), BesTView::GetPsi(), BesTView::MoveFocus(), BesTView::operator=(), BesTView::ResetView(), BesTView::SetParallel(), BesTView::SetPerspective(), BesTView::SetPsi(), and BesTView::SetRange().
Double_t BesTView::fRmax[3] [protected, inherited] |
Definition at line 43 of file BesTView.h.
Referenced by BesTView::AxisVertex(), BesTView::BesTView(), BesTView::DefinePerspectiveView(), BesTView::FindScope(), BesTView::GetExtent(), BesTView::GetRange(), BesTView::GetRmax(), BesTView::MoveFocus(), BesTView::operator=(), BesTView::PadRange(), BesTView::SetOutlineToCube(), and BesTView::SetRange().
Double_t BesTView::fRmin[3] [protected, inherited] |
Definition at line 44 of file BesTView.h.
Referenced by BesTView::AxisVertex(), BesTView::BesTView(), BesTView::DefinePerspectiveView(), BesTView::FindScope(), BesTView::GetExtent(), BesTView::GetRange(), BesTView::GetRmin(), BesTView::operator=(), BesTView::PadRange(), BesTView::SetOutlineToCube(), and BesTView::SetRange().
BesStatus* Bes2DView::fStatus3D [private] |
BesStatus* Bes2DView::fStatusCurrent [private] |
Definition at line 37 of file Bes2DView.h.
Referenced by GetFishEyeStatus(), GetRSign(), GetStatusCurrent(), NDCtoWC(), PrintCurrent(), SetFishEye(), WCtoNDC(), and ~Bes2DView().
BesStatus* Bes2DView::fStatusXY [private] |
BesStatus* Bes2DView::fStatusZR [private] |
Int_t BesTView::fSystem [protected, inherited] |
Definition at line 54 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::GetDistancetoAxis(), BesTView::GetSystem(), BesTView::operator=(), and BesTView::SetSystem().
Double_t BesTView::fTB[16] [protected, inherited] |
Definition at line 42 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::operator=(), and BesTView::ResetView().
Double_t BesTView::fTback[16] [protected, inherited] |
Definition at line 47 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::GetTback(), BesTView::NDCtoWC(), BesTView::operator=(), and BesTView::ResetView().
Double_t BesTView::fTN[16] [protected, inherited] |
Definition at line 41 of file BesTView.h.
Referenced by BesTView::AxisVertex(), BesTView::BesTView(), BesTView::FindNormal(), BesTView::FindPhiSectors(), BesTView::FindThetaSectors(), BesTView::GetTN(), BesTView::operator=(), and BesTView::ResetView().
Double_t BesTView::fTnorm[16] [protected, inherited] |
Definition at line 46 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::DefinePerspectiveView(), BesTView::GetTnorm(), BesTView::NormalWCtoNDC(), BesTView::operator=(), BesTView::PadRange(), BesTView::ResetView(), and BesTView::WCtoNDC().
Double_t BesTView::fUpix [protected, inherited] |
Definition at line 39 of file BesTView.h.
Referenced by BesTView::operator=(), BesTView::ResizePad(), and BesTView::SetDefaultWindow().
Double_t BesTView::fUVcoord[4] [protected, inherited] |
Definition at line 45 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::DefinePerspectiveView(), BesTView::GetWindow(), BesTView::GetWindowHeight(), BesTView::GetWindowWidth(), BesTView::MoveWindow(), BesTView::operator=(), BesTView::ResizePad(), and BesTView::SetWindow().
Double_t BesTView::fVpix [protected, inherited] |
Definition at line 40 of file BesTView.h.
Referenced by BesTView::operator=(), BesTView::ResizePad(), and BesTView::SetDefaultWindow().
Double_t BesTView::fX1[3] [protected, inherited] |
Definition at line 48 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::GetDistancetoAxis(), BesTView::operator=(), and BesTView::SetAxisNDC().
Double_t BesTView::fX2[3] [protected, inherited] |
Definition at line 49 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::GetDistancetoAxis(), BesTView::operator=(), and BesTView::SetAxisNDC().
Double_t BesTView::fY1[3] [protected, inherited] |
Definition at line 50 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::GetDistancetoAxis(), BesTView::operator=(), and BesTView::SetAxisNDC().
Double_t BesTView::fY2[3] [protected, inherited] |
Definition at line 51 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::GetDistancetoAxis(), BesTView::operator=(), and BesTView::SetAxisNDC().
Double_t BesTView::fZ1[3] [protected, inherited] |
Definition at line 52 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::GetDistancetoAxis(), BesTView::operator=(), and BesTView::SetAxisNDC().
Double_t BesTView::fZ2[3] [protected, inherited] |
Definition at line 53 of file BesTView.h.
Referenced by BesTView::BesTView(), BesTView::GetDistancetoAxis(), BesTView::operator=(), and BesTView::SetAxisNDC().
Double_t Bes2DView::fZoomFactor [private] |
Definition at line 38 of file Bes2DView.h.
Referenced by GetZoomFactor(), Reset(), SetZoomFactor(), UnZoom(), and Zoom().