GeoModel - GeoModelCore
GeoBox.cxx
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GeoModelKernel/GeoBox.h"
6 #include "GeoModelKernel/GeoShapeAction.h"
7 
8 const std::string GeoBox::s_classType = "Box";
9 const ShapeType GeoBox::s_classTypeID = 0x10;
10 
11 GeoBox::GeoBox (double XHalfLength, double YHalfLength, double ZHalfLength)
12  : m_xHalfLength (XHalfLength)
13  , m_yHalfLength (YHalfLength)
14  , m_zHalfLength (ZHalfLength)
15 {
16 }
17 
18 GeoBox::~GeoBox()
19 {
20 }
21 
22 double GeoBox::volume () const
23 {
24  return 8.0 * m_xHalfLength * m_yHalfLength * m_zHalfLength;
25 }
26 
27 const std::string & GeoBox::type () const
28 {
29  return s_classType;
30 }
31 
32 ShapeType GeoBox::typeID () const
33 {
34  return s_classTypeID;
35 }
36 
37 void GeoBox::exec (GeoShapeAction *action) const
38 {
39  action->handleBox(this);
40 }
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...