CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
DDExtrudedPolygon Class Reference

#include <DDSolid.h>

Inheritance diagram for DDExtrudedPolygon:
DDPolySolid DDSolid DDBase< DDName, DDI::Solid * >

Public Member Functions

 DDExtrudedPolygon (const DDSolid &s)
 
std::vector< double > xVec (void) const
 
std::vector< double > yVec (void) const
 
std::vector< double > zscaleVec (void) const
 
std::vector< double > zVec (void) const
 
std::vector< double > zxVec (void) const
 
std::vector< double > zyVec (void) const
 
- Public Member Functions inherited from DDPolySolid
 DDPolySolid (const DDSolid &s)
 
- Public Member Functions inherited from DDSolid
 DDSolid (void)
 Uninitialilzed solid reference-object; for further details on reference-objects see documentation of DDLogicalPart. More...
 
 DDSolid (const DDName &name)
 Creates a reference-object to a solid named name. More...
 
const std::vector< double > & parameters (void) const
 Give the parameters of the solid. More...
 
DDSolidShape shape (void) const
 The type of the solid. More...
 
double volume (void) const
 Returns the volume of the given solid (does not work with boolean soids !) More...
 
- Public Member Functions inherited from DDBase< DDName, DDI::Solid * >
 DDBase ()
 
const DDNameddname () const
 
def_type isDefined () const
 
bool isValid () const
 true, if the wrapped pointer is valid More...
 
const DDNamename () const
 
 operator bool () const
 
bool operator< (const DDBase &b) const
 
bool operator== (const DDBase &b) const
 
bool operator> (const DDBase &b) const
 
const DDI::rep_traits< DDName, DDI::Solid * >::reference rep () const
 
DDI::rep_traits< DDName, DDI::Solid * >::reference rep ()
 
std::string toString () const
 
const DDI::rep_traits< DDName, DDI::Solid * >::reference val () const
 
const DDI::rep_traits< DDName, DDI::Solid * >::reference val ()
 
virtual ~DDBase ()
 

Private Member Functions

 DDExtrudedPolygon (void)
 
auto xyPointsSize (void) const -> std::size_t
 
auto zSectionsSize (void) const -> std::size_t
 

Additional Inherited Members

- Public Types inherited from DDBase< DDName, DDI::Solid * >
typedef std::pair< const DDName *, bool > def_type
 
typedef DDI::Solidpimpl_type
 
typedef DDI::rep_type< DDName, pimpl_type > * prep_type
 
typedef DDI::Singleton< DDI::Store< DDName, DDI::Solid * > > StoreT
 
- Static Public Member Functions inherited from DDBase< DDName, DDI::Solid * >
static auto begin ()
 
static void clear ()
 
static auto end ()
 
static size_t size ()
 
- Protected Member Functions inherited from DDPolySolid
 DDPolySolid (void)
 
virtual std::vector< double > getVec (const size_t &which, const size_t &offset=0, const size_t &nVecs=1) const
 note defaults please. More...
 
- Protected Attributes inherited from DDBase< DDName, DDI::Solid * >
prep_type prep_
 

Detailed Description

Definition at line 267 of file DDSolid.h.

Constructor & Destructor Documentation

DDExtrudedPolygon::DDExtrudedPolygon ( const DDSolid s)

Definition at line 461 of file DDSolid.cc.

References ddextrudedpolygon, Exception, DDName::name(), DDBase< N, C >::name(), DDName::ns(), DDSolid::shape(), and AlCaHLTBitMon_QueryRunRegistry::string.

462  : DDPolySolid(s)
463 {
464  if( s.shape() != ddextrudedpolygon ) {
465  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDExtrudedPolygon.\n";
466  ex = ex + "Use a different solid interface!";
467  throw cms::Exception("DDException") << ex;
468  }
469 }
const N & name() const
Definition: DDBase.h:78
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:141
DDPolySolid(void)
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
DDExtrudedPolygon::DDExtrudedPolygon ( void  )
private

Member Function Documentation

std::vector< double > DDExtrudedPolygon::xVec ( void  ) const

Definition at line 497 of file DDSolid.cc.

References DDBase< DDName, DDI::Solid * >::rep(), and xyPointsSize().

Referenced by TGeoMgrFromDdd::createShape(), TGeoFromDddService::createShape(), HGCalGeomParameters::loadGeometryHexagon(), and DDCoreToDDXMLOutput::solid().

498 {
499  return std::vector<double>( rep().parameters().begin() + 1,
500  rep().parameters().begin() + 1 + xyPointsSize());
501 }
const DDI::rep_traits< DDName, DDI::Solid * >::reference rep() const
Definition: DDBase.h:84
auto xyPointsSize(void) const -> std::size_t
Definition: DDSolid.cc:472
auto DDExtrudedPolygon::xyPointsSize ( void  ) const -> std::size_t
private

Definition at line 472 of file DDSolid.cc.

References DDSolid::parameters(), DDBase< DDName, DDI::Solid * >::rep(), DDBase< DDName, DDI::Solid * >::size(), and zSectionsSize().

Referenced by xVec(), and yVec().

473 {
474  // Compute the size of the X and Y coordinate vectors
475  // which define the vertices of the outlined polygon
476  // defined in clock-wise order
477 
478  return ( rep().parameters().size() - 4 * zSectionsSize()) * 0.5;
479 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:147
const DDI::rep_traits< DDName, DDI::Solid * >::reference rep() const
Definition: DDBase.h:84
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:482
static size_t size()
Definition: DDBase.h:69
std::vector< double > DDExtrudedPolygon::yVec ( void  ) const

Definition at line 504 of file DDSolid.cc.

References DDBase< DDName, DDI::Solid * >::rep(), and xyPointsSize().

Referenced by TGeoMgrFromDdd::createShape(), TGeoFromDddService::createShape(), and DDCoreToDDXMLOutput::solid().

505 {
506  return std::vector<double>( rep().parameters().begin() + 1 + xyPointsSize(),
507  rep().parameters().begin() + 1 + 2 * xyPointsSize());
508 }
const DDI::rep_traits< DDName, DDI::Solid * >::reference rep() const
Definition: DDBase.h:84
auto xyPointsSize(void) const -> std::size_t
Definition: DDSolid.cc:472
std::vector< double > DDExtrudedPolygon::zscaleVec ( void  ) const

Definition at line 532 of file DDSolid.cc.

References DDBase< DDName, DDI::Solid * >::rep(), and zSectionsSize().

Referenced by TGeoMgrFromDdd::createShape(), TGeoFromDddService::createShape(), and DDCoreToDDXMLOutput::solid().

533 {
534  return std::vector<double>( rep().parameters().end() - zSectionsSize(),
535  rep().parameters().end());
536 }
const DDI::rep_traits< DDName, DDI::Solid * >::reference rep() const
Definition: DDBase.h:84
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:482
auto DDExtrudedPolygon::zSectionsSize ( void  ) const -> std::size_t
private

Definition at line 482 of file DDSolid.cc.

References DDBase< DDName, DDI::Solid * >::rep().

Referenced by xyPointsSize(), zscaleVec(), zVec(), zxVec(), and zyVec().

483 {
484  // The first parameters element stores a size of the four equal size vectors
485  // which form the ExtrudedPolygon shape Z sections:
486  //
487  // * first: Z coordinate of the XY polygone plane,
488  // * second and third: x and y offset of the polygone in the XY plane,
489  // * fourth: the polygone scale in each XY plane
490  //
491  // The Z sections defined by the z position in an increasing order.
492 
493  return rep().parameters()[0];
494 }
const DDI::rep_traits< DDName, DDI::Solid * >::reference rep() const
Definition: DDBase.h:84
std::vector< double > DDExtrudedPolygon::zVec ( void  ) const

Definition at line 511 of file DDSolid.cc.

References DDBase< DDName, DDI::Solid * >::rep(), and zSectionsSize().

Referenced by TGeoMgrFromDdd::createShape(), TGeoFromDddService::createShape(), HGCalGeomParameters::loadGeometryHexagon(), and DDCoreToDDXMLOutput::solid().

512 {
513  return std::vector<double>( rep().parameters().end() - 4 * zSectionsSize(),
514  rep().parameters().end() - 3 * zSectionsSize());
515 }
const DDI::rep_traits< DDName, DDI::Solid * >::reference rep() const
Definition: DDBase.h:84
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:482
std::vector< double > DDExtrudedPolygon::zxVec ( void  ) const

Definition at line 518 of file DDSolid.cc.

References DDBase< DDName, DDI::Solid * >::rep(), and zSectionsSize().

Referenced by TGeoMgrFromDdd::createShape(), TGeoFromDddService::createShape(), and DDCoreToDDXMLOutput::solid().

519 {
520  return std::vector<double>( rep().parameters().end() - 3 * zSectionsSize(),
521  rep().parameters().end() - 2 * zSectionsSize());
522 }
const DDI::rep_traits< DDName, DDI::Solid * >::reference rep() const
Definition: DDBase.h:84
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:482
std::vector< double > DDExtrudedPolygon::zyVec ( void  ) const

Definition at line 525 of file DDSolid.cc.

References DDBase< DDName, DDI::Solid * >::rep(), and zSectionsSize().

Referenced by TGeoMgrFromDdd::createShape(), TGeoFromDddService::createShape(), and DDCoreToDDXMLOutput::solid().

526 {
527  return std::vector<double>( rep().parameters().end() - 2 * zSectionsSize(),
528  rep().parameters().end() - zSectionsSize());
529 }
const DDI::rep_traits< DDName, DDI::Solid * >::reference rep() const
Definition: DDBase.h:84
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:482