ROOT logo
// @(#)root/geom:$Id: TVirtualGeoPainter.h 31454 2009-11-30 07:39:14Z brun $
// Author: Andrei Gheata   11/01/02

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
#ifndef ROOT_TVirtualGeoPainter
#define ROOT_TVirtualGeoPainter


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TVirtualGeoPainter                                                   //
//                                                                      //
// Abstract base class for geometry painters                            //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TObject
#include "TObject.h"
#endif

class TGeoVolume;
class TGeoNode;
class TGeoShape;
class TGeoMatrix;
class TGeoHMatrix;
class TGeoManager;
class TVirtualGeoTrack;
class TParticle;
class TObjArray;
class TH2F;
class TStopwatch;
class TGeoBatemanSol;
class TGeoIteratorPlugin;

class TVirtualGeoPainter : public TObject {

protected:
   static TVirtualGeoPainter   *fgGeoPainter; //Pointer to class painter

public:
enum EGeoVisLevel {
   kGeoVisLevel   = 0
};         
enum EGeoVisOption {
   kGeoVisDefault = 0,    // default visualization - everything visible 3 levels down
   kGeoVisLeaves  = 1,    // only last leaves are visible
   kGeoVisOnly    = 2,    // only current volume is drawn
   kGeoVisBranch  = 3,    // only a given branch is drawn
   kGeoVisChanged = 4     // visibility changed
};
enum EGeoBombOption {   
   kGeoNoBomb     = 0,    // default - no bomb
   kGeoBombXYZ    = 1,    // explode view in cartesian coordinates
   kGeoBombCyl    = 2,    // explode view in cylindrical coordinates (R, Z)
   kGeoBombSph    = 3     // explode view in spherical coordinates (R)
};

public:
   TVirtualGeoPainter(TGeoManager *manager);
   virtual ~TVirtualGeoPainter();

   virtual void       AddSize3D(Int_t numpoints, Int_t numsegs, Int_t numpolys) = 0;
   virtual TVirtualGeoTrack *AddTrack(Int_t id, Int_t pdgcode, TObject *particle) = 0;
   virtual void       AddTrackPoint(Double_t *point, Double_t *box, Bool_t reset=kFALSE) = 0;
   virtual void       BombTranslation(const Double_t *tr, Double_t *bombtr) = 0;
   virtual void       CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="") = 0;
   virtual void       CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.) = 0; 
   virtual void       CheckBoundaryReference(Int_t icheck=-1) = 0;
   virtual void       CheckGeometryFull(Bool_t checkoverlaps=kTRUE, Bool_t checkcrossings=kTRUE, Int_t nrays=10000, const Double_t *vertex=NULL) = 0;
   virtual void       CheckGeometry(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) const = 0;
   virtual void       CheckOverlaps(const TGeoVolume *vol, Double_t ovlp=0.1, Option_t *option="") const = 0;
   virtual Int_t      CountVisibleNodes() = 0;
   virtual void       DefaultAngles() = 0;
   virtual void       DefaultColors() = 0;
   virtual Int_t      DistanceToPrimitiveVol(TGeoVolume *vol, Int_t px, Int_t py) = 0;
   virtual void       Draw(Option_t *option="") = 0;
   virtual void       DrawBatemanSol(TGeoBatemanSol *sol, Option_t *option="") = 0;
   virtual void       DrawShape(TGeoShape *shape, Option_t *option="") = 0;
   virtual void       DrawOnly(Option_t *option="") = 0;
   virtual void       DrawOverlap(void *ovlp, Option_t *option="") = 0;
   virtual void       DrawCurrentPoint(Int_t color) = 0;
   virtual void       DrawPanel() = 0;
   virtual void       DrawPath(const char *path) = 0;
   virtual void       DrawVolume(TGeoVolume *vol, Option_t *option="") = 0;
   virtual void       EditGeometry(Option_t *option="") = 0;
   virtual void       EstimateCameraMove(Double_t /*tmin*/, Double_t /*tmax*/, Double_t *, Double_t * ) {;}
   virtual void       ExecuteShapeEvent(TGeoShape *shape, Int_t event, Int_t px, Int_t py) = 0;
   virtual void       ExecuteManagerEvent(TGeoManager *geom, Int_t event, Int_t px, Int_t py) = 0;
   virtual void       ExecuteVolumeEvent(TGeoVolume *volume, Int_t event, Int_t px, Int_t py) = 0;
   virtual Int_t      GetColor(Int_t base, Float_t light) const = 0;
   virtual Int_t      GetNsegments() const = 0; 
   virtual void       GetBombFactors(Double_t &bombx, Double_t &bomby, Double_t &bombz, Double_t &bombr) const = 0;
   virtual Int_t      GetBombMode() const = 0; 
   virtual const char *GetDrawPath() const = 0; 
   virtual TGeoVolume *GetDrawnVolume() const = 0;
   virtual TGeoVolume *GetTopVolume() const = 0; 
   virtual void       GetViewAngles(Double_t &/*longitude*/, Double_t &/*latitude*/, Double_t &/*psi*/) {;}
   virtual Int_t      GetVisLevel() const = 0; 
   virtual Int_t      GetVisOption() const = 0; 
   virtual char      *GetVolumeInfo(const TGeoVolume *volume, Int_t px, Int_t py) const = 0;
   virtual void       GrabFocus(Int_t nfr=0, Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0) =0;
   virtual Double_t  *GetViewBox() = 0;
   virtual Bool_t     IsPaintingShape() const = 0;
   virtual Bool_t     IsRaytracing() const = 0;
   virtual Bool_t     IsExplodedView() const = 0;
   virtual TH2F      *LegoPlot(Int_t ntheta=60, Double_t themin=0., Double_t themax=180.,
                            Int_t nphi=90, Double_t phimin=0., Double_t phimax=360.,
                            Double_t rmin=0., Double_t rmax=9999999, Option_t *option="") = 0;
   virtual void       ModifiedPad(Bool_t update=kFALSE) const = 0;
   virtual void       OpProgress(const char *opname, Long64_t current, Long64_t size, TStopwatch *watch=0, Bool_t last=kFALSE, Bool_t refresh=kFALSE) = 0;
   virtual void       Paint(Option_t *option="") = 0;
   virtual void       PaintNode(TGeoNode *node, Option_t *option="", TGeoMatrix* global=0) = 0;
   virtual void       PaintShape(TGeoShape *shape, Option_t *option="") = 0;
   virtual void       PaintOverlap(void *ovlp, Option_t *option="")  = 0;
   virtual void       PrintOverlaps() const = 0;
   virtual void       PaintVolume(TGeoVolume *vol, Option_t *option="", TGeoMatrix* global=0) = 0;
   virtual void       RandomPoints(const TGeoVolume *vol, Int_t npoints, Option_t *option="") = 0;
   virtual void       RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) = 0;
   virtual void       Raytrace(Option_t *option="") = 0;
   virtual TGeoNode  *SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil, const char* g3path) = 0;
   virtual void       SetBombFactors(Double_t bombx=1.3, Double_t bomby=1.3, Double_t bombz=1.3,
                                     Double_t bombr=1.3) = 0;
   virtual void       SetClippingShape(TGeoShape *shape) = 0;
   virtual void       SetExplodedView(Int_t iopt=0) = 0;
   virtual void       SetGeoManager(TGeoManager *geom) = 0;
   virtual void       SetIteratorPlugin(TGeoIteratorPlugin *plugin) = 0;
   virtual void       SetCheckedNode(TGeoNode *node) = 0;
   virtual void       SetNsegments(Int_t nseg=20) = 0;    
   virtual void       SetNmeshPoints(Int_t npoints) = 0;
   virtual void       SetRaytracing(Bool_t flag=kTRUE) = 0;
   static  TVirtualGeoPainter *GeoPainter();
   static void        SetPainter(const TVirtualGeoPainter *painter);
   virtual void       SetTopVisible(Bool_t vis=kTRUE) = 0;
   virtual void       SetTopVolume(TGeoVolume *vol) = 0;
   virtual void       SetVisLevel(Int_t level=3) = 0;
   virtual void       SetVisOption(Int_t option=0) = 0;
   virtual Int_t      ShapeDistancetoPrimitive(const TGeoShape *shape, Int_t numpoints, Int_t px, Int_t py) const = 0;
   virtual void       Test(Int_t npoints, Option_t *option) = 0;
   virtual void       TestOverlaps(const char *path) = 0;
   virtual Bool_t     TestVoxels(TGeoVolume *vol) = 0;
   virtual void       UnbombTranslation(const Double_t *tr, Double_t *bombtr) = 0;
   virtual Double_t   Weight(Double_t precision, Option_t *option="v") = 0;
      
   ClassDef(TVirtualGeoPainter,0)  //Abstract interface for geometry painters
};

#endif
 TVirtualGeoPainter.h:1
 TVirtualGeoPainter.h:2
 TVirtualGeoPainter.h:3
 TVirtualGeoPainter.h:4
 TVirtualGeoPainter.h:5
 TVirtualGeoPainter.h:6
 TVirtualGeoPainter.h:7
 TVirtualGeoPainter.h:8
 TVirtualGeoPainter.h:9
 TVirtualGeoPainter.h:10
 TVirtualGeoPainter.h:11
 TVirtualGeoPainter.h:12
 TVirtualGeoPainter.h:13
 TVirtualGeoPainter.h:14
 TVirtualGeoPainter.h:15
 TVirtualGeoPainter.h:16
 TVirtualGeoPainter.h:17
 TVirtualGeoPainter.h:18
 TVirtualGeoPainter.h:19
 TVirtualGeoPainter.h:20
 TVirtualGeoPainter.h:21
 TVirtualGeoPainter.h:22
 TVirtualGeoPainter.h:23
 TVirtualGeoPainter.h:24
 TVirtualGeoPainter.h:25
 TVirtualGeoPainter.h:26
 TVirtualGeoPainter.h:27
 TVirtualGeoPainter.h:28
 TVirtualGeoPainter.h:29
 TVirtualGeoPainter.h:30
 TVirtualGeoPainter.h:31
 TVirtualGeoPainter.h:32
 TVirtualGeoPainter.h:33
 TVirtualGeoPainter.h:34
 TVirtualGeoPainter.h:35
 TVirtualGeoPainter.h:36
 TVirtualGeoPainter.h:37
 TVirtualGeoPainter.h:38
 TVirtualGeoPainter.h:39
 TVirtualGeoPainter.h:40
 TVirtualGeoPainter.h:41
 TVirtualGeoPainter.h:42
 TVirtualGeoPainter.h:43
 TVirtualGeoPainter.h:44
 TVirtualGeoPainter.h:45
 TVirtualGeoPainter.h:46
 TVirtualGeoPainter.h:47
 TVirtualGeoPainter.h:48
 TVirtualGeoPainter.h:49
 TVirtualGeoPainter.h:50
 TVirtualGeoPainter.h:51
 TVirtualGeoPainter.h:52
 TVirtualGeoPainter.h:53
 TVirtualGeoPainter.h:54
 TVirtualGeoPainter.h:55
 TVirtualGeoPainter.h:56
 TVirtualGeoPainter.h:57
 TVirtualGeoPainter.h:58
 TVirtualGeoPainter.h:59
 TVirtualGeoPainter.h:60
 TVirtualGeoPainter.h:61
 TVirtualGeoPainter.h:62
 TVirtualGeoPainter.h:63
 TVirtualGeoPainter.h:64
 TVirtualGeoPainter.h:65
 TVirtualGeoPainter.h:66
 TVirtualGeoPainter.h:67
 TVirtualGeoPainter.h:68
 TVirtualGeoPainter.h:69
 TVirtualGeoPainter.h:70
 TVirtualGeoPainter.h:71
 TVirtualGeoPainter.h:72
 TVirtualGeoPainter.h:73
 TVirtualGeoPainter.h:74
 TVirtualGeoPainter.h:75
 TVirtualGeoPainter.h:76
 TVirtualGeoPainter.h:77
 TVirtualGeoPainter.h:78
 TVirtualGeoPainter.h:79
 TVirtualGeoPainter.h:80
 TVirtualGeoPainter.h:81
 TVirtualGeoPainter.h:82
 TVirtualGeoPainter.h:83
 TVirtualGeoPainter.h:84
 TVirtualGeoPainter.h:85
 TVirtualGeoPainter.h:86
 TVirtualGeoPainter.h:87
 TVirtualGeoPainter.h:88
 TVirtualGeoPainter.h:89
 TVirtualGeoPainter.h:90
 TVirtualGeoPainter.h:91
 TVirtualGeoPainter.h:92
 TVirtualGeoPainter.h:93
 TVirtualGeoPainter.h:94
 TVirtualGeoPainter.h:95
 TVirtualGeoPainter.h:96
 TVirtualGeoPainter.h:97
 TVirtualGeoPainter.h:98
 TVirtualGeoPainter.h:99
 TVirtualGeoPainter.h:100
 TVirtualGeoPainter.h:101
 TVirtualGeoPainter.h:102
 TVirtualGeoPainter.h:103
 TVirtualGeoPainter.h:104
 TVirtualGeoPainter.h:105
 TVirtualGeoPainter.h:106
 TVirtualGeoPainter.h:107
 TVirtualGeoPainter.h:108
 TVirtualGeoPainter.h:109
 TVirtualGeoPainter.h:110
 TVirtualGeoPainter.h:111
 TVirtualGeoPainter.h:112
 TVirtualGeoPainter.h:113
 TVirtualGeoPainter.h:114
 TVirtualGeoPainter.h:115
 TVirtualGeoPainter.h:116
 TVirtualGeoPainter.h:117
 TVirtualGeoPainter.h:118
 TVirtualGeoPainter.h:119
 TVirtualGeoPainter.h:120
 TVirtualGeoPainter.h:121
 TVirtualGeoPainter.h:122
 TVirtualGeoPainter.h:123
 TVirtualGeoPainter.h:124
 TVirtualGeoPainter.h:125
 TVirtualGeoPainter.h:126
 TVirtualGeoPainter.h:127
 TVirtualGeoPainter.h:128
 TVirtualGeoPainter.h:129
 TVirtualGeoPainter.h:130
 TVirtualGeoPainter.h:131
 TVirtualGeoPainter.h:132
 TVirtualGeoPainter.h:133
 TVirtualGeoPainter.h:134
 TVirtualGeoPainter.h:135
 TVirtualGeoPainter.h:136
 TVirtualGeoPainter.h:137
 TVirtualGeoPainter.h:138
 TVirtualGeoPainter.h:139
 TVirtualGeoPainter.h:140
 TVirtualGeoPainter.h:141
 TVirtualGeoPainter.h:142
 TVirtualGeoPainter.h:143
 TVirtualGeoPainter.h:144
 TVirtualGeoPainter.h:145
 TVirtualGeoPainter.h:146
 TVirtualGeoPainter.h:147
 TVirtualGeoPainter.h:148
 TVirtualGeoPainter.h:149
 TVirtualGeoPainter.h:150
 TVirtualGeoPainter.h:151
 TVirtualGeoPainter.h:152
 TVirtualGeoPainter.h:153
 TVirtualGeoPainter.h:154