34 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
40 using namespace CLHEP;
51 G4UTet::G4UTet(
const G4String& pName,
56 : Base_t(pName, U3Vector(anchor.
x(),anchor.
y(),anchor.
z()),
57 U3Vector(p2.
x(), p2.
y(), p2.
z()),
58 U3Vector(p3.
x(), p3.
y(), p3.
z()),
59 U3Vector(p4.
x(), p4.
y(), p4.
z()))
82 G4bool degenerate=std::fabs(signed_vol) < 1
e-9*fMaxSize*fMaxSize*fMaxSize;
84 if(degeneracyFlag) *degeneracyFlag = degenerate;
88 "Degenerate tetrahedron not allowed.");
97 G4UTet::G4UTet( __void__&
a )
114 G4UTet::G4UTet(
const G4UTet& rhs)
124 G4UTet& G4UTet::operator = (
const G4UTet& rhs)
128 if (
this == &rhs) {
return *
this; }
132 Base_t::operator=(rhs);
154 return new G4UTet(*
this);
161 std::vector<G4ThreeVector> G4UTet::GetVertices()
const
163 std::vector<U3Vector> vec(4);
164 Base_t::GetVertices(vec[0], vec[1], vec[2], vec[3]);
165 std::vector<G4ThreeVector> vertices;
166 for (
unsigned int i=0; i<4; ++i)
169 vertices.push_back(
v);
181 Base_t::Extent(vmin,vmax);
182 pMin.
set(vmin.x(),vmin.y(),vmin.z());
183 pMax.
set(vmax.x(),vmax.y(),vmax.z());
187 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
190 message <<
"Bad bounding box (min >= max) for solid: "
192 <<
"\npMin = " << pMin
193 <<
"\npMax = " <<
pMax;
194 G4Exception(
"G4UTet::BoundingLimits()",
"GeomMgt0001",
205 G4UTet::CalculateExtent(
const EAxis pAxis,
214 BoundingLimits(bmin,bmax);
219 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
225 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
227 return exist = (pMin <
pMax) ?
true :
false;
232 std::vector<G4ThreeVector> vec = GetVertices();
242 std::vector<const G4ThreeVectorList *> polygons(2);
243 polygons[0] = &anchor;
247 return exists = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
257 std::vector<U3Vector> vec(4);
258 Base_t::GetVertices(vec[0], vec[1], vec[2], vec[3]);
261 const G4int faces[4][4] = {{1,3,2,0},{1,4,3,0},{1,2,4,0},{2,3,4,0}};
262 for (
unsigned int i=0; i<4; ++i)
264 xyz[i][0] = vec[i].x();
265 xyz[i][1] = vec[i].y();
266 xyz[i][2] = vec[i].z();
274 #endif // G4GEOM_USE_USOLIDS