Bayeux  3.4.1
Core Foundation library for SuperNEMO
right_circular_conical_frustrum.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2015-03-15
4  * Last modified: 2015-03-15
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Right circular conical frustrum
11  *
12  */
13 
14 #ifndef GEOMTOOLS_RIGHT_CIRCULAR_CONICAL_FRUSTRUM_H
15 #define GEOMTOOLS_RIGHT_CIRCULAR_CONICAL_FRUSTRUM_H 1
16 
17 // This project:
18 #include <geomtools/cone.h>
19 #include <geomtools/i_shape_3d.h>
20 #include <geomtools/i_stackable.h>
22 
23 namespace geomtools {
24 
25  // Class forward declarations:
26  class disk;
27  class triangle;
28  class quadrangle;
29  class right_circular_conical_nappe;
30 
33  public i_stackable
34  {
35  public:
36 
47  | FACE_BOTTOM
48  | FACE_TOP
52  };
53 
59  };
60 
62  static const std::string & rccf_label();
63 
65  virtual std::string get_shape_name() const;
66 
68  bool is_valid() const;
69 
71  double get_xmin () const;
72 
74  double get_xmax () const;
75 
77  double get_ymin () const;
78 
80  double get_ymax () const;
81 
83  double get_zmin () const;
84 
86  double get_zmax () const;
87 
89  void set_z(double);
90 
92  double get_z() const;
93 
95  bool has_top_face() const;
96 
98  bool has_bottom_face() const;
99 
101  bool has_inner_face() const;
102 
104  bool has_inner_bottom_radius() const;
105 
107  void set_inner_bottom_radius(double);
108 
110  double get_inner_bottom_radius() const;
111 
113  void set_outer_bottom_radius(double);
114 
116  double get_outer_bottom_radius() const;
117 
119  bool has_inner_top_radius() const;
120 
122  void set_inner_top_radius(double);
123 
125  double get_inner_top_radius() const;
126 
128  void set_outer_top_radius(double);
129 
131  double get_outer_top_radius() const;
132 
134  const angular_range & get_angle_domain() const;
135 
137  bool has_partial_angle() const;
138 
140  bool has_start_angle() const;
141 
143  void set_start_angle(double);
144 
146  double get_start_angle() const;
147 
149  bool has_delta_angle() const;
150 
152  void set_delta_angle(double);
153 
155  double get_delta_angle() const;
156 
159 
161  right_circular_conical_frustrum(double inner_bottom_radius_,
162  double outer_bottom_radius_,
163  double inner_top_radius_,
164  double outer_top_radius_,
165  double z_);
166 
168  right_circular_conical_frustrum(double inner_bottom_radius_,
169  double outer_bottom_radius_,
170  double inner_top_radius_,
171  double outer_top_radius_,
172  double z_,
173  double start_angle_,
174  double delta_angle_);
175 
178 
180  virtual void tree_dump (std::ostream & out_ = std::clog,
181  const std::string & title_ = "",
182  const std::string & indent_ = "",
183  bool inherit_ = false) const;
184 
187 
190 
192  void compute_top_face(disk & top_disk_, placement &) const;
193 
195  void compute_bottom_face(disk & bottom_disk_, placement &) const;
196 
202  enum ssaf_type {
207  };
208 
210  void compute_start_stop_angle_face(quadrangle & qface_, triangle & tface_) const;
211 
214 
217 
220 
223 
226 
228  void compute_start_angle_face(quadrangle & qface_, triangle & tface_, placement &) const;
229 
231  void compute_stop_angle_face(quadrangle & qface_, triangle & tface_, placement &) const;
232 
234  virtual unsigned int compute_faces(face_info_collection_type &) const;
235 
237  virtual double get_surface(uint32_t mask_ = FACE_ALL) const;
238 
240  virtual double get_volume(uint32_t flags_ = VOLUME_BULK) const;
241 
243  virtual bool is_inside (const vector_3d &,
244  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
245 
247  virtual bool is_outside (const vector_3d &,
248  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
249 
251  virtual face_identifier on_surface(const vector_3d &,
252  const face_identifier & a_surface_mask = face_identifier::face_bits_any(),
253  double a_skin = GEOMTOOLS_PROPER_TOLERANCE) const;
254 
256  virtual vector_3d get_normal_on_surface (const vector_3d & position_,
257  const face_identifier & ) const;
258 
260  virtual bool find_intercept(const vector_3d & from_,
261  const vector_3d & direction_,
262  face_intercept_info & intercept_,
263  double skin_ = GEOMTOOLS_PROPER_TOLERANCE) const;
264 
266  virtual void initialize(const datatools::properties &, const handle_dict_type * = 0);
267 
269  virtual void reset();
270 
286  };
287 
289  virtual void generate_wires_self(wires_type & wires_,
290  uint32_t options_ = 0) const;
291 
292  protected:
293 
295  void _set_defaults();
296 
298  virtual void _build_bounding_data();
299 
300  private:
301 
302  double _inner_bottom_radius_;
303  double _outer_bottom_radius_;
304  double _inner_top_radius_;
305  double _outer_top_radius_;
306  double _z_;
307  angular_range _angle_domain_;
308 
309  // Registration interface :
311 
312  };
313 
316 
317 } // end of namespace geomtools
318 
319 #endif // GEOMTOOLS_RIGHT_CIRCULAR_CONICAL_FRUSTRUM_H
320 
321 /*
322 ** Local Variables: --
323 ** mode: c++ --
324 ** c-file-style: "gnu" --
325 ** tab-width: 2 --
326 ** End: --
327 */
Definition: right_circular_conical_frustrum.h:39
bool has_start_angle() const
Check the start angle.
Quadrangle type.
Definition: right_circular_conical_frustrum.h:204
Right circular conical frustrum (3D shape)
Definition: right_circular_conical_frustrum.h:32
ssaf_type
Start/stop angle face type.
Definition: right_circular_conical_frustrum.h:202
Invalid/undefined type.
Definition: right_circular_conical_frustrum.h:203
void set_start_angle(double)
Set the start angle.
Do not render the bottom edge.
Definition: right_circular_conical_frustrum.h:276
double get_outer_top_radius() const
Return the outer top radius.
const angular_range & get_angle_domain() const
Return the angle domain.
Right circular conical nappe (2D shape)
Definition: right_circular_conical_nappe.h:29
double get_xmin() const
Return the minimum X.
Mother abstract class for all 3D solid shapes.
Definition: i_shape_3d.h:46
void compute_stop_angle_face(quadrangle &qface_, triangle &tface_, placement &) const
Compute the stop phi angle face.
virtual void _build_bounding_data()
Build bounding data.
Definition: right_circular_conical_frustrum.h:56
bool start_stop_angle_face_is_triangle() const
Check if the start/stop angle face is a triangle with bottom or top base.
static const uint32_t bit01
Definition: bit_mask.h:28
void set_inner_top_radius(double)
Set the inner top radius.
Definition: right_circular_conical_frustrum.h:43
void set_outer_bottom_radius(double)
Set the outer bottom radius.
static const uint32_t bit03
Definition: bit_mask.h:30
Triangle type with top base.
Definition: right_circular_conical_frustrum.h:206
Identifier of a face attached to a solid shape.
Definition: face_identifier.h:32
void compute_inner_face(right_circular_conical_nappe &in_) const
Compute the inner face.
virtual vector_3d get_normal_on_surface(const vector_3d &position_, const face_identifier &) const
Compute the normal to the surface of the furstrum.
Last defined bit.
Definition: right_circular_conical_frustrum.h:279
virtual face_identifier on_surface(const vector_3d &, const face_identifier &a_surface_mask=face_identifier::face_bits_any(), double a_skin=GEOMTOOLS_PROPER_TOLERANCE) const
Return the surface bit a point belongs to.
Definition: right_circular_conical_frustrum.h:45
Do not render the start phi angle edge.
Definition: right_circular_conical_frustrum.h:277
void compute_outer_face(right_circular_conical_nappe &on_) const
Compute the outer face.
virtual double get_surface(uint32_t mask_=FACE_ALL) const
Compute the surface.
static const uint32_t bit04
Definition: bit_mask.h:31
Definition: right_circular_conical_frustrum.h:46
virtual void generate_wires_self(wires_type &wires_, uint32_t options_=0) const
Generate a sequence of polylines for wires 3D rendering.
Do not render the top edge.
Definition: right_circular_conical_frustrum.h:274
volumes_mask_type
Volume flags.
Definition: right_circular_conical_frustrum.h:55
Do not render the bottom edge.
Definition: right_circular_conical_frustrum.h:273
double get_start_angle() const
Return the start angle.
bool has_inner_face() const
Check for an inner face.
The face_intercept_info class hosts the parameters of.
Definition: face_intercept_info.h:31
rccf_wires_rendering_option_type
3D rendering options
Definition: right_circular_conical_frustrum.h:272
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
Definition: right_circular_conical_frustrum.h:41
Triangle type with bottom base.
Definition: right_circular_conical_frustrum.h:205
void compute_bottom_face(disk &bottom_disk_, placement &) const
Compute the bottom face.
Do not render the bottom edge.
Definition: right_circular_conical_frustrum.h:275
bool has_top_face() const
Check for a top face.
void compute_start_angle_face(quadrangle &qface_, triangle &tface_, placement &) const
Compute the start phi angle face.
Abstract base stackable object.
Definition: i_stackable.h:32
faces_mask_type
Face flags.
Definition: right_circular_conical_frustrum.h:38
Definition: right_circular_conical_frustrum.h:40
virtual void reset()
Reset the frustrum.
void set_delta_angle(double)
Set the delta angle.
double get_inner_bottom_radius() const
Return the inner bottom radius.
bool start_stop_angle_face_is_triangle_top() const
Check if the start/stop angle face is a triangle with top base.
static const face_identifier & face_bits_any()
Return a singleton face identifier with any bit.
double get_delta_angle() const
Return the delta angle.
std::map< std::string, object_entry > handle_dict_type
Dictionary of handle of 3D object entries.
Definition: i_object_3d.h:124
bool start_stop_angle_face_is_quadrangle() const
Check if the start/srop angle face is a quadrangle.
static const uint32_t bit02
Definition: bit_mask.h:29
static const uint32_t FACE_BITS_NONE
No valid or known face bit.
Definition: face_identifier.h:45
double get_inner_top_radius() const
Return the inner top radius.
A triangle.
Definition: triangle.h:29
double get_zmax() const
Return the maximum Z.
Angular range.
Definition: angular_range.h:33
bool has_delta_angle() const
Check the dedislta angle.
bool has_bottom_face() const
Check for a bottom face.
static const uint32_t bit05
Definition: bit_mask.h:32
right_circular_conical_frustrum()
Default constructor.
Do not render the stop phi angle edge.
Definition: right_circular_conical_frustrum.h:278
virtual void initialize(const datatools::properties &, const handle_dict_type *=0)
Initialize the frustrum from properties.
virtual std::string get_shape_name() const
Return the identifier/name of the shape.
#define GEOMTOOLS_OBJECT_3D_REGISTRATION_INTERFACE(ModelClassName)
Definition: i_object_3d.h:260
void _set_defaults()
Set default attributes.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
bool has_inner_top_radius() const
Check inner top radius.
double get_z() const
Return the Z dimension.
Definition: right_circular_conical_frustrum.h:44
Last defined bit.
Definition: i_wires_3d_rendering.h:62
double get_outer_bottom_radius() const
Return the outer bottom radius.
bool start_stop_angle_face_is_triangle_bottom() const
Check if the start/stop angle face is a triangle with bottom base.
The placement for a geometry volume with its translation and rotation with respect to some mother ref...
Definition: placement.h:34
right_circular_conical_frustrum conical_frustrum
Type alias.
Definition: right_circular_conical_frustrum.h:315
void compute_top_face(disk &top_disk_, placement &) const
Compute the top face.
Definition: right_circular_conical_frustrum.h:57
void set_z(double)
Set the Z dimension.
void set_outer_top_radius(double)
Set the outer top radius.
bool is_valid() const
Check if the frustrum is valid.
std::list< polyline_type > wires_type
Alias for a list of 3D-polylines.
Definition: utils.h:61
virtual double get_volume(uint32_t flags_=VOLUME_BULK) const
Compute the volume.
bool has_inner_bottom_radius() const
Check inner bottom radius.
static const uint32_t bit00
Definition: bit_mask.h:27
void set_inner_bottom_radius(double)
Set the inner bottom radius.
Rendering options bit mask.
Definition: right_circular_conical_frustrum.h:280
double get_zmin() const
Return the minimum Z.
virtual bool is_outside(const vector_3d &, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const
Check if a point is outside the frustrum.
double get_xmax() const
Return the maximum X.
ssaf_type get_start_stop_angle_face_type() const
Return the type of the start/stop phi angle face.
void compute_start_stop_angle_face(quadrangle &qface_, triangle &tface_) const
Compute the start/stop phi angle face.
virtual bool is_inside(const vector_3d &, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const
Check if a point is inside the frustrum.
double get_ymax() const
Return the maximum Y.
A quadrangle.
Definition: quadrangle.h:36
static const std::string & rccf_label()
Return the identifier label for the class.
bool has_partial_angle() const
Check is the angular spread is partial.
std::vector< face_info > face_info_collection_type
Type alias for a collection of face information objects.
Definition: face_info.h:168
Definition: right_circular_conical_frustrum.h:42
virtual bool find_intercept(const vector_3d &from_, const vector_3d &direction_, face_intercept_info &intercept_, double skin_=GEOMTOOLS_PROPER_TOLERANCE) const
Find the intercept point with a face of the frustrum.
Definition: right_circular_conical_frustrum.h:58
double get_ymin() const
Return the minimum Y.
A disk/ring sector surface (2D shape)
Definition: disk.h:26
virtual ~right_circular_conical_frustrum()
Destructor.
virtual unsigned int compute_faces(face_info_collection_type &) const
Compute informations about the faces of this solid shape.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125