|
| 1 | +namespace CGAL { |
| 2 | + |
| 3 | +/*! |
| 4 | +\ingroup PkgMesh_3Domains |
| 5 | +
|
| 6 | +\brief The class `Labeled_mesh_domain_3` implements indexed domains. |
| 7 | +
|
| 8 | +This class is a model of concept `MeshDomain_3`. |
| 9 | +
|
| 10 | +Any boundary facet is labeled <a,b>, a<b, where a and b are the |
| 11 | +tags of its incident subdomain. |
| 12 | +Thus, a boundary facet of the domain is labeled <0,b>, where b!=0. |
| 13 | +
|
| 14 | +This class includes a function that provides, the subdomain index of any |
| 15 | +query point. An intersection between a segment and bounding |
| 16 | +surfaces is detected when both segment endpoints are associated with different |
| 17 | +values of subdomain indices. The intersection is then constructed by bisection. |
| 18 | +The bisection stops when the query segment is shorter than an error bound |
| 19 | +`e` given by the product of the |
| 20 | +length of the diagonal of the bounding box (in world coordinates), or the radius of the bounding sphere, and |
| 21 | +a relative error bound passed as argument to the constructor of `Labeled_mesh_domain_3`. |
| 22 | +
|
| 23 | +Implicit_mesh_domain_3 is a heir of Labeled_mesh_domain_3. It uses a satisfying labeling function if there is only one component to mesh. |
| 24 | +
|
| 25 | +\tparam LabelingFunction is the type of the input function.<br /> |
| 26 | +This parameter stands for a model of the concept ImplicitFunction described in the surface mesh generation package.<br /> |
| 27 | +Labeling function f must return 0 if the point isn't located in any subdomain. Usually, the return type of labeling functions are integer.<br /> |
| 28 | +Let p be a Point. |
| 29 | +<ul> |
| 30 | +<li>f(p)=0 means that p is outside domain.</li> |
| 31 | +<li>f(p)=a, a!=0 means that p is inside subdomain a.</li> |
| 32 | +</ul> |
| 33 | +Implicit_multi_domain_to_labeling_function_wrapper is a good candidate for this template parameter |
| 34 | +if there are several components to mesh. |
| 35 | +
|
| 36 | +\tparam BGT is a geometric traits class that provides |
| 37 | +the basic operations to implement |
| 38 | +intersection tests and intersection computations |
| 39 | +through a bisection method. This parameter must be instantiated |
| 40 | +with a model of the concept `BisectionGeometricTraits_3`. |
| 41 | +
|
| 42 | +\cgalModels MeshDomain_3 |
| 43 | +
|
| 44 | +\sa `Implicit_mesh_domain_3` |
| 45 | +\sa `Implicit_multi_domain_to_labeling_function_wrapper` |
| 46 | +\sa `CGAL::make_mesh_3()`. |
| 47 | +
|
| 48 | +*/ |
| 49 | +template<class LabelingFunction, class BGT> |
| 50 | +class Labeled_mesh_domain_3 |
| 51 | +{ |
| 52 | +public: |
| 53 | + |
| 54 | +/// \name Creation |
| 55 | +/// @{ |
| 56 | + |
| 57 | +/*! |
| 58 | +\brief Construction from a labeling function, a bounding Sphere and a relative error bound. |
| 59 | +\param f the labeling function. |
| 60 | +\param bounding_sphere the bounding sphere of the meshable space. |
| 61 | +\param relative_error_bound is the relative error bound used to compute intersection points between the implicit surface and query segments. The |
| 62 | +bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the radius of |
| 63 | +`bounding_sphere`. |
| 64 | +*/ |
| 65 | +Labeled_mesh_domain_3(const LabelingFunction& f, |
| 66 | + const Sphere_3& bounding_sphere, |
| 67 | + const FT& relative_error_bound = FT(1e-3)); |
| 68 | + |
| 69 | +/*! |
| 70 | +\brief Construction from a labeling function, a bounding box and a relative error bound. |
| 71 | +\param f the labeling function. |
| 72 | +\param bbox the bounding box of the meshable space. |
| 73 | +\param relative_error_bound is the relative error bound used to compute intersection points between the implicit surface and query segments. The |
| 74 | +bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diagonal of |
| 75 | +`bounding_box`. |
| 76 | +*/ |
| 77 | +Labeled_mesh_domain_3(const LabelingFunction& f, |
| 78 | + const Bbox_3& bbox, |
| 79 | + const FT& relative_error_bound = FT(1e-3)); |
| 80 | + |
| 81 | +/*! |
| 82 | +\brief Construction from a function, a bounding Iso_cuboid_3 and a relative error bound. |
| 83 | +\param f the function. |
| 84 | +\param bbox the bounding box of the meshable space. |
| 85 | +\param relative_error_bound is the relative error bound used to compute intersection points between the implicit surface and query segments. The |
| 86 | +bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diagonal of |
| 87 | +`bounding_box`. |
| 88 | +*/ |
| 89 | +Labeled_mesh_domain_3(const LabelingFunction& f, |
| 90 | + const Iso_cuboid_3& bbox, |
| 91 | + const FT& relative_error_bound = FT(1e-3)); |
| 92 | + |
| 93 | +/// @} |
| 94 | + |
| 95 | +}; /* end Labeled_mesh_domain_3 */ |
| 96 | +} /* end namespace CGAL */ |
0 commit comments