Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
17class TGeoManager;
18class TGeoShape;
19class TGeoHMatrix;
21class TBuffer3D;
22
23namespace ROOT {
24namespace Experimental {
25
27
28// ==========================================================================================
29// REveGeoShape
30// Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted
31// TGeoShape's (without an active TGeoManager) and simplified geometries (needed for NLT projections).
32// ==========================================================================================
33
34class REveGeoShape : public REveShape,
35 public REveProjectable
36{
37private:
38 REveGeoShape(const REveGeoShape &) = delete;
40
41protected:
43 TGeoShape *fShape{nullptr};
44 TGeoCompositeShape *fCompositeShape{nullptr}; //! Temporary holder (if passed shape is composite shape).
45
47
50
52
53public:
54 REveGeoShape(const std::string &name = "REveGeoShape", const std::string &title = "");
55 ~REveGeoShape() override;
56
57 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
58 void BuildRenderData() override;
59
60 Int_t GetNSegments() const { return fNSegments; }
61 TGeoShape *GetShape() const { return fShape; }
62 void SetNSegments(Int_t s);
63 void SetShape(TGeoShape *s);
64
65 void ComputeBBox() override;
66
67 void SaveExtract(const char *file, const char *name);
68 void WriteExtract(const char *name);
69
70 static REveGeoShape *ImportShapeExtract(REveGeoShapeExtract *gse, REveElement *parent = nullptr);
71
72 // GeoProjectable
73 virtual std::unique_ptr<TBuffer3D> MakeBuffer3D();
74 TClass *ProjectedClass(const REveProjection *p) const override;
75
76 static TGeoManager *GetGeoManager();
78};
79
80//------------------------------------------------------------------------------
81
82// ==========================================================================================
83// REveGeoShapeProjected
84// ==========================================================================================
85
87private:
90
91protected:
92 std::unique_ptr<TBuffer3D> fBuff; //! 3d buffer
93
94 void SetDepthLocal(Float_t d) override;
95
96public:
98 ~REveGeoShapeProjected() override;
99
100 void SetProjection(REveProjectionManager *proj, REveProjectable *model) override;
101 void UpdateProjection() override;
102 REveElement *GetProjectedAsElement() override { return this; }
103
104 void ComputeBBox() override;
105};
106
107} // namespace Experimental
108} // namespace ROOT
109
110#endif
#define d(i)
Definition RSha256.hxx:102
float Float_t
Definition RtypesCore.h:57
winID h TVirtualViewer3D TVirtualGLPainter p
char name[80]
Definition TGX11.cxx:110
Globally positioned TGeoShape with rendering attributes and an optional list of daughter shape-extrac...
void ComputeBBox() override
Override of virtual method from TAttBBox.
std::unique_ptr< TBuffer3D > fBuff
void SetProjection(REveProjectionManager *proj, REveProjectable *model) override
This is virtual method from base-class REveProjected.
REveGeoShapeProjected(const REveGeoShapeProjected &)=delete
void UpdateProjection() override
This is virtual method from base-class REveProjected.
REveElement * GetProjectedAsElement() override
Returns this projected dynamic-casted to REveElement.
void SetDepthLocal(Float_t d) override
3d buffer
REveGeoShapeProjected & operator=(const REveGeoShapeProjected &)=delete
static REveGeoShape * ImportShapeExtract(REveGeoShapeExtract *gse, REveElement *parent=nullptr)
Import a shape extract 'gse' under element 'parent'.
TGeoShape * MakePolyShape()
Create derived REveGeoShape form a TGeoCompositeShape.
~REveGeoShape() override
Destructor.
static TGeoManager * fgGeoManager
Temporary holder (if passed shape is composite shape).
void SetNSegments(Int_t s)
Set number of segments.
void SaveExtract(const char *file, const char *name)
Save the shape tree as REveGeoShapeExtract.
TClass * ProjectedClass(const REveProjection *p) const override
Return class for projected objects:
static REveGeoShape * SubImportShapeExtract(REveGeoShapeExtract *gse, REveElement *parent)
Recursive version for importing a shape extract tree.
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
void ComputeBBox() override
Compute bounding-box.
REveGeoShape & operator=(const REveGeoShape &)=delete
void WriteExtract(const char *name)
Write the shape tree as REveGeoShapeExtract to current directory.
void SetShape(TGeoShape *s)
Set TGeoShape shown by this object.
virtual std::unique_ptr< TBuffer3D > MakeBuffer3D()
Create a TBuffer3D suitable for presentation of the shape.
void BuildRenderData() override
Crates 3D point array for rendering.
static TGeoHMatrix * GetGeoHMatrixIdentity()
Return static identity matrix in homogeneous representation.
static TGeoManager * GetGeoManager()
Return static geo-manager that is used internally to make shapes lead a happy life.
REveGeoShape(const REveGeoShape &)=delete
TGeoCompositeShape * fCompositeShape
REveGeoShapeExtract * DumpShapeTree(REveGeoShape *geon, REveGeoShapeExtract *parent=nullptr)
Export this shape and its descendants into a geoshape-extract.
REveProjectionManager Manager class for steering of projections and managing projected objects.
REveProjection Base for specific classes that implement non-linear projections.
Generic 3D primitive description class.
Definition TBuffer3D.h:18
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
Composite shapes are Boolean combinations of two or more shape components.
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition TGeoMatrix.h:458
The manager class for any TGeo geometry.
Definition TGeoManager.h:44
Base abstract class for all shapes.
Definition TGeoShape.h:25
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...