31 std::vector<VGM::TwoVector> polygon,
32 std::vector<std::vector<double> > zsections)
33 :
VGM::ISolid(),
VGM::IExtrudedSolid(),
BaseVGM::VExtrudedSolid(), fXtru(0)
40 if (zsections.size() < 2) {
41 std::cerr <<
"+++ Error +++" << std::endl;
42 std::cerr <<
" Number of z-sections = " << zsections.size()
43 <<
" has to be >= 2" << std::endl;
47 fXtru =
new TGeoXtru(zsections.size());
48 fXtru->SetName(name.data());
51 Int_t nv = polygon.size();
52 double* xv =
new double[nv];
53 double* yv =
new double[nv];
54 for (
unsigned int i = 0; i < polygon.size(); ++i) {
58 fXtru->DefinePolygon(nv, xv, yv);
61 for (
unsigned int i = 0; i < zsections.size(); ++i) {
75 :
VGM::ISolid(),
VGM::IExtrudedSolid(),
BaseVGM::VExtrudedSolid(), fXtru(xtru)
84 :
VGM::ISolid(),
VGM::IExtrudedSolid(),
BaseVGM::VExtrudedSolid(), fXtru(0)
92 VGM::IExtrudedSolid(rhs),
137 if (index < 0 || index > NofVertices()) {
138 std::cerr <<
"+++ Error +++" << std::endl;
139 std::cerr <<
" Wrong vertex index: " << index << std::endl;
153 if (iz < 0 || iz > NofZSections()) {
154 std::cerr <<
"+++ Error +++" << std::endl;
155 std::cerr <<
" Wrong index: " << iz << std::endl;
165 if (iz < 0 || iz > NofZSections()) {
166 std::cerr <<
"+++ Error +++" << std::endl;
167 std::cerr <<
" Wrong index: " << iz << std::endl;
178 if (iz < 0 || iz > NofZSections()) {
179 std::cerr <<
"+++ Error +++" << std::endl;
180 std::cerr <<
" Wrong index: " << iz << std::endl;
184 return fXtru->GetScale(iz);
VGM implementation for Root extruded solid.
virtual std::string Name() const
Return the name of this solid.
virtual int NofZSections() const
Return the number of planes perpendicular to the z axis.
virtual VGM::TwoVector Offset(int iz) const
Return the polygon offset in iz-th side.
virtual double ZPosition(int iz) const
Return the z position of the iz-th plane in mm.
int NofVertices() const
Return the number of vertices of outline polygon.
VGM::TwoVector Vertex(int index) const
Return the index-th vertex of outline polygon.
virtual double Scale(int iz) const
Return the polygon scale in iz-th side.
void AddSolid(VGM::ISolid *, TGeoShape *)
static SolidMap * Instance()
static double Length()
Return Root length unit in VGM units.
std::pair< double, double > TwoVector