GeoModel - GeoModelCore
GeoCons.cxx
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GeoModelKernel/GeoCons.h"
6 #include "GeoModelKernel/GeoShapeAction.h"
7 
8 const std::string GeoCons::s_classType = "Cons";
9 const ShapeType GeoCons::s_classTypeID = 0x11;
10 
11 GeoCons::GeoCons (double RMin1, double RMin2, double RMax1, double RMax2, double DZ, double SPhi, double DPhi)
12  : m_rMin1 (RMin1)
13  , m_rMin2 (RMin2)
14  , m_rMax1 (RMax1)
15  , m_rMax2 (RMax2)
16  , m_dZ (DZ)
17  , m_sPhi (SPhi)
18  , m_dPhi (DPhi)
19 {
20 }
21 
22 GeoCons::~GeoCons()
23 {
24 }
25 
26 double GeoCons::volume () const
27 {
28  return (m_dPhi * (1./3)) * m_dZ * (m_rMax1 * m_rMax1 + m_rMax2 * m_rMax2 + m_rMax1 * m_rMax2
29  - m_rMin1 * m_rMin1 - m_rMin2 * m_rMin2 -
30  m_rMin1 * m_rMin2);
31 }
32 
33 const std::string & GeoCons::type () const
34 {
35  return s_classType;
36 }
37 
38 ShapeType GeoCons::typeID () const
39 {
40  return s_classTypeID;
41 }
42 
43 void GeoCons::exec (GeoShapeAction *action) const
44 {
45  action->handleCons(this);
46 }
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...