39 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
45 using namespace CLHEP;
56 G4UTet::G4UTet(
const G4String& pName,
61 : G4USolid(pName, new UTet(pName,
62 UVector3(anchor.x(),anchor.y(),anchor.z()),
63 UVector3(p2.x(), p2.y(), p2.z()),
64 UVector3(p3.x(), p3.y(), p3.z()),
65 UVector3(p4.x(), p4.y(), p4.z()),
75 G4UTet::G4UTet( __void__&
a )
92 G4UTet::G4UTet(
const G4UTet& rhs)
102 G4UTet& G4UTet::operator = (
const G4UTet& rhs)
106 if (
this == &rhs) {
return *
this; }
110 G4USolid::operator=(rhs);
119 std::vector<G4ThreeVector> G4UTet::GetVertices()
const
121 std::vector<UVector3> vec = GetShape()->GetVertices();
122 std::vector<G4ThreeVector> vertices;
123 for (
unsigned int i=0; i<vec.size(); ++i)
126 vertices.push_back(v);
138 GetShape()->Extent(vmin,vmax);
139 pMin.set(vmin.x(),vmin.y(),vmin.z());
140 pMax.set(vmax.x(),vmax.y(),vmax.z());
144 if (pMin.x() >= pMax.x() || pMin.y() >= pMax.y() || pMin.z() >= pMax.z())
146 std::ostringstream message;
147 message <<
"Bad bounding box (min >= max) for solid: "
149 <<
"\npMin = " << pMin
150 <<
"\npMax = " << pMax;
161 G4UTet::CalculateExtent(
const EAxis pAxis,
174 if (
true)
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
176 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
178 return exist = (pMin < pMax) ?
true :
false;
183 std::vector<UVector3> vec = GetShape()->GetVertices();
186 anchor[0].set(vec[0].x(),vec[0].y(),vec[0].z());
189 base[0].set(vec[1].x(),vec[1].y(),vec[1].z());
190 base[1].set(vec[2].x(),vec[2].y(),vec[2].z());
191 base[2].set(vec[3].x(),vec[3].y(),vec[3].z());
193 std::vector<const G4ThreeVectorList *> polygons(2);
194 polygons[0] = &anchor;
198 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
210 GetShape()->GetParametersList(index, array);
214 const G4int faces[4][4]={{1,3,2,0},{1,4,3,0},{1,2,4,0},{2,3,4,0}};
215 xyz[0][0]=array[0]; xyz[0][1]=array[1]; xyz[0][2]=array[2];
216 xyz[1][0]=array[3]; xyz[1][1]=array[4]; xyz[1][2]=array[5];
217 xyz[2][0]=array[6]; xyz[2][1]=array[7]; xyz[2][2]=array[8];
218 xyz[3][0]=array[9]; xyz[3][1]=array[10]; xyz[3][2]=array[11];
220 ph->createPolyhedron(4,4,xyz,faces);
225 #endif // G4GEOM_USE_USOLIDS
CLHEP::Hep3Vector G4ThreeVector
std::vector< ExP01TrackerHit * > a
G4GLOB_DLL std::ostream G4cout
std::vector< G4ThreeVector > G4ThreeVectorList
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)