A DDSolid represents the shape of a part. More...
#include <DDSolid.h>
Public Member Functions | |
DDSolid (void) | |
Uninitialilzed solid reference-object; for further details on reference-objects see documentation of DDLogicalPart. | |
DDSolid (const DDName &name) | |
Creates a reference-object to a solid named name. | |
const std::vector< double > & | parameters (void) const |
Give the parameters of the solid. | |
DDSolidShape | shape (void) const |
The type of the solid. | |
double | volume (void) const |
Returns the volume of the given solid (does not work with boolean soids !) | |
Private Member Functions | |
DDSolid (const DDName &, DDI::Solid *) | |
DDSolid (const DDName &, DDSolidShape, const std::vector< double > &) | |
Friends | |
class | DDDToPersFactory |
class | DDPersToDDDFactory |
struct | DDSolidFactory |
class | DDStreamer |
std::ostream & | operator<< (std::ostream &, const DDSolid &) |
A DDSolid represents the shape of a part.
An object of this class is a reference-object and thus is a lightweight class. It can be copied by value without having a large overhead. Assignment to the reference-object invalidates the object to which it was referred. Assignment also affects all other instances of this class which were created using the same value of DDName. In fact, the value of DDName identifies a DDSolid uniquely.
For further details concerning the usage of reference-objects refer to the documentation of DDLogicalPart.
DDSolid::DDSolid | ( | void | ) |
Uninitialilzed solid reference-object; for further details on reference-objects see documentation of DDLogicalPart.
Definition at line 58 of file DDSolid.cc.
: DDBase<DDName,Solid*>() { }
DDSolid::DDSolid | ( | const DDName & | name | ) |
Creates a reference-object to a solid named name.
If the solid was not yet created using one of the solid generating factory functions DDbox()
, DDtub
, ... this constructor creates a (default) initialized reference object named name. It can be used as placeholder everywhere and becomes a reference to a valid solid as soon as one of the factory functions DDBox
, ... has been called (using the same value for DDName).
For further details concerning reference-objects refer to the documentation of DDLogicalPart.
Definition at line 61 of file DDSolid.cc.
References DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::Solid * >::prep_.
: DDBase<DDName,Solid*>() { prep_ = StoreT::instance().create(n); }
DDSolid::DDSolid | ( | const DDName & | n, |
DDI::Solid * | s | ||
) | [private] |
Definition at line 66 of file DDSolid.cc.
References DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::Solid * >::prep_.
: DDBase<DDName,Solid*>() { prep_ = StoreT::instance().create(n,s); }
DDSolid::DDSolid | ( | const DDName & | n, |
DDSolidShape | s, | ||
const std::vector< double > & | p | ||
) | [private] |
Definition at line 72 of file DDSolid.cc.
References ddbox, ddcons, ddellipsoid, ddellipticaltube, ddorb, ddparallelepiped, ddpolycone_rrz, ddpolycone_rz, ddpolyhedra_rrz, ddpolyhedra_rz, ddpseudotrap, ddshapeless, ddsphere, ddtorus, ddtrap, ddtrunctubs, ddtubs, DDI::Singleton< I >::instance(), DDBase< DDName, DDI::Solid * >::prep_, and DDI::Solid::setParameters().
{ DDI::Solid * solid(0); std::vector<double> dummy; switch(s) { case ddbox: solid = new DDI::Box(0,0,0); break; case ddtubs: solid = new DDI::Tubs(0,0,0,0,0); break; case ddcons: solid = new DDI::Cons(0,0,0,0,0,0,0); break; case ddpseudotrap: solid = new DDI::PseudoTrap(0,0,0,0,0,0,0); break; case ddshapeless: solid = new DDI::Shapeless(); break; case ddtrap: solid = new DDI::Trap(0,0,0,0,0,0,0,0,0,0,0); break; case ddpolyhedra_rz: solid = new DDI::Polyhedra(0,0,0,dummy,dummy); break; case ddpolyhedra_rrz: solid = new DDI::Polyhedra(0,0,0,dummy,dummy,dummy); break; case ddpolycone_rz: solid = new DDI::Polycone(0,0,dummy,dummy); break; case ddpolycone_rrz: solid = new DDI::Polycone(0,0,dummy,dummy,dummy); break; case ddtrunctubs: solid = new DDI::TruncTubs(0,0,0,0,0,0,0,0); break; case ddtorus: solid = new DDI::Torus(0,0,0,0,0); break; case ddsphere: solid = new DDI::Sphere(0,0,0,0,0,0); break; case ddorb: solid = new DDI::Orb(0); break; case ddellipticaltube: solid = new DDI::EllipticalTube(0,0,0); break; case ddellipsoid: solid = new DDI::Ellipsoid(0,0,0,0,0); break; case ddparallelepiped: solid = new DDI::Parallelepiped(0,0,0,0,0,0); break; default: throw DDException("DDSolid::DDSolid(DDName,DDSolidShape,std::vector<double>: wrong shape"); } solid->setParameters(p); prep_ = StoreT::instance().create(n,solid); }
const std::vector< double > & DDSolid::parameters | ( | void | ) | const |
Give the parameters of the solid.
Definition at line 153 of file DDSolid.cc.
References DDBase< DDName, DDI::Solid * >::rep().
Referenced by CSCGeometryParsFromDD::build(), RPCGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), DDG4SolidConverter::convert(), TGeoFromDddService::createShape(), DDTruncTubs::cutInside(), ddstats(), DDEcalBarrelNewAlgo::execute(), DDEcalBarrelAlgo::execute(), DDEcalEndcapAlgo::execute(), DTGeometryParsFromDD::extractParameters(), DTGeometryBuilderFromDDD::extractParameters(), DDPolySolid::getVec(), HcalTB02SD::initMap(), ECalSD::initMap(), DreamSD::initMap(), HcalNumberingFromDDD::loadGeometry(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), DDCompareSolid::operator()(), DDCompareBoolSol::operator()(), DDPolyhedra::sides(), DDStreamer::solids_write(), and streamSolid().
{ return rep().parameters(); }
DDSolidShape DDSolid::shape | ( | void | ) | const |
The type of the solid.
Definition at line 147 of file DDSolid.cc.
References DDBase< DDName, DDI::Solid * >::rep().
Referenced by OutputDDToDDL::addToSolStore(), SolidsForOnline::beginRun(), CSCGeometryParsFromDD::build(), DDG4SolidConverter::convert(), TGeoFromDddService::createShape(), DDBox::DDBox(), DDCheckLP(), DDCons::DDCons(), DDEllipsoid::DDEllipsoid(), DDEllipticalTube::DDEllipticalTube(), DDIntersection::DDIntersection(), DDOrb::DDOrb(), DDParallelepiped::DDParallelepiped(), DDPolycone::DDPolycone(), DDPolyhedra::DDPolyhedra(), DDPseudoTrap::DDPseudoTrap(), DDShapelessSolid::DDShapelessSolid(), DDSphere::DDSphere(), DDSubtraction::DDSubtraction(), DDTorus::DDTorus(), DDTrap::DDTrap(), DDTruncTubs::DDTruncTubs(), DDTubs::DDTubs(), DDUnion::DDUnion(), DTGeometryParsFromDD::extractParameters(), DTGeometryBuilderFromDDD::extractParameters(), HcalTB02SD::initMap(), ECalSD::initMap(), DreamSD::initMap(), HcalNumberingFromDDD::loadGeometry(), DDLDivision::makeDivider(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), DDCompareSolid::operator()(), DDCompareBoolSol::operator()(), operator<<(), DDPolyhedra::rMaxVec(), DDPolycone::rMaxVec(), DDPolycone::rMinVec(), DDPolyhedra::rMinVec(), DDPolyhedra::rVec(), DDPolycone::rVec(), MagGeoBuilderFromDDD::volumeHandle::shape(), DDErrorDetection::so(), DDCoreToDDXMLOutput::solid(), DDStreamer::solids_write(), streamSolid(), DDG4SolidConverter::trunctubs(), MagGeoBuilderFromDDD::volumeHandle::volumeHandle(), DDPolyhedra::zVec(), and DDPolycone::zVec().
{ return rep().shape(); }
double DDSolid::volume | ( | void | ) | const |
Returns the volume of the given solid (does not work with boolean soids !)
Definition at line 136 of file DDSolid.cc.
References DDBase< DDName, DDI::Solid * >::rep().
Referenced by DDCompactViewImpl::weight().
{ return rep().volume(); }
friend struct DDSolidFactory [friend] |
friend class DDStreamer [friend] |
std::ostream& operator<< | ( | std::ostream & | os, |
const DDSolid & | solid | ||
) | [friend] |
Definition at line 36 of file DDSolid.cc.
{ DDBase<DDName,DDI::Solid*>::def_type defined(solid.isDefined()); if (defined.first) { os << *(defined.first) << " "; if (defined.second) { os << " " << DDSolidShapesName::name(solid.shape()) << ": "; solid.rep().stream(os); } else { os << "* solid not defined * "; } } else { os << "* solid not declared * "; } return os; }