40 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
46 using namespace CLHEP;
57 G4UTet::G4UTet(
const G4String& pName,
62 : G4USolid(pName, new UTet(pName,
63 UVector3(anchor.
x(),anchor.
y(),anchor.
z()),
64 UVector3(p2.
x(), p2.
y(), p2.
z()),
65 UVector3(p3.
x(), p3.
y(), p3.
z()),
66 UVector3(p4.
x(), p4.
y(), p4.
z()),
76 G4UTet::G4UTet( __void__&
a )
93 G4UTet::G4UTet(
const G4UTet& rhs)
103 G4UTet& G4UTet::operator = (
const G4UTet& rhs)
107 if (
this == &rhs) {
return *
this; }
111 G4USolid::operator=(rhs);
120 std::vector<G4ThreeVector> G4UTet::GetVertices()
const
122 std::vector<UVector3> vec = GetShape()->GetVertices();
123 std::vector<G4ThreeVector> vertices;
124 for (
unsigned int i=0; i<vec.size(); ++i)
127 vertices.push_back(v);
139 GetShape()->Extent(vmin,vmax);
140 pMin.
set(vmin.x(),vmin.y(),vmin.z());
141 pMax.
set(vmax.x(),vmax.y(),vmax.z());
145 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
148 message <<
"Bad bounding box (min >= max) for solid: "
150 <<
"\npMin = " << pMin
151 <<
"\npMax = " << pMax;
152 G4Exception(
"G4UTet::BoundingLimits()",
"GeomMgt0001",
163 G4UTet::CalculateExtent(
const EAxis pAxis,
173 BoundingLimits(bmin,bmax);
176 if (
true)
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
178 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
180 return exist = (pMin < pMax) ?
true :
false;
185 std::vector<UVector3> vec = GetShape()->GetVertices();
188 anchor[0].set(vec[0].
x(),vec[0].
y(),vec[0].
z());
191 base[0].set(vec[1].
x(),vec[1].
y(),vec[1].
z());
192 base[1].set(vec[2].
x(),vec[2].
y(),vec[2].
z());
193 base[2].set(vec[3].
x(),vec[3].
y(),vec[3].
z());
195 std::vector<const G4ThreeVectorList *> polygons(2);
196 polygons[0] = &anchor;
200 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
212 GetShape()->GetParametersList(index, array);
216 const G4int faces[4][4]={{1,3,2,0},{1,4,3,0},{1,2,4,0},{2,3,4,0}};
217 xyz[0][0]=array[0]; xyz[0][1]=array[1]; xyz[0][2]=array[2];
218 xyz[1][0]=array[3]; xyz[1][1]=array[4]; xyz[1][2]=array[5];
219 xyz[2][0]=array[6]; xyz[2][1]=array[7]; xyz[2][2]=array[8];
220 xyz[3][0]=array[9]; xyz[3][1]=array[10]; xyz[3][2]=array[11];
227 #endif // G4GEOM_USE_USOLIDS
void set(double x, double y, double z)
G4int createPolyhedron(G4int Nnodes, G4int Nfaces, const G4double xyz[][3], const G4int faces[][4])
std::vector< ExP01TrackerHit * > a
void message(RunManager *runmanager)
const XML_Char int const XML_Char int const XML_Char * base
std::vector< G4ThreeVector > G4ThreeVectorList
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout