Logo ROOT  
Reference Guide
TEveGeoShape.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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 
12 #include "TEveGeoShape.h"
13 #include "TEveTrans.h"
14 #include "TEveManager.h"
16 #include "TEveProjections.h"
17 #include "TEveProjectionManager.h"
18 
19 #include "TEveGeoShapeExtract.h"
20 #include "TEveGeoPolyShape.h"
21 
22 #include "TROOT.h"
23 #include "TBuffer3D.h"
24 #include "TBuffer3DTypes.h"
25 #include "TVirtualViewer3D.h"
26 #include "TColor.h"
27 #include "TFile.h"
28 
29 #include "TGeoShape.h"
30 #include "TGeoVolume.h"
31 #include "TGeoNode.h"
32 #include "TGeoShapeAssembly.h"
33 #include "TGeoCompositeShape.h"
34 #include "TGeoBoolNode.h"
35 #include "TGeoManager.h"
36 #include "TGeoMatrix.h"
37 #include "TVirtualGeoPainter.h"
38 
39 namespace
40 {
41  TGeoManager* init_geo_mangeur()
42  {
43  // Create a phony geo manager that can be used for storing free
44  // shapes. Otherwise shapes register themselves to current
45  // geo-manager (or even create one).
46 
47  TGeoManager *old = gGeoManager;
48  TGeoIdentity *old_id = gGeoIdentity;
49  gGeoManager = 0;
50  TGeoManager* mgr = new TGeoManager();
51  mgr->SetNameTitle("TEveGeoShape::fgGeoMangeur",
52  "Static geo manager used for wrapped TGeoShapes.");
53  gGeoIdentity = new TGeoIdentity("Identity");
54  gGeoManager = old;
55  gGeoIdentity = old_id;
56  return mgr;
57  }
58 
59  TGeoHMatrix localGeoHMatrixIdentity;
60 }
61 
62 /** \class TEveGeoShape
63 \ingroup TEve
64 Wrapper for TGeoShape with absolute positioning and color
65 attributes allowing display of extracted TGeoShape's (without an
66 active TGeoManager) and simplified geometries (needed for non-linear
67 projections).
68 
69 TGeoCompositeShapes and TGeoAssemblies are supported.
70 
71 If fNSegments data-member is < 2 (0 by default), the default number of
72 segments is used for tesselation and special GL objects are
73 instantiated for selected shapes (spheres, tubes). If fNSegments is > 2,
74 it gets forwarded to geo-manager and this tesselation detail is
75 used when creating the buffer passed to GL.
76 */
77 
79 
80 TGeoManager* TEveGeoShape::fgGeoMangeur = init_geo_mangeur();
81 
82 ////////////////////////////////////////////////////////////////////////////////
83 /// Return static geo-manager that is used internally to make shapes
84 /// lead a happy life.
85 /// Set gGeoManager to this object when creating TGeoShapes to be
86 /// passed into TEveGeoShapes.
87 
89 {
90  return fgGeoMangeur;
91 }
92 
93 ////////////////////////////////////////////////////////////////////////////////
94 /// Return static identity matrix in homogeneous representation.
95 /// This is needed because TGeoCompositeShape::PaintComposite()
96 /// assumes TGeoShape::fgTransform is a TGeoHMatrix and we need to pass in
97 /// an identity matrix when painting a composite shape.
98 
100 {
101  return &localGeoHMatrixIdentity;
102 }
103 
104 ////////////////////////////////////////////////////////////////////////////////
105 /// Constructor.
106 
107 TEveGeoShape::TEveGeoShape(const char* name, const char* title) :
108  TEveShape (name, title),
109  fNSegments (0),
110  fShape (0),
111  fCompositeShape (0)
112 {
113  InitMainTrans();
114 }
115 
116 ////////////////////////////////////////////////////////////////////////////////
117 /// Destructor.
118 
120 {
121  SetShape(0);
122 }
123 
124 ////////////////////////////////////////////////////////////////////////////////
125 /// Create derived TEveGeoShape form a TGeoCompositeShape.
126 
128 {
130 }
131 
132 ////////////////////////////////////////////////////////////////////////////////
133 /// Set number of segments.
134 
136 {
137  if (s != fNSegments && fCompositeShape != 0)
138  {
139  delete fShape;
140  fShape = MakePolyShape();
141  }
142  fNSegments = s;
143 }
144 
145 ////////////////////////////////////////////////////////////////////////////////
146 /// Set TGeoShape shown by this object.
147 ///
148 /// The shape is owned by TEveGeoShape but TGeoShape::fUniqueID is
149 /// used for reference counting so you can pass the same shape to
150 /// several TEveGeoShapes.
151 ///
152 /// If it if is taken from an existing TGeoManager, manually
153 /// increase the fUniqueID before passing it to TEveGeoShape.
154 
156 {
158 
159  if (fCompositeShape)
160  {
161  delete fShape;
163  }
164  if (fShape)
165  {
167  if (fShape->GetUniqueID() == 0)
168  {
169  delete fShape;
170  }
171  }
172  fShape = s;
173  if (fShape)
174  {
176  fCompositeShape = dynamic_cast<TGeoCompositeShape*>(fShape);
177  if (fCompositeShape)
178  {
179  fShape = MakePolyShape();
180  }
181  }
182 }
183 
184 ////////////////////////////////////////////////////////////////////////////////
185 /// Compute bounding-box.
186 
188 {
189  TGeoBBox *bb = dynamic_cast<TGeoBBox*>(fShape);
190  if (bb)
191  {
192  BBoxInit();
193  const Double_t *o = bb->GetOrigin();
194  BBoxCheckPoint(o[0] - bb->GetDX(), o[0] - bb->GetDY(), o[0] - bb->GetDZ());
195  BBoxCheckPoint(o[0] + bb->GetDX(), o[0] + bb->GetDY(), o[0] + bb->GetDZ());
196  }
197  else
198  {
199  BBoxZero();
200  }
201 }
202 
203 ////////////////////////////////////////////////////////////////////////////////
204 /// Paint object.
205 
206 void TEveGeoShape::Paint(Option_t* /*option*/)
207 {
208  static const TEveException eh("TEveGeoShape::Paint ");
209 
210  if (fShape == 0)
211  return;
212 
214 
215  if (fCompositeShape)
216  {
217  Double_t halfLengths[3] = { fCompositeShape->GetDX(), fCompositeShape->GetDY(), fCompositeShape->GetDZ() };
218 
220  buff.fID = this;
221  buff.fColor = GetMainColor();
223  RefMainTrans().SetBuffer3D(buff);
224  buff.fLocalFrame = kTRUE; // Always enforce local frame (no geo manager).
225  buff.SetAABoundingBox(fCompositeShape->GetOrigin(), halfLengths);
227 
228  Bool_t paintComponents = kTRUE;
229 
230  // Start a composite shape, identified by this buffer
231  if (TBuffer3D::GetCSLevel() == 0)
232  paintComponents = gPad->GetViewer3D()->OpenComposite(buff);
233 
235 
236  // Paint the boolean node - will add more buffers to viewer
239  if (paintComponents) fCompositeShape->GetBoolNode()->Paint("");
241  // Close the composite shape
242  if (TBuffer3D::DecCSLevel() == 0)
243  gPad->GetViewer3D()->CloseComposite();
244  }
245  else
246  {
249 
250  buff.fID = this;
251  buff.fColor = GetMainColor();
253  RefMainTrans().SetBuffer3D(buff);
254  buff.fLocalFrame = kTRUE; // Always enforce local frame (no geo manager).
255 
257  if (fNSegments > 2)
259  fShape->GetBuffer3D(sections, kTRUE);
260 
261  Int_t reqSec = gPad->GetViewer3D()->AddObject(buff);
262 
263  if (reqSec != TBuffer3D::kNone) {
264  // This shouldn't happen, but I suspect it does sometimes.
265  if (reqSec & TBuffer3D::kCore)
266  Warning(eh, "Core section required again for shape='%s'. This shouldn't happen.", GetName());
267  fShape->GetBuffer3D(reqSec, kTRUE);
268  reqSec = gPad->GetViewer3D()->AddObject(buff);
269  }
270 
271  if (reqSec != TBuffer3D::kNone)
272  Warning(eh, "Extra section required: reqSec=%d, shape=%s.", reqSec, GetName());
273  }
274 }
275 
276 ////////////////////////////////////////////////////////////////////////////////
277 /// Save the shape tree as TEveGeoShapeExtract.
278 /// File is always recreated.
279 /// This function is obsolete, use SaveExtractInstead().
280 
281 void TEveGeoShape::Save(const char* file, const char* name)
282 {
283  Warning("Save()", "This function is deprecated, use SaveExtract() instead.");
285 }
286 
287 ////////////////////////////////////////////////////////////////////////////////
288 /// Save the shape tree as TEveGeoShapeExtract.
289 /// File is always recreated.
290 
291 void TEveGeoShape::SaveExtract(const char* file, const char* name)
292 {
293  TEveGeoShapeExtract* gse = DumpShapeTree(this, 0);
294 
295  TFile f(file, "RECREATE");
296  gse->Write(name);
297  f.Close();
298 }
299 
300 ////////////////////////////////////////////////////////////////////////////////
301 /// Write the shape tree as TEveGeoShapeExtract to current directory.
302 
304 {
305  TEveGeoShapeExtract* gse = DumpShapeTree(this, 0);
306  gse->Write(name);
307 }
308 
309 ////////////////////////////////////////////////////////////////////////////////
310 /// Export this shape and its descendants into a geoshape-extract.
311 
313  TEveGeoShapeExtract* parent)
314 {
315  TEveGeoShapeExtract* she = new TEveGeoShapeExtract(gsre->GetName(), gsre->GetTitle());
316  she->SetTrans(gsre->RefMainTrans().Array());
317  {
318  Int_t ci = gsre->GetFillColor();
319  TColor *c = gROOT->GetColor(ci);
320  Float_t rgba[4] = { 1, 0, 0, Float_t(1 - gsre->GetMainTransparency()/100.) };
321  if (c)
322  {
323  rgba[0] = c->GetRed();
324  rgba[1] = c->GetGreen();
325  rgba[2] = c->GetBlue();
326  }
327  she->SetRGBA(rgba);
328  }
329  {
330  Int_t ci = gsre->GetLineColor();
331  TColor *c = gROOT->GetColor(ci);
332  Float_t rgba[4] = { 1, 0, 0, 1 };
333  if (c)
334  {
335  rgba[0] = c->GetRed();
336  rgba[1] = c->GetGreen();
337  rgba[2] = c->GetBlue();
338  }
339  she->SetRGBALine(rgba);
340  }
341  she->SetRnrSelf(gsre->GetRnrSelf());
342  she->SetRnrElements(gsre->GetRnrChildren());
343  she->SetRnrFrame(gsre->GetDrawFrame());
344  she->SetMiniFrame(gsre->GetMiniFrame());
345  she->SetShape(gsre->GetShape());
346  if (gsre->HasChildren())
347  {
348  TList* ele = new TList();
349  she->SetElements(ele);
350  she->GetElements()->SetOwner(true);
352  while (i != gsre->EndChildren()) {
353  TEveGeoShape* l = dynamic_cast<TEveGeoShape*>(*i);
354  DumpShapeTree(l, she);
355  i++;
356  }
357  }
358  if (parent)
359  parent->GetElements()->Add(she);
360 
361  return she;
362 }
363 
364 ////////////////////////////////////////////////////////////////////////////////
365 /// Import a shape extract 'gse' under element 'parent'.
366 
368  TEveElement* parent)
369 {
372  TEveGeoShape* gsre = SubImportShapeExtract(gse, parent);
373  gsre->ElementChanged();
374  return gsre;
375 }
376 
377 ////////////////////////////////////////////////////////////////////////////////
378 /// Recursive version for importing a shape extract tree.
379 
381  TEveElement* parent)
382 {
383  TEveGeoShape* gsre = new TEveGeoShape(gse->GetName(), gse->GetTitle());
384  gsre->RefMainTrans().SetFromArray(gse->GetTrans());
385  const Float_t* rgba = gse->GetRGBA();
386  gsre->SetMainColorRGB(rgba[0], rgba[1], rgba[2]);
387  gsre->SetMainAlpha(rgba[3]);
388  rgba = gse->GetRGBALine();
389  gsre->SetLineColor(TColor::GetColor(rgba[0], rgba[1], rgba[2]));
390  gsre->SetRnrSelf(gse->GetRnrSelf());
391  gsre->SetRnrChildren(gse->GetRnrElements());
392  gsre->SetDrawFrame(gse->GetRnrFrame());
393  gsre->SetMiniFrame(gse->GetMiniFrame());
394  gsre->SetShape(gse->GetShape());
395 
396  if (parent)
397  parent->AddElement(gsre);
398 
399  if (gse->HasElements())
400  {
401  TIter next(gse->GetElements());
402  TEveGeoShapeExtract* chld;
403  while ((chld = (TEveGeoShapeExtract*) next()) != 0)
404  SubImportShapeExtract(chld, gsre);
405  }
406 
407  return gsre;
408 }
409 
410 ////////////////////////////////////////////////////////////////////////////////
411 /// Return class for projected objects:
412 /// - 2D projections: TEvePolygonSetProjected,
413 /// - 3D projections: TEveGeoShapeProjected.
414 /// Virtual from TEveProjectable.
415 
417 {
418  if (p->Is2D())
420  else
422 }
423 
424 ////////////////////////////////////////////////////////////////////////////////
425 /// Create a TBuffer3D suitable for presentation of the shape.
426 /// Transformation matrix is also applied.
427 
429 {
430  if (fShape == 0) return 0;
431 
432  if (dynamic_cast<TGeoShapeAssembly*>(fShape)) {
433  // TGeoShapeAssembly makes a bad TBuffer3D.
434  return 0;
435  }
436 
438 
439  TBuffer3D* buff = fShape->MakeBuffer3D();
440  TEveTrans& mx = RefMainTrans();
441  if (mx.GetUseTrans())
442  {
443  Int_t n = buff->NbPnts();
444  Double_t* pnts = buff->fPnts;
445  for(Int_t k = 0; k < n; ++k)
446  {
447  mx.MultiplyIP(&pnts[3*k]);
448  }
449  }
450  return buff;
451 }
452 
453 
454 /** \class TEveGeoShapeProjected
455 \ingroup TEve
456 A 3D projected TEveGeoShape.
457 */
458 
460 
461 ////////////////////////////////////////////////////////////////////////////////
462 /// Constructor.
463 
465  TEveShape("TEveGeoShapeProjected"),
466  fBuff(0)
467 {
468 }
469 
470 ////////////////////////////////////////////////////////////////////////////////
471 /// Destructor.
472 
474 {
475  delete fBuff;
476 }
477 
478 ////////////////////////////////////////////////////////////////////////////////
479 /// This should never be called as this class is only used for 3D
480 /// projections.
481 /// The implementation is required as this metod is abstract.
482 /// Just emits a warning if called.
483 
485 {
486  Warning("SetDepthLocal", "This function only exists to fulfill an abstract interface.");
487 }
488 
489 ////////////////////////////////////////////////////////////////////////////////
490 /// This is virtual method from base-class TEveProjected.
491 
494 {
496 
497  TEveGeoShape* gre = dynamic_cast<TEveGeoShape*>(fProjectable);
498  CopyVizParams(gre);
499 }
500 
501 ////////////////////////////////////////////////////////////////////////////////
502 /// This is virtual method from base-class TEveProjected.
503 
505 {
506  TEveGeoShape *gre = dynamic_cast<TEveGeoShape*>(fProjectable);
508 
509  delete fBuff;
510  fBuff = gre->MakeBuffer3D();
511 
512  if (fBuff)
513  {
515 
516  Double_t *p = fBuff->fPnts;
517  for (UInt_t i = 0; i < fBuff->NbPnts(); ++i, p+=3)
518  {
519  prj->ProjectPointdv(p, 0);
520  }
521  }
522 
523  ResetBBox();
524 }
525 
526 ////////////////////////////////////////////////////////////////////////////////
527 /// Override of virtual method from TAttBBox.
528 
530 {
531  if (fBuff && fBuff->NbPnts() > 0)
532  {
533  BBoxInit();
534 
535  Double_t *p = fBuff->fPnts;
536  for (UInt_t i = 0; i < fBuff->NbPnts(); ++i, p+=3)
537  {
538  BBoxCheckPoint(p[0], p[1], p[2]);
539  }
540  }
541  else
542  {
543  BBoxZero();
544  }
545 }
TGeoShape.h
TEveElement::HasChildren
Bool_t HasChildren() const
Definition: TEveElement.h:171
c
#define c(i)
Definition: RSha256.hxx:119
l
auto * l
Definition: textangle.C:4
TEveGeoManagerHolder
Definition: TEveUtil.h:141
TEveGeoShapeExtract::SetRnrSelf
void SetRnrSelf(Bool_t r)
Definition: TEveGeoShapeExtract.h:46
TGeoShapeAssembly.h
TEveGeoShape::fShape
TGeoShape * fShape
Definition: TEveGeoShape.h:31
TEveGeoShape.h
n
const Int_t n
Definition: legend1.C:16
TEveTrans::SetFromArray
void SetFromArray(const Double_t arr[16])
Set matrix from Double_t array.
Definition: TEveTrans.cxx:177
TEveGeoShapeExtract::SetMiniFrame
void SetMiniFrame(Bool_t r)
Definition: TEveGeoShapeExtract.h:49
TEveElement::GetMainTransparency
virtual Char_t GetMainTransparency() const
Definition: TEveElement.h:281
TEveShape::CopyVizParams
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
Definition: TEveShape.cxx:70
TEveGeoShapeExtract::GetMiniFrame
Bool_t GetMiniFrame()
Definition: TEveGeoShapeExtract.h:59
TEveGeoShape::MakeBuffer3D
virtual TBuffer3D * MakeBuffer3D()
Create a TBuffer3D suitable for presentation of the shape.
Definition: TEveGeoShape.cxx:428
TEveElement
Definition: TEveElement.h:35
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TEveTrans
Definition: TEveTrans.h:26
TBuffer3D::kNone
@ kNone
Definition: TBuffer3D.h:55
TEveGeoShape::fgGeoMangeur
static TGeoManager * fgGeoMangeur
Temporary holder (if passed shape is composite shape).
Definition: TEveGeoShape.h:34
gGeoIdentity
R__EXTERN TGeoIdentity * gGeoIdentity
Definition: TGeoMatrix.h:478
f
#define f(i)
Definition: RSha256.hxx:122
TNamed::SetNameTitle
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Definition: TNamed.cxx:154
TBuffer3D::SetSectionsValid
void SetSectionsValid(UInt_t mask)
Definition: TBuffer3D.h:71
TEveProjected::SetProjection
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Sets projection manager and reference in the projectable object.
Definition: TEveProjectionBases.cxx:193
TEveGeoShapeExtract::SetTrans
void SetTrans(const Double_t arr[16])
Set transformation matrix.
Definition: TEveGeoShapeExtract.cxx:80
gGeoManager
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:602
TGeoCompositeShape::GetBoolNode
TGeoBoolNode * GetBoolNode() const
Definition: TGeoCompositeShape.h:65
TEveGeoShapeExtract::GetRnrElements
Bool_t GetRnrElements()
Definition: TEveGeoShapeExtract.h:57
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TEveGeoShapeProjected::SetProjection
virtual void SetProjection(TEveProjectionManager *proj, TEveProjectable *model)
This is virtual method from base-class TEveProjected.
Definition: TEveGeoShape.cxx:492
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
TBuffer3D::DecCSLevel
static UInt_t DecCSLevel()
Decrement CS level.
Definition: TBuffer3D.cxx:512
TEveGeoShapeExtract::GetRnrFrame
Bool_t GetRnrFrame()
Definition: TEveGeoShapeExtract.h:58
TEveProjection
Definition: TEveProjections.h:26
TEveGeoShapeProjected
Definition: TEveGeoShape.h:74
TBuffer3D::SetAABoundingBox
void SetAABoundingBox(const Double_t origin[3], const Double_t halfLengths[3])
Set fBBVertex in kBoundingBox section to a axis aligned (local) BB using supplied origin and box half...
Definition: TBuffer3D.cxx:320
TEveGeoShapeExtract::SetRnrElements
void SetRnrElements(Bool_t r)
Definition: TEveGeoShapeExtract.h:47
TEveGeoShape::GetShape
TGeoShape * GetShape() const
Definition: TEveGeoShape.h:49
TCollection::SetOwner
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Definition: TCollection.cxx:746
TEveGeoShapeExtract
Definition: TEveGeoShapeExtract.h:20
TEveTrans::Array
Double_t * Array()
Definition: TEveTrans.h:94
TEveProjections.h
TEveElement::GetRnrSelf
virtual Bool_t GetRnrSelf() const
Definition: TEveElement.h:256
TEveShape::GetMiniFrame
virtual Bool_t GetMiniFrame() const
Definition: TEveShape.h:64
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
TEveProjection::ProjectPointdv
void ProjectPointdv(Double_t *v, Float_t d)
Project double array.
Definition: TEveProjections.cxx:64
TEveProjected::fProjectable
TEveProjectable * fProjectable
Definition: TEveProjectionBases.h:91
TGeoVolume.h
TEveGeoShape::SubImportShapeExtract
static TEveGeoShape * SubImportShapeExtract(TEveGeoShapeExtract *gse, TEveElement *parent)
Recursive version for importing a shape extract tree.
Definition: TEveGeoShape.cxx:380
TGeoBBox::GetDZ
virtual Double_t GetDZ() const
Definition: TGeoBBox.h:78
TAttBBox::BBoxZero
void BBoxZero(Float_t epsilon=0, Float_t x=0, Float_t y=0, Float_t z=0)
Create cube of volume (2*epsilon)^3 at (x,y,z).
Definition: TAttBBox.cxx:42
TObject::GetUniqueID
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition: TObject.cxx:377
TEveGeoShape::ComputeBBox
virtual void ComputeBBox()
Compute bounding-box.
Definition: TEveGeoShape.cxx:187
TBuffer3D::NbPnts
UInt_t NbPnts() const
Definition: TBuffer3D.h:86
TEveTrans::GetUseTrans
Bool_t GetUseTrans() const
Definition: TEveTrans.h:168
TEveProjection::Is2D
virtual Bool_t Is2D() const =0
TColor.h
TEveGeoShape::GetGeoHMatrixIdentity
static TGeoHMatrix * GetGeoHMatrixIdentity()
Return static identity matrix in homogeneous representation.
Definition: TEveGeoShape.cxx:99
TEveGeoPolyShape.h
TEveElement::List_i
List_t::iterator List_i
Definition: TEveElement.h:72
TGeoShape::GetTransform
static TGeoMatrix * GetTransform()
Returns current transformation matrix that applies to shape.
Definition: TGeoShape.cxx:536
TEveGeoShape::WriteExtract
void WriteExtract(const char *name)
Write the shape tree as TEveGeoShapeExtract to current directory.
Definition: TEveGeoShape.cxx:303
gEve
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
TEveElement::GetMainColor
virtual Color_t GetMainColor() const
Definition: TEveElement.h:272
TGeoShape::MakeBuffer3D
virtual TBuffer3D * MakeBuffer3D() const
Definition: TGeoShape.h:143
TFile.h
bool
TBuffer3D::kShapeSpecific
@ kShapeSpecific
Definition: TBuffer3D.h:58
TGeoCompositeShape
Definition: TGeoCompositeShape.h:27
TEveGeoShapeExtract::GetRGBA
Float_t * GetRGBA()
Definition: TEveGeoShapeExtract.h:54
TEveGeoShape::SaveExtract
void SaveExtract(const char *file, const char *name)
Save the shape tree as TEveGeoShapeExtract.
Definition: TEveGeoShape.cxx:291
TBuffer3D::kBoundingBox
@ kBoundingBox
Definition: TBuffer3D.h:57
TEveGeoShape::MakePolyShape
TGeoShape * MakePolyShape()
Create derived TEveGeoShape form a TGeoCompositeShape.
Definition: TEveGeoShape.cxx:127
TAttBBox::BBoxCheckPoint
void BBoxCheckPoint(Float_t x, Float_t y, Float_t z)
Definition: TAttBBox.h:58
TROOT.h
TEveGeoShapeExtract::GetElements
TList * GetElements()
Definition: TEveGeoShapeExtract.h:61
TEveGeoShape::Save
void Save(const char *file, const char *name="Extract")
Save the shape tree as TEveGeoShapeExtract.
Definition: TEveGeoShape.cxx:281
TEveGeoShape::fCompositeShape
TGeoCompositeShape * fCompositeShape
Definition: TEveGeoShape.h:32
TEveElement::GetRnrChildren
virtual Bool_t GetRnrChildren() const
Definition: TEveElement.h:257
TEveGeoShapeExtract::GetTrans
Double_t * GetTrans()
Definition: TEveGeoShapeExtract.h:53
TEveProjectable
Definition: TEveProjectionBases.h:34
TEveElement::SetRnrSelf
virtual Bool_t SetRnrSelf(Bool_t rnr)
Set render state of this element, i.e.
Definition: TEveElement.cxx:1061
TGeoBBox::GetDX
virtual Double_t GetDX() const
Definition: TGeoBBox.h:76
TEveElement::InitMainTrans
virtual void InitMainTrans(Bool_t can_edit=kTRUE)
Initialize the main transformation to identity matrix.
Definition: TEveElement.cxx:1274
TBuffer3D
Definition: TBuffer3D.h:17
TEveGeoShape::Paint
virtual void Paint(Option_t *option="")
Paint object.
Definition: TEveGeoShape.cxx:206
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TEveTrans::SetBuffer3D
void SetBuffer3D(TBuffer3D &buff)
Fill transformation part TBuffer3D core section.
Definition: TEveTrans.cxx:1048
TEveProjectionManager.h
TEveGeoShapeProjected::~TEveGeoShapeProjected
virtual ~TEveGeoShapeProjected()
Destructor.
Definition: TEveGeoShape.cxx:473
TGeoShape
Definition: TGeoShape.h:25
TEveGeoShape::~TEveGeoShape
virtual ~TEveGeoShape()
Destructor.
Definition: TEveGeoShape.cxx:119
TBuffer3D::fColor
Int_t fColor
Definition: TBuffer3D.h:94
TEveShape::SetMiniFrame
virtual void SetMiniFrame(Bool_t r)
Definition: TEveShape.h:71
TEveGeoShape::SetNSegments
void SetNSegments(Int_t s)
Set number of segments.
Definition: TEveGeoShape.cxx:135
TEveElement::ElementChanged
virtual void ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kFALSE)
Call this after an element has been changed so that the state can be propagated around the framework.
Definition: TEveElement.cxx:1852
TEveGeoShape::GetGeoMangeur
static TGeoManager * GetGeoMangeur()
Return static geo-manager that is used internally to make shapes lead a happy life.
Definition: TEveGeoShape.cxx:88
TGeoHMatrix
Definition: TGeoMatrix.h:420
TColor
Definition: TColor.h:19
TEveProjectionManager
Definition: TEveProjectionManager.h:20
TEveElement::SetMainColorRGB
void SetMainColorRGB(UChar_t r, UChar_t g, UChar_t b)
Convert RGB values to Color_t and call SetMainColor.
Definition: TEveElement.cxx:1182
TEveProjected::fManager
TEveProjectionManager * fManager
Definition: TEveProjectionBases.h:90
TEveGeoShapeExtract::GetRGBALine
Float_t * GetRGBALine()
Definition: TEveGeoShapeExtract.h:55
TVirtualViewer3D.h
TEveGeoShapeProjected::SetDepthLocal
virtual void SetDepthLocal(Float_t d)
This should never be called as this class is only used for 3D projections.
Definition: TEveGeoShape.cxx:484
TEveGeoShapeProjected::TEveGeoShapeProjected
TEveGeoShapeProjected()
Constructor.
Definition: TEveGeoShape.cxx:464
TAttBBox::ResetBBox
void ResetBBox()
Definition: TAttBBox.h:52
TEveManager::TRedrawDisabler
Definition: TEveManager.h:55
TEveShape::SetLineColor
virtual void SetLineColor(Color_t c)
Definition: TEveShape.h:67
TBuffer3D.h
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGeoBoolNode::Paint
void Paint(Option_t *option) override
Special schema for feeding the 3D buffers to the painter client.
Definition: TGeoBoolNode.cxx:294
TEveGeoShapeExtract::SetRGBA
void SetRGBA(const Float_t arr[4])
Set RGBA color.
Definition: TEveGeoShapeExtract.cxx:89
TEveGeoShape::SetShape
void SetShape(TGeoShape *s)
Set TGeoShape shown by this object.
Definition: TEveGeoShape.cxx:155
TEveElement::AddElement
virtual void AddElement(TEveElement *el)
Add el to the list of children.
Definition: TEveElement.cxx:1324
TAttBBox::BBoxInit
void BBoxInit(Float_t infinity=1e6)
Dynamic Float_t[6] X(min,max), Y(min,max), Z(min,max)
Definition: TAttBBox.cxx:29
TBuffer3DTypes.h
TBuffer3D::kRaw
@ kRaw
Definition: TBuffer3D.h:60
TGeoBBox::GetOrigin
virtual const Double_t * GetOrigin() const
Definition: TGeoBBox.h:79
TGeoBBox
Definition: TGeoBBox.h:17
TGeoCompositeShape.h
TEveTrans.h
TColor::GetColor
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition: TColor.cxx:1766
TBuffer3D::fTransparency
Short_t fTransparency
Definition: TBuffer3D.h:95
TGeoShape::GetBuffer3D
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Stub implementation to avoid forcing implementation at this stage.
Definition: TGeoShape.cxx:689
TObject::Warning
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:876
TEveGeoShapeExtract::SetRnrFrame
void SetRnrFrame(Bool_t r)
Definition: TEveGeoShapeExtract.h:48
TFile
Definition: TFile.h:54
unsigned int
TGeoMatrix.h
TEveGeoShapeProjected::UpdateProjection
virtual void UpdateProjection()
This is virtual method from base-class TEveProjected.
Definition: TEveGeoShape.cxx:504
TEvePolygonSetProjected.h
TGeoManager.h
TEveShape::GetDrawFrame
virtual Bool_t GetDrawFrame() const
Definition: TEveShape.h:62
TEveGeoShapeExtract::SetRGBALine
void SetRGBALine(const Float_t arr[4])
Set RGBA color for line.
Definition: TEveGeoShapeExtract.cxx:98
TEveManager.h
TEveGeoShape
Definition: TEveGeoShape.h:23
TEveElement::SetMainAlpha
void SetMainAlpha(Float_t alpha)
Set main-transparency via float alpha variable.
Definition: TEveElement.cxx:1226
TVirtualGeoPainter.h
Double_t
double Double_t
Definition: RtypesCore.h:59
TGeoMatrix
Definition: TGeoMatrix.h:40
TBuffer3D::fLocalFrame
Bool_t fLocalFrame
Definition: TBuffer3D.h:96
TEveGeoShapeExtract::GetRnrSelf
Bool_t GetRnrSelf()
Definition: TEveGeoShapeExtract.h:56
TBuffer3D::fID
TObject * fID
Definition: TBuffer3D.h:93
TEveException
Definition: TEveUtil.h:101
TEveGeoShapeExtract::SetElements
void SetElements(TList *e)
Definition: TEveGeoShapeExtract.h:51
TGeoBBox::GetDY
virtual Double_t GetDY() const
Definition: TGeoBBox.h:77
TEveGeoShape::ProjectedClass
virtual TClass * ProjectedClass(const TEveProjection *p) const
Return class for projected objects:
Definition: TEveGeoShape.cxx:416
TEveShape::GetLineColor
virtual Color_t GetLineColor() const
Definition: TEveShape.h:60
TClass
Definition: TClass.h:80
TEveGeoShape::ImportShapeExtract
static TEveGeoShape * ImportShapeExtract(TEveGeoShapeExtract *gse, TEveElement *parent=0)
Import a shape extract 'gse' under element 'parent'.
Definition: TEveGeoShape.cxx:367
TGeoShapeAssembly
Definition: TGeoShapeAssembly.h:19
file
Definition: file.py:1
TEveGeoShape::DumpShapeTree
TEveGeoShapeExtract * DumpShapeTree(TEveGeoShape *geon, TEveGeoShapeExtract *parent=0)
Export this shape and its descendants into a geoshape-extract.
Definition: TEveGeoShape.cxx:312
TObject::Write
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TObject.cxx:795
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TEveGeoShape::TEveGeoShape
TEveGeoShape(const TEveGeoShape &)
TEveElement::SetRnrChildren
virtual Bool_t SetRnrChildren(Bool_t rnr)
Set render state of this element's children, i.e.
Definition: TEveElement.cxx:1083
TEveElement::BeginChildren
List_i BeginChildren()
Definition: TEveElement.h:166
TBuffer3DTypes::kComposite
@ kComposite
Definition: TBuffer3DTypes.h:37
TBuffer3D::kRawSizes
@ kRawSizes
Definition: TBuffer3D.h:59
name
char name[80]
Definition: TGX11.cxx:110
TEveGeoShapeExtract::HasElements
Bool_t HasElements()
True if has at least one element.
Definition: TEveGeoShapeExtract.cxx:61
TBuffer3D::fPnts
Double_t * fPnts
Definition: TBuffer3D.h:118
TGeoBoolNode.h
gPad
#define gPad
Definition: TVirtualPad.h:287
TIter
Definition: TCollection.h:233
TEveGeoShapeExtract.h
make_cnn_model.model
model
Definition: make_cnn_model.py:6
TEveElement::EndChildren
List_i EndChildren()
Definition: TEveElement.h:167
TEveProjectionManager::GetProjection
TEveProjection * GetProjection()
Definition: TEveProjectionManager.h:55
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
Class
void Class()
Definition: Class.C:29
TEveShape::GetFillColor
virtual Color_t GetFillColor() const
Definition: TEveShape.h:59
TBuffer3D::GetCSLevel
static UInt_t GetCSLevel()
Return CS level.
Definition: TBuffer3D.cxx:496
TEveElement::RefMainTrans
virtual TEveTrans & RefMainTrans()
Return reference to main transformation.
Definition: TEveElement.cxx:1261
TEveGeoShapeExtract::GetShape
TGeoShape * GetShape()
Definition: TEveGeoShapeExtract.h:60
TGeoManager
Definition: TGeoManager.h:44
TEveGeoShapeProjected::ComputeBBox
virtual void ComputeBBox()
Override of virtual method from TAttBBox.
Definition: TEveGeoShape.cxx:529
TEveTrans::MultiplyIP
void MultiplyIP(TVector3 &v, Double_t w=1) const
Multiply vector in-place.
Definition: TEveTrans.cxx:728
TEveGeoPolyShape::Construct
static TEveGeoPolyShape * Construct(TGeoCompositeShape *cshp, Int_t n_seg)
Static constructor from a composite shape.
Definition: TEveGeoPolyShape.cxx:49
TGeoIdentity
Definition: TGeoMatrix.h:383
TEveGeoShape::fNSegments
Int_t fNSegments
Definition: TEveGeoShape.h:30
TEveShape::SetDrawFrame
virtual void SetDrawFrame(Bool_t f)
Definition: TEveShape.h:69
TGeoNode.h
TEveGeoShapeExtract::SetShape
void SetShape(TGeoShape *s)
Definition: TEveGeoShapeExtract.h:50
TEveShape
Definition: TEveShape.h:23
TList
Definition: TList.h:44
TBuffer3D::IncCSLevel
static void IncCSLevel()
Increment CS level.
Definition: TBuffer3D.cxx:504
TEveGeoShapeProjected::fBuff
TBuffer3D * fBuff
Definition: TEveGeoShape.h:82
TObject::SetUniqueID
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition: TObject.cxx:707
gROOT
#define gROOT
Definition: TROOT.h:406
int
TBuffer3D::kCore
@ kCore
Definition: TBuffer3D.h:56
TGeoShape::SetTransform
static void SetTransform(TGeoMatrix *matrix)
Set current transformation matrix that applies to shape.
Definition: TGeoShape.cxx:544