84 :
G4VSolid(rhs), fCubicVolume(rhs.fCubicVolume),
85 fSurfaceArea(rhs.fSurfaceArea),
86 kRadTolerance(rhs.kRadTolerance), fAccurate(rhs.fAccurate)
124 G4int inside = 0, generated;
126 d = (extentMax - extentMin) / 2.;
127 p = (extentMax + extentMin) / 2.;
130 for (generated = 0; generated < 10000; ++generated)
135 length.
z()*rvec.
z());
138 G4double vbox = (2 * d.x()) * (2 * d.y()) * (2 * d.z());
154 for (
G4int i = 0 ; i < numNodes ; ++i)
163 if (minDistance > distance) minDistance = distance;
171 std::vector<G4int>& candidates,
174 G4int candidatesCount = candidates.size();
178 for (
G4int i = 0 ; i < candidatesCount; ++i)
180 G4int candidate = candidates[i];
187 if (minDistance > distance) minDistance = distance;
189 if (minDistance == 0)
break;
214 if (shift) currentPoint += direction * shift;
217 std::vector<G4int> candidates, curVoxel(3);
226 candidates, exclusion);
227 if (minDistance > distance) minDistance = distance;
228 if (distance < shift)
break;
233 while (minDistance > shift);
253 G4int ignoredSolid = -1;
258 for (
G4int i = 0; i < numNodes; ++i)
260 if (i != ignoredSolid)
273 if (resultDistToOut ==
kInfinity) resultDistToOut = 0;
277 + distance*localDirection);
278 resultDistToOut += distance;
286 return resultDistToOut;
319 std::vector<G4int> candidates;
338 G4int maxCandidate = 0;
341 G4int limit = candidates.size();
342 for (
G4int i = 0 ; i < limit ; ++i)
344 G4int candidate = candidates[i];
368 false, 0, &localNormal);
369 if (maxDistance < shift)
372 maxCandidate = candidate;
373 maxNormal = localNormal;
385 distance += maxDistance;
386 currentPoint += maxDistance * direction;
387 if(maxDistance == 0.) ++count;
390 exclusion.SetBitNumber(maxCandidate);
412 exclusion.ResetBitNumber(maxCandidate);
415 while ((notOutside) && (count < numNodes));
439 std::vector<G4int> candidates;
440 std::vector<G4MultiUnionSurface> surfaces;
450 for (
G4int i = 0 ; i < limit ; ++i)
452 G4int candidate = candidates[i];
459 location = solid.
Inside(localPoint);
464 surface.
point = localPoint;
465 surface.
solid = &solid;
466 surfaces.push_back(surface);
475 G4int size = surfaces.size();
476 for (
G4int i = 0; i < size - 1; ++i)
479 for (
G4int j = i + 1; j < size; ++j)
520 G4int countSurface = 0;
523 for (
G4int i = 0 ; i < numNodes ; ++i)
532 location = solid.
Inside(localPoint);
550 for (
G4int i = 0 ; i < numNodes ; ++i)
645 std::vector<G4int> candidates;
657 G4int limit = candidates.size();
658 for (
G4int i = 0 ; i < limit ; ++i)
660 G4int candidate = candidates[i];
673 return normal.
unit();
694 return normal.
unit();
711 return normal.
unit();
723 std::vector<G4int> candidates;
731 G4int limit = candidates.size();
732 for (
G4int i = 0; i < limit; ++i)
734 G4int candidate = candidates[i];
744 if (safetyMin > safety) safetyMin = safety;
747 if (safetyMin ==
kInfinity) safetyMin = 0;
766 for (
G4int j = 0; j < numNodes; ++j)
773 for (
auto i = 0; i <= 2; ++i)
776 if ((dxyz[i] =
std::abs(point[i] - pos[i]) - hlen[i]) > safetyMin)
780 for (
auto i = 0; i <= 2; ++i)
781 if (dxyz[i] > 0) d2xyz += dxyz[i] * dxyz[i];
786 if (d2xyz >= safetyMin * safetyMin)
796 if (safety <= 0)
return safety;
798 if (safetyMin > safety) safetyMin = safety;
829 G4int safetyNode = 0;
833 for (
G4int i = 0; i < numNodes; ++i)
837 if (dxyz0 > safetyMin)
continue;
839 if (dxyz1 > safetyMin)
continue;
841 if (dxyz2 > safetyMin)
continue;
843 if (dxyz0 > 0) d2xyz += dxyz0 * dxyz0;
844 if (dxyz1 > 0) d2xyz += dxyz1 * dxyz1;
845 if (dxyz2 > 0) d2xyz += dxyz2 * dxyz2;
846 if (d2xyz >= safetyMin * safetyMin)
continue;
854 if (safetyMin > safety)
888 for (
G4int i = 0 ; i < limit; ++i)
895 if (current.
x() > max.
x()) max.
setX(current.
x());
896 if (current.
x() < min.
x()) min.
setX(current.
x());
898 if (current.
y() > max.
y()) max.
setY(current.
y());
899 if (current.
y() < min.
y()) min.
setY(current.
y());
901 if (current.
z() > max.
z()) max.
setZ(current.
z());
902 if (current.
z() < min.
z()) min.
setZ(current.
z());
910 G4int oldprc = os.precision(16);
911 os <<
"-----------------------------------------------------------\n"
912 <<
" *** Dump for solid - " <<
GetName() <<
" ***\n"
913 <<
" ===================================================\n"
914 <<
" Solid type: G4MultiUnion\n"
915 <<
" Parameters: \n";
917 for (
G4int i = 0 ; i < numNodes ; ++i)
923 os <<
" Rotation is :" <<
" \n";
927 <<
"-----------------------------------------------------------\n";
928 os.precision(oldprc);
978 processor.
push_back (operation, *operand);
981 if (processor.
execute(*top)) {
return top; }