85 std::lock_guard<std::mutex> guard(
fMutex);
86 std::vector<ThreadData_t *>::iterator i =
fThreadData.begin();
100 std::lock_guard<std::mutex> guard(
fMutex);
103 for (
Int_t tid = 0; tid < nthreads; tid++) {
110 fLeft->CreateThreadData(nthreads);
112 fRight->CreateThreadData(nthreads);
181 Error(
"ctor",
"left shape is NULL");
185 Error(
"ctor",
"right shape is NULL");
230 if (nleft + nright == 0)
236 fLeft->SetPoints(points1);
240 fRight->SetPoints(points2);
242 for (
Int_t i = 0; i < nleft; i++) {
247 for (
Int_t i = 0; i < nright; i++) {
267 if (
fLeft->IsComposite())
269 if (
fRight->IsComposite())
287 TString sleft, sright, stransf;
290 Error(
"MakeBranch",
"invalid expression");
297 if (stransf.
Length() == 0) {
303 Error(
"MakeBranch",
"transformation %s not found", stransf.
Data());
311 Error(
"MakeBranch",
"shape %s not found", sleft.
Data());
337 if (boolop && (!shape || !shape->
IsValid())) {
338 Error(
"MakeBranch",
"Shape %s not valid", newshape.
Data());
379 left->PaintComposite(option);
390 right->PaintComposite(option);
408 if (
fLeft->IsComposite())
410 if (
fRight->IsComposite())
421 Error(
"ReplaceMatrix",
422 "Matrices should not be gGeoIdentity. Use default matrix constructor to represent identities.");
425 if (!mat || !newmat) {
426 Error(
"ReplaceMatrix",
"Matrices should not be null pointers.");
446 fLeft->SavePrimitive(out, option);
447 fRight->SavePrimitive(out, option);
450 fLeftMat->SavePrimitive(out, option);
475 for (
Int_t i = 0; i < 3 * npoints; i++)
504 Error(
"Paint",
"gPad->GetViewer3D() returned 0, cannot work with composite!\n");
530 Fatal(
"TGeoUnion",
"Unions with a half-space (%s + %s) not allowed", left->GetName(), right->GetName());
546 fLeft->ComputeBBox();
557 for (i = 0; i < 8; i++) {
558 fLeftMat->LocalToMaster(&vert[3 * i], &
pt[0]);
572 for (i = 8; i < 16; i++) {
591 dz = 0.5 * (zmax - zmin);
592 origin[2] = 0.5 * (zmin + zmax);
601 fLeftMat->MasterToLocal(point, &local[0]);
605 fRightMat->MasterToLocal(point, &local[0]);
606 inside =
fRight->Contains(&local[0]);
616 norm[0] = norm[1] = 0.;
621 fLeftMat->MasterToLocal(point, local);
622 fLeftMat->MasterToLocalVect(dir, ldir);
623 fLeft->ComputeNormal(local, ldir, lnorm);
624 fLeftMat->LocalToMasterVect(lnorm, norm);
630 fRight->ComputeNormal(local, ldir, lnorm);
631 fRightMat->LocalToMasterVect(lnorm, norm);
634 fLeftMat->MasterToLocal(point, local);
635 if (
fLeft->Contains(local)) {
636 fLeftMat->MasterToLocalVect(dir, ldir);
637 fLeft->ComputeNormal(local, ldir, lnorm);
638 fLeftMat->LocalToMasterVect(lnorm, norm);
642 if (
fRight->Contains(local)) {
644 fRight->ComputeNormal(local, ldir, lnorm);
645 fRightMat->LocalToMasterVect(lnorm, norm);
649 local[0] = point[0] + 1E-5 * dir[0];
650 local[1] = point[1] + 1E-5 * dir[1];
651 local[2] = point[2] + 1E-5 * dir[2];
654 local[0] = point[0] - 1E-5 * dir[0];
655 local[1] = point[1] - 1E-5 * dir[1];
656 local[2] = point[2] - 1E-5 * dir[2];
677 if (iact < 3 && safe) {
682 if (iact == 1 && step < *safe)
686 Double_t local[3], local1[3], master[3], ldir[3], rdir[3], pushed[3];
687 memcpy(master, point, 3 *
sizeof(
Double_t));
690 Double_t d1 = 0., d2 = 0., snxt = 0., eps = 0.;
691 fLeftMat->MasterToLocalVect(dir, ldir);
693 fLeftMat->MasterToLocal(point, local);
696 d1 =
fLeft->DistFromInside(local, ldir, 3);
698 memcpy(local1, local, 3 *
sizeof(
Double_t));
702 d2 =
fRight->DistFromInside(local, rdir, 3);
703 if (!(inside1 | inside2)) {
705 d1 =
fLeft->DistFromOutside(local1, ldir, 3);
708 for (i = 0; i < 3; i++)
709 local1[i] += eps * ldir[i];
711 d1 =
fLeft->DistFromInside(local1, ldir, 3);
714 d2 =
fRight->DistFromOutside(local, rdir, 3);
717 for (i = 0; i < 3; i++)
718 local[i] += eps * rdir[i];
720 d2 =
fRight->DistFromInside(local, rdir, 3);
725 while (inside1 || inside2) {
726 if (inside1 && inside2) {
732 for (i = 0; i < 3; i++)
733 master[i] += d1 * dir[i];
736 inside2 =
fRight->Contains(local);
739 d2 =
fRight->DistFromInside(local, rdir, 3);
747 for (i = 0; i < 3; i++)
748 master[i] += d2 * dir[i];
750 fLeftMat->MasterToLocal(master, local);
751 inside1 =
fLeft->Contains(local);
754 d1 =
fLeft->DistFromInside(local, ldir, 3);
764 for (i = 0; i < 3; i++) {
765 master[i] += d1 * dir[i];
770 inside2 =
fRight->Contains(local);
773 d2 =
fRight->DistFromInside(local, rdir, 3);
783 for (i = 0; i < 3; i++) {
784 master[i] += d2 * dir[i];
788 fLeftMat->MasterToLocal(pushed, local);
789 inside1 =
fLeft->Contains(local);
792 d1 =
fLeft->DistFromInside(local, ldir, 3);
807 if (iact < 3 && safe) {
812 if (iact == 1 && step < *safe)
816 Double_t local[3], ldir[3], rdir[3];
818 fLeftMat->MasterToLocal(point, &local[0]);
819 fLeftMat->MasterToLocalVect(dir, &ldir[0]);
820 fRightMat->MasterToLocalVect(dir, &rdir[0]);
821 d1 =
fLeft->DistFromOutside(&local[0], &ldir[0], iact, step, safe);
822 fRightMat->MasterToLocal(point, &local[0]);
823 d2 =
fRight->DistFromOutside(&local[0], &rdir[0], iact, step, safe);
840 fLeftMat->MasterToLocal(point, local1);
844 Bool_t intrue = in1 | in2;
864 out <<
" pBoolNode = new TGeoUnion(";
865 out <<
fLeft->GetPointerName() <<
",";
866 out <<
fRight->GetPointerName() <<
",";
868 out <<
fLeftMat->GetPointerName() <<
",";
872 out <<
fRightMat->GetPointerName() <<
");" << std::endl;
874 out <<
"0);" << std::endl;
901 Error(
"Paint",
"gPad->GetViewer3D() returned 0, cannot work with composite!\n");
927 Fatal(
"TGeoSubstraction",
"Subtractions from a half-space (%s) not allowed", left->GetName());
943 if (
box->IsNullBox())
944 fLeft->ComputeBBox();
951 box->SetBoxPoints(&vert[0]);
952 for (i = 0; i < 8; i++) {
953 fLeftMat->LocalToMaster(&vert[3 * i], &
pt[0]);
971 dz = 0.5 * (zmax - zmin);
972 origin[2] = 0.5 * (zmin + zmax);
981 norm[0] = norm[1] = 0.;
983 Double_t local[3], ldir[3], lnorm[3];
985 fLeftMat->MasterToLocal(point, local);
986 fLeftMat->MasterToLocalVect(dir, ldir);
987 fLeft->ComputeNormal(local, ldir, lnorm);
988 fLeftMat->LocalToMasterVect(lnorm, norm);
994 fRight->ComputeNormal(local, ldir, lnorm);
995 fRightMat->LocalToMasterVect(lnorm, norm);
999 if (
fRight->Contains(local)) {
1000 fRightMat->MasterToLocalVect(dir, ldir);
1001 fRight->ComputeNormal(local, ldir, lnorm);
1002 fRightMat->LocalToMasterVect(lnorm, norm);
1005 fLeftMat->MasterToLocal(point, local);
1006 if (!
fLeft->Contains(local)) {
1007 fLeftMat->MasterToLocalVect(dir, ldir);
1008 fLeft->ComputeNormal(local, ldir, lnorm);
1009 fLeftMat->LocalToMasterVect(lnorm, norm);
1013 local[0] = point[0] + 1E-5 * dir[0];
1014 local[1] = point[1] + 1E-5 * dir[1];
1015 local[2] = point[2] + 1E-5 * dir[2];
1017 local[0] = point[0] - 1E-5 * dir[0];
1018 local[1] = point[1] - 1E-5 * dir[1];
1019 local[2] = point[2] - 1E-5 * dir[2];
1032 fLeftMat->MasterToLocal(point, &local[0]);
1036 fRightMat->MasterToLocal(point, &local[0]);
1037 inside = !
fRight->Contains(&local[0]);
1055 if (iact < 3 && safe) {
1060 if (iact == 1 && step < *safe)
1064 Double_t local[3], ldir[3], rdir[3];
1066 fLeftMat->MasterToLocal(point, &local[0]);
1067 fLeftMat->MasterToLocalVect(dir, &ldir[0]);
1068 fRightMat->MasterToLocalVect(dir, &rdir[0]);
1069 d1 =
fLeft->DistFromInside(&local[0], &ldir[0], iact, step, safe);
1070 fRightMat->MasterToLocal(point, &local[0]);
1071 d2 =
fRight->DistFromOutside(&local[0], &rdir[0], iact, step, safe);
1088 if (iact < 3 && safe) {
1093 if (iact == 1 && step < *safe)
1097 Double_t local[3], master[3], ldir[3], rdir[3];
1098 memcpy(&master[0], point, 3 *
sizeof(
Double_t));
1101 fRightMat->MasterToLocal(point, &local[0]);
1102 fLeftMat->MasterToLocalVect(dir, &ldir[0]);
1103 fRightMat->MasterToLocalVect(dir, &rdir[0]);
1111 d1 =
fRight->DistFromInside(&local[0], &rdir[0], iact, step, safe);
1113 for (i = 0; i < 3; i++)
1114 master[i] += (d1 + 1E-8) * dir[i];
1117 fLeftMat->MasterToLocal(&master[0], &local[0]);
1118 if (
fLeft->Contains(&local[0]))
1123 fLeftMat->MasterToLocal(&master[0], &local[0]);
1124 d2 =
fLeft->DistFromOutside(&local[0], &ldir[0], iact, step, safe);
1128 fRightMat->MasterToLocal(&master[0], &local[0]);
1129 d1 =
fRight->DistFromOutside(&local[0], &rdir[0], iact, step, safe);
1136 for (i = 0; i < 3; i++)
1137 master[i] += (d1 + 1E-8) * dir[i];
1140 fRightMat->MasterToLocal(&master[0], &local[0]);
1151 fLeftMat->MasterToLocal(point, local1);
1153 fRightMat->MasterToLocal(point, local2);
1155 Bool_t intrue = in1 && (!in2);
1175 out <<
" pBoolNode = new TGeoSubtraction(";
1176 out <<
fLeft->GetPointerName() <<
",";
1177 out <<
fRight->GetPointerName() <<
",";
1179 out <<
fLeftMat->GetPointerName() <<
",";
1183 out <<
fRightMat->GetPointerName() <<
");" << std::endl;
1185 out <<
"0);" << std::endl;
1212 Error(
"Paint",
"gPad->GetViewer3D() returned 0, cannot work with composite!\n");
1240 Fatal(
"ctor",
"cannot intersect two half-spaces: %s * %s", left->
GetName(), right->
GetName());
1259 Double_t xmin1, xmax1, ymin1, ymax1, zmin1, zmax1;
1260 Double_t xmin2, xmax2, ymin2, ymax2, zmin2, zmax2;
1261 xmin1 = ymin1 = zmin1 = xmin2 = ymin2 = zmin2 =
TGeoShape::Big();
1262 xmax1 = ymax1 = zmax1 = xmax2 = ymax2 = zmax2 = -
TGeoShape::Big();
1265 fLeft->ComputeBBox();
1267 for (i = 0; i < 8; i++) {
1268 fLeftMat->LocalToMaster(&vert[3 * i], &
pt[0]);
1287 for (i = 8; i < 16; i++) {
1304 dx = 0.5 * (xmax2 - xmin2);
1305 origin[0] = 0.5 * (xmax2 + xmin2);
1306 dy = 0.5 * (ymax2 - ymin2);
1307 origin[1] = 0.5 * (ymax2 + ymin2);
1308 dz = 0.5 * (zmax2 - zmin2);
1309 origin[2] = 0.5 * (zmax2 + zmin2);
1313 dx = 0.5 * (xmax1 - xmin1);
1314 origin[0] = 0.5 * (xmax1 + xmin1);
1315 dy = 0.5 * (ymax1 - ymin1);
1316 origin[1] = 0.5 * (ymax1 + ymin1);
1317 dz = 0.5 * (zmax1 - zmin1);
1318 origin[2] = 0.5 * (zmax1 + zmin1);
1329 Warning(
"ComputeBBox",
"shapes %s and %s do not intersect",
fLeft->GetName(),
fRight->GetName());
1331 memset(origin, 0, 3 *
sizeof(
Double_t));
1334 dx = 0.5 * (sort[isort[2]] - sort[isort[1]]);
1335 origin[0] = 0.5 * (sort[isort[1]] + sort[isort[2]]);
1342 Warning(
"ComputeBBox",
"shapes %s and %s do not intersect",
fLeft->GetName(),
fRight->GetName());
1344 memset(origin, 0, 3 *
sizeof(
Double_t));
1347 dy = 0.5 * (sort[isort[2]] - sort[isort[1]]);
1348 origin[1] = 0.5 * (sort[isort[1]] + sort[isort[2]]);
1355 Warning(
"ComputeBBox",
"shapes %s and %s do not intersect",
fLeft->GetName(),
fRight->GetName());
1357 memset(origin, 0, 3 *
sizeof(
Double_t));
1360 dz = 0.5 * (sort[isort[2]] - sort[isort[1]]);
1361 origin[2] = 0.5 * (sort[isort[1]] + sort[isort[2]]);
1370 Double_t local[3], ldir[3], lnorm[3];
1371 norm[0] = norm[1] = 0.;
1374 fLeftMat->MasterToLocal(point, local);
1375 fLeftMat->MasterToLocalVect(dir, ldir);
1376 fLeft->ComputeNormal(local, ldir, lnorm);
1377 fLeftMat->LocalToMasterVect(lnorm, norm);
1382 fRightMat->MasterToLocalVect(dir, ldir);
1383 fRight->ComputeNormal(local, ldir, lnorm);
1384 fRightMat->LocalToMasterVect(lnorm, norm);
1387 fLeftMat->MasterToLocal(point, local);
1388 if (!
fLeft->Contains(local)) {
1389 fLeftMat->MasterToLocalVect(dir, ldir);
1390 fLeft->ComputeNormal(local, ldir, lnorm);
1391 fLeftMat->LocalToMasterVect(lnorm, norm);
1395 if (!
fRight->Contains(local)) {
1396 fRightMat->MasterToLocalVect(dir, ldir);
1397 fRight->ComputeNormal(local, ldir, lnorm);
1398 fRightMat->LocalToMasterVect(lnorm, norm);
1402 local[0] = point[0] + 1E-5 * dir[0];
1403 local[1] = point[1] + 1E-5 * dir[1];
1404 local[2] = point[2] + 1E-5 * dir[2];
1406 local[0] = point[0] - 1E-5 * dir[0];
1407 local[1] = point[1] - 1E-5 * dir[1];
1408 local[2] = point[2] - 1E-5 * dir[2];
1421 fLeftMat->MasterToLocal(point, &local[0]);
1425 fRightMat->MasterToLocal(point, &local[0]);
1426 inside =
fRight->Contains(&local[0]);
1444 if (iact < 3 && safe) {
1449 if (iact == 1 && step < *safe)
1453 Double_t local[3], ldir[3], rdir[3];
1455 fLeftMat->MasterToLocal(point, &local[0]);
1456 fLeftMat->MasterToLocalVect(dir, &ldir[0]);
1457 fRightMat->MasterToLocalVect(dir, &rdir[0]);
1458 d1 =
fLeft->DistFromInside(&local[0], &ldir[0], iact, step, safe);
1459 fRightMat->MasterToLocal(point, &local[0]);
1460 d2 =
fRight->DistFromInside(&local[0], &rdir[0], iact, step, safe);
1478 if (iact < 3 && safe) {
1483 if (iact == 1 && step < *safe)
1487 Double_t lpt[3], rpt[3], master[3], ldir[3], rdir[3];
1488 memcpy(master, point, 3 *
sizeof(
Double_t));
1492 fLeftMat->MasterToLocal(point, lpt);
1494 fLeftMat->MasterToLocalVect(dir, ldir);
1495 fRightMat->MasterToLocalVect(dir, rdir);
1500 if (inleft && inright) {
1503 d1 =
fLeft->DistFromInside(lpt, ldir, 3);
1504 d2 =
fRight->DistFromInside(rpt, rdir, 3);
1509 if (inleft && inright)
1516 d1 =
fLeft->DistFromOutside(lpt, ldir, 3);
1522 d2 =
fRight->DistFromOutside(rpt, rdir, 3);
1533 for (i = 0; i < 3; i++)
1534 master[i] += d1 * dir[i];
1537 for (i = 0; i < 3; i++)
1538 rpt[i] += tol * rdir[i];
1540 inright =
fRight->Contains(rpt);
1549 for (i = 0; i < 3; i++)
1550 master[i] += d2 * dir[i];
1551 fLeftMat->MasterToLocal(master, lpt);
1553 for (i = 0; i < 3; i++)
1554 lpt[i] += tol * ldir[i];
1556 inleft =
fLeft->Contains(lpt);
1571 fLeftMat->MasterToLocal(point, local1);
1573 fRightMat->MasterToLocal(point, local2);
1575 Bool_t intrue = in1 & in2;
1595 out <<
" pBoolNode = new TGeoIntersection(";
1596 out <<
fLeft->GetPointerName() <<
",";
1597 out <<
fRight->GetPointerName() <<
",";
1599 out <<
fLeftMat->GetPointerName() <<
",";
1603 out <<
fRightMat->GetPointerName() <<
");" << std::endl;
1605 out <<
"0);" << std::endl;
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
externTGeoIdentity * gGeoIdentity
Generic 3D primitive description class.
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...
void ClearThreadData() const
std::vector< ThreadData_t * > fThreadData
! Navigation data per thread
~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 CreateThreadData(Int_t nthreads)
Create thread data for n threads max.
void Paint(Option_t *option) override
Special schema for feeding the 3D buffers to the painter client.
TGeoBoolNode(const TGeoBoolNode &)=delete
virtual void SetPoints(Double_t *points) const
Fill buffer with shape vertices.
Int_t fThreadSize
! Size for the navigation data array
std::mutex fMutex
! Mutex for thread data access
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.
ThreadData_t & GetThreadData() const
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.
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return
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.
static Int_t Parse(const char *expr, TString &expr1, TString &expr2, TString &expr3)
Parse a string boolean expression and do a syntax check.
static Int_t ThreadId()
Translates the current thread id to an ordinal number.
Geometrical transformation package.
Base abstract class for all shapes.
const char * GetName() const override
Get the shape name.
static TGeoMatrix * GetTransform()
Returns current transformation matrix that applies to shape.
static Double_t Tolerance()
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.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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.
const char * Data() const
Abstract 3D shapes viewer.
virtual void AddCompositeOp(UInt_t operation)=0
virtual Int_t AddObject(const TBuffer3D &buffer, Bool_t *addChildren=nullptr)=0
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.
ThreadData_t()
Constructor.
~ThreadData_t()
Destructor.