Bayeux  3.4.1
Core Foundation library for SuperNEMO
composite_surface.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2015-03-17
4  * Last modified: 2015-03-17
5  *
6  * License:
7  *
8  * Description:
9  *
10  * A 2D surface composed of elementary 2D surfaces
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GEOMTOOLS_COMPOSITE_SURFACE_H
17 #define GEOMTOOLS_COMPOSITE_SURFACE_H 1
18 
19 // This project:
20 #include <geomtools/i_shape_2d.h>
21 #include <geomtools/face_info.h>
22 
23 namespace geomtools {
24 
27  {
28  public:
29 
31  static const std::string & composite_surface_label();
32 
34  virtual std::string get_shape_name() const;
35 
37  bool is_valid() const;
38 
41 
43  composite_surface(double tolerance_);
44 
46  composite_surface(double tolerance_, double angular_tolerance_);
47 
49  virtual ~composite_surface();
50 
52  void initialize(const datatools::properties &, const handle_dict_type * = 0);
53 
55  void reset();
56 
58  unsigned int get_number_of_surfaces() const;
59 
62 
64  face_info & add();
65 
67  void remove_last();
68 
70  const face_info & get(unsigned int index_) const;
71 
73  virtual double get_surface(uint32_t flags_ = ALL_PIECES) const;
74 
76  virtual double get_perimeter(uint32_t flags_ = ALL_PIECES) const;
77 
83  virtual bool is_on_surface(const vector_3d & position_,
84  double skin_ = GEOMTOOLS_PROPER_TOLERANCE
85  ) const;
86 
92  virtual vector_3d get_normal_on_surface(const vector_3d & position_,
93  bool check_ = false,
94  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
95 
97  virtual bool find_intercept(const vector_3d & from_,
98  const vector_3d & direction_,
99  face_intercept_info & intercept_,
100  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
101 
103  virtual void tree_dump(std::ostream & out_ = std::clog,
104  const std::string & title_ = "",
105  const std::string & indent_ = "",
106  bool inherit_= false) const;
107 
109  virtual void generate_wires_self(wires_type & wires_,
110  uint32_t options_ = 0) const;
111 
112  private:
113 
114  face_info_collection_type _surfaces_;
115 
116  };
117 
118 } // end of namespace geomtools
119 
120 #endif // GEOMTOOLS_COMPOSITE_SURFACE_H
121 
122 /*
123 ** Local Variables: --
124 ** mode: c++ --
125 ** c-file-style: "gnu" --
126 ** tab-width: 2 --
127 ** End: --
128 */
virtual std::string get_shape_name() const
Return the identifier/name of the shape.
virtual double get_surface(uint32_t flags_=ALL_PIECES) const
Return the surface.
The abstract base class for all 2D shapes/surfaces.
Definition: composite_surface.h:26
bool is_valid() const
Check if the surface is valid.
static const std::string & composite_surface_label()
Return the identifier label for the class.
virtual bool find_intercept(const vector_3d &from_, const vector_3d &direction_, face_intercept_info &intercept_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
Find the intercept point with one of the component face.
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
The face_intercept_info class hosts the parameters of.
Definition: face_intercept_info.h:31
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
virtual bool is_on_surface(const vector_3d &position_, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const
virtual vector_3d get_normal_on_surface(const vector_3d &position_, bool check_=false, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const
composite_surface()
Default constructor.
void remove_last()
Remove last surface.
static const uint32_t ALL_PIECES
Special flag representing all pieces composing a 2D shape.
Definition: i_shape_2d.h:53
unsigned int get_number_of_surfaces() const
Return the number of embedded surfaces.
std::map< std::string, object_entry > handle_dict_type
Dictionary of handle of 3D object entries.
Definition: i_object_3d.h:124
virtual ~composite_surface()
Destructor.
face_info & add()
Add a surface.
virtual double get_perimeter(uint32_t flags_=ALL_PIECES) const
Return the perimeter.
The abstract base class for all 2D shapes/surfaces.
Definition: i_shape_2d.h:37
const face_info_collection_type & get_surfaces() const
Return the array of surface items.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
const face_info & get(unsigned int index_) const
Get the surface item at given index.
void initialize(const datatools::properties &, const handle_dict_type *=0)
Initialize from properties and a dictionary of 3D-objects.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
Information about the nature and positioning of a face of the solid.
Definition: face_info.h:38
std::vector< face_info > face_info_collection_type
Type alias for a collection of face information objects.
Definition: face_info.h:168
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125