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, std::unique_ptr< 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, std::unique_ptr< DDI::Solid > >
void create (const DDName &name, std::unique_ptr< DDI::Solid > vals)
 
void create (const DDName &name)
 
 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, std::unique_ptr< DDI::Solid > >::reference rep () const
 
DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep ()
 
std::string toString () const
 
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference val () const
 
const DDI::rep_traits< DDName, std::unique_ptr< 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, std::unique_ptr< DDI::Solid > >
using def_type = std::pair< const DDName *, bool >
 
using StoreT = DDI::Singleton< DDI::Store< DDName, std::unique_ptr< DDI::Solid > > >
 
- Static Public Member Functions inherited from DDBase< DDName, std::unique_ptr< DDI::Solid > >
static auto begin ()
 
static auto end ()
 
- 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...
 

Detailed Description

Definition at line 261 of file DDSolid.h.

Constructor & Destructor Documentation

DDExtrudedPolygon::DDExtrudedPolygon ( const DDSolid s)

Definition at line 437 of file DDSolid.cc.

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

438  : DDPolySolid(s)
439 {
441  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDExtrudedPolygon.\n";
442  ex = ex + "Use a different solid interface!";
443  throw cms::Exception("DDException") << ex;
444  }
445 }
const N & name() const
Definition: DDBase.h:74
DDPolySolid(void)=delete
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:67
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:138
const std::string & name() const
Returns the name.
Definition: DDName.cc:53
DDExtrudedPolygon::DDExtrudedPolygon ( void  )
delete

Member Function Documentation

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

Definition at line 473 of file DDSolid.cc.

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

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

474 {
475  return std::vector<double>( rep().parameters().begin() + 1,
476  rep().parameters().begin() + 1 + xyPointsSize());
477 }
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:80
auto xyPointsSize(void) const -> std::size_t
Definition: DDSolid.cc:448
auto DDExtrudedPolygon::xyPointsSize ( void  ) const -> std::size_t
private

Definition at line 448 of file DDSolid.cc.

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

Referenced by xVec(), and yVec().

449 {
450  // Compute the size of the X and Y coordinate vectors
451  // which define the vertices of the outlined polygon
452  // defined in clock-wise order
453 
454  return ( rep().parameters().size() - 4 * zSectionsSize()) * 0.5;
455 }
size
Write out results.
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:144
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:458
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:80
std::vector< double > DDExtrudedPolygon::yVec ( void  ) const

Definition at line 480 of file DDSolid.cc.

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

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

481 {
482  return std::vector<double>( rep().parameters().begin() + 1 + xyPointsSize(),
483  rep().parameters().begin() + 1 + 2 * xyPointsSize());
484 }
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:80
auto xyPointsSize(void) const -> std::size_t
Definition: DDSolid.cc:448
std::vector< double > DDExtrudedPolygon::zscaleVec ( void  ) const

Definition at line 508 of file DDSolid.cc.

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

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

509 {
510  return std::vector<double>( rep().parameters().end() - zSectionsSize(),
511  rep().parameters().end());
512 }
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:458
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:80
auto DDExtrudedPolygon::zSectionsSize ( void  ) const -> std::size_t
private

Definition at line 458 of file DDSolid.cc.

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

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

459 {
460  // The first parameters element stores a size of the four equal size vectors
461  // which form the ExtrudedPolygon shape Z sections:
462  //
463  // * first: Z coordinate of the XY polygone plane,
464  // * second and third: x and y offset of the polygone in the XY plane,
465  // * fourth: the polygone scale in each XY plane
466  //
467  // The Z sections defined by the z position in an increasing order.
468 
469  return rep().parameters()[0];
470 }
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:80
std::vector< double > DDExtrudedPolygon::zVec ( void  ) const

Definition at line 487 of file DDSolid.cc.

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

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

488 {
489  return std::vector<double>( rep().parameters().end() - 4 * zSectionsSize(),
490  rep().parameters().end() - 3 * zSectionsSize());
491 }
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:458
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:80
std::vector< double > DDExtrudedPolygon::zxVec ( void  ) const

Definition at line 494 of file DDSolid.cc.

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

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

495 {
496  return std::vector<double>( rep().parameters().end() - 3 * zSectionsSize(),
497  rep().parameters().end() - 2 * zSectionsSize());
498 }
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:458
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:80
std::vector< double > DDExtrudedPolygon::zyVec ( void  ) const

Definition at line 501 of file DDSolid.cc.

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

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

502 {
503  return std::vector<double>( rep().parameters().end() - 2 * zSectionsSize(),
504  rep().parameters().end() - zSectionsSize());
505 }
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:458
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:80