43 const std::vector<G4TwoVector>& vertices)
47 std::vector<UVector2> v;
48 for (
size_t n=0;
n<vertices.size(); ++
n)
50 v.push_back(
UVector2(vertices[
n].x(),vertices[
n].y()));
94 if (
this == &source)
return *
this;
111 size_t nVertices, nFacets;
114 G4int subdivisions=0;
139 Dx = 0.5*(maxVec.x()- minVec.y());
140 Dy = 0.5*(maxVec.y()- minVec.y());
141 if (Dy > Dx) { Dx=Dy; }
143 subdivisions=8*
G4int(maxTwist/(Dx*Dx*Dx)*fDz);
144 if (subdivisions<4) { subdivisions=4; }
145 if (subdivisions>30) { subdivisions=30; }
148 G4int sub4=4*subdivisions;
149 nVertices = 8+subdivisions*4;
150 nFacets = 6+subdivisions*4;
161 for( i=0;i<subdivisions;i++)
163 for(
G4int j=0;j<4;j++)
178 for (i=0;i<subdivisions+1;i++)
181 polyhedron->
AddFacet(5+is,8+is,4+is,1+is);
182 polyhedron->
AddFacet(8+is,7+is,3+is,4+is);
183 polyhedron->
AddFacet(7+is,6+is,2+is,3+is);
184 polyhedron->
AddFacet(6+is,5+is,1+is,2+is);
186 polyhedron->
AddFacet(5+sub4,6+sub4,7+sub4,8+sub4);
G4Polyhedron * CreatePolyhedron() const
CLHEP::Hep3Vector G4ThreeVector
UGenericTrap * GetShape() const
G4double GetZHalfLength() const
G4TwoVector GetVertex(G4int index) const
G4int GetVisSubdivisions() const
G4UGenericTrap(const G4String &name, G4double halfZ, const std::vector< G4TwoVector > &vertices)
void Initialise(const std::vector< UVector2 > &vertices)
void SetName(const std::string &aName)
void AddVertex(const G4ThreeVector &v)
UVector3 GetMaximumBBox() const
void SetZHalfLength(G4double)
void AddFacet(const G4int iv1, const G4int iv2, const G4int iv3, const G4int iv4=0)
G4USolid & operator=(const G4USolid &rhs)
G4UGenericTrap & operator=(const G4UGenericTrap &source)
G4double GetTwistAngle(G4int index) const
CLHEP::Hep2Vector G4TwoVector
UVector3 GetMinimumBBox() const