Logo ROOT  
Reference Guide
REveGeoShape.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Author: Matevz Tadel 2007, 1018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, 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 #ifndef ROOT7_REveGeoShape
13 #define ROOT7_REveGeoShape
14 
15 #include <ROOT/REveShape.hxx>
16 
17 class TGeoShape;
18 class TGeoHMatrix;
19 class TGeoCompositeShape;
20 class TBuffer3D;
21 
22 namespace ROOT {
23 namespace Experimental {
24 
25 class REveGeoShapeExtract;
26 
27 // ==========================================================================================
28 // REveGeoShape
29 // Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted
30 // TGeoShape's (without an active TGeoManager) and simplified geometries (needed for NLT projections).
31 // ==========================================================================================
32 
33 class REveGeoShape : public REveShape,
34  public REveProjectable
35 {
36 private:
37  REveGeoShape(const REveGeoShape &) = delete;
38  REveGeoShape &operator=(const REveGeoShape &) = delete;
39 
40 protected:
42  TGeoShape *fShape{nullptr};
43  TGeoCompositeShape *fCompositeShape{nullptr}; //! Temporary holder (if passed shape is composite shape).
44 
46 
49 
51 
52 public:
53  REveGeoShape(const std::string &name = "REveGeoShape", const std::string &title = "");
54  virtual ~REveGeoShape();
55 
56  Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
57  void BuildRenderData() override;
58 
59  Int_t GetNSegments() const { return fNSegments; }
60  TGeoShape *GetShape() const { return fShape; }
61  void SetNSegments(Int_t s);
62  void SetShape(TGeoShape *s);
63 
64  void ComputeBBox() override;
65 
66  void SaveExtract(const char *file, const char *name);
67  void WriteExtract(const char *name);
68 
69  static REveGeoShape *ImportShapeExtract(REveGeoShapeExtract *gse, REveElement *parent = nullptr);
70 
71  // GeoProjectable
72  virtual std::unique_ptr<TBuffer3D> MakeBuffer3D();
73  TClass *ProjectedClass(const REveProjection *p) const override;
74 
75  static TGeoManager *GetGeoManager();
77 };
78 
79 //------------------------------------------------------------------------------
80 
81 // ==========================================================================================
82 // REveGeoShapeProjected
83 // ==========================================================================================
84 
86 private:
89 
90 protected:
91  std::unique_ptr<TBuffer3D> fBuff; //! 3d buffer
92 
93  void SetDepthLocal(Float_t d) override;
94 
95 public:
97  virtual ~REveGeoShapeProjected();
98 
100  void UpdateProjection() override;
101  REveElement *GetProjectedAsElement() override { return this; }
102 
103  void ComputeBBox() override;
104 };
105 
106 } // namespace Experimental
107 } // namespace ROOT
108 
109 #endif
ROOT::Experimental::REveProjected
Definition: REveProjectionBases.hxx:81
ROOT::Experimental::REveGeoShapeProjected
Definition: REveGeoShape.hxx:85
ROOT::Experimental::REveGeoShape::~REveGeoShape
virtual ~REveGeoShape()
Destructor.
Definition: REveGeoShape.cxx:119
ROOT::Experimental::REveGeoShapeProjected::SetProjection
void SetProjection(REveProjectionManager *proj, REveProjectable *model) override
This is virtual method from base-class REveProjected.
Definition: REveGeoShape.cxx:444
ROOT::Experimental::REveGeoShape::fCompositeShape
TGeoCompositeShape * fCompositeShape
Definition: REveGeoShape.hxx:43
REveShape.hxx
ROOT::Experimental::REveGeoShapeProjected::~REveGeoShapeProjected
virtual ~REveGeoShapeProjected()
Destructor.
Definition: REveGeoShape.cxx:424
ROOT::Experimental::REveGeoShape
Definition: REveGeoShape.hxx:35
ROOT::Experimental::REveGeoShape::operator=
REveGeoShape & operator=(const REveGeoShape &)=delete
ROOT::Experimental::REveGeoShape::REveGeoShape
REveGeoShape(const REveGeoShape &)=delete
ROOT::Experimental::REveGeoShapeProjected::fBuff
std::unique_ptr< TBuffer3D > fBuff
Definition: REveGeoShape.hxx:91
ROOT::Experimental::REveGeoShapeProjected::ComputeBBox
void ComputeBBox() override
Override of virtual method from TAttBBox.
Definition: REveGeoShape.cxx:480
ROOT::Experimental::REveGeoShapeProjected::REveGeoShapeProjected
REveGeoShapeProjected()
Constructor.
Definition: REveGeoShape.cxx:415
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
Int_t
int Int_t
Definition: RtypesCore.h:45
ROOT::Experimental::REveGeoShape::GetShape
TGeoShape * GetShape() const
Definition: REveGeoShape.hxx:60
ROOT::Experimental::REveGeoShape::SetNSegments
void SetNSegments(Int_t s)
Set number of segments.
Definition: REveGeoShape.cxx:174
ROOT::Experimental::REveGeoShape::SubImportShapeExtract
static REveGeoShape * SubImportShapeExtract(REveGeoShapeExtract *gse, REveElement *parent)
Recursive version for importing a shape extract tree.
Definition: REveGeoShape.cxx:329
ROOT::Experimental::REveGeoShapeProjected::GetProjectedAsElement
REveElement * GetProjectedAsElement() override
Returns this projected dynamic-casted to REveElement.
Definition: REveGeoShape.hxx:101
ROOT::Experimental::REveElement
Definition: REveElement.hxx:41
ROOT::Experimental::REveGeoShape::BuildRenderData
void BuildRenderData() override
Crates 3D point array for rendering.
Definition: REveGeoShape.cxx:145
TGeoCompositeShape
Class handling Boolean composition of shapes.
Definition: TGeoCompositeShape.h:28
ROOT::Experimental::REveProjection
REveProjection Base for specific classes that implement non-linear projections.
Definition: REveProjections.hxx:30
ROOT::Experimental::REveGeoShape::ImportShapeExtract
static REveGeoShape * ImportShapeExtract(REveGeoShapeExtract *gse, REveElement *parent=nullptr)
Import a shape extract 'gse' under element 'parent'.
Definition: REveGeoShape.cxx:316
ROOT::Experimental::REveGeoShape::fShape
TGeoShape * fShape
Definition: REveGeoShape.hxx:42
ROOT::Experimental::REveGeoShape::WriteExtract
void WriteExtract(const char *name)
Write the shape tree as REveGeoShapeExtract to current directory.
Definition: REveGeoShape.cxx:254
ROOT::Experimental::REveGeoShape::GetGeoHMatrixIdentity
static TGeoHMatrix * GetGeoHMatrixIdentity()
Return static identity matrix in homogeneous representation.
Definition: REveGeoShape.cxx:102
TBuffer3D
Generic 3D primitive description class.
Definition: TBuffer3D.h:18
ROOT::Experimental::REveGeoShapeExtract
Definition: REveGeoShapeExtract.hxx:24
TGeoShape
Base abstract class for all shapes.
Definition: TGeoShape.h:26
ROOT::Experimental::REveGeoShape::fNSegments
Int_t fNSegments
Definition: REveGeoShape.hxx:41
ROOT::Experimental::REveGeoShapeProjected::SetDepthLocal
void SetDepthLocal(Float_t d) override
3d buffer
Definition: REveGeoShape.cxx:436
TGeoHMatrix
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition: TGeoMatrix.h:421
ROOT::Experimental::REveShape
Definition: REveShape.hxx:31
ROOT::Experimental::REveProjectable
Definition: REveProjectionBases.hxx:38
ROOT::Experimental::REveGeoShape::fgGeoManager
static TGeoManager * fgGeoManager
Temporary holder (if passed shape is composite shape).
Definition: REveGeoShape.hxx:45
ROOT::Experimental::REveGeoShape::ComputeBBox
void ComputeBBox() override
Compute bounding-box.
Definition: REveGeoShape.cxx:223
ROOT::Experimental::REveGeoShape::GetGeoManager
static TGeoManager * GetGeoManager()
Return static geo-manager that is used internally to make shapes lead a happy life.
Definition: REveGeoShape.cxx:91
ROOT::Experimental::REveGeoShape::ProjectedClass
TClass * ProjectedClass(const REveProjection *p) const override
Return class for projected objects:
Definition: REveGeoShape.cxx:365
ROOT::Experimental::REveGeoShape::MakeBuffer3D
virtual std::unique_ptr< TBuffer3D > MakeBuffer3D()
Create a TBuffer3D suitable for presentation of the shape.
Definition: REveGeoShape.cxx:377
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
file
Definition: file.py:1
ROOT::Experimental::REveGeoShape::DumpShapeTree
REveGeoShapeExtract * DumpShapeTree(REveGeoShape *geon, REveGeoShapeExtract *parent=nullptr)
Export this shape and its descendants into a geoshape-extract.
Definition: REveGeoShape.cxx:264
ROOT::Experimental::REveGeoShape::SetShape
void SetShape(TGeoShape *s)
Set TGeoShape shown by this object.
Definition: REveGeoShape.cxx:193
name
char name[80]
Definition: TGX11.cxx:110
d
#define d(i)
Definition: RSha256.hxx:102
make_cnn_model.model
model
Definition: make_cnn_model.py:6
ROOT::Experimental::REveGeoShape::GetNSegments
Int_t GetNSegments() const
Definition: REveGeoShape.hxx:59
ROOT::Experimental::REveGeoShape::WriteCoreJson
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
Definition: REveGeoShape.cxx:137
ROOT::Experimental::REveGeoShapeProjected::UpdateProjection
void UpdateProjection() override
This is virtual method from base-class REveProjected.
Definition: REveGeoShape.cxx:456
ROOT::Experimental::REveGeoShape::MakePolyShape
TGeoShape * MakePolyShape()
Create derived REveGeoShape form a TGeoCompositeShape.
Definition: REveGeoShape.cxx:127
ROOT::Experimental::REveProjectionManager
REveProjectionManager Manager class for steering of projections and managing projected objects.
Definition: REveProjectionManager.hxx:30
ROOT::Experimental::REveGeoShapeProjected::operator=
REveGeoShapeProjected & operator=(const REveGeoShapeProjected &)=delete
ROOT::Experimental::REveGeoShapeProjected::REveGeoShapeProjected
REveGeoShapeProjected(const REveGeoShapeProjected &)=delete
TGeoManager
The manager class for any TGeo geometry.
Definition: TGeoManager.h:45
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Experimental::REveGeoShape::SaveExtract
void SaveExtract(const char *file, const char *name)
Save the shape tree as REveGeoShapeExtract.
Definition: REveGeoShape.cxx:240
int