GeoModel - GeoModelCore
GeoUnidentifiedShape.cxx
1 #include "GeoModelKernel/GeoUnidentifiedShape.h"
2 #include "GeoModelKernel/Query.h"
3 #include "GeoModelKernel/GeoShapeAction.h"
4 
5 const std::string GeoUnidentifiedShape::_classType="UnidentifiedShape";
6 const ShapeType GeoUnidentifiedShape::_classTypeID=0xFFFFFFFF;
7 
8 // Destructor:
9 GeoUnidentifiedShape::~GeoUnidentifiedShape() {
10 }
11 
12 // Constructor:
13 GeoUnidentifiedShape::GeoUnidentifiedShape(const std::string & name):
14  _name(name) {}
15 
16 // Constructor:
17 GeoUnidentifiedShape::GeoUnidentifiedShape(const std::string & name, const std::string & asciiData) :
18  _name(name),
19  _asciiData(asciiData) {}
20 
21 // Constructor with volume:
22 GeoUnidentifiedShape::GeoUnidentifiedShape(const std::string & name, const std::string & asciiData, double volume):
23  _name(name),
24  _asciiData(asciiData),
25  _volume(volume) {}
26 
27 // Returns the user-provided name of the volume (eg "MySpecialShape");
28 const std::string & GeoUnidentifiedShape::name() const {
29  return _name;
30 }
31 
32 // Returns the ascii data associated with this object (possibly empty);
33 const std::string & GeoUnidentifiedShape::asciiData() const {
34  return _asciiData;
35 }
36 
37 // Returns the volume of the shape, for mass inventory
38 double GeoUnidentifiedShape::volume () const {
39  return _volume;
40 }
41 
42 // Returns the shape type, as a string.
43 const std::string & GeoUnidentifiedShape::type () const {
44  return _classType;
45 }
46 
47 // Returns the shape type, as an coded integer.
48 ShapeType GeoUnidentifiedShape::typeID () const {
49  return _classTypeID;
50 }
51 
52 // Executes a GeoShapeAction
53 void GeoUnidentifiedShape::exec (GeoShapeAction *action) const {
54  action->handleUnidentifiedShape(this);
55 }
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...