Bayeux
3.4.1
Core Foundation library for SuperNEMO
bayeux
geomtools
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
>
31
#include <
geomtools/i_find_intercept.h
>
32
#include <
geomtools/i_wires_3d_rendering.h
>
33
34
namespace
geomtools
{
35
37
class
i_shape_2d
:
public
i_object_3d
,
38
public
i_find_intercept
,
39
public
i_wires_3d_rendering
40
{
41
public
:
42
44
enum
faces_mask_type
{
45
FACE_NONE
=
face_identifier::FACE_BITS_NONE
,
46
FACE_UNIQUE
=
datatools::bit_mask::bit00
,
47
FACE_UP
=
FACE_UNIQUE
,
48
FACE_DOWN
=
datatools::bit_mask::bit01
,
49
FACE_ALL
=
FACE_UNIQUE
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
109
static
void
init_ocd
(
datatools::object_configuration_description
& ocd_);
110
111
// Serialization interface
112
DATATOOLS_SERIALIZATION_DECLARATION
()
113
114
};
115
117
typedef
datatools::handle<i_shape_2d>
shape_2d_handle_type
;
118
typedef
shape_2d_handle_type
face_handle_type
;
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
*/
geomtools::i_object_3d
Mother abstract class for all 3D object classes.
Definition:
i_object_3d.h:49
geomtools::i_shape_2d::get_surface
virtual double get_surface(uint32_t flags_=ALL_PIECES) const
Return the surface.
geomtools::i_find_intercept
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
i_object_3d.h
geomtools::i_shape_2d::get_number_of_sides
virtual unsigned int get_number_of_sides() const
Return the number of associated sides.
geomtools::i_shape_2d::get_perimeter
virtual double get_perimeter(uint32_t flags_=ALL_PIECES) const
Return the perimeter.
i_find_intercept.h
datatools::bit_mask::bit01
static const uint32_t bit01
Definition:
bit_mask.h:28
geomtools::i_shape_2d::FACE_NONE
Invalid face.
Definition:
i_shape_2d.h:45
geomtools::i_shape_2d::FACE_ALL
Definition:
i_shape_2d.h:49
geomtools::i_shape_2d::has_surface
virtual bool has_surface(uint32_t flags_=ALL_PIECES) const
Check if the 2D shape surface is defined.
datatools::object_configuration_description
An object that describes the way an object of a given class can be configured through properties.
Definition:
object_configuration_description.h:234
geomtools::i_shape_2d::has_perimeter
virtual bool has_perimeter(uint32_t flags_=ALL_PIECES) const
Check if the 2D shape known its perimeter.
DATATOOLS_SERIALIZATION_DECLARATION
#define DATATOOLS_SERIALIZATION_DECLARATION()
Definition:
i_serializable.h:266
geomtools::i_shape_2d::FACE_UNIQUE
Up face.
Definition:
i_shape_2d.h:46
handle.h
GEOMTOOLS_PROPER_TOLERANCE
#define GEOMTOOLS_PROPER_TOLERANCE
Definition:
geomtools_config.h:26
geomtools::face_handle_type
shape_2d_handle_type face_handle_type
Definition:
i_shape_2d.h:118
geomtools::i_shape_2d::has_number_of_sides
virtual bool has_number_of_sides() const
Check if the 2D shape knows its number of associated sides.
geomtools::i_shape_2d::ALL_PIECES
static const uint32_t ALL_PIECES
Special flag representing all pieces composing a 2D shape.
Definition:
i_shape_2d.h:53
datatools::handle
Templatized handle class that wraps a Boost shared pointer and behaves like a reference.
Definition:
handle.h:114
geomtools::i_shape_2d::i_shape_2d
i_shape_2d()
Default constructor.
geomtools::i_shape_2d::is_on_surface
virtual bool is_on_surface(const vector_3d &position_, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const =0
geomtools::i_shape_2d::get_dimensional
int get_dimensional() const
Return the dimension of the object.
geomtools::face_identifier::FACE_BITS_NONE
static const uint32_t FACE_BITS_NONE
No valid or known face bit.
Definition:
face_identifier.h:45
geomtools::i_shape_2d::~i_shape_2d
virtual ~i_shape_2d()
Destructor.
geomtools::i_shape_2d::init_ocd
static void init_ocd(datatools::object_configuration_description &ocd_)
utils.h
geomtools::i_shape_2d
The abstract base class for all 2D shapes/surfaces.
Definition:
i_shape_2d.h:37
geomtools::i_wires_3d_rendering
brief Abstract interface for objects that can describe themselves as a collection of polylines for 3D...
Definition:
i_wires_3d_rendering.h:39
geomtools::vector_3d
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition:
clhep.h:63
ocd_macros.h
bit_mask.h
geomtools::i_shape_2d::FACE_DOWN
Down face.
Definition:
i_shape_2d.h:48
geomtools::i_shape_2d::get_normal_on_surface
virtual vector_3d get_normal_on_surface(const vector_3d &position_, bool check_=false, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const =0
datatools::bit_mask::bit00
static const uint32_t bit00
Definition:
bit_mask.h:27
geomtools::i_shape_2d::faces_mask_type
faces_mask_type
The up/down identifier of the face.
Definition:
i_shape_2d.h:44
i_wires_3d_rendering.h
geomtools::shape_2d_handle_type
datatools::handle< i_shape_2d > shape_2d_handle_type
Type aliases for a handle to a 2D shape.
Definition:
i_shape_2d.h:117
geomtools::i_shape_2d::FACE_UP
Unique face.
Definition:
i_shape_2d.h:47
geomtools
Top-level namespace of the Bayeux/geomtools module library.
Definition:
electromagnetic_field_manager.h:39
Generated by
1.8.15