22#include <ROOT/REveManager.hxx>
23#include <ROOT/REveGeoShapeExtract.hxx>
24#include <ROOT/REveGeoShape.hxx>
25#include <ROOT/REveGeoPolyShape.hxx>
29REX::REveGeoPolyShape *eve_pshape =
nullptr;
30REX::REveGeoShape *eve_shape =
nullptr;
77 REX::REveManager::Create();
79 REX::REveGeoPolyShape::SetAutoEnforceTriangles(
true);
82 auto geo_cshape =
dynamic_cast<TGeoCompositeShape*
>(node->GetDaughter(0)->GetVolume()->GetShape());
84 if (!geo_cshape)
throw std::runtime_error(
"The first vshape is not a CSG shape.");
86 bool poly_first =
false;
89 eve_pshape =
new REX::REveGeoPolyShape;
90 eve_pshape->BuildFromComposite(geo_cshape, 40);
92 eve_shape =
new REX::REveGeoShape(
"CSG_Result");
93 eve_shape->SetShape(eve_pshape);
97 eve_shape =
new REX::REveGeoShape(
"CSG_Result");
98 eve_shape->SetNSegments(40);
99 eve_shape->SetShape(geo_cshape);
101 eve_pshape =
dynamic_cast<REX::REveGeoPolyShape*
>(eve_shape->GetShape());
108 eve_pshape->Draw(
"ogl");
110 eve_shape->SaveExtract(
"csg.root",
"CSG Demo");
R__EXTERN TGeoManager * gGeoManager
Class handling Boolean composition of shapes.
The manager class for any TGeo geometry.
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
TGeoNode * GetTopNode() const
Base class describing materials.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
virtual void SetName(const char *name)
Set the name of the TNamed.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)