ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TVirtualGeoPainter.h
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 11/01/02
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 #ifndef ROOT_TVirtualGeoPainter
12 #define ROOT_TVirtualGeoPainter
13 
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TVirtualGeoPainter //
18 // //
19 // Abstract base class for geometry painters //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 
24 #ifndef ROOT_TObject
25 #include "TObject.h"
26 #endif
27 
28 class TGeoVolume;
29 class TGeoNode;
30 class TGeoShape;
31 class TGeoMatrix;
32 class TGeoHMatrix;
33 class TGeoManager;
34 class TVirtualGeoTrack;
35 class TParticle;
36 class TObjArray;
37 class TH2F;
38 class TStopwatch;
39 class TGeoBatemanSol;
40 class TGeoIteratorPlugin;
41 class TGeoPolygon;
42 
43 class TVirtualGeoPainter : public TObject {
44 
45 protected:
46  static TVirtualGeoPainter *fgGeoPainter; //Pointer to class painter
47 
48 public:
51 };
53  kGeoVisDefault = 0, // default visualization - everything visible 3 levels down
54  kGeoVisLeaves = 1, // only last leaves are visible
55  kGeoVisOnly = 2, // only current volume is drawn
56  kGeoVisBranch = 3, // only a given branch is drawn
57  kGeoVisChanged = 4 // visibility changed
58 };
60  kGeoNoBomb = 0, // default - no bomb
61  kGeoBombXYZ = 1, // explode view in cartesian coordinates
62  kGeoBombCyl = 2, // explode view in cylindrical coordinates (R, Z)
63  kGeoBombSph = 3 // explode view in spherical coordinates (R)
64 };
65 
66 public:
68  virtual ~TVirtualGeoPainter();
69 
70  virtual void AddSize3D(Int_t numpoints, Int_t numsegs, Int_t numpolys) = 0;
71  virtual TVirtualGeoTrack *AddTrack(Int_t id, Int_t pdgcode, TObject *particle) = 0;
72  virtual void AddTrackPoint(Double_t *point, Double_t *box, Bool_t reset=kFALSE) = 0;
73  virtual void BombTranslation(const Double_t *tr, Double_t *bombtr) = 0;
74  virtual void CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="") = 0;
75  virtual void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option) = 0;
76  virtual void CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.) = 0;
77  virtual void CheckBoundaryReference(Int_t icheck=-1) = 0;
78  virtual void CheckGeometryFull(Bool_t checkoverlaps=kTRUE, Bool_t checkcrossings=kTRUE, Int_t nrays=10000, const Double_t *vertex=NULL) = 0;
79  virtual void CheckGeometry(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) const = 0;
80  virtual void CheckOverlaps(const TGeoVolume *vol, Double_t ovlp=0.1, Option_t *option="") const = 0;
81  virtual Int_t CountVisibleNodes() = 0;
82  virtual void DefaultAngles() = 0;
83  virtual void DefaultColors() = 0;
85  virtual void Draw(Option_t *option="") = 0;
86  virtual void DrawBatemanSol(TGeoBatemanSol *sol, Option_t *option="") = 0;
87  virtual void DrawShape(TGeoShape *shape, Option_t *option="") = 0;
88  virtual void DrawOnly(Option_t *option="") = 0;
89  virtual void DrawOverlap(void *ovlp, Option_t *option="") = 0;
90  virtual void DrawCurrentPoint(Int_t color) = 0;
91  virtual void DrawPanel() = 0;
92  virtual void DrawPath(const char *path, Option_t *option="") = 0;
93  virtual void DrawPolygon(const TGeoPolygon *poly) = 0;
94  virtual void DrawVolume(TGeoVolume *vol, Option_t *option="") = 0;
95  virtual void EditGeometry(Option_t *option="") = 0;
96  virtual void EstimateCameraMove(Double_t /*tmin*/, Double_t /*tmax*/, Double_t *, Double_t * ) {;}
97  virtual void ExecuteShapeEvent(TGeoShape *shape, Int_t event, Int_t px, Int_t py) = 0;
98  virtual void ExecuteManagerEvent(TGeoManager *geom, Int_t event, Int_t px, Int_t py) = 0;
99  virtual void ExecuteVolumeEvent(TGeoVolume *volume, Int_t event, Int_t px, Int_t py) = 0;
100  virtual Int_t GetColor(Int_t base, Float_t light) const = 0;
101  virtual Int_t GetNsegments() const = 0;
102  virtual void GetBombFactors(Double_t &bombx, Double_t &bomby, Double_t &bombz, Double_t &bombr) const = 0;
103  virtual Int_t GetBombMode() const = 0;
104  virtual const char *GetDrawPath() const = 0;
105  virtual TGeoVolume *GetDrawnVolume() const = 0;
106  virtual TGeoVolume *GetTopVolume() const = 0;
107  virtual void GetViewAngles(Double_t &/*longitude*/, Double_t &/*latitude*/, Double_t &/*psi*/) {;}
108  virtual Int_t GetVisLevel() const = 0;
109  virtual Int_t GetVisOption() const = 0;
110  virtual const char*GetVolumeInfo(const TGeoVolume *volume, Int_t px, Int_t py) const = 0;
111  virtual void GrabFocus(Int_t nfr=0, Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0) =0;
112  virtual Double_t *GetViewBox() = 0;
113  virtual Bool_t IsPaintingShape() const = 0;
114  virtual Bool_t IsRaytracing() const = 0;
115  virtual Bool_t IsExplodedView() const = 0;
116  virtual TH2F *LegoPlot(Int_t ntheta=60, Double_t themin=0., Double_t themax=180.,
117  Int_t nphi=90, Double_t phimin=0., Double_t phimax=360.,
118  Double_t rmin=0., Double_t rmax=9999999, Option_t *option="") = 0;
119  virtual void ModifiedPad(Bool_t update=kFALSE) const = 0;
120  virtual void OpProgress(const char *opname, Long64_t current, Long64_t size, TStopwatch *watch=0, Bool_t last=kFALSE, Bool_t refresh=kFALSE, const char *msg="") = 0;
121  virtual void Paint(Option_t *option="") = 0;
122  virtual void PaintNode(TGeoNode *node, Option_t *option="", TGeoMatrix* global=0) = 0;
123  virtual void PaintShape(TGeoShape *shape, Option_t *option="") = 0;
124  virtual void PaintOverlap(void *ovlp, Option_t *option="") = 0;
125  virtual void PrintOverlaps() const = 0;
126  virtual void PaintVolume(TGeoVolume *vol, Option_t *option="", TGeoMatrix* global=0) = 0;
127  virtual void RandomPoints(const TGeoVolume *vol, Int_t npoints, Option_t *option="") = 0;
128  virtual void RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz, const char *target_vol, Bool_t check_norm) = 0;
129  virtual void Raytrace(Option_t *option="") = 0;
130  virtual TGeoNode *SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil, const char* g3path) = 0;
131  virtual void SetBombFactors(Double_t bombx=1.3, Double_t bomby=1.3, Double_t bombz=1.3,
132  Double_t bombr=1.3) = 0;
133  virtual void SetClippingShape(TGeoShape *shape) = 0;
134  virtual void SetExplodedView(Int_t iopt=0) = 0;
135  virtual void SetGeoManager(TGeoManager *geom) = 0;
136  virtual void SetIteratorPlugin(TGeoIteratorPlugin *plugin) = 0;
137  virtual void SetCheckedNode(TGeoNode *node) = 0;
138  virtual void SetNsegments(Int_t nseg=20) = 0;
139  virtual void SetNmeshPoints(Int_t npoints) = 0;
140  virtual void SetRaytracing(Bool_t flag=kTRUE) = 0;
141  static TVirtualGeoPainter *GeoPainter();
142  static void SetPainter(const TVirtualGeoPainter *painter);
143  virtual void SetTopVisible(Bool_t vis=kTRUE) = 0;
144  virtual void SetTopVolume(TGeoVolume *vol) = 0;
145  virtual void SetVisLevel(Int_t level=3) = 0;
146  virtual void SetVisOption(Int_t option=0) = 0;
147  virtual Int_t ShapeDistancetoPrimitive(const TGeoShape *shape, Int_t numpoints, Int_t px, Int_t py) const = 0;
148  virtual void Test(Int_t npoints, Option_t *option) = 0;
149  virtual void TestOverlaps(const char *path) = 0;
150  virtual Bool_t TestVoxels(TGeoVolume *vol) = 0;
151  virtual void UnbombTranslation(const Double_t *tr, Double_t *bombtr) = 0;
152  virtual Double_t Weight(Double_t precision, Option_t *option="v") = 0;
153 
154  ClassDef(TVirtualGeoPainter,0) //Abstract interface for geometry painters
155 };
156 
157 #endif
virtual void Draw(Option_t *option="")=0
Default Draw method for all objects.
virtual Int_t GetColor(Int_t base, Float_t light) const =0
virtual void Paint(Option_t *option="")=0
This method must be overridden if a class wants to paint itself.
virtual Int_t GetVisLevel() const =0
double dist(Rotation3D const &r1, Rotation3D const &r2)
Definition: 3DDistances.cxx:48
An array of TObjects.
Definition: TObjArray.h:39
virtual Int_t CountVisibleNodes()=0
virtual Int_t GetVisOption() const =0
virtual void GetViewAngles(Double_t &, Double_t &, Double_t &)
TVirtualGeoPainter(TGeoManager *manager)
long long Long64_t
Definition: RtypesCore.h:69
virtual void EditGeometry(Option_t *option="")=0
virtual void ModifiedPad(Bool_t update=kFALSE) const =0
static TVirtualGeoPainter * GeoPainter()
Static function returning a pointer to the geometry painter.
virtual Double_t * GetViewBox()=0
virtual void ExecuteVolumeEvent(TGeoVolume *volume, Int_t event, Int_t px, Int_t py)=0
virtual const char * GetDrawPath() const =0
float Float_t
Definition: RtypesCore.h:53
virtual TVirtualGeoTrack * AddTrack(Int_t id, Int_t pdgcode, TObject *particle)=0
const char Option_t
Definition: RtypesCore.h:62
const char * current
Definition: demos.C:12
virtual Int_t GetNsegments() const =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
static TVirtualGeoPainter * fgGeoPainter
virtual void Test(Int_t npoints, Option_t *option)=0
Description of the dynamic properties of a particle.
Definition: TParticle.h:34
virtual void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option)=0
virtual Double_t Weight(Double_t precision, Option_t *option="v")=0
virtual void PrintOverlaps() const =0
virtual void SetTopVolume(TGeoVolume *vol)=0
virtual Bool_t IsPaintingShape() const =0
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void ExecuteManagerEvent(TGeoManager *geom, Int_t event, Int_t px, Int_t py)=0
virtual void RandomPoints(const TGeoVolume *vol, Int_t npoints, Option_t *option="")=0
Float_t py
Definition: hprod.C:33
virtual void DrawPanel()=0
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
virtual void DefaultAngles()=0
virtual Bool_t TestVoxels(TGeoVolume *vol)=0
virtual void DrawOverlap(void *ovlp, Option_t *option="")=0
virtual void PaintNode(TGeoNode *node, Option_t *option="", TGeoMatrix *global=0)=0
virtual void SetClippingShape(TGeoShape *shape)=0
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void GrabFocus(Int_t nfr=0, Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0)=0
virtual void SetNsegments(Int_t nseg=20)=0
virtual Bool_t IsExplodedView() const =0
virtual void SetExplodedView(Int_t iopt=0)=0
virtual void BombTranslation(const Double_t *tr, Double_t *bombtr)=0
virtual void DrawBatemanSol(TGeoBatemanSol *sol, Option_t *option="")=0
virtual void CheckBoundaryReference(Int_t icheck=-1)=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
Float_t z[5]
Definition: Ifit.C:16
virtual void DrawCurrentPoint(Int_t color)=0
virtual Int_t DistanceToPrimitiveVol(TGeoVolume *vol, Int_t px, Int_t py)=0
virtual Int_t ShapeDistancetoPrimitive(const TGeoShape *shape, Int_t numpoints, Int_t px, Int_t py) const =0
REAL * vertex
Definition: triangle.c:512
virtual TGeoNode * SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil, const char *g3path)=0
virtual void SetTopVisible(Bool_t vis=kTRUE)=0
virtual void DrawOnly(Option_t *option="")=0
iterplugin * plugin
Definition: runplugin.C:3
virtual void SetGeoManager(TGeoManager *geom)=0
virtual void CheckGeometryFull(Bool_t checkoverlaps=kTRUE, Bool_t checkcrossings=kTRUE, Int_t nrays=10000, const Double_t *vertex=NULL)=0
virtual void SetRaytracing(Bool_t flag=kTRUE)=0
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:256
virtual void GetBombFactors(Double_t &bombx, Double_t &bomby, Double_t &bombz, Double_t &bombr) const =0
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
virtual void EstimateCameraMove(Double_t, Double_t, Double_t *, Double_t *)
virtual void SetCheckedNode(TGeoNode *node)=0
virtual void DefaultColors()=0
virtual void DrawVolume(TGeoVolume *vol, Option_t *option="")=0
virtual TGeoVolume * GetTopVolume() const =0
virtual void SetVisOption(Int_t option=0)=0
virtual Int_t GetBombMode() const =0
double Double_t
Definition: RtypesCore.h:55
virtual void DrawPath(const char *path, Option_t *option="")=0
virtual void SetVisLevel(Int_t level=3)=0
virtual const char * GetVolumeInfo(const TGeoVolume *volume, Int_t px, Int_t py) const =0
Double_t y[n]
Definition: legend1.C:17
virtual void SetNmeshPoints(Int_t npoints)=0
virtual void SetIteratorPlugin(TGeoIteratorPlugin *plugin)=0
virtual void CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.)=0
virtual void DrawPolygon(const TGeoPolygon *poly)=0
Mother of all ROOT objects.
Definition: TObject.h:58
Float_t px
Definition: hprod.C:33
static void SetPainter(const TVirtualGeoPainter *painter)
Static function to set an alternative histogram painter.
virtual void DrawShape(TGeoShape *shape, Option_t *option="")=0
virtual void ExecuteShapeEvent(TGeoShape *shape, Int_t event, Int_t px, Int_t py)=0
virtual Bool_t IsRaytracing() const =0
virtual void Raytrace(Option_t *option="")=0
virtual void AddSize3D(Int_t numpoints, Int_t numsegs, Int_t numpolys)=0
virtual void RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz, const char *target_vol, Bool_t check_norm)=0
#define NULL
Definition: Rtypes.h:82
virtual void AddTrackPoint(Double_t *point, Double_t *box, Bool_t reset=kFALSE)=0
virtual void UnbombTranslation(const Double_t *tr, Double_t *bombtr)=0
virtual TGeoVolume * GetDrawnVolume() const =0
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void OpProgress(const char *opname, Long64_t current, Long64_t size, TStopwatch *watch=0, Bool_t last=kFALSE, Bool_t refresh=kFALSE, const char *msg="")=0
virtual void PaintOverlap(void *ovlp, Option_t *option="")=0
virtual void TestOverlaps(const char *path)=0
virtual void PaintShape(TGeoShape *shape, Option_t *option="")=0
virtual void CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="")=0
virtual ~TVirtualGeoPainter()
*-*-*-*-*-*-*-*-*-*-*Geometry painter default destructor*-*-*-*-*-*-*-*-* *-* =======================...
virtual void PaintVolume(TGeoVolume *vol, Option_t *option="", TGeoMatrix *global=0)=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
Stopwatch class.
Definition: TStopwatch.h:30