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)
 
 DDExtrudedPolygon (void)=delete
 
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)
 
 DDPolySolid (void)=delete
 
- 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

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
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 276 of file DDSolid.h.

Constructor & Destructor Documentation

DDExtrudedPolygon::DDExtrudedPolygon ( const DDSolid s)

Definition at line 464 of file DDSolid.cc.

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

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

Member Function Documentation

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

Definition at line 500 of file DDSolid.cc.

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

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

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

Definition at line 475 of file DDSolid.cc.

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

Referenced by xVec(), and yVec().

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

Definition at line 507 of file DDSolid.cc.

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

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

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

Definition at line 535 of file DDSolid.cc.

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

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

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

Definition at line 485 of file DDSolid.cc.

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

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

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

Definition at line 514 of file DDSolid.cc.

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

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

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

Definition at line 521 of file DDSolid.cc.

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

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

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

Definition at line 528 of file DDSolid.cc.

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

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

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