17 bar->
AddButton(
"How to run ",
"help()",
"Instructions ");
18 bar->
AddButton(
"Union ",
"s_union()",
"A + B ");
19 bar->
AddButton(
"Intersection ",
"s_intersection()",
"A * B ");
20 bar->
AddButton(
"Difference ",
"s_difference()",
"A - B ");
22 bar->
AddButton(
"Complex composite",
"complex_1()",
"(A * B) + (C - D)");
39 gROOT->GetListOfCanvases()->Delete();
40 TCanvas *
c =
new TCanvas(
"composite shape",
"Union boolean operation", 700, 1000);
44 gPad->SetPad(0,0,1,0.4);
46 gPad->SetPad(0,0.4,1,1);
82 pt->
AddText(
"----- It's an example of boolean union operation : A + B");
83 pt->
AddText(
"----- A == part of sphere (5-175, 0-340), B == pgon");
96 gROOT->GetListOfCanvases()->Delete();
97 TCanvas *
c =
new TCanvas(
"composite shape",
"Intersection boolean operation", 700, 1000);
101 gPad->SetPad(0,0,1,0.4);
103 gPad->SetPad(0,0.4,1,1);
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");
154 gROOT->GetListOfCanvases()->Delete();
155 TCanvas *
c =
new TCanvas(
"composite shape",
"Difference boolean operation", 700, 1000);
159 gPad->SetPad(0,0,1,0.4);
161 gPad->SetPad(0,0.4,1,1);
194 pt->
AddText(
"----- It's an example of boolean difference: A - B");
195 pt->
AddText(
"----- A == part of sphere (0-180, 0-270), B == partial torus (45-145)");
208 gROOT->GetListOfCanvases()->Delete();
213 gPad->SetPad(0,0,1,0.4);
215 gPad->SetPad(0,0.4,1,1);
260 pt->
AddText(
"----- (sphere * box) + (sphere - box) ");
274void AddText(
TPaveText *pave,
const char *datamember,
Double_t value,
const char *comment)
277 for (
Int_t i=0; i<128; i++)
line[i] =
' ';
278 memcpy(&
line[0], datamember, strlen(datamember));
281 sprintf(number,
"%5.2f", value);
282 memcpy(&
line[12], number, strlen(number));
285 sprintf(&
line[30],
"%s",comment);
291void AddText(
TPaveText *pave,
const char *datamember,
Int_t value,
const char *comment)
294 for (
Int_t i=0; i<128; i++)
line[i] =
' ';
295 memcpy(&
line[0], datamember, strlen(datamember));
298 sprintf(number,
"%5i", value);
299 memcpy(&
line[12], number, strlen(number));
302 sprintf(&
line[30],
"%s",comment);
312 if (!pave || !pf)
return;
313 for (
Int_t i=0; i<128; i++)
line[i] =
' ';
320 AddText(pave,
"fNdiv",finder->
GetNdiv(),
"number of divisions");
321 AddText(pave,
"fStart",finder->
GetStart(),
"start divisioning position");
322 AddText(pave,
"fStep",finder->
GetStep(),
"division step");
331 if (!painter)
return;
345 new TCanvas(
"chelp",
"Help to run demos",200,10,700,600);
348 welcome->
AddText(
"Welcome to the new geometry package");
357 hdemo->
AddText(
"- Demo for building TGeo composite shapes");
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TSystem * gSystem
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineColor(Color_t lcolor)
Set the line 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.
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.
Composite shapes are Boolean combinations of two or more shape components.
The manager class for any TGeo geometry.
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
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.
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 ...
Base finder class for patterns.
TGeoVolume * GetVolume() const
Double_t GetStart() const
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...
Base abstract class for all shapes.
virtual const char * GetAxisName(Int_t iaxis) const =0
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=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
TGeoShape * GetShape() const
virtual void Draw(Option_t *option="")
draw top volume according to option
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
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 Draw(Option_t *option="")
Draw this pavetext with its current attributes.
virtual void SetAllWith(const char *text, Option_t *option, Double_t value)
Set attribute option for all lines containing string text.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Base class for several text objects.
Abstract class for geometry painters.
virtual void SetRaytracing(Bool_t flag=kTRUE)=0
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)