14TCanvas *create_canvas(
const char *title,
bool divide =
true)
16 auto c = (
TCanvas *)
gROOT->GetListOfCanvases()->FindObject(
"csg_canvas");
22 c =
new TCanvas(
"csg_canvas", title, 700,1000);
28 gPad->SetPad(0,0,1,0.4);
30 gPad->SetPad(0,0.4,1,1);
40 if (is_raytracing != raytracing) {
41 gGeoManager->GetTopVolume()->SetVisRaytrace(raytracing);
50 auto c = create_canvas(
"Union boolean operation");
84 TText *
text =
pt->AddText(
"TGeoCompositeShape - composite shape class");
85 text->SetTextColor(2);
86 pt->AddText(
"----- It's an example of boolean union operation : A + B");
87 pt->AddText(
"----- A == part of sphere (5-175, 0-340), B == pgon");
89 pt->SetAllWith(
"-----",
"color",4);
90 pt->SetAllWith(
"-----",
"font",72);
91 pt->SetAllWith(
"-----",
"size",0.04);
93 pt->SetTextSize(.044);
101 auto c = create_canvas(
"Intersection boolean operation");
135 TText *
text =
pt->AddText(
"TGeoCompositeShape - composite shape class");
137 text->SetTextColor(2);
138 pt->AddText(
"----- Here is an example of boolean intersection operation : A * B");
139 pt->AddText(
"----- A == sphere (with inner radius non-zero), B == box");
141 pt->SetAllWith(
"-----",
"color",4);
142 pt->SetAllWith(
"-----",
"font",72);
143 pt->SetAllWith(
"-----",
"size",0.04);
144 pt->SetTextAlign(12);
145 pt->SetTextSize(0.044);
153 auto c = create_canvas(
"Difference boolean operation");
182 TText *
text =
pt->AddText(
"TGeoCompositeShape - composite shape class");
184 text->SetTextColor(2);
186 pt->AddText(
"----- It's an example of boolean difference: A - B");
187 pt->AddText(
"----- A == part of sphere (0-180, 0-270), B == partial torus (45-145)");
189 pt->SetAllWith(
"-----",
"color",4);
190 pt->SetAllWith(
"-----",
"font",72);
191 pt->SetAllWith(
"-----",
"size",0.04);
192 pt->SetTextAlign(12);
193 pt->SetTextSize(0.044);
201 auto c = create_canvas(
"A * B - C");
244 TText *
text =
pt->AddText(
"TGeoCompositeShape - composite shape class");
245 text->SetTextColor(2);
246 pt->AddText(
"----- (sphere * box) + (sphere - box) ");
249 pt->SetAllWith(
"-----",
"color",4);
250 pt->SetAllWith(
"-----",
"font",72);
251 pt->SetAllWith(
"-----",
"size",0.04);
252 pt->SetTextAlign(12);
253 pt->SetTextSize(0.044);
264 bool drawn =
gPad->GetListOfPrimitives()->FindObject(top);
267 printf(
"raytrace %d\n", raytracing);
276 auto c = create_canvas(
"Help to run demos",
false);
279 welcome->
AddText(
"Welcome to the new geometry package");
288 hdemo->
AddText(
"- Demo for building TGeo composite shapes");
290 hdemo->
AddText(
" .... s_union() : Union boolean operation");
291 hdemo->
AddText(
" .... s_difference() : Difference boolean operation");
292 hdemo->
AddText(
" .... s_intersection() : Intersection boolean operation");
293 hdemo->
AddText(
" .... s_complex() : Combination of (A * B) + (C - D)");
307 bar->
AddButton(
"How to run ",
"help()",
"Instructions ");
308 bar->
AddButton(
"Union ",
"s_union()",
"A + B ");
309 bar->
AddButton(
"Intersection ",
"s_intersection()",
"A * B ");
310 bar->
AddButton(
"Difference ",
"s_difference()",
"A - B ");
311 bar->
AddButton(
"Complex composite",
"s_complex()",
"(A * B) + (C - D)");
312 bar->
AddButton(
"RAY-TRACE ON/OFF",
"raytrace()",
"Toggle ray-tracing mode");
Option_t Option_t TPoint TPoint const char text
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TSystem * gSystem
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
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.
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 ...
virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax)
Defines z position of a section plane, rmin and rmax at this z.
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
virtual void SetName(const char *name)
Set the name of the TNamed.
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.
Base class for several text objects.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)