CMS 3D CMS Logo

List of all members | Public Member Functions
DDI::Box Class Reference

#include <Box.h>

Inheritance diagram for DDI::Box:
DDI::Solid

Public Member Functions

 Box (double xHalf, double yHalf, double zHalf)
 
void stream (std::ostream &os) const override
 
double volume () const override
 
 ~Box () override
 
- 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 13 of file Box.h.

Constructor & Destructor Documentation

DDI::Box::Box ( double  xHalf,
double  yHalf,
double  zHalf 
)
inline

Definition at line 16 of file Box.h.

References ddbox, and DDI::Solid::p_.

18  {
19  p_.emplace_back(xHalf);
20  p_.emplace_back(yHalf);
21  p_.emplace_back(zHalf);
22  }
Solid()
Definition: Solid.h:14
std::vector< double > p_
Definition: Solid.h:32
DDI::Box::~Box ( )
inlineoverride

Definition at line 23 of file Box.h.

23 { }

Member Function Documentation

void DDI::Box::stream ( std::ostream &  os) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 8 of file Box.cc.

References DDI::Solid::p_.

Referenced by volume().

9 {
10  os << " xhalf[cm]=" << p_[0]/cm
11  << " yhalf[cm]=" << p_[1]/cm
12  << " zhalf[cm]=" << p_[2]/cm;
13 }
std::vector< double > p_
Definition: Solid.h:32
double DDI::Box::volume ( void  ) const
inlineoverridevirtual

Reimplemented from DDI::Solid.

Definition at line 25 of file Box.h.

References DDI::Solid::p_, and stream().

25 { return 8.*p_[0]*p_[1]*p_[2]; }
std::vector< double > p_
Definition: Solid.h:32