Deprecate Implicit_mesh_domain_3 as well

This commit is contained in:
Laurent Rineau 2018-03-20 18:27:46 +01:00
parent f0233cfbf7
commit 30ff350986
10 changed files with 73 additions and 27 deletions

View File

@ -6,7 +6,7 @@
#include <CGAL/Mesh_complex_3_in_triangulation_3.h> #include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h> #include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Implicit_mesh_domain_3.h> #include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/Polyhedral_mesh_domain_3.h> #include <CGAL/Polyhedral_mesh_domain_3.h>
#include <CGAL/Mesh_domain_with_polyline_features_3.h> #include <CGAL/Mesh_domain_with_polyline_features_3.h>
#include <CGAL/make_mesh_3.h> #include <CGAL/make_mesh_3.h>
@ -25,7 +25,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::FT FT; typedef K::FT FT;
typedef K::Point_3 Point; typedef K::Point_3 Point;
typedef FT (Function)(const Point&); typedef FT (Function)(const Point&);
typedef CGAL::Implicit_mesh_domain_3<Function,K> Implicit_domain; typedef CGAL::Labeled_mesh_domain_3<K> Implicit_domain;
// Polyhedral Domain // Polyhedral Domain
typedef CGAL::Polyhedron_3<K> Polyhedron; typedef CGAL::Polyhedron_3<K> Polyhedron;
@ -214,8 +214,10 @@ int main()
// - the first argument is the function pointer // - the first argument is the function pointer
// - the second argument is a bounding sphere of the domain // - the second argument is a bounding sphere of the domain
// (Warning: Sphere_3 constructor uses square radius !) // (Warning: Sphere_3 constructor uses square radius !)
Implicit_domain sphere_domain(sphere_centered_at_111, Implicit_domain sphere_domain =
K::Sphere_3(K::Point_3(1, 1, 1), 2.)); Implicit_domain::create_implicit_mesh_domain(sphere_centered_at_111,
K::Sphere_3(K::Point_3(1, 1, 1),
2.));
Domain domain(sphere_domain, polyhedron_domain); Domain domain(sphere_domain, polyhedron_domain);

View File

@ -4,7 +4,7 @@
#include <CGAL/Mesh_complex_3_in_triangulation_3.h> #include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h> #include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Implicit_mesh_domain_3.h> #include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h> #include <CGAL/make_mesh_3.h>
#include <CGAL/perturb_mesh_3.h> #include <CGAL/perturb_mesh_3.h>
#include <CGAL/exude_mesh_3.h> #include <CGAL/exude_mesh_3.h>
@ -14,7 +14,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::FT FT; typedef K::FT FT;
typedef K::Point_3 Point; typedef K::Point_3 Point;
typedef FT (Function)(const Point&); typedef FT (Function)(const Point&);
typedef CGAL::Implicit_mesh_domain_3<Function,K> Mesh_domain; typedef CGAL::Labeled_mesh_domain_3<K> Mesh_domain;
// Triangulation // Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
@ -41,7 +41,9 @@ using namespace CGAL::parameters;
int main() int main()
{ {
// Domain (Warning: Sphere_3 constructor uses square radius !) // Domain (Warning: Sphere_3 constructor uses square radius !)
Mesh_domain domain(ellipsoid_function, K::Sphere_3(CGAL::ORIGIN, 2.)); Mesh_domain domain =
Mesh_domain::create_implicit_mesh_domain(ellipsoid_function,
K::Sphere_3(CGAL::ORIGIN, 2.));
// Criteria // Criteria
Facet_criteria facet_criteria(30, 0.08, 0.025); // angle, size, approximation Facet_criteria facet_criteria(30, 0.08, 0.025); // angle, size, approximation

View File

@ -4,7 +4,7 @@
#include <CGAL/Mesh_complex_3_in_triangulation_3.h> #include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h> #include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Implicit_mesh_domain_3.h> #include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h> #include <CGAL/make_mesh_3.h>
// Domain // Domain
@ -12,7 +12,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::FT FT; typedef K::FT FT;
typedef K::Point_3 Point; typedef K::Point_3 Point;
typedef FT (Function)(const Point&); typedef FT (Function)(const Point&);
typedef CGAL::Implicit_mesh_domain_3<Function,K> Mesh_domain; typedef CGAL::Labeled_mesh_domain_3<K> Mesh_domain;
#ifdef CGAL_CONCURRENT_MESH_3 #ifdef CGAL_CONCURRENT_MESH_3
typedef CGAL::Parallel_tag Concurrency_tag; typedef CGAL::Parallel_tag Concurrency_tag;
@ -38,7 +38,8 @@ FT sphere_function (const Point& p)
int main() int main()
{ {
// Domain (Warning: Sphere_3 constructor uses squared radius !) // Domain (Warning: Sphere_3 constructor uses squared radius !)
Mesh_domain domain(sphere_function, Mesh_domain domain =
Mesh_domain::create_implicit_mesh_domain(sphere_function,
K::Sphere_3(CGAL::ORIGIN, 2.)); K::Sphere_3(CGAL::ORIGIN, 2.));
// Mesh criteria // Mesh criteria

View File

@ -4,7 +4,7 @@
#include <CGAL/Mesh_complex_3_in_triangulation_3.h> #include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h> #include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Implicit_mesh_domain_3.h> #include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h> #include <CGAL/make_mesh_3.h>
// Domain // Domain
@ -12,7 +12,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::FT FT; typedef K::FT FT;
typedef K::Point_3 Point; typedef K::Point_3 Point;
typedef FT (Function)(const Point&); typedef FT (Function)(const Point&);
typedef CGAL::Implicit_mesh_domain_3<Function,K> Mesh_domain; typedef CGAL::Labeled_mesh_domain_3<K> Mesh_domain;
#ifdef CGAL_CONCURRENT_MESH_3 #ifdef CGAL_CONCURRENT_MESH_3
typedef CGAL::Parallel_tag Concurrency_tag; typedef CGAL::Parallel_tag Concurrency_tag;
@ -52,7 +52,8 @@ FT sphere_function (const Point& p)
int main() int main()
{ {
// Domain (Warning: Sphere_3 constructor uses squared radius !) // Domain (Warning: Sphere_3 constructor uses squared radius !)
Mesh_domain domain(sphere_function, Mesh_domain domain =
Mesh_domain::create_implicit_mesh_domain(sphere_function,
K::Sphere_3(CGAL::ORIGIN, 2.)); K::Sphere_3(CGAL::ORIGIN, 2.));
// Mesh criteria // Mesh criteria

View File

@ -4,7 +4,7 @@
#include <CGAL/Mesh_complex_3_in_triangulation_3.h> #include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h> #include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Implicit_mesh_domain_3.h> #include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/Mesh_domain_with_polyline_features_3.h> #include <CGAL/Mesh_domain_with_polyline_features_3.h>
#include <CGAL/make_mesh_3.h> #include <CGAL/make_mesh_3.h>
@ -16,7 +16,7 @@ typedef K::FT FT;
typedef K::Point_3 Point; typedef K::Point_3 Point;
typedef FT (Function)(const Point&); typedef FT (Function)(const Point&);
typedef CGAL::Mesh_domain_with_polyline_features_3< typedef CGAL::Mesh_domain_with_polyline_features_3<
CGAL::Implicit_mesh_domain_3<Function,K> > Mesh_domain; CGAL::Labeled_mesh_domain_3<K> > Mesh_domain;
// Polyline // Polyline
typedef std::vector<Point> Polyline_3; typedef std::vector<Point> Polyline_3;
@ -60,7 +60,8 @@ FT sphere_function (const Point& p)
int main() int main()
{ {
// Domain (Warning: Sphere_3 constructor uses squared radius !) // Domain (Warning: Sphere_3 constructor uses squared radius !)
Mesh_domain domain(sphere_function, Mesh_domain domain =
Mesh_domain::create_implicit_mesh_domain(sphere_function,
K::Sphere_3(Point(1, 0, 0), 6.)); K::Sphere_3(Point(1, 0, 0), 6.));
// Mesh criteria // Mesh criteria

View File

@ -48,7 +48,7 @@ template<class Image,
class class
CGAL_DEPRECATED_MSG CGAL_DEPRECATED_MSG
( "The class template `CGAL::Gray_image_mesh_domain_3` is now deprecated. " ( "The class template `CGAL::Gray_image_mesh_domain_3` is now deprecated. "
"Use the member function template " "Use the static member function template "
"`Labeled_mesh_domain_3<K>::create_gray_image_mesh_domain` instead.") "`Labeled_mesh_domain_3<K>::create_gray_image_mesh_domain` instead.")
Gray_image_mesh_domain_3 Gray_image_mesh_domain_3
: public Labeled_mesh_domain_3<BGT, Subdomain_index> : public Labeled_mesh_domain_3<BGT, Subdomain_index>

View File

@ -47,7 +47,12 @@ namespace CGAL {
template<class Function, template<class Function,
class BGT, class BGT,
class Wrapper = Implicit_to_labeling_function_wrapper<Function,BGT> > class Wrapper = Implicit_to_labeling_function_wrapper<Function,BGT> >
class Implicit_mesh_domain_3 class
CGAL_DEPRECATED_MSG
( "The class template `CGAL::Implicit_mesh_domain_3` is now deprecated. "
"Use the static member function template "
"`Labeled_mesh_domain_3<K>::create_implicit_image_mesh_domain` instead.")
Implicit_mesh_domain_3
: public Labeled_mesh_domain_3<BGT> : public Labeled_mesh_domain_3<BGT>
{ {
public: public:

View File

@ -68,10 +68,7 @@ public:
Implicit_to_labeling_function_wrapper(const Function_& f) Implicit_to_labeling_function_wrapper(const Function_& f)
: r_f_(f) {} : r_f_(f) {}
// Default copy constructor and assignment operator are ok // Default copy constructor, assignment operator, and destructor are ok
/// Destructor
~Implicit_to_labeling_function_wrapper() {}
/// Operator () /// Operator ()
return_type operator()(const Point_3& p, const bool = true) const return_type operator()(const Point_3& p, const bool = true) const
@ -85,7 +82,12 @@ private:
}; // end class Implicit_to_labeling_function_wrapper }; // end class Implicit_to_labeling_function_wrapper
template <typename BGT, typename Function>
Implicit_to_labeling_function_wrapper<Function, BGT>
make_implicit_to_labeling_function_wrapper(const Function& f)
{
return Implicit_to_labeling_function_wrapper<Function, BGT>(f);
}
/** /**
* \deprecated * \deprecated

View File

@ -54,7 +54,7 @@ template<class Image,
class class
CGAL_DEPRECATED_MSG CGAL_DEPRECATED_MSG
( "The class template `CGAL::Labeled_image_mesh_domain_3` is now deprecated. " ( "The class template `CGAL::Labeled_image_mesh_domain_3` is now deprecated. "
"Use the member function template " "Use the static member function template "
"`Labeled_mesh_domain_3<K>::create_labeled_image_mesh_domain` instead.") "`Labeled_mesh_domain_3<K>::create_labeled_image_mesh_domain` instead.")
Labeled_image_mesh_domain_3 Labeled_image_mesh_domain_3
: public Labeled_mesh_domain_3<BGT, Subdomain_index> : public Labeled_mesh_domain_3<BGT, Subdomain_index>

View File

@ -58,6 +58,9 @@
#include <CGAL/Image_3.h> #include <CGAL/Image_3.h>
#include <CGAL/Mesh_3/Image_to_labeled_function_wrapper.h> #include <CGAL/Mesh_3/Image_to_labeled_function_wrapper.h>
// support for implicit functions
#include <CGAL/Implicit_to_labeling_function_wrapper.h>
namespace CGAL { namespace CGAL {
@ -447,6 +450,35 @@ public:
p::construct_surface_patch_index = p::construct_surface_patch_index =
create_construct_surface_patch_index(construct_surface_patch_index_)); create_construct_surface_patch_index(construct_surface_patch_index_));
} }
BOOST_PARAMETER_MEMBER_FUNCTION(
(Labeled_mesh_domain_3),
static create_implicit_mesh_domain,
parameters::tag,
(required
(function_, *)
(bounding_object_,*)
)
(optional
(relative_error_bound_, (const FT&),
FT(1e-3))
(p_rng_, (CGAL::Random*), (CGAL::Random*)(0))
(null_subdomain_index_,*,Null_functor())
(construct_surface_patch_index_, *,
Null_functor())
)
)
{
namespace p = CGAL::parameters;
return Labeled_mesh_domain_3
(make_implicit_to_labeling_function_wrapper<BGT>(function_),
bounding_object_,
p::relative_error_bound = relative_error_bound_,
p::p_rng = p_rng_,
p::null_subdomain_index =
create_null_subdomain_index(null_subdomain_index_),
p::construct_surface_patch_index =
create_construct_surface_patch_index(construct_surface_patch_index_));
}
/// @} /// @}
/** /**