Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TView3D.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/g3d:$Id$
0002 // Author: Rene Brun 19/02/2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 
0013 #ifndef ROOT_TView3D
0014 #define ROOT_TView3D
0015 
0016 
0017 /////////////////////////////////////////////////////////////////////////
0018 //                                                                     //
0019 // TView3D                                                             //
0020 //                                                                     //
0021 /////////////////////////////////////////////////////////////////////////
0022 
0023 
0024 #include "TView.h"
0025 
0026 class TSeqCollection;
0027 class TVirtualPad;
0028 
0029 class TView3D : public TView {
0030 
0031 protected:
0032    Double_t        fLatitude;         //View angle latitude
0033    Double_t        fLongitude;        //View angle longitude
0034    Double_t        fPsi;              //View angle psi
0035    Double_t        fDview;            //Distance from COP to COV
0036    Double_t        fDproj;            //Distance from COP to projection plane
0037    Double_t        fUpix;             // pad X size in pixels
0038    Double_t        fVpix;             // pad Y size in pixels
0039    Double_t        fTN[16];           //
0040    Double_t        fTB[16];           //
0041    Double_t        fRmax[3];          //Upper limits of object
0042    Double_t        fRmin[3];          //Lower limits of object
0043    Double_t        fUVcoord[4];       //Viewing window limits
0044    Double_t        fTnorm[16];        //Transformation matrix
0045    Double_t        fTback[16];        //Back transformation matrix
0046    Double_t        fX1[3];            //First coordinate of X axis
0047    Double_t        fX2[3];            //Second coordinate of X axis
0048    Double_t        fY1[3];            //First coordinate of Y axis
0049    Double_t        fY2[3];            //Second coordinate of Y axis
0050    Double_t        fZ1[3];            //First coordinate of Z axis
0051    Double_t        fZ2[3];            //Second coordinate of Z axis
0052    Int_t           fSystem;           //Coordinate system
0053    TSeqCollection *fOutline;          //Collection of outline's objects
0054    Bool_t          fDefaultOutline;   //Set to TRUE if outline is default cube
0055    Bool_t          fAutoRange;        //Set to TRUE if range computed automatically
0056    Bool_t          fChanged;          //! Set to TRUE after ExecuteRotateView
0057 
0058    TView3D(const TView3D&); // Not implemented
0059    TView3D& operator=(const TView3D&); // Not implemented
0060 
0061    void            ResetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep);
0062 
0063 
0064 public:
0065    // TView3D status bits
0066    enum {
0067       kPerspective  = BIT(6)
0068    };
0069 
0070    TView3D();
0071    TView3D(Int_t system, const Double_t *rmin, const Double_t *rmax);
0072    ~TView3D() override;
0073 
0074    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) override;
0075    void     DefinePerspectiveView() override;
0076    void     DefineViewDirection(const Double_t *s, const Double_t *c,
0077                                         Double_t cosphi, Double_t sinphi,
0078                                         Double_t costhe, Double_t sinthe,
0079                                         Double_t cospsi, Double_t sinpsi,
0080                                         Double_t *tnorm, Double_t *tback) override;
0081    void      DrawOutlineCube(TList *outline, Double_t *rmin, Double_t *rmax) override;
0082    void      ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0083    void      ExecuteRotateView(Int_t event, Int_t px, Int_t py) override;
0084    void      FindScope(Double_t *scale, Double_t *center, Int_t &irep) override;
0085    Int_t     GetDistancetoAxis(Int_t axis, Int_t px, Int_t py, Double_t &ratio) override;
0086    Double_t  GetDview() const override {return fDview;}
0087    Double_t  GetDproj() const override {return fDproj;}
0088    Double_t  GetExtent() const override;
0089    Bool_t    GetAutoRange() override {return fAutoRange;}
0090    Double_t  GetLatitude() override {return fLatitude;}
0091    Double_t  GetLongitude() override {return fLongitude;}
0092    Double_t  GetPsi() override {return fPsi;}
0093    void      GetRange (Float_t *min, Float_t *max) override;
0094    void      GetRange (Double_t *min, Double_t *max) override;
0095    Double_t *GetRmax() override {return fRmax;}
0096    Double_t *GetRmin() override {return fRmin;}
0097    TSeqCollection *GetOutline() override {return fOutline; }
0098    Double_t *GetTback() override {return fTback;}
0099    Double_t *GetTN() override {return fTN;}
0100    Double_t *GetTnorm() override {return fTnorm;}
0101    Int_t     GetSystem() override {return fSystem;}
0102    void      GetWindow(Double_t &u0, Double_t &v0, Double_t &du, Double_t &dv) const override;
0103    Double_t  GetWindowWidth() const override {return 0.5*(fUVcoord[1]-fUVcoord[0]);}
0104    Double_t  GetWindowHeight() const override {return 0.5*(fUVcoord[3]-fUVcoord[2]);}
0105    void      FindNormal(Double_t x, Double_t  y, Double_t z, Double_t &zn) override;
0106    void      FindPhiSectors(Int_t iopt, Int_t &kphi, Double_t *aphi, Int_t &iphi1, Int_t &iphi2) override;
0107    void      FindThetaSectors(Int_t iopt, Double_t phi, Int_t &kth, Double_t *ath, Int_t &ith1, Int_t &ith2) override;
0108    Bool_t    IsClippedNDC(Double_t *p) const override;
0109    Bool_t    IsPerspective() const override {return TestBit(kPerspective);}
0110    Bool_t    IsViewChanged() const override {return fChanged;}
0111    void      NDCtoWC(const Float_t *pn, Float_t *pw) override;
0112    void      NDCtoWC(const Double_t *pn, Double_t *pw) override;
0113    void      NormalWCtoNDC(const Float_t *pw, Float_t *pn) override;
0114    void      NormalWCtoNDC(const Double_t *pw, Double_t *pn) override;
0115    void      PadRange(Int_t rback) override;
0116    void      ResizePad() override;
0117    void      SetAutoRange(Bool_t autorange=kTRUE) override {fAutoRange=autorange;}
0118    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) override;
0119    void      SetDefaultWindow() override;
0120    void      SetDview(Double_t dview) override {fDview=dview;}
0121    void      SetDproj(Double_t dproj) override {fDproj=dproj;}
0122    void      SetLatitude(Double_t latitude) override {fLatitude = latitude;}
0123    void      SetLongitude(Double_t longitude) override {fLongitude = longitude;}
0124    void      SetPsi(Double_t psi) override {fPsi = psi;}
0125    void      SetOutlineToCube() override;
0126    void      SetParallel() override; // *MENU*
0127    void      SetPerspective() override; // *MENU*
0128    void      SetRange(const Double_t *min, const Double_t *max) override;
0129    void      SetRange(Double_t x0, Double_t y0, Double_t z0, Double_t x1, Double_t y1, Double_t z1, Int_t flag=0) override;
0130    void      SetSystem(Int_t system) override {fSystem = system;}
0131    void      SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep) override;
0132    void      SetViewChanged(Bool_t flag=kTRUE) override {fChanged = flag;}
0133    void      SetWindow(Double_t u0, Double_t v0, Double_t du, Double_t dv) override;
0134    void      WCtoNDC(const Float_t *pw, Float_t *pn) override;
0135    void      WCtoNDC(const Double_t *pw, Double_t *pn) override;
0136 
0137 //--
0138    void      MoveFocus(Double_t *center, Double_t dx, Double_t dy, Double_t dz, Int_t nsteps=10,
0139                                Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0) override;
0140    void      MoveViewCommand(Char_t chCode, Int_t count=1) override;
0141    void      MoveWindow(Char_t option) override;
0142 
0143    void      AdjustScales(TVirtualPad *pad = nullptr) override;
0144    void      Centered3DImages(TVirtualPad *pad = nullptr) override;
0145    void      Centered() override;                       // *MENU*
0146    void      FrontView(TVirtualPad *pad = nullptr) override;
0147    void      Front() override;                          // *MENU*
0148 
0149    void      ZoomIn() override; // *MENU*
0150    void      ZoomOut() override; // *MENU*
0151    void      ZoomView(TVirtualPad *pad = nullptr, Double_t zoomFactor = 1.25 ) override;
0152    void      UnzoomView(TVirtualPad *pad = nullptr,Double_t unZoomFactor = 1.25) override;
0153 
0154    void      RotateView(Double_t phi, Double_t theta, TVirtualPad *pad = nullptr) override;
0155    void      SideView(TVirtualPad *pad = nullptr) override;
0156    void      Side() override;                          // *MENU*
0157    void      TopView(TVirtualPad *pad = nullptr) override;
0158    void      Top() override;                           // *MENU*
0159 
0160    void      ToggleRulers(TVirtualPad *pad = nullptr) override;
0161    void      ShowAxis() override;                      // *MENU*
0162    void      ToggleZoom(TVirtualPad *pad = nullptr) override;
0163    void      ZoomMove() override;                      // *MENU*
0164    void      Zoom() override;                          // *MENU*
0165    void      UnZoom() override;                        // *MENU*
0166 
0167    static  void      AdjustPad(TVirtualPad *pad = nullptr);
0168 
0169    ClassDefOverride(TView3D,3);  //3-D View
0170 };
0171 
0172 #endif
0173