14 bar->
AddButton(
"Intersection ",
"s_intersection()",
"A * B ");
15 bar->
AddButton(
"Difference ",
"s_difference()",
"A - B ");
17 bar->
AddButton(
"Complex composite",
"complex_1()",
"(A * B) + (C - D)");
34 gROOT->GetListOfCanvases()->Delete();
35 TCanvas *
c =
new TCanvas(
"composite shape",
"Union boolean operation", 700, 1000);
39 gPad->SetPad(0,0,1,0.4);
41 gPad->SetPad(0,0.4,1,1);
77 pt->
AddText(
"----- It's an example of boolean union operation : A + B");
78 pt->
AddText(
"----- A == part of sphere (5-175, 0-340), B == pgon");
91 gROOT->GetListOfCanvases()->Delete();
92 TCanvas *
c =
new TCanvas(
"composite shape",
"Intersection boolean operation", 700, 1000);
96 gPad->SetPad(0,0,1,0.4);
98 gPad->SetPad(0,0.4,1,1);
135 pt->
AddText(
"----- Here is an example of boolean intersection operation : A * B");
136 pt->
AddText(
"----- A == sphere (with inner radius non-zero), B == box");
149 gROOT->GetListOfCanvases()->Delete();
150 TCanvas *
c =
new TCanvas(
"composite shape",
"Difference boolean operation", 700, 1000);
154 gPad->SetPad(0,0,1,0.4);
156 gPad->SetPad(0,0.4,1,1);
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)");
203 gROOT->GetListOfCanvases()->Delete();
208 gPad->SetPad(0,0,1,0.4);
210 gPad->SetPad(0,0.4,1,1);
255 pt->
AddText(
"----- (sphere * box) + (sphere - box) ");
272 for (
Int_t i=0; i<128; i++) line[i] =
' ';
273 memcpy(&line[0], datamember, strlen(datamember));
276 sprintf(number,
"%5.2f", value);
277 memcpy(&line[12], number, strlen(number));
280 sprintf(&line[30],
"%s",comment);
289 for (
Int_t i=0; i<128; i++) line[i] =
' ';
290 memcpy(&line[0], datamember, strlen(datamember));
293 sprintf(number,
"%5i", value);
294 memcpy(&line[12], number, strlen(number));
297 sprintf(&line[30],
"%s",comment);
307 if (!pave || !pf)
return;
308 for (
Int_t i=0; i<128; i++) line[i] =
' ';
311 sprintf(line,
"Division of %s on axis %d (%s)", volume->
GetName(), iaxis,sh->
GetAxisName(iaxis));
314 text->SetTextAlign(12);
316 AddText(pave,
"fStart",finder->
GetStart(),
"start divisioning position");
326 if (!painter)
return;
340 new TCanvas(
"chelp",
"Help to run demos",200,10,700,600);
343 welcome->AddText(
"Welcome to the new geometry package");
344 welcome->SetTextFont(32);
345 welcome->SetTextColor(4);
346 welcome->SetFillColor(24);
350 hdemo->SetTextAlign(12);
351 hdemo->SetTextFont(52);
352 hdemo->AddText(
"- Demo for building TGeo composite shapes");
354 hdemo->SetAllWith(
"....",
"color",2);
355 hdemo->SetAllWith(
"....",
"font",72);
356 hdemo->SetAllWith(
"....",
"size",0.03);
void Show()
Show control bar.
void AddButton(TControlBarButton *button)
Add button.
Double_t GetStart() const
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
virtual void SetName(const char *name)
Change (i.e.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual void Draw(Option_t *option="")
draw top volume according to option
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
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.
Base class for several text objects.
virtual void SetTextAlign(Short_t align=11)
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
TGeoVolume * GetVolume() const
virtual void SetLineColor(Color_t lcolor)
R__EXTERN TSystem * gSystem
virtual void SetRaytracing(Bool_t flag=kTRUE)=0
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
void pgon(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
virtual const char * GetName() const
Returns name of object.
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
virtual const char * GetAxisName(Int_t iaxis) const =0
void AddText(TPaveText *pave, const char *datamember, Double_t value, const char *comment)
TGeoShape * GetShape() const
A Pave (see TPave) with text, lines or/and boxes inside.
R__EXTERN TGeoManager * gGeoManager
Mother of all ROOT objects.
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
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.
virtual void SetTextColor(Color_t tcolor=1)
virtual void SetTextSize(Float_t tsize=1)
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
virtual void SetAllWith(const char *text, Option_t *option, Double_t value)
Set attribute option for all lines containing string text.