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