mirror of https://github.com/CGAL/cgal
Cleanup of GetFilter
This commit is contained in:
parent
c510a89ea0
commit
ac1200fe28
|
|
@ -106,7 +106,7 @@ CGAL_add_named_parameter(do_not_modify_t, do_not_modify, do_not_modify)
|
||||||
// List of named parameters that we use in the package 'Surface Mesh Simplification'
|
// List of named parameters that we use in the package 'Surface Mesh Simplification'
|
||||||
CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost)
|
CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost)
|
||||||
CGAL_add_named_parameter(get_placement_policy_t, get_placement_policy, get_placement)
|
CGAL_add_named_parameter(get_placement_policy_t, get_placement_policy, get_placement)
|
||||||
CGAL_add_named_parameter(get_filter_policy_t, get_filter_policy, get_filter)
|
CGAL_add_named_parameter(filter_t, filter, filter)
|
||||||
|
|
||||||
//to be documented
|
//to be documented
|
||||||
CGAL_add_named_parameter(face_normal_t, face_normal, face_normal_map)
|
CGAL_add_named_parameter(face_normal_t, face_normal, face_normal_map)
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,18 @@ namespace Surface_mesh_simplification {
|
||||||
/*!
|
/*!
|
||||||
\ingroup PkgSurfaceMeshSimplificationRef
|
\ingroup PkgSurfaceMeshSimplificationRef
|
||||||
|
|
||||||
The class `Bounded_normal_change_filter` is a model for the `GetFilter` concept.
|
The class `Bounded_normal_change_filter` is a model for the `Filter` concept.
|
||||||
It rejects the placement if the nested filter rejects it, or
|
It rejects the placement if the nested filter rejects it, or
|
||||||
if any triangle in the profile changes the normal by more than 90 degree, in this order.
|
if any triangle in the profile changes the normal by more than 90 degree, in this order.
|
||||||
|
|
||||||
|
|
||||||
\tparam Get_filter_ must be a model of the concept `GetFilter`. It defaults to a class that does
|
\tparam Filter_ must be a model of the concept `Filter`. It defaults to a class that does
|
||||||
not filter any placement.
|
not filter any placement.
|
||||||
|
|
||||||
\cgalModels `GetFilter`
|
\cgalModels `Filter`
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template <typename GetFilter_>
|
template <typename Filter_>
|
||||||
class Bounded_normal_change_filter {
|
class Bounded_normal_change_filter {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -31,9 +31,9 @@ public:
|
||||||
/*!
|
/*!
|
||||||
Constructor
|
Constructor
|
||||||
|
|
||||||
\param get_filter is the filter that will be filtered.
|
\param filter is the filter that will be filtered.
|
||||||
*/
|
*/
|
||||||
Bounded_normal_change_filter(const GetFilter_& get_filter);
|
Bounded_normal_change_filter(const Filter_& filter);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,20 +5,20 @@ namespace Surface_mesh_simplification {
|
||||||
/*!
|
/*!
|
||||||
\ingroup PkgSurfaceMeshSimplificationRef
|
\ingroup PkgSurfaceMeshSimplificationRef
|
||||||
|
|
||||||
The class `Polyhedral_envelope_filter` is a model for the `GetFilter` concept.
|
The class `Polyhedral_envelope_filter` is a model for the `Filter` concept.
|
||||||
It rejects the placement if the nested filter rejects it, or
|
It rejects the placement if the nested filter rejects it, or
|
||||||
if any triangle in the profile is not inside the polyhedral envelope, in this order.
|
if any triangle in the profile is not inside the polyhedral envelope, in this order.
|
||||||
|
|
||||||
|
|
||||||
\tparam Get_filter_ must be a model of the concept `GetFilter`. It defaults to a class that does
|
\tparam Filter_ must be a model of the concept `Filter`. It defaults to a class that does
|
||||||
not filter any placement.
|
not filter any placement.
|
||||||
|
|
||||||
\cgalModels `GetFilter`
|
\cgalModels `Filter`
|
||||||
|
|
||||||
\sa `Polyhedral_envelope`
|
\sa `Polyhedral_envelope`
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template <typename GeomTraits, typename GetFilter_>
|
template <typename GeomTraits, typename Filter_>
|
||||||
class Polyhedral_envelope_filter {
|
class Polyhedral_envelope_filter {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ public:
|
||||||
|
|
||||||
\param get_filter is the filter that will be filtered.
|
\param get_filter is the filter that will be filtered.
|
||||||
*/
|
*/
|
||||||
Polyhedral_envelope_filter(const FT& dist, const GetFilter_& get_filter);
|
Polyhedral_envelope_filter(const FT& dist, const Filter_& get_filter);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
\ingroup PkgSurfaceMeshSimplificationConcepts
|
\ingroup PkgSurfaceMeshSimplificationConcepts
|
||||||
\cgalConcept
|
\cgalConcept
|
||||||
|
|
||||||
The concept `GetFilter` describes the requirements for the <I>policy
|
The concept `Filter` describes the requirements for the <I>policy
|
||||||
function object</I> which gets the profile and placement of an edge
|
function object</I> which gets the profile and placement of an edge
|
||||||
and which can filter the placement. The filtering is only done when
|
and which can filter the placement. The filtering is only done when
|
||||||
an edge is taken from the priority queue in order to get collapsed,
|
an edge is taken from the priority queue in order to get collapsed,
|
||||||
|
|
@ -19,7 +19,7 @@ be absent). The value `boost::none` indicates that the edge should not be collap
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class GetFilter
|
class Filter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
- `StopPredicate`
|
- `StopPredicate`
|
||||||
- `GetCost`
|
- `GetCost`
|
||||||
- `GetPlacement`
|
- `GetPlacement`
|
||||||
- `GetFilter`
|
- `Filter`
|
||||||
- `EdgeCollapseSimplificationVisitor`
|
- `EdgeCollapseSimplificationVisitor`
|
||||||
|
|
||||||
\cgalCRPSection{Functions}
|
\cgalCRPSection{Functions}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ int main(int argc, char** argv)
|
||||||
SMS::Bounded_normal_change_filter<> filter;
|
SMS::Bounded_normal_change_filter<> filter;
|
||||||
SMS::edge_collapse(surface_mesh, stop,
|
SMS::edge_collapse(surface_mesh, stop,
|
||||||
CGAL::parameters::get_cost(SMS::LindstromTurk_cost<Surface_mesh>())
|
CGAL::parameters::get_cost(SMS::LindstromTurk_cost<Surface_mesh>())
|
||||||
.get_filter(filter)
|
.filter(filter)
|
||||||
.get_placement(Placement()));
|
.get_placement(Placement()));
|
||||||
|
|
||||||
std::cout << t.time() << " sec" << std::endl;
|
std::cout << t.time() << " sec" << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ int main(int argc, char** argv)
|
||||||
std::cout << "eps = " << 0.01*diag << std::endl;
|
std::cout << "eps = " << 0.01*diag << std::endl;
|
||||||
Placement placement;
|
Placement placement;
|
||||||
Filter filter(0.01*diag);
|
Filter filter(0.01*diag);
|
||||||
SMS::edge_collapse(mesh, stop, CGAL::parameters::get_cost(Cost()).get_filter(filter).get_placement(placement));
|
SMS::edge_collapse(mesh, stop, CGAL::parameters::get_cost(Cost()).filter(filter).get_placement(placement));
|
||||||
|
|
||||||
std::ofstream out("out.off");
|
std::ofstream out("out.off");
|
||||||
out << mesh << std::endl;
|
out << mesh << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ int edge_collapse(TM& tmesh,
|
||||||
choose_parameter<No_constrained_edge_map<TM> >(get_parameter(np, internal_np::edge_is_constrained)),
|
choose_parameter<No_constrained_edge_map<TM> >(get_parameter(np, internal_np::edge_is_constrained)),
|
||||||
choose_parameter<LindstromTurk_cost<TM> >(get_parameter(np, internal_np::get_cost_policy)),
|
choose_parameter<LindstromTurk_cost<TM> >(get_parameter(np, internal_np::get_cost_policy)),
|
||||||
choose_parameter<LindstromTurk_placement<TM> >(get_parameter(np, internal_np::get_placement_policy)),
|
choose_parameter<LindstromTurk_placement<TM> >(get_parameter(np, internal_np::get_placement_policy)),
|
||||||
choose_parameter<internal::Dummy_filter>(get_parameter(np, internal_np::get_filter_policy)),
|
choose_parameter<internal::Dummy_filter>(get_parameter(np, internal_np::filter)),
|
||||||
choose_parameter<internal::Dummy_visitor>(get_parameter(np, internal_np::visitor)));
|
choose_parameter<internal::Dummy_visitor>(get_parameter(np, internal_np::visitor)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue