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