Bayeux  3.4.1
Core Foundation library for SuperNEMO
i_composite_shape_3d.h
Go to the documentation of this file.
1 
15 #ifndef GEOMTOOLS_I_COMPOSITE_SHAPE_3D_H
16 #define GEOMTOOLS_I_COMPOSITE_SHAPE_3D_H 1
17 
18 // Standard library:
19 #include <string>
20 
21 // This project:
22 #include <geomtools/i_shape_3d.h>
23 #include <geomtools/placement.h>
24 
25 namespace geomtools {
26 
29  {
30 
31  public:
32 
35  {
36 
37  public:
38 
39  void copy(shape_type &);
40 
41  void reset();
42 
43  bool is_valid() const;
44 
45  shape_type();
46 
47  virtual ~shape_type();
48 
49  bool is_delete() const;
50 
51  void set_shape_ref(const std::string &);
52 
53  const std::string & get_shape_ref() const;
54 
55  const i_shape_3d & get_shape() const;
56 
58 
59  const placement & get_placement() const;
60 
62 
63  // Factory methods:
64 
65  static void make_shape(i_shape_3d &,
66  const placement &,
67  shape_type &);
68 
69  static void make_shape(i_shape_3d &,
70  const placement &,
71  const std::string & shape_ref_,
72  shape_type &);
73 
74  static void make_shape(i_shape_3d *,
75  const placement &,
76  shape_type &);
77 
79  virtual void tree_dump(std::ostream & out_ = std::clog,
80  const std::string & title_ = "",
81  const std::string & indent_ = "",
82  bool inherit_ = false) const;
83 
85  void dump(std::ostream & out_ = std::clog) const;
86 
87  private:
88 
89  // forbid implementation of:
90  shape_type(const shape_type &);
91 
92  shape_type & operator=(const shape_type &);
93 
94  private:
95 
96  bool _delete_;
97  i_shape_3d * _shape_;
98  std::string _shape_ref_;
99  placement _placement_;
100 
101  };
102 
103  /*
105  enum faces_mask_type {
106  FACE_NONE = face_identifier::FACE_BITS_NONE,
107  _FACE_BEGIN = datatools::bit_mask::bit00,
108  FACE_FIRST = datatools::bit_mask::bit00,
109  FACE_SECOND = datatools::bit_mask::bit01,
110  _FACE_END = datatools::bit_mask::bit02,
111  FACE_ALL = (FACE_FIRST| FACE_SECOND)
112  };
113  */
114 
115  static const uint32_t FIRST_PART = 0;
116  static const uint32_t SECOND_PART = 1;
117 
124  };
125 
127  bool using_face_id_bits() const;
128 
130  bool using_face_id_part_index() const;
131 
133  virtual void make_any_face(face_identifier &) const;
134 
136  bool is_valid() const;
137 
139  bool is_composite() const;
140 
142  virtual bool volume_can_be_forced() const;
143 
146 
148  virtual ~i_composite_shape_3d();
149 
151  void set_shape1(i_shape_3d &, const placement &, const std::string & shref_ = "");
152 
154  void set_shape2(i_shape_3d &, const placement &, const std::string & shref_ = "");
155 
157  void set_shapes(i_shape_3d &, i_shape_3d &, const placement &,
158  const std::string & sh1ref_ = "", const std::string & sh2ref_ = "");
159 
161  void set_shape1(i_shape_3d *, const placement &);
162 
164  void set_shape2(i_shape_3d *, const placement &);
165 
167  void set_shapes(i_shape_3d *, i_shape_3d *, const placement &);
168 
170  const shape_type & get_shape1() const;
171 
173  const shape_type & get_shape2() const;
174 
176  const shape_type & get_shape(int i_) const;
177 
179  void dump(std::ostream & out_ = std::clog) const;
180 
182  virtual void tree_dump(std::ostream & out_ = std::clog,
183  const std::string & title_ = "",
184  const std::string & indent_ = "",
185  bool inherit_ = false) const;
186 
188  virtual void initialize(const datatools::properties &,
189  const handle_dict_type *);
190 
192  virtual void reset();
193 
205  )
206  };
207 
208  private:
209 
210  shape_type _shape1_;
211  shape_type _shape2_;
212 
213  };
214 
215 } // end of namespace geomtools
216 
217 #endif // GEOMTOOLS_I_COMPOSITE_SHAPE_3D_H
218 
219 /*
220 ** Local Variables: --
221 ** mode: c++ --
222 ** c-file-style: "gnu" --
223 ** tab-width: 2 --
224 ** End: --
225 */
virtual void initialize(const datatools::properties &, const handle_dict_type *)
Initialize from properties.
component_shape_type
Masks used for the two solids.
Definition: i_composite_shape_3d.h:119
const shape_type & get_shape1() const
Return first shape.
Render the second solid.
Definition: i_composite_shape_3d.h:198
void set_shape2(i_shape_3d &, const placement &, const std::string &shref_="")
Set second shape.
Mother abstract class for all 3D solid shapes.
Definition: i_shape_3d.h:46
void set_shapes(i_shape_3d &, i_shape_3d &, const placement &, const std::string &sh1ref_="", const std::string &sh2ref_="")
Set both shapes.
An interface with utilities for printable objects.
Definition: i_tree_dump.h:36
#define GEOMTOOLS_DEFAULT_TOLERANCE
Definition: geomtools_config.h:20
static const uint32_t bit01
Definition: bit_mask.h:28
Definition: i_composite_shape_3d.h:121
void dump(std::ostream &out_=std::clog) const
Dump.
Identifier of a face attached to a solid shape.
Definition: face_identifier.h:32
virtual void make_any_face(face_identifier &) const
Build a face identifier any mask.
bool using_face_id_bits() const
Check if the face identification scheme is based on face bits.
Definition: i_composite_shape_3d.h:123
virtual void reset()
Reset.
bool is_valid() const
Check if the shape is valid.
virtual ~i_composite_shape_3d()
Destructor.
const shape_type & get_shape(int i_) const
Return shape by index.
Last defined bit.
Definition: i_composite_shape_3d.h:200
const placement & get_placement() const
void set_shape_ref(const std::string &)
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
Record for a composite shape.
Definition: i_composite_shape_3d.h:34
const shape_type & get_shape2() const
Return second shape.
Boost the solids sampling.
Definition: i_composite_shape_3d.h:199
Definition: i_composite_shape_3d.h:120
std::map< std::string, object_entry > handle_dict_type
Dictionary of handle of 3D object entries.
Definition: i_object_3d.h:124
static const uint32_t FIRST_PART
Definition: i_composite_shape_3d.h:115
static const uint32_t SECOND_PART
Definition: i_composite_shape_3d.h:116
Only bounding box.
Definition: i_composite_shape_3d.h:196
Definition: i_composite_shape_3d.h:122
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
bool using_face_id_part_index() const
Check if the face identification scheme uses part index.
bool is_composite() const
Check if the shape is composite.
Rendering options bit mask.
Definition: i_composite_shape_3d.h:201
const std::string & get_shape_ref() const
Render the first solid.
Definition: i_composite_shape_3d.h:197
static void make_shape(i_shape_3d &, const placement &, shape_type &)
Last defined bit.
Definition: i_wires_3d_rendering.h:62
The placement for a geometry volume with its translation and rotation with respect to some mother ref...
Definition: placement.h:34
i_composite_shape_3d(double skin_=GEOMTOOLS_DEFAULT_TOLERANCE)
Constructor.
Base class for binary composite shapes.
Definition: i_composite_shape_3d.h:28
static const uint32_t bit00
Definition: bit_mask.h:27
virtual bool volume_can_be_forced() const
Check if a forced volume can be set.
void dump(std::ostream &out_=std::clog) const
Print.
void set_shape1(i_shape_3d &, const placement &, const std::string &shref_="")
Set first shape.
composite_wires_rendering_option_type
3D rendering options
Definition: i_composite_shape_3d.h:195
const i_shape_3d & get_shape() const
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125