22 c =
new TCanvas(
"csg_canvas", title, 700, 1000);
26 c->Divide(1, 2, 0, 0);
28 gPad->SetPad(0, 0, 1, 0.4);
30 gPad->SetPad(0, 0.4, 1, 1);
63 pgon->DefineSection(0, 0, 0, 20);
64 pgon->DefineSection(1, 30, 0, 20);
71 tr->RegisterYourself();
86 text->SetTextColor(2);
87 pt->
AddText(
"----- It's an example of boolean union operation : A + B");
88 pt->
AddText(
"----- A == part of sphere (5-175, 0-340), B == pgon");
120 tr->RegisterYourself();
139 text->SetTextColor(2);
140 pt->
AddText(
"----- Here is an example of boolean intersection operation : A * B");
141 pt->
AddText(
"----- A == sphere (with inner radius non-zero), B == box");
187 text->SetTextColor(2);
189 pt->
AddText(
"----- It's an example of boolean difference: A - B");
190 pt->
AddText(
"----- A == part of sphere (0-180, 0-270), B == partial torus (45-145)");
230 tr->RegisterYourself();
231 tr1->RegisterYourself();
232 tr2->RegisterYourself();
233 tr3->RegisterYourself();
249 text->SetTextColor(2);
250 pt->
AddText(
"----- (sphere * box) + (sphere - box) ");
267 bool drawn =
gPad->GetListOfPrimitives()->FindObject(top);
283 welcome->AddText(
"Welcome to the new geometry package");
290 hdemo->SetTextAlign(12);
291 hdemo->SetTextFont(52);
292 hdemo->AddText(
"- Demo for building TGeo composite shapes");
294 hdemo->AddText(
" .... s_union() : Union boolean operation");
295 hdemo->AddText(
" .... s_difference() : Difference boolean operation");
296 hdemo->AddText(
" .... s_intersection() : Intersection boolean operation");
297 hdemo->AddText(
" .... s_complex() : Combination of (A * B) + (C - D)");
299 hdemo->SetAllWith(
"....",
"color", 2);
300 hdemo->SetAllWith(
"....",
"font", 72);
301 hdemo->SetAllWith(
"....",
"size", 0.03);
311 bar->
AddButton(
"How to run ",
"help()",
"Instructions ");
312 bar->
AddButton(
"Union ",
"s_union()",
"A + B ");
313 bar->
AddButton(
"Intersection ",
"s_intersection()",
"A * B ");
314 bar->
AddButton(
"Difference ",
"s_difference()",
"A - B ");
315 bar->
AddButton(
"Complex composite",
"s_complex()",
"(A * B) + (C - D)");
316 bar->
AddButton(
"RAY-TRACE ON/OFF",
"raytrace()",
"Toggle ray-tracing mode");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char text
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TSystem * gSystem
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
void Show()
Show control bar.
void AddButton(TControlBarButton *button)
Add button.
void SetVisRaytrace(Bool_t flag=kTRUE)
Composite shapes are Boolean combinations of two or more shape components.
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.
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
TGeoVolume * GetTopVolume() const
Base class describing materials.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Polygons are defined in the same way as polycones, the difference being just that the segments betwee...
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
The torus is defined by its axial radius, its inner and outer radius.
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
void Draw(Option_t *option="") override
draw top volume according to option
Bool_t IsRaytracing() const
Check if the painter is currently ray-tracing the content of this volume.
virtual void Clear(Option_t *="")
TObject * FindObject(const char *name) const override
Search if object named name is inside this pad or in pads inside this pad.
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
virtual void SetAllWith(const char *text, Option_t *option, Double_t value)
Set attribute option for all lines containing string text.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Base class for several text objects.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)