GeoModel - GeoModelCore
GeoShape.h
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELKERNEL_GEOSHAPE_H
6 #define GEOMODELKERNEL_GEOSHAPE_H
7 
27 #include "GeoModelKernel/RCBase.h"
28 #include <GeoModelKernel/GeoDefinitions.h>
29 #include <string>
30 
31 typedef unsigned int ShapeType;
33 class GeoShapeUnion;
35 class GeoShapeShift;
36 class GeoShapeAction;
37 
38 class GeoShape : public RCBase
39 {
40  public:
41  // Constructor for shape. Must provide the name, a string to identify this shape.
42  GeoShape ();
43 
44  // Returns the volume of the shape, for mass inventory
45  virtual double volume () const = 0;
46 
47  // Boolean OR operation for shapes
48  const GeoShapeUnion & add (const GeoShape& shape) const;
49 
50  // Subtraction operation for shapes.
51  const GeoShapeSubtraction & subtract (const GeoShape& shape) const;
52 
53  // Intersection of shapes.
54  const GeoShapeIntersection & intersect (const GeoShape& shape) const;
55 
56  // Shift shapes, for boolean operations.
57  const GeoShapeShift & operator << (const GeoTrf::Transform3D &shift) const;
58 
59  // Returns the shape type, as a string.
60  virtual const std::string & type () const = 0;
61 
62  // Returns the shape type, as an coded integer.
63  virtual ShapeType typeID () const = 0;
64 
65  // Executes a GeoShapeAction
66  virtual void exec (GeoShapeAction *action) const = 0;
67 
68  protected:
69  virtual ~GeoShape();
70 
71  private:
72  GeoShape(const GeoShape &right);
73  GeoShape & operator=(const GeoShape &right);
74 
75 };
76 
77 #endif
This is a base class for objects whose memory is managed through reference counting. Reference-counted objects can only be created using operator new, the cannot be created on the stack.
Definition: RCBase.h:24
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