MINFView Class Reference

#include <MINFDisplay.h>

List of all members.

Public Member Functions

 MINFView (Double_t xcenter, Double_t ycenter, Double_t zcenter, Double_t xrange, Double_t yrange, Double_t zrange, Double_t longitude, Double_t latitude, Double_t psi)
virtual ~MINFView ()
Bool_t DeZoom ()
const Text_t * GetLabel ()
virtual void OldFindScope (Double_t *scale, Double_t *center, Int_t &irep)
virtual void OldGetRange (Double_t *min, Double_t *max)
virtual Double_t * OldGetTback ()
void SaveView ()
void SetViewMode ()
void Zoom (Double_t xoffset, Double_t yoffset, Double_t xscale, Double_t yscale)
void Zoom ()

Private Member Functions

MINFZoomCurZoom ()

Private Attributes

TList * fZooms
VIEWMODE fViewMode
Double_t fTbackDouble [12]

Detailed Description

Definition at line 110 of file MINFDisplay.h.


Constructor & Destructor Documentation

MINFView::MINFView ( Double_t  xcenter,
Double_t  ycenter,
Double_t  zcenter,
Double_t  xrange,
Double_t  yrange,
Double_t  zrange,
Double_t  longitude,
Double_t  latitude,
Double_t  psi 
)

Definition at line 737 of file MINFDisplay.cxx.

00740                                  :
00741 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,15,3)
00742   TView3D(1,0,0)
00743 #else
00744   TView(1)
00745 #endif
00746 , fZooms(0)
00747 {
00748   fLongitude = longitude;
00749   fLatitude  = latitude;
00750   fPsi       = psi;
00751 
00752   SetViewMode();
00753 
00754   fZooms = new TList();
00755   fZooms->Add(new MINFZoom(xcenter,   ycenter,  zcenter,
00756                            xrange,    yrange,   zrange,
00757                            longitude, latitude, psi));
00758   SetRange(xcenter - xrange,
00759            ycenter - yrange,
00760            zcenter - zrange,
00761            xcenter + xrange,
00762            ycenter + yrange,
00763            zcenter + zrange);
00764 }

MINFView::~MINFView (  )  [virtual]

Definition at line 767 of file MINFDisplay.cxx.

References fZooms.

00768 {
00769   fZooms->Delete();
00770   delete fZooms;
00771 }


Member Function Documentation

MINFZoom* MINFView::CurZoom (  )  [inline, private]

Definition at line 121 of file MINFDisplay.h.

References fZooms.

Referenced by DeZoom(), and SaveView().

00121 {return (MINFZoom *) fZooms->Last();}

Bool_t MINFView::DeZoom (  ) 

Definition at line 774 of file MINFDisplay.cxx.

References CurZoom(), fZooms, MINFZoom::Latitude(), MINFZoom::Longitude(), MINFZoom::Psi(), SetViewMode(), MINFZoom::Xcenter(), MINFZoom::Xrange(), MINFZoom::Ycenter(), MINFZoom::Yrange(), MINFZoom::Zcenter(), and MINFZoom::Zrange().

Referenced by MINFDisplay::UnZoom().

00775 {
00776   if ((MINFZoom *) fZooms->Before(CurZoom())) {
00777     fZooms->Remove(fZooms->Last());
00778     MINFZoom *zoom = CurZoom();
00779     SetViewMode();
00780     Int_t iret = 0;
00781     SetRange(zoom->Xcenter() - zoom->Xrange(),
00782              zoom->Ycenter() - zoom->Yrange(),
00783              zoom->Zcenter() - zoom->Zrange(),
00784              zoom->Xcenter() + zoom->Xrange(),
00785              zoom->Ycenter() + zoom->Yrange(),
00786              zoom->Zcenter() + zoom->Zrange());
00787     SetView(zoom->Longitude(), zoom->Latitude(), zoom->Psi(), iret);
00788     return kTRUE;
00789   }
00790   return kFALSE;
00791 }

const Text_t * MINFView::GetLabel (  ) 

Definition at line 794 of file MINFDisplay.cxx.

References BACK, BOTTOM, FRONT, fViewMode, LSIDE, OTHER, RSIDE, SetViewMode(), and TOP.

00795 {
00796   SetViewMode();
00797   switch(fViewMode) {
00798     case TOP :
00799         return "Top";
00800 //  break;
00801     case RSIDE :
00802         return "RSide";
00803 //  break;
00804     case FRONT :
00805         return "Front";
00806 //  break;
00807     case LSIDE :
00808         return "LSide";
00809 //  break;
00810     case BOTTOM :
00811         return "Bottom";
00812 //  break;
00813     case BACK :
00814         return "Back";
00815 //  break;
00816     case OTHER :
00817       return "Oblique";
00818 //  break;
00819     default :
00820       return "Oblique";
00821   }
00822 }

void MINFView::OldFindScope ( Double_t *  scale,
Double_t *  center,
Int_t &  irep 
) [virtual]

Definition at line 825 of file MINFDisplay.cxx.

00826 {
00827 
00828 // Provided in Double_t by TView starting with ROOT_v2.25/00.
00829 // Eliminate this when Minos upgrades to this ROOT level.
00830 // *-*-*-*-*-*-*-Find centre of a MIN-MAX scope and scale factors-*-*-*
00831 // *-*           ================================================     *
00832 // *-*                                                                *
00833 // *-*    Output: SCALE(3)  - scale factors                           *
00834 // *-*            CENTER(3) - centre                                  *
00835 // *-*            IREP      - reply (-1 if error in min-max)          *
00836 // *-*                                                                *
00837 // *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
00838 
00839    irep = 0;
00840    Double_t sqrt3 = 0.5*TMath::Sqrt(3.0);
00841 
00842    for (Int_t i = 0; i < 3; i++) {
00843       if (fRmin[i] >= fRmax[i]) {irep = -1; return;}
00844       scale[i]  = sqrt3 * (fRmax[i] - fRmin[i]);
00845       center[i] = 0.5 * (fRmax[i] + fRmin[i]);
00846    }
00847 }

void MINFView::OldGetRange ( Double_t *  min,
Double_t *  max 
) [virtual]

Definition at line 850 of file MINFDisplay.cxx.

00851 {
00852 
00853 // Provided in Double_t by TView starting with ROOT_v2.25/00.
00854 // Eliminate this when Minos upgrades to this ROOT level.
00855    for (Int_t i = 0; i < 3; max[i] = fRmax[i], min[i] = fRmin[i], i++);
00856 }

Double_t * MINFView::OldGetTback (  )  [virtual]

Definition at line 859 of file MINFDisplay.cxx.

References fTbackDouble.

00860 {
00861 
00862 // Not yet provided  by TView.  Eliminate when ROOT adds this method.
00863    for (Int_t i = 0; i < 12; fTbackDouble[i] = fTback[i],  i++);
00864    return fTbackDouble;
00865 }

void MINFView::SaveView (  ) 

Definition at line 868 of file MINFDisplay.cxx.

References CurZoom(), and MINFZoom::SetView().

Referenced by MINFDisplay::ExecuteEvent().

00869 {
00870   Double_t scale[3], center[3];
00871   Int_t irep;
00872   FindScope(scale, center, irep);
00873   Double_t rmin[3], rmax[3];
00874   GetRange(rmin, rmax);
00875   CurZoom()->SetView(center[0], center[1], center[2], rmax[0]-center[0],
00876                                    rmax[1]-center[1], rmax[2]-center[2],
00877                                            fLongitude, fLatitude, fPsi);
00878 }

void MINFView::SetViewMode (  ) 

Definition at line 881 of file MINFDisplay.cxx.

References BACK, BOTTOM, FRONT, fViewMode, LSIDE, OTHER, RSIDE, and TOP.

Referenced by DeZoom(), MINFDisplay::ExecuteEvent(), and GetLabel().

00882 {
00883   if    (fLongitude==90.  && fLatitude==90.  && fPsi==90.)
00884     fViewMode = TOP;
00885 else if (fLongitude==180. && fLatitude==90.  && fPsi==90.)
00886     fViewMode = RSIDE;
00887 else if (fLongitude==90.  && fLatitude==180. && fPsi==0.)
00888     fViewMode = FRONT;
00889 else if (fLongitude==0.   && fLatitude==90.  && fPsi==-90.)
00890     fViewMode = LSIDE;
00891 else if (fLongitude==-90. && fLatitude==90.  && fPsi==90.)
00892     fViewMode = BOTTOM;
00893 else if (fLongitude==180. && fLatitude==0.   && fPsi==90.)
00894     fViewMode = BACK;
00895 else
00896     fViewMode = OTHER;
00897 }

void MINFView::Zoom (  )  [inline]

Definition at line 144 of file MINFDisplay.h.

References Zoom().

Referenced by Zoom().

00144 { Zoom(0.,0.,1.,1.); }  // statisfy hidden TView::Zoom()

void MINFView::Zoom ( Double_t  xoffset,
Double_t  yoffset,
Double_t  xscale,
Double_t  yscale 
)

Definition at line 900 of file MINFDisplay.cxx.

References fZooms, max, and min.

Referenced by MINFDisplay::ExecuteEvent().

00902 {
00903   Double_t scale[3], center[3], min[3], max[3];
00904   Int_t irep;
00905   FindScope(scale, center, irep);
00906   GetRange(min, max);
00907 
00908   Double_t dxdX = GetTback()[0]/scale[0]; //dxdX = -sph*cps-cth*cph*sps;
00909   Double_t dxdY = GetTback()[1]/scale[0]; //dxdY =  sph*sps-cth*cph*cps;
00910   Double_t dxdN = GetTback()[2]/scale[0]; //dxdN =  sth*cph;
00911   Double_t dydX = GetTback()[4]/scale[1]; //dydX =  cph*cps-cth*sph*sps;
00912   Double_t dydY = GetTback()[5]/scale[1]; //dydY = -cph*sps-cth*sph*cps;
00913   Double_t dydN = GetTback()[6]/scale[1]; //dydN =  sth*sph;
00914   Double_t dzdX = GetTback()[8]/scale[2]; //dzdX =  sth*sps;
00915   Double_t dzdY = GetTback()[9]/scale[2]; //dzdY =  sth*cps;
00916   Double_t dzdN = GetTback()[10]/scale[2];//dzdN =  cth;
00917 
00918   Double_t xcenter = center[0];
00919   Double_t ycenter = center[1];
00920   Double_t zcenter = center[2];
00921   Double_t xrange  = 0.5 * (max[0] - min[0]);
00922   Double_t yrange  = 0.5 * (max[1] - min[1]);
00923   Double_t zrange  = 0.5 * (max[2] - min[2]);
00924 
00925   Double_t xcenternew = xcenter + xrange * (xoffset*dxdX+yoffset*dxdY);
00926   Double_t ycenternew = ycenter + yrange * (xoffset*dydX+yoffset*dydY);
00927   Double_t zcenternew = zcenter + zrange * (xoffset*dzdX+yoffset*dzdY);
00928   Double_t xrangenew  = xrange *
00929                        TMath::Sqrt(dxdX*dxdX*xscale*xscale +
00930                                    dxdY*dxdY*yscale*yscale + dxdN*dxdN);
00931   Double_t yrangenew  = yrange *
00932                        TMath::Sqrt(dydX*dydX*xscale*xscale +
00933                                    dydY*dydY*yscale*yscale + dydN*dydN);
00934   Double_t zrangenew  = zrange *
00935                        TMath::Sqrt(dzdX*dzdX*xscale*xscale +
00936                                    dzdY*dzdY*yscale*yscale + dzdN*dzdN);
00937 
00938   fZooms->Add(new MINFZoom(xcenternew, ycenternew, zcenternew,
00939                            xrangenew,  yrangenew,  zrangenew,
00940                            fLongitude, fLatitude,  fPsi));
00941 
00942   SetRange(xcenternew-xrangenew,
00943            ycenternew-yrangenew,
00944            zcenternew-zrangenew,
00945            xcenternew+xrangenew,
00946            ycenternew+yrangenew,
00947            zcenternew+zrangenew);
00948 }


Member Data Documentation

Double_t MINFView::fTbackDouble[12] [private]

Definition at line 119 of file MINFDisplay.h.

Referenced by OldGetTback().

Definition at line 118 of file MINFDisplay.h.

Referenced by GetLabel(), and SetViewMode().

TList* MINFView::fZooms [private]

Definition at line 117 of file MINFDisplay.h.

Referenced by CurZoom(), DeZoom(), Zoom(), and ~MINFView().


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

Generated on 16 Jan 2018 for loon by  doxygen 1.6.1