CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 "Solid.h"
6 
7 
8 namespace DDI {
9 
10  class Box : public Solid
11  {
12  public:
13  Box(double xHalf, double yHalf, double zHalf)
14  : Solid(ddbox)
15  {
16  p_.push_back(xHalf);
17  p_.push_back(yHalf);
18  p_.push_back(zHalf);
19  }
20  ~Box() { }
21 
22  double volume() const { return 8.*p_[0]*p_[1]*p_[2]; }
23  void stream(std::ostream & os) const;
24  };
25 
26 }
27 #endif // DDI_Box_h
Box(double xHalf, double yHalf, double zHalf)
Definition: Box.h:13
~Box()
Definition: Box.h:20
std::vector< double > p_
Definition: Solid.h:41
void stream(std::ostream &os) const
Definition: Box.cc:5
Definition: Box.h:10
double volume() const
Definition: Box.h:22