202 fNode->ClearThreadData();
211 fNode->CreateThreadData(nthreads);
233 Error(
"ctor",
"Composite %s: cannot parse expression: %s",
name, expression);
264 Error(
"ctor",
"Composite shape %s has null node",
name);
290 while (iin < 10000) {
298 Double_t capacity = iin * vbox / igen;
317 fNode->ComputeNormal(point, dir, norm);
326 return fNode->Contains(point);
350 return fNode->DistFromOutside(point, dir, iact, step, safe);
361 return fNode->DistFromInside(point, dir, iact, step, safe);
371 Error(
"Divide",
"Composite shapes cannot be divided");
391 fNode->InvalidateMeshCaches();
400 printf(
" Bounding box:\n");
420 Error(
"MakeNode",
"parser error");
424 Warning(
"MakeNode",
"no geometrical transformation allowed at this level");
426 case 0:
Error(
"MakeNode",
"Expression has no boolean operation");
return;
444 if (!painter || !viewer)
460 paintComponents = viewer->
OpenComposite(buffer, &addChildren);
470 fNode->Paint(option);
486 if (
gGeoManager->GetListOfShapes()->FindObject(
this))
493 matrix =
fNode->GetLeftMatrix();
496 else if (!
gGeoManager->GetListOfMatrices()->FindObject(matrix)) {
499 matrix =
fNode->GetRightMatrix();
502 else if (!
gGeoManager->GetListOfMatrices()->FindObject(matrix)) {
505 shape =
fNode->GetLeftShape();
506 if (!
gGeoManager->GetListOfShapes()->FindObject(shape)) {
514 shape =
fNode->GetRightShape();
515 if (!
gGeoManager->GetListOfShapes()->FindObject(shape)) {
533 return fNode->Safety(point, in);
545 fNode->SavePrimitive(out, option);
547 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoCompositeShape(\"" <<
GetName() <<
"\", pBoolNode);"
588 return fNode->GetNpoints();
598 for (
Int_t i = 0; i < vecsize; i++)
609 for (
Int_t i = 0; i < vecsize; i++)
619 for (
Int_t i = 0; i < vecsize; i++)
629 for (
Int_t i = 0; i < vecsize; i++)
640 for (
Int_t i = 0; i < vecsize; i++)
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
externTGeoManager * gGeoManager
Generic 3D primitive description class.
static UInt_t DecCSLevel()
Decrement CS level.
static UInt_t GetCSLevel()
Return CS level.
static void IncCSLevel()
Increment CS level.
void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override
Fill the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections,...
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
TGeoBBox(const TGeoBBox &)=delete
void InspectShape() const override
Base class for Boolean operations between two shapes.
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Divide all range of iaxis in range/step cells.
void ComputeBBox() override
compute bounding box of the sphere
void Sizeof3D() const override
compute size of this 3D object
TGeoCompositeShape()
Default constructor.
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
computes the closest distance from given point to this shape, according to option.
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
Compute distance from outside point to this composite shape.
Int_t GetNmeshVertices() const override
Return number of vertices of the mesh representation.
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Check the inside status for each of the points in the array.
void ClearThreadData() const override
Needed just for cleanup.
Double_t Capacity() const override
Computes capacity of this shape [length^3] by sampling with 1% error.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
virtual Bool_t PaintComposite(Option_t *option="") const
Paint this composite shape into the current 3D viewer Returns bool flag indicating if the caller shou...
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
Compute distance from inside point to outside of this composite shape.
void InspectShape() const override
print shape parameters
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Computes normal vector in POINT to the composite shape.
~TGeoCompositeShape() override
destructor
void CreateThreadData(Int_t nthreads) override
Needed just for cleanup.
Bool_t Contains(const Double_t *point) const override
Tests if point is inside the shape.
TGeoCompositeShape(const TGeoCompositeShape &)=delete
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
Compute safe distance from each of the points in the input array.
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
void RegisterYourself()
Register the shape and all components to TGeoManager class.
void SetPoints(Double_t *points) const override
create points for a composite shape
void InvalidateMeshCaches()
Invalidate mesh caching done by TGeoBoolNode.
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
void MakeNode(const char *expression)
Make a boolean node according to the top level boolean operation of expression.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute closest distance from point px,py to each corner.
Matrix class used for computing global transformations Should NOT be used for node definition.
void Clear(Option_t *option="") override
clear the data for this matrix
Boolean node representing an intersection between two components.
static Int_t Parse(const char *expr, TString &expr1, TString &expr2, TString &expr3)
Parse a string boolean expression and do a syntax check.
Geometrical transformation package.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Bool_t IsRegistered() const
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
TGeoShape()
Default constructor.
virtual Bool_t IsComposite() const
const char * GetPointerName() const
Provide a pointer name containing uid.
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
const char * GetName() const override
Get the shape name.
static TGeoMatrix * GetTransform()
Returns current transformation matrix that applies to shape.
Boolean node representing a subtraction.
Boolean node representing a union between two components.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Random number generator class based on M.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Abstract class for geometry painters.
Abstract 3D shapes viewer.
virtual Bool_t PreferLocalFrame() const =0
virtual void CloseComposite()=0
virtual Bool_t OpenComposite(const TBuffer3D &buffer, Bool_t *addChildren=nullptr)=0