Bayeux  3.4.1
Core Foundation library for SuperNEMO
i_shape_2d.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2008-05-23
4  * Last modified: 2015-02-24
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Interface for 2D shaped surfaces
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_I_SHAPE_2D_H
17 #define GEOMTOOLS_I_SHAPE_2D_H 1
18 
19 // Standard library:
20 #include <string>
21 
22 // Third party:
23 // - Bayeux/datatools:
24 #include <datatools/bit_mask.h>
25 #include <datatools/handle.h>
26 #include <datatools/ocd_macros.h>
27 
28 // This project:
29 #include <geomtools/utils.h>
30 #include <geomtools/i_object_3d.h>
33 
34 namespace geomtools {
35 
37  class i_shape_2d : public i_object_3d,
38  public i_find_intercept,
40  {
41  public:
42 
50  };
51 
53  static const uint32_t ALL_PIECES = 0xFFFFFFFF;
54 
56  virtual bool has_number_of_sides() const;
57 
59  virtual unsigned int get_number_of_sides() const;
60 
62  virtual bool has_perimeter(uint32_t flags_ = ALL_PIECES) const;
63 
65  virtual double get_perimeter(uint32_t flags_ = ALL_PIECES) const;
66 
68  virtual bool has_surface(uint32_t flags_ = ALL_PIECES) const;
69 
71  virtual double get_surface(uint32_t flags_ = ALL_PIECES) const;
72 
74  int get_dimensional() const;
75 
77  i_shape_2d();
78 
80  i_shape_2d(double tolerance_);
81 
83  i_shape_2d(double tolerance_, double angular_tolerance_);
84 
86  virtual ~i_shape_2d();
87 
93  virtual bool is_on_surface(const vector_3d & position_,
94  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const = 0;
95 
101  virtual vector_3d get_normal_on_surface(const vector_3d & position_,
102  bool check_ = false,
103  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const = 0;
104 
110 
111  // Serialization interface
113 
114  };
115 
119 
120 } // end of namespace geomtools
121 
122 /*
123 // Class version:
124 #include <boost/serialization/version.hpp>
125 BOOST_CLASS_VERSION(geomtools::i_shape_2d, 0)
126 */
127 
128 #endif // GEOMTOOLS_I_SHAPE_2D_H
129 
130 /*
131 ** Local Variables: --
132 ** mode: c++ --
133 ** c-file-style: "gnu" --
134 ** tab-width: 2 --
135 ** End: --
136 */
Mother abstract class for all 3D object classes.
Definition: i_object_3d.h:49
virtual double get_surface(uint32_t flags_=ALL_PIECES) const
Return the surface.
Abstract interface for all objects for which we can compute the intercept with a ray emitted from a p...
Definition: i_find_intercept.h:32
virtual unsigned int get_number_of_sides() const
Return the number of associated sides.
virtual double get_perimeter(uint32_t flags_=ALL_PIECES) const
Return the perimeter.
static const uint32_t bit01
Definition: bit_mask.h:28
Invalid face.
Definition: i_shape_2d.h:45
Definition: i_shape_2d.h:49
virtual bool has_surface(uint32_t flags_=ALL_PIECES) const
Check if the 2D shape surface is defined.
An object that describes the way an object of a given class can be configured through properties.
Definition: object_configuration_description.h:234
virtual bool has_perimeter(uint32_t flags_=ALL_PIECES) const
Check if the 2D shape known its perimeter.
#define DATATOOLS_SERIALIZATION_DECLARATION()
Definition: i_serializable.h:266
Up face.
Definition: i_shape_2d.h:46
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
shape_2d_handle_type face_handle_type
Definition: i_shape_2d.h:118
virtual bool has_number_of_sides() const
Check if the 2D shape knows its number of associated sides.
static const uint32_t ALL_PIECES
Special flag representing all pieces composing a 2D shape.
Definition: i_shape_2d.h:53
Templatized handle class that wraps a Boost shared pointer and behaves like a reference.
Definition: handle.h:114
i_shape_2d()
Default constructor.
virtual bool is_on_surface(const vector_3d &position_, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const =0
int get_dimensional() const
Return the dimension of the object.
static const uint32_t FACE_BITS_NONE
No valid or known face bit.
Definition: face_identifier.h:45
virtual ~i_shape_2d()
Destructor.
static void init_ocd(datatools::object_configuration_description &ocd_)
The abstract base class for all 2D shapes/surfaces.
Definition: i_shape_2d.h:37
brief Abstract interface for objects that can describe themselves as a collection of polylines for 3D...
Definition: i_wires_3d_rendering.h:39
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
Down face.
Definition: i_shape_2d.h:48
virtual vector_3d get_normal_on_surface(const vector_3d &position_, bool check_=false, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const =0
static const uint32_t bit00
Definition: bit_mask.h:27
faces_mask_type
The up/down identifier of the face.
Definition: i_shape_2d.h:44
datatools::handle< i_shape_2d > shape_2d_handle_type
Type aliases for a handle to a 2D shape.
Definition: i_shape_2d.h:117
Unique face.
Definition: i_shape_2d.h:47
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39