107 Error(
"ctor",
"left shape is NULL");
111 Error(
"ctor",
"right shape is NULL");
215 Error(
"MakeBranch",
"invalid expression");
228 Error(
"MakeBranch",
"transformation %s not found",
stransf.Data());
236 Error(
"MakeBranch",
"shape %s not found",
sleft.Data());
304 left->PaintComposite(
option);
315 right->PaintComposite(
option);
346 Error(
"ReplaceMatrix",
347 "Matrices should not be gGeoIdentity. Use default matrix constructor to represent identities.");
351 Error(
"ReplaceMatrix",
"Matrices should not be null pointers.");
429 Error(
"Paint",
"gPad->GetViewer3D() returned 0, cannot work with composite!\n");
455 Fatal(
"TGeoUnion",
"Unions with a half-space (%s + %s) not allowed", left->
GetName(), right->
GetName());
482 for (i = 0; i < 8; i++) {
497 for (i = 8; i < 16; i++) {
516 dz = 0.5 * (zmax - zmin);
517 origin[2] = 0.5 * (zmin + zmax);
545 if (
td.fSelected == 1) {
552 if (
td.fSelected == 2) {
574 local[0] = point[0] + 1E-5 * dir[0];
575 local[1] = point[1] + 1E-5 * dir[1];
576 local[2] = point[2] + 1E-5 * dir[2];
579 local[0] = point[0] - 1E-5 * dir[0];
580 local[1] = point[1] - 1E-5 * dir[1];
581 local[2] = point[2] - 1E-5 * dir[2];
633 for (i = 0; i < 3; i++)
642 for (i = 0; i < 3; i++)
657 for (i = 0; i < 3; i++)
672 for (i = 0; i < 3; i++)
689 for (i = 0; i < 3; i++) {
708 for (i = 0; i < 3; i++) {
789 out <<
" pBoolNode = new TGeoUnion(";
799 out <<
"0);" << std::endl;
826 Error(
"Paint",
"gPad->GetViewer3D() returned 0, cannot work with composite!\n");
852 Fatal(
"TGeoSubstraction",
"Subtractions from a half-space (%s) not allowed", left->
GetName());
868 if (
box->IsNullBox())
877 for (i = 0; i < 8; i++) {
896 dz = 0.5 * (zmax - zmin);
897 origin[2] = 0.5 * (zmin + zmax);
909 if (
td.fSelected == 1) {
916 if (
td.fSelected == 2) {
938 local[0] = point[0] + 1E-5 * dir[0];
939 local[1] = point[1] + 1E-5 * dir[1];
940 local[2] = point[2] + 1E-5 * dir[2];
942 local[0] = point[0] - 1E-5 * dir[0];
943 local[1] = point[1] - 1E-5 * dir[1];
944 local[2] = point[2] - 1E-5 * dir[2];
1038 for (i = 0; i < 3; i++)
1061 for (i = 0; i < 3; i++)
1100 out <<
" pBoolNode = new TGeoSubtraction(";
1110 out <<
"0);" << std::endl;
1137 Error(
"Paint",
"gPad->GetViewer3D() returned 0, cannot work with composite!\n");
1165 Fatal(
"ctor",
"cannot intersect two half-spaces: %s * %s", left->
GetName(), right->
GetName());
1192 for (i = 0; i < 8; i++) {
1212 for (i = 8; i < 16; i++) {
1298 if (
td.fSelected == 1) {
1305 if (
td.fSelected == 2) {
1327 local[0] = point[0] + 1E-5 * dir[0];
1328 local[1] = point[1] + 1E-5 * dir[1];
1329 local[2] = point[2] + 1E-5 * dir[2];
1331 local[0] = point[0] - 1E-5 * dir[0];
1332 local[1] = point[1] - 1E-5 * dir[1];
1333 local[2] = point[2] - 1E-5 * dir[2];
1458 for (i = 0; i < 3; i++)
1462 for (i = 0; i < 3; i++)
1474 for (i = 0; i < 3; i++)
1478 for (i = 0; i < 3; i++)
1520 out <<
" pBoolNode = new TGeoIntersection(";
1530 out <<
"0);" << std::endl;
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char)
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 GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
Generic 3D primitive description class.
Base class for Boolean operations between two shapes.
virtual void Sizeof3D() const
Register size of this 3D object.
Int_t fNpoints
! number of points on the mesh
Bool_t MakeBranch(const char *expr, Bool_t left)
Expands the boolean expression either on left or right branch, creating component elements (composite...
~TGeoBoolNode() override
Destructor.
TGeoShape::EInside Inside(const Double_t *point) const
Implementation of the inside function using just Contains and GetNormal.
Bool_t ReplaceMatrix(TGeoMatrix *mat, TGeoMatrix *newmat)
Replace one of the matrices.
void AssignPoints(Int_t npoints, Double_t *points)
Set fPoints array.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void Paint(Option_t *option) override
Special schema for feeding the 3D buffers to the painter client.
ThreadData_t & GetThreadData() const
Per-thread scratch state, owned by the calling thread and indexed by this node.
virtual void SetPoints(Double_t *points) const
Fill buffer with shape vertices.
void RegisterMatrices()
Register all matrices of the boolean node and descendents.
Bool_t fMeshValid
! Flag for mesh cache validity
Double_t * fPoints
! array of mesh points
void InvalidateMeshCaches()
Invalidate mesh caching recursively.
TGeoBoolNode()
Default constructor.
Int_t GetNpoints()
Returns number of vertices for the composite shape described by this node.
static std::atomic< UInt_t > fgInstanceCount
void SetSelected(Int_t sel)
Set the selected branch.
Composite shapes are Boolean combinations of two or more shape components.
Matrix class used for computing global transformations Should NOT be used for node definition.
Int_t DistanceToPrimitive(Int_t px, Int_t py) override
Compute minimum distance to shape vertices.
TGeoBoolNode * MakeClone() const override
Make a clone of this. Pointers are preserved.
TGeoIntersection()
Default constructor.
void Sizeof3D() const override
Register 3D size of this shape.
void ComputeBBox(Double_t &dx, Double_t &dy, Double_t &dz, Double_t *origin) override
Compute bounding box corresponding to a intersection of two shapes.
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=0, Double_t *safe=nullptr) const override
Compute distance from a given point outside to the shape.
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
Compute safety distance for a union node;.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Normal computation in POINT. The orientation is chosen so that DIR.dot.NORM>0.
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=0, Double_t *safe=nullptr) const override
Compute distance from a given point inside to the shape boundary.
void Paint(Option_t *option) override
Paint method.
~TGeoIntersection() override
Destructor — deletion of components handled by TGeoManager class.
Bool_t Contains(const Double_t *point) const override
Find if a intersection of two shapes contains a given point.
TObjArray * GetListOfMatrices() const
static Int_t Parse(const char *expr, TString &expr1, TString &expr2, TString &expr3)
Parse a string boolean expression and do a syntax check.
TObjArray * GetListOfShapes() const
Geometrical transformation package.
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Bool_t IsIdentity() const
const char * GetPointerName() const
Provide a pointer name containing uid.
Base abstract class for all shapes.
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Stub implementation to avoid forcing implementation at this stage.
virtual 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 =0
virtual Int_t GetNmeshVertices() const
virtual void Sizeof3D() const =0
virtual Bool_t IsComposite() const
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const =0
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const =0
const char * GetPointerName() const
Provide a pointer name containing uid.
virtual 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 =0
const char * GetName() const override
Get the shape name.
virtual void ComputeBBox()=0
static TGeoMatrix * GetTransform()
Returns current transformation matrix that applies to shape.
virtual Bool_t Contains(const Double_t *point) const =0
static Double_t Tolerance()
virtual void SetPoints(Double_t *points) const =0
Bool_t TestShapeBit(UInt_t f) const
TGeoSubtraction()
Default constructor.
void ComputeBBox(Double_t &dx, Double_t &dy, Double_t &dz, Double_t *origin) override
Compute bounding box corresponding to a subtraction of two shapes.
~TGeoSubtraction() override
Destructor — deletion of components handled by TGeoManager class.
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
Compute safety distance for a union node;.
TGeoBoolNode * MakeClone() const override
Make a clone of this. Pointers are preserved.
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=0, Double_t *safe=nullptr) const override
Compute distance from a given point outside to the shape.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
Bool_t Contains(const Double_t *point) const override
Find if a subtraction of two shapes contains a given point.
void Sizeof3D() const override
Register 3D size of this shape.
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=0, Double_t *safe=nullptr) const override
Compute distance from a given point inside to the shape boundary.
void Paint(Option_t *option) override
Paint method.
Int_t DistanceToPrimitive(Int_t px, Int_t py) override
Compute minimum distance to shape vertices.
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Normal computation in POINT. The orientation is chosen so that DIR.dot.NORM>0.
Int_t DistanceToPrimitive(Int_t px, Int_t py) override
Compute minimum distance to shape vertices.
TGeoBoolNode * MakeClone() const override
Make a clone of this. Pointers are preserved.
void ComputeBBox(Double_t &dx, Double_t &dy, Double_t &dz, Double_t *origin) override
Compute bounding box corresponding to a union of two shapes.
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Normal computation in POINT. The orientation is chosen so that DIR.dot.NORM>0.
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=0, Double_t *safe=nullptr) const override
Compute distance from a given outside point to the shape.
Bool_t Contains(const Double_t *point) const override
Find if a union of two shapes contains a given point.
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
Compute safety distance for a union node;.
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=0, Double_t *safe=nullptr) const override
Computes distance from a given point inside the shape to its boundary.
~TGeoUnion() override
Destructor — deletion of components handled by TGeoManager class.
TGeoUnion()
Default constructor.
void Paint(Option_t *option) override
Paint method.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void Sizeof3D() const override
Register 3D size of this shape.
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Abstract 3D shapes viewer.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Sort the n elements of the array a of generic templated type Element.
TGeoShape::EInside Inside(const Double_t *point, Solid const *solid)
Generic implementation of the inside function using just Contains and GetNormal.