36 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
45 std::vector<G4TwoVector> polygon,
46 std::vector<ZSection> zsections)
47 : G4USolid(name, new UExtrudedSolid())
49 GetShape()->SetName(name);
50 std::vector<UVector2> pvec;
51 for (
unsigned int i=0; i<polygon.size(); ++i)
53 pvec.push_back(UVector2(polygon[i].
x(), polygon[i].y()));
55 std::vector<UExtrudedSolid::ZSection> svec;
56 for (
unsigned int i=0; i<zsections.size(); ++i)
58 ZSection sec = zsections[i];
59 svec.push_back(UExtrudedSolid::ZSection(sec.fZ,
60 UVector2(sec.fOffset.x(), sec.fOffset.y()), sec.fScale));
62 GetShape()->Initialise(pvec, svec);
66 G4UExtrudedSolid::G4UExtrudedSolid(
const G4String& name,
67 std::vector<G4TwoVector> polygon,
71 : G4USolid(name, new UExtrudedSolid())
73 GetShape()->SetName(name);
74 std::vector<UVector2> pvec;
75 for (
unsigned int i=0; i<polygon.size(); ++i)
77 pvec.push_back(UVector2(polygon[i].
x(), polygon[i].y()));
79 GetShape()->Initialise(pvec, halfZ, UVector2(off1.x(), off1.y()), scale1,
80 UVector2(off2.x(), off2.y()), scale2);
88 G4UExtrudedSolid::G4UExtrudedSolid(__void__&
a)
98 G4UExtrudedSolid::~G4UExtrudedSolid()
107 G4UExtrudedSolid::G4UExtrudedSolid(
const G4UExtrudedSolid &source)
118 G4UExtrudedSolid::operator=(
const G4UExtrudedSolid &source)
120 if (
this == &source)
return *
this;
122 G4USolid::operator=( source );
132 G4int G4UExtrudedSolid::GetNofVertices()
const
134 return GetShape()->GetNofVertices();
138 UVector2 v = GetShape()->GetVertex(i);
141 std::vector<G4TwoVector> G4UExtrudedSolid::GetPolygon()
const
143 std::vector<UVector2> pol = GetShape()->GetPolygon();
144 std::vector<G4TwoVector> v;
145 for (
unsigned int i=0; i<pol.size(); ++i)
151 G4int G4UExtrudedSolid::GetNofZSections()
const
153 return GetShape()->GetNofZSections();
155 G4UExtrudedSolid::ZSection G4UExtrudedSolid::GetZSection(
G4int i)
const
157 return ZSection(GetShape()->GetZSection(i));
159 std::vector<G4UExtrudedSolid::ZSection> G4UExtrudedSolid::GetZSections()
const
161 std::vector<UExtrudedSolid::ZSection> sv = GetShape()->GetZSections();
162 std::vector<G4UExtrudedSolid::ZSection> vec;
163 for (
unsigned int i=0; i<sv.size(); ++i)
165 vec.push_back(ZSection(sv[i]));
175 G4Polyhedron* G4UExtrudedSolid::CreatePolyhedron ()
const
177 G4int nFacets = GetShape()->GetNumberOfFacets();
179 for (
G4int l = 0; l<nFacets; ++l)
181 VUFacet* facet = GetShape()->GetFacet(l);
182 G4int n = facet->GetNumberOfVertices();
189 for (
G4int i = 0; i<nFacets; ++i)
191 VUFacet* facet = GetShape()->GetFacet(i);
193 G4int n = facet->GetNumberOfVertices();
196 UVector3 vtx = facet->GetVertex(
m);
200 else if (n == 3) v[3] = 0;
203 G4int k = facet->GetVertexIndex(j);
206 polyhedron->
AddFacet(v[0],v[1],v[2],v[3]);
213 #endif // G4GEOM_USE_USOLIDS
CLHEP::Hep3Vector G4ThreeVector
void AddVertex(const G4ThreeVector &v)
const G4double x[NPOINTSGL]
void AddFacet(const G4int iv1, const G4int iv2, const G4int iv3, const G4int iv4=0)
CLHEP::Hep2Vector G4TwoVector