CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Box.h
Go to the documentation of this file.
1 #ifndef DDI_Box_h
2 #define DDI_Box_h
3 
4 #include <iosfwd>
5 #include <vector>
6 
8 #include "Solid.h"
9 
10 namespace DDI {
11 
12  class Box : public Solid {
13  public:
14  Box(double xHalf, double yHalf, double zHalf) : Solid(DDSolidShape::ddbox) {
15  p_.emplace_back(xHalf);
16  p_.emplace_back(yHalf);
17  p_.emplace_back(zHalf);
18  }
19  ~Box() override {}
20 
21  double volume() const override { return 8. * p_[0] * p_[1] * p_[2]; }
22  void stream(std::ostream& os) const override;
23  };
24 
25 } // namespace DDI
26 #endif // DDI_Box_h
Box(double xHalf, double yHalf, double zHalf)
Definition: Box.h:14
void stream(std::ostream &os) const override
Definition: Box.cc:8
~Box() override
Definition: Box.h:19
double volume() const override
Definition: Box.h:21
Definition: Assembly.h:7
DDSolidShape
Definition: DDSolidShapes.h:6
std::vector< double > p_
Definition: Solid.h:30
Definition: Box.h:12