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
 
double volume () const
 
- 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 ( 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.

References DDI::Solid::p_.

19 {
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 }
float float float z
T x() const
Cartesian x coordinate.
Solid()
Definition: Solid.h:14
std::vector< double > p_
Definition: Solid.h:32

Member Function Documentation

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

Reimplemented from DDI::Solid.

Definition at line 43 of file ExtrudedPolygon.cc.

References createfilelist::int, gen::k, funct::m, and DDI::Solid::p_.

44 {
45  auto xysize = ( unsigned int )(( p_.size() - 4*p_[0]) * 0.5 );
46  os << " XY Points[cm]=";
47  for( unsigned int k = 1; k <= xysize; ++k )
48  os << p_[k]/cm << ", " << p_[k + xysize]/cm << "; ";
49  os << " with " << p_[0] << " Z sections:";
50  unsigned int m0 = p_.size() - 4*p_[0];
51  for( unsigned int m = m0; m < m0 + p_[0]; ++m )
52  {
53  os << " z[cm]=" << p_[m]/cm;
54  os << ", x[cm]=" << p_[m+p_[0]]/cm;
55  os << ", y[cm]=" << p_[m+2*p_[0]]/cm;
56  os << ", scale[cm]=" << p_[m+3*p_[0]]/cm << ";";
57  }
58 }
int k[5][pyjets_maxn]
std::vector< double > p_
Definition: Solid.h:32
double ExtrudedPolygon::volume ( void  ) const
virtual

Reimplemented from DDI::Solid.

Definition at line 35 of file ExtrudedPolygon.cc.

36 {
37  double volume = 0;
38  /* FIXME: volume is not implemented */
39  return volume;
40 }
double volume() const