TPainter3dAlgorithms.h

Go to the documentation of this file.
00001 // @(#)root/histpainter:$Id: TPainter3dAlgorithms.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Rene Brun, Evgueni Tcherniaev, Olivier Couet   12/12/94
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 #ifndef ROOT_TPainter3dAlgorithms
00013 #define ROOT_TPainter3dAlgorithms
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TPainter3dAlgorithms                                                 //
00019 //                                                                      //
00020 // 3D graphics representations package.                                 //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TObject
00025 #include "TObject.h"
00026 #endif
00027 
00028 #ifndef ROOT_TAttLine
00029 #include "TAttLine.h"
00030 #endif
00031 
00032 #ifndef ROOT_TAttFill
00033 #include "TAttFill.h"
00034 #endif
00035 
00036 const Int_t kCARTESIAN   = 1;
00037 const Int_t kPOLAR       = 2;
00038 const Int_t kCYLINDRICAL = 3;
00039 const Int_t kSPHERICAL   = 4;
00040 const Int_t kRAPIDITY    = 5;
00041 
00042 class TF3;
00043 
00044 class TPainter3dAlgorithms : public TObject, public TAttLine, public TAttFill {
00045 
00046 private:
00047    Double_t     fX0;               //
00048    Double_t     fDX;               //
00049    Double_t     fRmin[3];          //Lower limits of lego
00050    Double_t     fRmax[3];          //Upper limits of lego
00051    Double_t     fU[2000];          //
00052    Double_t     fD[2000];          //
00053    Double_t     fT[200];           //
00054    Double_t     fFunLevel[257];    //Function levels corresponding to colors
00055    Double_t     fPlines[1200];     //
00056    Double_t     fAphi[183];        //
00057    Double_t     fYdl;              //
00058    Double_t     fYls[4];           //
00059    Double_t     fVls[12];          //
00060    Double_t     fQA;               //
00061    Double_t     fQD;               //
00062    Double_t     fQS;               //
00063    Double_t     fXrast;            //
00064    Double_t     fYrast;            //
00065    Double_t     fDXrast;           //
00066    Double_t     fDYrast;           //
00067    Int_t        fSystem;           //Coordinate system
00068    Int_t        fNT;               //
00069    Int_t        fNlevel;           //Number of color levels
00070    Int_t        fColorLevel[258];  //Color levels corresponding to functions
00071    Int_t       *fColorMain;        //
00072    Int_t       *fColorDark;        //
00073    Int_t        fColorTop;         //
00074    Int_t        fColorBottom;      //
00075    Int_t        fMesh;             //(=1 if mesh to draw, o otherwise)
00076    Int_t        fNlines;           //
00077    Int_t        fLevelLine[200];   //
00078    Int_t        fLoff;             //
00079    Int_t        fNqs;              //
00080    Int_t        fNStack;           //Number of histograms in the stack to be painted
00081    Int_t        fNxrast;           //
00082    Int_t        fNyrast;           //
00083    Int_t        fIfrast;           //
00084    Int_t        *fRaster;          //pointer to raster buffer
00085    Int_t        fJmask[30];        //
00086    Int_t        fMask[465];        //
00087    Double_t     fP8[8][3];         //
00088    Double_t     fF8[8];            //
00089    Double_t     fG8[8][3];         //
00090    Double_t     fFmin;             // IsoSurface minimum function value
00091    Double_t     fFmax;             // IsoSurface maximum function value
00092    Int_t        fNcolor;           // Number of colours per Iso surface
00093    Int_t        fIc1;              // Base colour for the 1st Iso Surface
00094    Int_t        fIc2;              // Base colour for the 2nd Iso Surface
00095    Int_t        fIc3;              // Base colour for the 3rd Iso Surface
00096 
00097    static Int_t    fgF3Clipping;   // Clipping box is off (0) or on (1)
00098    static Double_t fgF3XClip;      // Clipping plne along X
00099    static Double_t fgF3YClip;      // Clipping plne along Y
00100    static Double_t fgF3ZClip;      // Clipping plne along Y
00101    static TF3      *fgCurrentF3;   // Pointer to the 3D function to be paint.
00102 
00103 
00104 public:
00105    typedef void (TPainter3dAlgorithms::*DrawFaceFunc_t)(Int_t *, Double_t *, Int_t, Int_t *, Double_t *);
00106    typedef void (TPainter3dAlgorithms::*LegoFunc_t)(Int_t,Int_t,Int_t&,Double_t*,Double_t*,Double_t*);
00107    typedef void (TPainter3dAlgorithms::*SurfaceFunc_t)(Int_t,Int_t,Double_t*,Double_t*);
00108 
00109 private:
00110    DrawFaceFunc_t  fDrawFace;        //pointer to face drawing function
00111    LegoFunc_t      fLegoFunction;    //pointer to lego function
00112    SurfaceFunc_t   fSurfaceFunction; //pointer to surface function
00113    
00114 public:
00115    TPainter3dAlgorithms();
00116    TPainter3dAlgorithms(Double_t *rmin, Double_t *rmax, Int_t system=1);
00117    virtual ~TPainter3dAlgorithms();
00118    void    BackBox(Double_t ang);
00119    void    ClearRaster();
00120    void    ColorFunction(Int_t nl, Double_t *fl, Int_t *icl, Int_t &irep);
00121    void    DefineGridLevels(Int_t ndivz);
00122    void    DrawFaceGouraudShaded(Int_t *icodes, Double_t xyz[][3], Int_t np, Int_t *iface, Double_t *t);
00123    void    DrawFaceMode1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t);
00124    void    DrawFaceMode2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t);
00125    void    DrawFaceMode3(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t);
00126    void    DrawFaceMove1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt);
00127    void    DrawFaceMove2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt);
00128    void    DrawFaceMove3(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt);
00129    void    DrawFaceRaster1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt);
00130    void    DrawFaceRaster2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt);
00131    void    FillPolygon(Int_t n, Double_t *p, Double_t *f);
00132    void    FillPolygonBorder(Int_t nn, Double_t *xy);
00133    void    FindLevelLines(Int_t np, Double_t *f, Double_t *t);
00134    void    FindPartEdge(Double_t *p1, Double_t *p2, Double_t f1, Double_t f2, Double_t fmin, Double_t fmax, Int_t &kpp, Double_t *pp);
00135    void    FindVisibleLine(Double_t *p1, Double_t *p2, Int_t ntmax, Int_t &nt, Double_t *t);
00136    void    FindVisibleDraw(Double_t *r1, Double_t *r2);
00137    void    FrontBox(Double_t ang);
00138    void    GouraudFunction(Int_t ia, Int_t ib, Double_t *f, Double_t *t);
00139    void    ImplicitFunction(Double_t *rmin, Double_t *rmax, Int_t nx, Int_t ny, Int_t nz, const char *chopt);
00140    void    IsoSurface (Int_t ns, Double_t *s, Int_t nx, Int_t ny, Int_t nz, Double_t *x, Double_t *y, Double_t *z, const char *chopt);
00141    void    InitMoveScreen(Double_t xmin, Double_t xmax);
00142    void    InitRaster(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Int_t nx, Int_t ny);
00143    void    LegoCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt);
00144    void    LegoFunction(Int_t ia, Int_t ib, Int_t &nv, Double_t *ab, Double_t *vv, Double_t *t);
00145    void    LegoPolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt);
00146    void    LegoCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt);
00147    void    LegoSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt);
00148    void    LightSource(Int_t nl, Double_t yl, Double_t xscr, Double_t yscr, Double_t zscr, Int_t &irep);
00149    void    Luminosity(Double_t *anorm, Double_t &flum);
00150    void    MarchingCube(Double_t fiso, Double_t p[8][3], Double_t f[8], Double_t g[8][3], Int_t &nnod, Int_t &ntria, Double_t xyz[][3], Double_t grad[][3], Int_t itria[][3]);
00151    void    MarchingCubeCase00(Int_t k1, Int_t k2, Int_t k3, Int_t k4, Int_t k5, Int_t k6, Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3]);
00152    void    MarchingCubeCase03(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3]);
00153    void    MarchingCubeCase04(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3]);
00154    void    MarchingCubeCase06(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3]);
00155    void    MarchingCubeCase07(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3]);
00156    void    MarchingCubeCase10(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3]);
00157    void    MarchingCubeCase12(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3]);
00158    void    MarchingCubeCase13(Int_t &nnod, Int_t &ntria, Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3]);
00159    void    MarchingCubeSetTriangles(Int_t ntria, Int_t it[][3], Int_t itria[48][3]);
00160    void    MarchingCubeMiddlePoint(Int_t nnod, Double_t xyz[52][3], Double_t grad[52][3], Int_t it[][3], Double_t *pxyz, Double_t *pgrad);
00161    void    MarchingCubeSurfacePenetration(Double_t a00, Double_t a10, Double_t a11, Double_t a01, Double_t b00, Double_t b10, Double_t b11, Double_t b01, Int_t &irep);
00162    void    MarchingCubeFindNodes(Int_t nnod, Int_t *ie, Double_t xyz[52][3], Double_t grad[52][3]);
00163    void    ModifyScreen(Double_t *r1, Double_t *r2);
00164    void    SetDrawFace(DrawFaceFunc_t pointer);
00165    void    SetIsoSurfaceParameters(Double_t fmin, Double_t fmax, Int_t ncolor, Int_t ic1, Int_t ic2, Int_t ic3){fFmin=fmin; fFmax=fmax; fNcolor=ncolor; fIc1=ic1; fIc2=ic2; fIc3=ic3;}
00166    void    SetLegoFunction(LegoFunc_t pointer);
00167    void    SetMesh(Int_t mesh=1) {fMesh=mesh;}
00168    void    SetSurfaceFunction(SurfaceFunc_t pointer);
00169    void    SetColorDark(Color_t color, Int_t n=0);
00170    void    SetColorMain(Color_t color, Int_t n=0);
00171    void    SideVisibilityDecode(Double_t val, Int_t &iv1, Int_t &iv2, Int_t &iv3, Int_t &iv4, Int_t &iv5, Int_t &iv6, Int_t &ir);
00172    void    SideVisibilityEncode(Int_t iopt, Double_t phi1, Double_t phi2, Double_t &val);
00173    void    Spectrum(Int_t nl, Double_t fmin, Double_t fmax, Int_t ic, Int_t idc, Int_t &irep);
00174    void    SurfaceCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt);
00175    void    SurfacePolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt);
00176    void    SurfaceCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt);
00177    void    SurfaceFunction(Int_t ia, Int_t ib, Double_t *f, Double_t *t);
00178    void    SurfaceSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt);
00179    void    SurfaceProperty(Double_t qqa, Double_t qqd, Double_t qqs, Int_t nnqs, Int_t &irep);
00180    void    TestEdge(Double_t del, Double_t xyz[52][3], Int_t i1, Int_t i2, Int_t iface[3], Double_t abcd[4], Int_t &irep);
00181    void    ZDepth(Double_t xyz[52][3], Int_t &nface, Int_t iface[48][3], Double_t dface[48][6], Double_t abcd[48][4], Int_t *iorder);
00182 
00183    static void    SetF3(TF3 *f3);
00184    static void    SetF3ClippingBoxOff();
00185    static void    SetF3ClippingBoxOn(Double_t xclip, Double_t yclip, Double_t zclip);
00186 
00187    ClassDef(TPainter3dAlgorithms,0)   //Hidden line removal package
00188 };
00189 
00190 #endif
00191 
00192 
00193 

Generated on Tue Jul 5 14:24:23 2011 for ROOT_528-00b_version by  doxygen 1.5.1