CMS 3D CMS Logo

List of all members | Public Member Functions
DDI::ExtrudedPolygon Class Reference

#include <ExtrudedPolygon.h>

Inheritance diagram for DDI::ExtrudedPolygon:
DDI::Solid

Public Member Functions

 ExtrudedPolygon (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::vector< double > &zx, const std::vector< double > &zy, const std::vector< double > &zscale)
 
void stream (std::ostream &) const override
 
double volume () const override
 
- Public Member Functions inherited from DDI::Solid
const std::vector< double > & parameters () const
 
void setParameters (std::vector< double > const &p)
 
DDSolidShape shape () const
 
 Solid ()
 
 Solid (DDSolidShape shape)
 
virtual ~Solid ()
 

Additional Inherited Members

- Protected Attributes inherited from DDI::Solid
std::vector< double > p_
 
DDSolidShape shape_
 

Detailed Description

Definition at line 11 of file ExtrudedPolygon.h.

Constructor & Destructor Documentation

◆ ExtrudedPolygon()

ExtrudedPolygon::ExtrudedPolygon ( const std::vector< double > &  x,
const std::vector< double > &  y,
const std::vector< double > &  z,
const std::vector< double > &  zx,
const std::vector< double > &  zy,
const std::vector< double > &  zscale 
)

Definition at line 13 of file ExtrudedPolygon.cc.

20  assert(x.size() == y.size());
21  assert(z.size() == zx.size());
22  assert(z.size() == zy.size());
23  assert(z.size() == zscale.size());
24 
25  p_.reserve(x.size() + y.size() + z.size() + zx.size() + zy.size() + zscale.size() + 1);
26  p_.emplace_back(z.size());
27  p_.insert(p_.end(), x.begin(), x.end());
28  p_.insert(p_.end(), y.begin(), y.end());
29  p_.insert(p_.end(), z.begin(), z.end());
30  p_.insert(p_.end(), zx.begin(), zx.end());
31  p_.insert(p_.end(), zy.begin(), zy.end());
32  p_.insert(p_.end(), zscale.begin(), zscale.end());
33 }

References cms::cuda::assert(), ddextrudedpolygon, and DDI::Solid::p_.

Member Function Documentation

◆ stream()

void DDI::ExtrudedPolygon::stream ( std::ostream &  os) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 41 of file ExtrudedPolygon.cc.

41  {
42  auto xysize = (unsigned int)((p_.size() - 4 * p_[0]) * 0.5);
43  os << " XY Points[cm]=";
44  for (unsigned int k = 1; k <= xysize; ++k)
45  os << convertMmToCm(p_[k]) << ", " << convertMmToCm(p_[k + xysize]) << "; ";
46  os << " with " << p_[0] << " Z sections:";
47  unsigned int m0 = p_.size() - 4 * p_[0];
48  for (unsigned int m = m0; m < m0 + p_[0]; ++m) {
49  os << " z[cm]=" << convertMmToCm(p_[m]);
50  os << ", x[cm]=" << convertMmToCm(p_[m + p_[0]]);
51  os << ", y[cm]=" << convertMmToCm(p_[m + 2 * p_[0]]);
52  os << ", scale[cm]=" << convertMmToCm(p_[m + 3 * p_[0]]) << ";";
53  }
54 }

References geant_units::operators::convertMmToCm(), createfilelist::int, dqmdumpme::k, and visualization-live-secondInstance_cfg::m.

◆ volume()

double ExtrudedPolygon::volume ( void  ) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 35 of file ExtrudedPolygon.cc.

35  {
36  double volume = 0;
37  /* FIXME: volume is not implemented */
38  return volume;
39 }
DDI::ExtrudedPolygon::volume
double volume() const override
Definition: ExtrudedPolygon.cc:35
DDAxes::y
cms::cuda::assert
assert(be >=bs)
DDAxes::x
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
DDAxes::z
dqmdumpme.k
k
Definition: dqmdumpme.py:60
DDI::Solid::Solid
Solid()
Definition: Solid.h:12
createfilelist.int
int
Definition: createfilelist.py:10
DDSolidShape::ddextrudedpolygon
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:63
DDI::Solid::p_
std::vector< double > p_
Definition: Solid.h:30