/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/EventDisplay/BesVisLib/BesVisLib-00-04-04/BesVisLib/BesTView.h

Go to the documentation of this file.
00001 // @(#)root/base:$Name: BesVisLib-00-04-04 $:$Id: BesTView.h,v 1.3 2014/04/18 02:15:14 maqm Exp $
00002 // Author: Rene Brun, Nenad Buncic, Evgueni Tcherniaev, Olivier Couet   18/08/95
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 
00013 #ifndef ROOT_BesTView
00014 #define ROOT_BesTView
00015 
00016 
00018 //                                                                     //
00019 // BesTView                                                               //
00020 //                                                                     //
00022 
00023 
00024 #ifndef ROOT_TView
00025 #include "TView.h"
00026 #endif
00027 
00028 class TSeqCollection;
00029 class TVirtualPad;
00030 
00031 class BesTView : public TView {
00032 
00033 protected:
00034    Double_t        fLatitude;         //View angle latitude
00035    Double_t        fLongitude;        //View angle longitude
00036    Double_t        fPsi;              //View angle psi
00037    Double_t        fDview;            //Distance from COP to COV
00038    Double_t        fDproj;            //Distance from COP to projection plane
00039    Double_t        fUpix;             // pad X size in pixels
00040    Double_t        fVpix;             // pad Y size in pixels
00041    Double_t        fTN[16];           //
00042    Double_t        fTB[16];           //
00043    Double_t        fRmax[3];          //Upper limits of object
00044    Double_t        fRmin[3];          //Lower limits of object
00045    Double_t        fUVcoord[4];       //Viewing window limits
00046    Double_t        fTnorm[16];        //Transformation matrix
00047    Double_t        fTback[16];        //Back transformation matrix
00048    Double_t        fX1[3];            //First coordinate of X axis
00049    Double_t        fX2[3];            //Second coordinate of X axis
00050    Double_t        fY1[3];            //First coordinate of Y axis
00051    Double_t        fY2[3];            //Second coordinate of Y axis
00052    Double_t        fZ1[3];            //First coordinate of Z axis
00053    Double_t        fZ2[3];            //Second coordinate of Z axis
00054    Int_t           fSystem;           //Coordinate system
00055    TSeqCollection *fOutline;          //Collection of outline's objects
00056    Bool_t          fDefaultOutline;   //Set to TRUE if outline is default cube
00057    Bool_t          fAutoRange;        //Set to TRUE if range computed automatically
00058    Bool_t          fChanged;          
00059 
00060    BesTView(const BesTView&); // Not implemented
00061    BesTView& operator=(const BesTView&); // Not implemented
00062 
00063    void            ResetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep);
00064 
00065 
00066 public:
00067    // BesTView status bits
00068    enum {
00069       kPerspective  = BIT(6)
00070    };
00071 
00072    BesTView();
00073    BesTView(Int_t system);
00074    BesTView(const Float_t *rmin, const Float_t *rmax, Int_t system = 1);
00075    BesTView(const Double_t *rmin, const Double_t *rmax, Int_t system = 1);
00076    virtual ~BesTView();
00077 
00078    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);
00079    virtual void DefinePerspectiveView();
00080    virtual void DefineViewDirection(const Double_t *s, const Double_t *c,
00081                                     Double_t cosphi, Double_t sinphi,
00082                                     Double_t costhe, Double_t sinthe,
00083                                     Double_t cospsi, Double_t sinpsi,
00084                                     Double_t *tnorm, Double_t *tback);
00085    virtual void      DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax);
00086    virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
00087    virtual void  ExecuteRotateView(Int_t event, Int_t px, Int_t py);
00088    virtual void  FindScope(Double_t *scale, Double_t *center, Int_t &irep);
00089    virtual Int_t GetDistancetoAxis(Int_t axis, Int_t px, Int_t py, Double_t &ratio);
00090    Double_t      GetDview() const {return fDview;}
00091    Double_t      GetDproj() const {return fDproj;}
00092    Double_t      GetExtent() const;
00093    Bool_t        GetAutoRange() {return fAutoRange;}
00094    Double_t      GetLatitude() {return fLatitude;}
00095    Double_t      GetLongitude() {return fLongitude;}
00096    Double_t      GetPsi() {return fPsi;}
00097    virtual void  GetRange (Float_t *min, Float_t *max);
00098    virtual void  GetRange (Double_t *min, Double_t *max);
00099    Double_t     *GetRmax() {return fRmax;}
00100    Double_t     *GetRmin() {return fRmin;}
00101    TSeqCollection *GetOutline() {return fOutline; }
00102    Double_t     *GetTback() {return fTback;}
00103    Double_t     *GetTN() {return fTN;}
00104    Double_t     *GetTnorm() {return fTnorm;}
00105    Int_t         GetSystem() {return fSystem;}
00106    void          GetWindow(Double_t &u0, Double_t &v0, Double_t &du, Double_t &dv) const;
00107    Double_t      GetWindowWidth() const {return 0.5*(fUVcoord[1]-fUVcoord[0]);}
00108    Double_t      GetWindowHeight() const {return 0.5*(fUVcoord[3]-fUVcoord[2]);}
00109    virtual void  FindNormal(Double_t x, Double_t  y, Double_t z, Double_t &zn);
00110    virtual void  FindPhiSectors(Int_t iopt, Int_t &kphi, Double_t *aphi, Int_t &iphi1, Int_t &iphi2);
00111    virtual void  FindThetaSectors(Int_t iopt, Double_t phi, Int_t &kth, Double_t *ath, Int_t &ith1, Int_t &ith2);
00112    Bool_t        IsClippedNDC(Double_t *p) const;
00113    Bool_t        IsPerspective() const {return TestBit(kPerspective);}
00114    Bool_t        IsViewChanged() const {return fChanged;}
00115    virtual void  NDCtoWC(const Float_t *pn, Float_t *pw);
00116    virtual void  NDCtoWC(const Double_t *pn, Double_t *pw);
00117    virtual void  NormalWCtoNDC(const Float_t *pw, Float_t *pn);
00118    virtual void  NormalWCtoNDC(const Double_t *pw, Double_t *pn);
00119    virtual void  PadRange(Int_t rback);
00120    void          ResizePad();
00121    virtual void  SetAutoRange(Bool_t autorange=kTRUE) {fAutoRange=autorange;}
00122    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);
00123    void          SetDefaultWindow();
00124    void          SetDview(Double_t dview) {fDview=dview;}
00125    void          SetDproj(Double_t dproj) {fDproj=dproj;}
00126    void          SetLatitude(Double_t latitude) {fLatitude = latitude;}
00127    void          SetLongitude(Double_t longitude) {fLongitude = longitude;}
00128    void          SetPsi(Double_t psi) {fPsi = psi;}
00129    virtual void  SetOutlineToCube();
00130    virtual void  SetParallel(); // *MENU*
00131    virtual void  SetPerspective(); // *MENU*
00132    virtual void  SetRange(const Double_t *min, const Double_t *max);
00133    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);
00134    virtual void  SetSystem(Int_t system) {fSystem = system;}
00135    virtual void  SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep);
00136    void          SetViewChanged(Bool_t flag=kTRUE) {fChanged = flag;}
00137    void          SetWindow(Double_t u0, Double_t v0, Double_t du, Double_t dv);
00138    virtual void  WCtoNDC(const Float_t *pw, Float_t *pn);
00139    virtual void  WCtoNDC(const Double_t *pw, Double_t *pn);
00140 
00141 //--
00142    void         MoveFocus(Double_t *center, Double_t dx, Double_t dy, Double_t dz, Int_t nsteps=10,
00143                             Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0);
00144    virtual void MoveViewCommand(Char_t chCode, Int_t count=1);
00145    void         MoveWindow(Char_t option);
00146 
00147    static  void AdjustPad(TVirtualPad *pad=0);
00148    virtual void AdjustScales(TVirtualPad *pad=0); // *MENU*
00149    virtual void Centered3DImages(TVirtualPad *pad=0);
00150    virtual void Centered();                       // *MENU*
00151    virtual void FrontView(TVirtualPad *pad=0);
00152    virtual void Front();                          // *MENU*
00153 
00154    virtual void ZoomIn(); // *MENU*
00155    virtual void ZoomOut(); // *MENU*
00156    virtual void ZoomView(TVirtualPad *pad=0, Double_t zoomFactor = 1.25 );
00157    virtual void UnzoomView(TVirtualPad *pad=0,Double_t unZoomFactor = 1.25);
00158 
00159    virtual void RotateView(Double_t phi, Double_t theta, TVirtualPad *pad=0);
00160    virtual void SideView(TVirtualPad *pad=0);
00161    virtual void Side();                          // *MENU*
00162    virtual void TopView(TVirtualPad *pad=0);
00163    virtual void Top();                           // *MENU*
00164 
00165    virtual void ToggleRulers(TVirtualPad *pad=0);
00166    virtual void ShowAxis();                      // *MENU*
00167    virtual void ToggleZoom(TVirtualPad *pad=0);
00168    virtual void ZoomMove();                      // *MENU*
00169    virtual void Zoom();                          // *MENU*
00170    virtual void UnZoom();                        // *MENU*
00171 
00172    ClassDef(BesTView,2);  //3-D View
00173 };
00174 
00175 //      Shortcuts for menus
00176 inline void BesTView::Centered(){Centered3DImages();}
00177 inline void BesTView::Front()   {FrontView();}
00178 inline void BesTView::ShowAxis(){ToggleRulers(); }
00179 inline void BesTView::Side()    {SideView();}
00180 inline void BesTView::Top()     {TopView();}
00181 inline void BesTView::ZoomMove(){ToggleZoom();}
00182 inline void BesTView::Zoom()    {ZoomView();}
00183 inline void BesTView::UnZoom()  {UnzoomView();}
00184 
00185 #endif
00186 

Generated on Tue Nov 29 23:12:01 2016 for BOSS_7.0.2 by  doxygen 1.4.7