CMS 3D CMS Logo

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 
11 namespace DDI {
12 
13  class Box : public Solid
14  {
15  public:
16  Box(double xHalf, double yHalf, double zHalf)
18  {
19  p_.emplace_back(xHalf);
20  p_.emplace_back(yHalf);
21  p_.emplace_back(zHalf);
22  }
23  ~Box() override { }
24 
25  double volume() const override { return 8.*p_[0]*p_[1]*p_[2]; }
26  void stream(std::ostream & os) const override;
27  };
28 
29 }
30 #endif // DDI_Box_h
Box(double xHalf, double yHalf, double zHalf)
Definition: Box.h:16
DDSolidShape
Definition: DDSolidShapes.h:4
void stream(std::ostream &os) const override
Definition: Box.cc:8
~Box() override
Definition: Box.h:23
double volume() const override
Definition: Box.h:25
std::vector< double > p_
Definition: Solid.h:32
Definition: Box.h:13