50#if !defined(G4GEOM_USE_UTESSELLATEDSOLID)
110 fMinExtent.
set(0,0,0);
111 fMaxExtent.
set(0,0,0);
140 if (&ts ==
this)
return *
this;
156void G4TessellatedSolid::Initialize()
160 fRebuildPolyhedron =
false; fpPolyhedron =
nullptr;
161 fCubicVolume = 0.; fSurfaceArea = 0.;
163 fGeometryType =
"G4TessellatedSolid";
164 fSolidClosed =
false;
166 fMinExtent.
set(kInfinity,kInfinity,kInfinity);
167 fMaxExtent.
set(-kInfinity,-kInfinity,-kInfinity);
174void G4TessellatedSolid::DeleteObjects()
176 G4int size = fFacets.size();
177 for (
G4int i = 0; i < size; ++i) {
delete fFacets[i]; }
179 delete fpPolyhedron; fpPolyhedron =
nullptr;
194 for (
G4int i = 0; i <
n; ++i)
213 G4Exception(
"G4TessellatedSolid::AddFacet()",
"GeomSolids1002",
214 JustWarning,
"Attempt to add facets when solid is closed.");
219 set<G4VertexInfo,G4VertexComparator>::iterator begin
220 = fFacetList.begin(), end = fFacetList.end(), pos, it;
223 value.
id = fFacetList.size();
224 value.
mag2 = p.
x() + p.
y() + p.
z();
230 pos = fFacetList.lower_bound(value);
233 while (!found && it != end)
238 if ((found = (facet == aFacet)))
break;
240 if (dif > kCarTolerance3)
break;
244 if (fFacets.size() > 1)
247 while (!found && it != begin)
253 found = (facet == aFacet);
256 if (dif > kCarTolerance3)
break;
263 fFacets.push_back(aFacet);
264 fFacetList.insert(value);
270 G4Exception(
"G4TessellatedSolid::AddFacet()",
"GeomSolids1002",
271 JustWarning,
"Attempt to add facet not properly defined.");
279G4int G4TessellatedSolid::SetAllUsingStack(
const std::vector<G4int>& voxel,
280 const std::vector<G4int>& max,
283 vector<G4int> xyz = voxel;
284 stack<vector<G4int> > pos;
287 G4int cc = 0, nz = 0;
289 vector<G4int> candidates;
307 for (
auto i = 0; i <= 2; ++i)
309 if (xyz[i] < max[i] - 1)
335void G4TessellatedSolid::PrecalculateInsides()
337 vector<G4int> voxel(3), maxVoxels(3);
338 for (
auto i = 0; i <= 2; ++i) maxVoxels[i] = fVoxels.
GetBoundary(i).size();
339 G4int size = maxVoxels[0] * maxVoxels[1] * maxVoxels[2];
346 for (voxel[2] = 0; voxel[2] < maxVoxels[2] - 1; ++voxel[2])
348 for (voxel[1] = 0; voxel[1] < maxVoxels[1] - 1; ++voxel[1])
350 for (voxel[0] = 0; voxel[0] < maxVoxels[0] - 1; ++voxel[0])
353 if (!checked[index] && fVoxels.
IsEmpty(index))
355 for (
auto i = 0; i <= 2; ++i)
360 SetAllUsingStack(voxel, maxVoxels, inside, checked);
370void G4TessellatedSolid::Voxelize ()
382 PrecalculateInsides();
398void G4TessellatedSolid::SetExtremeFacets()
400 G4int size = fFacets.size();
401 for (
G4int j = 0; j < size; ++j)
406 G4int vsize = fVertexList.size();
407 for (
G4int i=0; i < vsize; ++i)
409 if (!facet.
IsInside(fVertexList[i]))
415 if (isExtreme) fExtremeFacets.insert(&facet);
421void G4TessellatedSolid::CreateVertexList()
433 set<G4VertexInfo,G4VertexComparator> vertexListSorted;
434 set<G4VertexInfo,G4VertexComparator>::iterator begin
435 = vertexListSorted.begin(), end = vertexListSorted.end(),
pos, it;
440 G4int size = fFacets.size();
444 vector<G4int> newIndex(100);
446 for (
G4int k = 0; k < size; ++k)
454 value.
id = fVertexList.size();
455 value.
mag2 = p.
x() + p.
y() + p.
z();
461 pos = vertexListSorted.lower_bound(value);
468 found = (dif < kCarTolerance24);
470 dif = q.
x() + q.
y() + q.
z() - value.
mag2;
471 if (dif > kCarTolerance3)
break;
475 if (!found && (fVertexList.size() > 1))
484 found = (dif < kCarTolerance24);
486 dif = value.
mag2 - (q.
x() + q.
y() + q.
z());
487 if (dif > kCarTolerance3)
break;
496 G4cout <<
"Adding new vertex #" << i <<
" of facet " << k
500 fVertexList.push_back(p);
501 vertexListSorted.insert(value);
502 begin = vertexListSorted.begin();
503 end = vertexListSorted.end();
504 newIndex[i] = value.
id;
508 if (value.
id == 0) fMinExtent = fMaxExtent = p;
511 if (p.
x() > fMaxExtent.
x()) fMaxExtent.
setX(p.
x());
512 else if (p.
x() < fMinExtent.
x()) fMinExtent.
setX(p.
x());
513 if (p.
y() > fMaxExtent.
y()) fMaxExtent.
setY(p.
y());
514 else if (p.
y() < fMinExtent.
y()) fMinExtent.
setY(p.
y());
515 if (p.
z() > fMaxExtent.
z()) fMaxExtent.
setZ(p.
z());
516 else if (p.
z() < fMinExtent.
z()) fMinExtent.
setZ(p.
z());
523 G4cout <<
"Vertex #" << i <<
" of facet " << k
524 <<
" found, redirecting to " <<
id <<
G4endl;
536 vector<G4ThreeVector>(fVertexList).swap(fVertexList);
540 for (
auto res=vertexListSorted.cbegin(); res!=vertexListSorted.cend(); ++res)
542 G4int id = (*res).id;
545 if (previousValue && (previousValue - 1e-9 > mvalue))
546 G4cout <<
"Error in CreateVertexList: previousValue " << previousValue
547 <<
" is smaller than mvalue " << mvalue <<
G4endl;
548 previousValue = mvalue;
560 G4cout <<
"G4TessellatedSolid - Allocated memory without voxel overhead "
561 << without <<
"; with " << with <<
"; ratio: " << ratio <<
G4endl;
617 for (
G4int i = 0; i < size; ++i)
629 return fFacets.size();
643 vector<G4int> startingVoxel(3);
646 const G4double dirTolerance = 1.0E-14;
648 const vector<G4int> &startingCandidates =
650 G4int limit = startingCandidates.size();
651 if (limit == 0 && fInsides.
GetNbits())
660 for(
G4int i = 0; i < limit; ++i)
662 G4int candidate = startingCandidates[i];
663 G4VFacet &facet = *fFacets[candidate];
665 if (dist < minDist) minDist = dist;
692 G4bool nearParallel =
false;
700 distOut = distIn = kInfinity;
712 vector<G4int> curVoxel(3);
713 curVoxel = startingVoxel;
721 const vector<G4int> &candidates =
722 started ? startingCandidates : fVoxels.
GetCandidates(curVoxel);
724 if (
G4int candidatesCount = candidates.size())
726 for (
G4int i = 0 ; i < candidatesCount; ++i)
728 G4int candidate = candidates[i];
730 G4VFacet& facet = *fFacets[candidate];
732 crossingO = facet.
Intersect(p,v,
true,distO,distFromSurfaceO,normalO);
733 crossingI = facet.
Intersect(p,v,
false,distI,distFromSurfaceI,normalI);
735 if (crossingO || crossingI)
739 nearParallel = (crossingO
740 && std::fabs(normalO.
dot(v))<dirTolerance)
741 || (crossingI && std::fabs(normalI.
dot(v))<dirTolerance);
744 if (crossingO && distO > 0.0 && distO < distOut)
746 if (crossingI && distI > 0.0 && distI < distIn)
752 if (nearParallel)
break;
759 G4bool inside = fInsides[index];
766 if (shift == kInfinity)
break;
768 currentPoint += direction * (shift + shiftBonus);
773 while (nearParallel && sm != fMaxTries);
787 std::ostringstream message;
788 G4int oldprc = message.precision(16);
789 message <<
"Cannot determine whether point is inside or outside volume!"
792 <<
"Geometry Type = " << fGeometryType <<
G4endl
793 <<
"Number of facets = " << fFacets.size() <<
G4endl
795 <<
"p.x() = " << p.
x()/mm <<
" mm" <<
G4endl
796 <<
"p.y() = " << p.
y()/mm <<
" mm" <<
G4endl
797 <<
"p.z() = " << p.
z()/mm <<
" mm";
798 message.precision(oldprc);
813 if (distIn == kInfinity && distOut == kInfinity)
834 const G4double dirTolerance = 1.0E-14;
840 G4int size = fFacets.size();
841 for (
G4int i = 0; i < size; ++i)
845 if (dist < minDist) minDist = dist;
881 for (
G4int i=0; i<nTry; ++i)
883 G4bool nearParallel =
false;
892 distOut = distIn = kInfinity;
895 vector<G4VFacet*>::const_iterator f = fFacets.begin();
904 crossingO = ((*f)->Intersect(p,v,
true,distO,distFromSurfaceO,normalO));
905 crossingI = ((*f)->Intersect(p,v,
false,distI,distFromSurfaceI,normalI));
906 if (crossingO || crossingI)
908 nearParallel = (crossingO && std::fabs(normalO.
dot(v))<dirTolerance)
909 || (crossingI && std::fabs(normalI.
dot(v))<dirTolerance);
912 if (crossingO && distO > 0.0 && distO < distOut) distOut = distO;
913 if (crossingI && distI > 0.0 && distI < distIn) distIn = distI;
916 }
while (!nearParallel && ++f != fFacets.end());
917 }
while (nearParallel && sm != fMaxTries);
927 std::ostringstream message;
928 G4int oldprc = message.precision(16);
929 message <<
"Cannot determine whether point is inside or outside volume!"
932 <<
"Geometry Type = " << fGeometryType <<
G4endl
933 <<
"Number of facets = " << fFacets.size() <<
G4endl
935 <<
"p.x() = " << p.
x()/mm <<
" mm" <<
G4endl
936 <<
"p.y() = " << p.
y()/mm <<
" mm" <<
G4endl
937 <<
"p.z() = " << p.
z()/mm <<
" mm";
938 message.precision(oldprc);
953 if (distIn == kInfinity && distOut == kInfinity)
960 if (i == 0) location = locationprime;
979 vector<G4int> curVoxel(3);
981 const vector<G4int> &candidates = fVoxels.
GetCandidates(curVoxel);
984 if (
G4int limit = candidates.size())
987 for(
G4int i = 0 ; i < limit ; ++i)
989 G4int candidate = candidates[i];
990 G4VFacet &fct = *fFacets[candidate];
992 if (dist < minDist) minDist = dist;
1000 minDist = MinDistanceFacet(p,
true, facet);
1004 minDist = kInfinity;
1005 G4int size = fFacets.size();
1006 for (
G4int i = 0; i < size; ++i)
1018 if (minDist != kInfinity)
1026 std::ostringstream message;
1027 message <<
"Point p is not on surface !?" <<
G4endl
1028 <<
" No facets found for point: " << p <<
" !" <<
G4endl
1029 <<
" Returning approximated value for normal.";
1031 G4Exception(
"G4TessellatedSolid::SurfaceNormal(p)",
1050G4TessellatedSolid::DistanceToInNoVoxels (
const G4ThreeVector& p,
1062 std::ostringstream message;
1063 G4int oldprc = message.precision(16) ;
1064 message <<
"Point p is already inside!?" <<
G4endl
1066 <<
" p.x() = " << p.
x()/mm <<
" mm" <<
G4endl
1067 <<
" p.y() = " << p.
y()/mm <<
" mm" <<
G4endl
1068 <<
" p.z() = " << p.
z()/mm <<
" mm" <<
G4endl
1070 message.precision(oldprc) ;
1071 G4Exception(
"G4TriangularFacet::DistanceToIn(p,v)",
1076 G4int size = fFacets.size();
1077 for (
G4int i = 0; i < size; ++i)
1080 if (facet.
Intersect(p,v,
false,dist,distFromSurface,normal))
1116G4TessellatedSolid::DistanceToOutNoVoxels (
const G4ThreeVector& p,
1130 std::ostringstream message;
1131 G4int oldprc = message.precision(16) ;
1132 message <<
"Point p is already outside!?" <<
G4endl
1134 <<
" p.x() = " << p.
x()/mm <<
" mm" <<
G4endl
1135 <<
" p.y() = " << p.
y()/mm <<
" mm" <<
G4endl
1136 <<
" p.z() = " << p.
z()/mm <<
" mm" <<
G4endl
1138 message.precision(oldprc) ;
1139 G4Exception(
"G4TriangularFacet::DistanceToOut(p)",
1144 G4bool isExtreme =
false;
1145 G4int size = fFacets.size();
1146 for (
G4int i = 0; i < size; ++i)
1149 if (facet.
Intersect(p,v,
true,dist,distFromSurface,normal))
1155 aConvex = (fExtremeFacets.find(&facet) != fExtremeFacets.end());
1158 aNormalVector = normal;
1161 if (dist >= 0.0 && dist < minDist)
1165 isExtreme = (fExtremeFacets.find(&facet) != fExtremeFacets.end());
1169 if (minDist < kInfinity)
1171 aNormalVector = minNormal;
1172 aConvex = isExtreme;
1179 Normal(p, aNormalVector);
1186void G4TessellatedSolid::
1187DistanceToOutCandidates(
const std::vector<G4int>& candidates,
1191 G4int& minCandidate )
const
1193 G4int candidatesCount = candidates.size();
1198 for (
G4int i = 0 ; i < candidatesCount; ++i)
1200 G4int candidate = candidates[i];
1201 G4VFacet& facet = *fFacets[candidate];
1202 if (facet.
Intersect(aPoint,direction,
true,dist,distFromSurface,normal))
1211 minCandidate = candidate;
1214 if (dist >= 0.0 && dist < minDist)
1218 minCandidate = candidate;
1227G4TessellatedSolid::DistanceToOutCore(
const G4ThreeVector& aPoint,
1237 minDistance = kInfinity;
1242 vector<G4int> curVoxel(3);
1243 if (!fVoxels.
Contains(aPoint))
return 0.;
1245 fVoxels.
GetVoxel(curVoxel, currentPoint);
1249 const vector<G4int>* old =
nullptr;
1251 G4int minCandidate = -1;
1254 const vector<G4int>& candidates = fVoxels.
GetCandidates(curVoxel);
1255 if (old == &candidates)
1257 if (old != &candidates && candidates.size())
1259 DistanceToOutCandidates(candidates, aPoint, direction, minDistance,
1260 aNormalVector, minCandidate);
1261 if (minDistance <= totalShift)
break;
1265 if (shift == kInfinity)
break;
1267 totalShift += shift;
1268 if (minDistance <= totalShift)
break;
1270 currentPoint += direction * (shift + shiftBonus);
1276 if (minCandidate < 0)
1281 Normal(aPoint, aNormalVector);
1285 aConvex = (fExtremeFacets.find(fFacets[minCandidate])
1286 != fExtremeFacets.end());
1291 minDistance = DistanceToOutNoVoxels(aPoint, aDirection, aNormalVector,
1300DistanceToInCandidates(
const std::vector<G4int>& candidates,
1304 G4int candidatesCount = candidates.size();
1310 for (
G4int i = 0 ; i < candidatesCount; ++i)
1312 G4int candidate = candidates[i];
1313 G4VFacet& facet = *fFacets[candidate];
1314 if (facet.
Intersect(aPoint,direction,
false,dist,distFromSurface,normal))
1324 && (dist >= 0.0) && (dist < minDistance))
1348G4TessellatedSolid::DistanceToInCore(
const G4ThreeVector& aPoint,
1356 minDistance = kInfinity;
1360 if (shift == kInfinity)
return shift;
1363 currentPoint += direction * (shift + shiftBonus);
1368 vector<G4int> curVoxel(3);
1370 fVoxels.
GetVoxel(curVoxel, currentPoint);
1373 const vector<G4int>& candidates = fVoxels.
GetCandidates(curVoxel);
1374 if (candidates.size())
1376 G4double distance=DistanceToInCandidates(candidates, aPoint, direction);
1377 if (minDistance > distance) minDistance = distance;
1378 if (distance < totalShift)
break;
1381 shift = fVoxels.
DistanceToNext(currentPoint, direction, curVoxel);
1382 if (shift == kInfinity )
break;
1384 totalShift += shift;
1385 if (minDistance < totalShift)
break;
1387 currentPoint += direction * (shift + shiftBonus);
1393 minDistance = DistanceToInNoVoxels(aPoint, aDirection, aPstep);
1402G4TessellatedSolid::CompareSortedVoxel(
const std::pair<G4int, G4double>& l,
1403 const std::pair<G4int, G4double>& r)
1405 return l.second < r.second;
1418 vector<pair<G4int, G4double> > voxelsSorted(size);
1420 pair<G4int, G4double> info;
1422 for (
G4int i = 0; i < size; ++i)
1429 info.second = safety;
1430 voxelsSorted[i] = info;
1433 std::sort(voxelsSorted.begin(), voxelsSorted.end(),
1434 &G4TessellatedSolid::CompareSortedVoxel);
1436 for (
G4int i = 0; i < size; ++i)
1438 const pair<G4int,G4double>& inf = voxelsSorted[i];
1440 if (dist > minDist)
break;
1443 G4int csize = candidates.size();
1444 for (
G4int j = 0; j < csize; ++j)
1446 G4int candidate = candidates[j];
1447 G4VFacet& facet = *fFacets[candidate];
1448 dist = simple ? facet.
Distance(p,minDist)
1468 std::ostringstream message;
1469 G4int oldprc = message.precision(16) ;
1470 message <<
"Point p is already inside!?" <<
G4endl
1472 <<
"p.x() = " << p.
x()/mm <<
" mm" <<
G4endl
1473 <<
"p.y() = " << p.
y()/mm <<
" mm" <<
G4endl
1474 <<
"p.z() = " << p.
z()/mm <<
" mm" <<
G4endl
1476 message.precision(oldprc) ;
1491 vector<G4int> startingVoxel(3);
1492 fVoxels.
GetVoxel(startingVoxel, p);
1493 const vector<G4int> &candidates = fVoxels.
GetCandidates(startingVoxel);
1494 if (candidates.size() == 0 && fInsides.
GetNbits())
1497 if (fInsides[index])
return 0.;
1502 minDist = MinDistanceFacet(p,
true, facet);
1506 minDist = kInfinity;
1507 G4int size = fFacets.size();
1508 for (
G4int i = 0; i < size; ++i)
1512 if (dist < minDist) minDist = dist;
1526 std::ostringstream message;
1527 G4int oldprc = message.precision(16) ;
1528 message <<
"Point p is already outside!?" <<
G4endl
1530 <<
"p.x() = " << p.
x()/mm <<
" mm" <<
G4endl
1531 <<
"p.y() = " << p.
y()/mm <<
" mm" <<
G4endl
1532 <<
"p.z() = " << p.
z()/mm <<
" mm" <<
G4endl
1534 message.precision(oldprc) ;
1535 G4Exception(
"G4TriangularFacet::DistanceToOut(p)",
1547 minDist = MinDistanceFacet(p,
true, facet);
1551 minDist = kInfinity;
1553 G4int size = fFacets.size();
1554 for (
G4int i = 0; i < size; ++i)
1558 if (dist < minDist) minDist = dist;
1572 return fGeometryType;
1581 os <<
"Geometry Type = " << fGeometryType <<
G4endl;
1582 os <<
"Number of facets = " << fFacets.size() <<
G4endl;
1584 G4int size = fFacets.size();
1585 for (
G4int i = 0; i < size; ++i)
1587 os <<
"FACET # = " << i + 1 <<
G4endl;
1621 location = InsideVoxels(aPoint);
1625 location = InsideNoVoxels(aPoint);
1656 G4double dist = DistanceToInCore(p,v,kInfinity);
1658 if (dist < kInfinity)
1662 std::ostringstream message;
1663 message <<
"Invalid response from facet in solid '" <<
GetName() <<
"',"
1665 <<
"at point: " << p <<
"and direction: " << v;
1666 G4Exception(
"G4TessellatedSolid::DistanceToIn(p,v)",
1713 G4double dist = DistanceToOutCore(p, v, n, valid);
1720 if (dist < kInfinity)
1724 std::ostringstream message;
1725 message <<
"Invalid response from facet in solid '" <<
GetName() <<
"',"
1727 <<
"at point: " << p <<
"and direction: " << v;
1728 G4Exception(
"G4TessellatedSolid::DistanceToOut(p,v,..)",
1747 G4int nVertices = fVertexList.size();
1748 G4int nFacets = fFacets.size();
1751 for (
auto v= fVertexList.cbegin(); v!=fVertexList.cend(); ++v)
1756 G4int size = fFacets.size();
1757 for (
G4int i = 0; i < size; ++i)
1763 for (
G4int j=0; j<n; ++j)
1768 polyhedron->
AddFacet(v[0],v[1],v[2],v[3]);
1781 if (fpPolyhedron ==
nullptr ||
1782 fRebuildPolyhedron ||
1787 delete fpPolyhedron;
1789 fRebuildPolyhedron =
false;
1792 return fpPolyhedron;
1807 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
1809 std::ostringstream message;
1810 message <<
"Bad bounding box (min >= max) for solid: "
1812 <<
"\npMin = " << pMin
1813 <<
"\npMax = " << pMax;
1814 G4Exception(
"G4TessellatedSolid::BoundingLimits()",
1846 return (pMin < pMax) ? true :
false;
1857 std::vector<const G4ThreeVectorList *> pyramid(2);
1860 apex[0] = (bmin+bmax)*0.5;
1877 if (!benv.
CalculateExtent(pAxis,pVoxelLimit,pTransform,emin,emax))
continue;
1878 if (emin < pMin) pMin = emin;
1879 if (emax > pMax) pMax = emax;
1880 if (eminlim > pMin && emaxlim < pMax)
break;
1882 return (pMin < pMax);
1890 return fMinExtent.
x();
1897 return fMaxExtent.
x();
1904 return fMinExtent.
y();
1911 return fMaxExtent.
y();
1918 return fMinExtent.
z();
1925 return fMaxExtent.
z();
1933 fMinExtent.
y(), fMaxExtent.
y(),
1934 fMinExtent.
z(), fMaxExtent.
z());
1941 if (fCubicVolume != 0.)
return fCubicVolume;
1947 G4int size = fFacets.size();
1948 for (
G4int i = 0; i < size; ++i)
1953 fCubicVolume += area * (facet.
GetVertex(0).
dot(unit_normal));
1956 return fCubicVolume;
1963 if (fSurfaceArea != 0.)
return fSurfaceArea;
1965 G4int size = fFacets.size();
1966 for (
G4int i = 0; i < size; ++i)
1969 fSurfaceArea += facet.
GetArea();
1971 return fSurfaceArea;
1980 G4int i = (
G4int) G4RandFlat::shoot(0., fFacets.size());
1981 return fFacets[i]->GetPointOnFace();
1993void G4TessellatedSolid::SetRandomVectors ()
1997 G4ThreeVector(-0.9577428892113370, 0.2732676269591740, 0.0897405271949221);
1999 G4ThreeVector(-0.8331264504940770,-0.5162067214954600,-0.1985722492445700);
2001 G4ThreeVector(-0.1516671651108820, 0.9666292616127460, 0.2064580868390110);
2003 G4ThreeVector( 0.6570250350323190,-0.6944539025883300, 0.2933460081893360);
2005 G4ThreeVector(-0.4820456281280320,-0.6331060000098690,-0.6056474264406270);
2007 G4ThreeVector( 0.7629032554236800 , 0.1016854697539910,-0.6384658864065180);
2009 G4ThreeVector( 0.7689540409061150, 0.5034929891988220, 0.3939600142169160);
2011 G4ThreeVector( 0.5765188359255740, 0.5997271636278330,-0.5549354566343150);
2013 G4ThreeVector( 0.6660632777862070,-0.6362809868288380, 0.3892379937580790);
2015 G4ThreeVector( 0.3824415020414780, 0.6541792713761380,-0.6525243125110690);
2017 G4ThreeVector(-0.5107726564526760, 0.6020905056811610, 0.6136760679616570);
2019 G4ThreeVector( 0.7459135439578050, 0.6618796061649330, 0.0743530220183488);
2021 G4ThreeVector( 0.1536405855311580, 0.8117477913978260,-0.5634359711967240);
2023 G4ThreeVector( 0.0744395301705579,-0.8707110101772920,-0.4861286795736560);
2025 G4ThreeVector(-0.1665874645185400, 0.6018553940549240,-0.7810369397872780);
2027 G4ThreeVector( 0.7766902003633100, 0.6014617505959970,-0.1870724331097450);
2029 G4ThreeVector(-0.8710128685847430,-0.1434320216603030,-0.4698551243971010);
2031 G4ThreeVector( 0.8901082092766820,-0.4388411398893870, 0.1229871120030100);
2033 G4ThreeVector(-0.6430417431544370,-0.3295938228697690, 0.6912779675984150);
2035 G4ThreeVector( 0.6331124368380410, 0.6306211461665000, 0.4488714875425340);
2044 G4int base =
sizeof(*this);
2048 G4int limit = fFacets.size();
2049 for (
G4int i = 0; i < limit; ++i)
2055 for (
auto it = fExtremeFacets.cbegin(); it != fExtremeFacets.cend(); ++it)
2070 size += sizeInsides + sizeVoxels;
std::vector< G4ThreeVector > G4ThreeVectorList
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
#define G4MUTEX_INITIALIZER
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
double dot(const Hep3Vector &) const
void set(double x, double y, double z)
G4bool BoundingBoxVsVoxelLimits(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
void AddFacet(const G4int iv1, const G4int iv2, const G4int iv3, const G4int iv4=0)
void AddVertex(const G4ThreeVector &v)
G4int GetNumberOfRotationStepsAtTimeOfCreation() const
unsigned int GetNbits() const
unsigned int GetNbytes() const
void ResetBitNumber(unsigned int bitnumber)
void SetBitNumber(unsigned int bitnumber, G4bool value=true)
virtual G4bool Normal(const G4ThreeVector &p, G4ThreeVector &n) const
G4double GetMinYExtent() const
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
virtual G4Polyhedron * GetPolyhedron() const
virtual G4double GetSurfaceArea()
G4double GetMinZExtent() const
virtual std::ostream & StreamInfo(std::ostream &os) const
G4TessellatedSolid & operator=(const G4TessellatedSolid &right)
G4double kCarToleranceHalf
G4TessellatedSolid & operator+=(const G4TessellatedSolid &right)
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4bool AddFacet(G4VFacet *aFacet)
void DisplayAllocatedMemory()
G4int GetNumberOfFacets() const
G4double GetMaxYExtent() const
G4double GetMaxZExtent() const
G4double GetMaxXExtent() const
G4bool GetSolidClosed() const
virtual G4double DistanceToOut(const G4ThreeVector &p) const
G4VFacet * GetFacet(G4int i) const
virtual G4double SafetyFromInside(const G4ThreeVector &p, G4bool aAccurate=false) const
G4double GetMinXExtent() const
virtual void DescribeYourselfTo(G4VGraphicsScene &scene) const
void SetSolidClosed(const G4bool t)
G4int AllocatedMemoryWithoutVoxels()
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
virtual G4VisExtent GetExtent() const
virtual G4Polyhedron * CreatePolyhedron() const
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
virtual G4GeometryType GetEntityType() const
virtual EInside Inside(const G4ThreeVector &p) const
virtual G4double SafetyFromOutside(const G4ThreeVector &p, G4bool aAccurate=false) const
virtual ~G4TessellatedSolid()
virtual G4double GetCubicVolume()
virtual G4VSolid * Clone() const
virtual G4ThreeVector GetPointOnSurface() const
virtual void SetVertexIndex(G4int i, G4int j)=0
virtual G4int AllocatedMemory()=0
virtual G4ThreeVector GetCircumcentre() const =0
std::ostream & StreamInfo(std::ostream &os) const
G4bool IsInside(const G4ThreeVector &p) const
virtual G4ThreeVector GetSurfaceNormal() const =0
virtual G4ThreeVector GetVertex(G4int i) const =0
virtual G4double GetArea() const =0
virtual G4int GetNumberOfVertices() const =0
virtual G4int GetVertexIndex(G4int i) const =0
virtual G4VFacet * GetClone()=0
virtual G4double Distance(const G4ThreeVector &, G4double)=0
virtual void SetVertices(std::vector< G4ThreeVector > *vertices)=0
virtual G4bool IsDefined() const =0
virtual G4bool Intersect(const G4ThreeVector &, const G4ThreeVector &, const G4bool, G4double &, G4double &, G4ThreeVector &)=0
virtual void AddSolid(const G4Box &)=0
G4VSolid & operator=(const G4VSolid &rhs)
G4double GetMinExtent(const EAxis pAxis) const
G4double GetMaxExtent(const EAxis pAxis) const
const G4SurfBits & Empty() const
G4double DistanceToBoundingBox(const G4ThreeVector &point) const
long long GetCountOfVoxels() const
const std::vector< G4double > & GetBoundary(G4int index) const
G4bool IsEmpty(G4int index) const
G4bool UpdateCurrentVoxel(const G4ThreeVector &point, const G4ThreeVector &direction, std::vector< G4int > &curVoxel) const
void GetVoxel(std::vector< G4int > &curVoxel, const G4ThreeVector &point) const
G4int GetMaxVoxels(G4ThreeVector &ratioOfReduction)
G4double DistanceToFirst(const G4ThreeVector &point, const G4ThreeVector &direction) const
G4int GetVoxelBoxesSize() const
static G4double MinDistanceToBox(const G4ThreeVector &aPoint, const G4ThreeVector &f)
void SetMaxVoxels(G4int max)
const G4VoxelBox & GetVoxelBox(G4int i) const
G4int GetPointIndex(const G4ThreeVector &p) const
G4double DistanceToNext(const G4ThreeVector &point, const G4ThreeVector &direction, std::vector< G4int > &curVoxel) const
void Voxelize(std::vector< G4VSolid * > &solids, std::vector< G4Transform3D > &transforms)
const std::vector< G4int > & GetVoxelBoxCandidates(G4int i) const
G4int GetVoxelsIndex(G4int x, G4int y, G4int z) const
G4bool Contains(const G4ThreeVector &point) const
const std::vector< G4int > & GetCandidates(std::vector< G4int > &curVoxel) const
static G4int GetNumberOfRotationSteps()
T max(const T t1, const T t2)
brief Return the largest of the two arguments