GeoModel - GeoModelCore
GeoShapeUnion.h
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELKERNEL_GEOSHAPEUNION_H
6 #define GEOMODELKERNEL_GEOSHAPEUNION_H
7 
8 #include "GeoModelKernel/GeoShape.h"
9 
10 #ifndef _GeoShapePersistification_On_
11  class Persistifier;
12 #endif
13 
14 class GeoShapeUnion : public GeoShape
15 {
16  public:
17  GeoShapeUnion (const GeoShape* A, const GeoShape* B);
18 
19  // Returns the volume of the shape, for mass inventory
20  virtual double volume () const;
21 
22  // Returns the OR shape type, as a string.
23  virtual const std::string & type () const;
24 
25  // Returns the OR shape type, as a coded integer.
26  virtual ShapeType typeID () const;
27 
28  // Returns the first operand being ORed
29  const GeoShape* getOpA () const;
30 
31  // Returns the second operand being ORed.
32  const GeoShape* getOpB () const;
33 
34  // Executes a GeoShapeAction
35  virtual void exec (GeoShapeAction *action) const;
36 
37  // For type identification.
38  static const std::string& getClassType ();
39 
40  // For type identification.
41  static ShapeType getClassTypeID ();
42 
43  protected:
44  virtual ~GeoShapeUnion();
45 
46  private:
47  GeoShapeUnion(const GeoShapeUnion &right);
48  GeoShapeUnion & operator=(const GeoShapeUnion &right);
49 
50  // The first shape operand in the OR operation.
51  const GeoShape* m_opA;
52 
53  // The second shape operand in the OR operation.
54  const GeoShape* m_opB;
55 
56  static const std::string s_classType;
57  static const ShapeType s_classTypeID;
58 
59  // For I/O only!
60  GeoShapeUnion(){}
61  friend Persistifier;
62 
63 };
64 
65 inline const std::string& GeoShapeUnion::getClassType ()
66 {
67  return s_classType;
68 }
69 
70 inline ShapeType GeoShapeUnion::getClassTypeID ()
71 {
72  return s_classTypeID;
73 }
74 
75 #endif
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...
This class describes a Shape. Shapes will be able to do the following things:
Definition: GeoShape.h:38