remove VSA namespace

CGAL::VSA::Metrics -> CGAL::Metrics
CGAL::VSA::parameters -> CGAL::Surface_mesh_approximation::parameters
This commit is contained in:
Lingjie Zhu 2018-02-26 11:09:11 +08:00
parent e94ee29de2
commit 745f87e172
11 changed files with 23 additions and 25 deletions

View File

@ -6,7 +6,7 @@
#include <CGAL/vsa_mesh_approximation.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::VSA::Plane_proxy<Kernel> Plane_proxy;
typedef CGAL::Plane_proxy<Kernel> Plane_proxy;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef boost::graph_traits<Polyhedron>::face_descriptor face_descriptor;
typedef std::map<face_descriptor, std::size_t> Facet_index_map;
@ -39,7 +39,7 @@ int main()
CGAL::vsa_mesh_approximation(input,
std::back_inserter(points),
std::back_inserter(triangles),
CGAL::VSA::parameters::min_error_drop(0.05). // seeding with minimum error drop
CGAL::Surface_mesh_approximation::parameters::min_error_drop(0.05). // seeding with minimum error drop
nb_of_iterations(40). // set number of clustering iterations after seeding
mesh_chord_error(0.3). // set chord approximation error threshold when meshing
facet_proxy_map(fpxmap). // get facet partition map

View File

@ -27,7 +27,7 @@ int main()
bool valid_polyhedron = CGAL::vsa_mesh_approximation(input,
std::back_inserter(points),
std::back_inserter(triangles),
CGAL::VSA::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
max_nb_proxies(200). // seeding with maximum number of proxies
nb_of_iterations(30). // number of clustering iterations after seeding
// output to polyhedron

View File

@ -31,7 +31,7 @@ int main()
// free function interface with named parameters
CGAL::vsa_mesh_segmentation(input,
fpxmap, // output segmentation
CGAL::VSA::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
max_nb_proxies(200). // first stop criterion
min_error_drop(0.05). // second stop criterion
nb_of_iterations(30)); // number of iterations after seeding

View File

@ -23,7 +23,7 @@ int main()
CGAL::vsa_mesh_approximation(input,
std::back_inserter(points),
std::back_inserter(triangles),
CGAL::VSA::parameters::max_nb_proxies(200));
CGAL::Surface_mesh_approximation::parameters::max_nb_proxies(200));
std::cout << "#vertices: " << points.size() << std::endl;
std::cout << "#triangles: " << triangles.size() << std::endl;

View File

@ -82,10 +82,10 @@ public:
>::Kernel >::type Geom_traits;
/// ErrorMetric type
typedef typename CGAL::Default::Get<ErrorMetric,
CGAL::VSA::L21_metric<TriangleMesh, VertexPointMap, false, Geom_traits> >::type Error_metric;
CGAL::L21_metric<TriangleMesh, VertexPointMap, false, Geom_traits> >::type Error_metric;
/// ProxyFitting type
typedef typename CGAL::Default::Get<ProxyFitting,
CGAL::VSA::L21_proxy_fitting<TriangleMesh, VertexPointMap, Geom_traits> >::type Proxy_fitting;
CGAL::L21_proxy_fitting<TriangleMesh, VertexPointMap, Geom_traits> >::type Proxy_fitting;
/// Proxy type
typedef typename Error_metric::Proxy Proxy;

View File

@ -1,5 +1,5 @@
#ifndef CGAL_SURFACE_MESH_APPROXIMATION_VSA_METRICS_H
#define CGAL_SURFACE_MESH_APPROXIMATION_VSA_METRICS_H
#ifndef CGAL_VSA_METRICS_H
#define CGAL_VSA_METRICS_H
#include <CGAL/license/Surface_mesh_approximation.h>
@ -13,7 +13,6 @@
#include <list>
namespace CGAL {
namespace VSA {
/*!
* \ingroup PkgTSMA
@ -59,7 +58,7 @@ template <typename TriangleMesh,
= typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type,
bool with_area_weighing = true,
typename GeomTraits = typename TriangleMesh::Traits,
typename PlaneProxy = CGAL::VSA::Plane_proxy<GeomTraits> >
typename PlaneProxy = CGAL::Plane_proxy<GeomTraits> >
class L21_metric
{
typedef typename GeomTraits::FT FT;
@ -329,7 +328,7 @@ template <typename TriangleMesh,
typename VertexPointMap
= typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type,
typename GeomTraits = typename TriangleMesh::Traits,
typename PlaneProxy = CGAL::VSA::Plane_proxy<GeomTraits> >
typename PlaneProxy = CGAL::Plane_proxy<GeomTraits> >
class L21_proxy_fitting
{
typedef typename GeomTraits::FT FT;
@ -498,7 +497,7 @@ template <typename TriangleMesh,
typename VertexPointMap
= typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type,
typename GeomTraits = typename TriangleMesh::Traits,
typename PlaneProxy = CGAL::VSA::Plane_proxy<GeomTraits> >
typename PlaneProxy = CGAL::Plane_proxy<GeomTraits> >
class L2_metric
{
typedef typename GeomTraits::FT FT;
@ -631,7 +630,7 @@ template <typename TriangleMesh,
typename VertexPointMap
= typename boost::property_map<TriangleMesh, boost::vertex_point_t>::type,
typename GeomTraits = typename TriangleMesh::Traits,
typename PlaneProxy = CGAL::VSA::Plane_proxy<GeomTraits> >
typename PlaneProxy = CGAL::Plane_proxy<GeomTraits> >
class L2_proxy_fitting
{
typedef typename GeomTraits::Point_3 Point_3;
@ -730,7 +729,6 @@ private:
const VertexPointMap vpoint_map;
};
} // end namespace VSA
} // end namespace CGAL
#endif // CGAL_SURFACE_MESH_APPROXIMATION_VSA_METRICS_H
#endif // CGAL_VSA_METRICS_H

View File

@ -45,7 +45,7 @@ namespace internal_np{
#undef CGAL_add_named_parameter
};
namespace VSA{
namespace Surface_mesh_approximation{
namespace parameters{
@ -63,7 +63,7 @@ namespace parameters{
#include <CGAL/internal/Surface_mesh_approximation/parameters_interface.h>
#undef CGAL_add_named_parameter
} //namespace parameters
} //namespace VSA
} //namespace Surface_mesh_approximation
} //namespace CGAL

View File

@ -17,8 +17,8 @@ typedef Polyhedron::Facet_handle Facet_handle;
typedef boost::associative_property_map<std::map<Facet_handle, std::size_t> > Facet_proxy_map;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::type Vertex_point_map;
typedef CGAL::VSA::L2_metric<Polyhedron> L2_metric;
typedef CGAL::VSA::L2_proxy_fitting<Polyhedron> L2_proxy_fitting;
typedef CGAL::L2_metric<Polyhedron> L2_metric;
typedef CGAL::L2_proxy_fitting<Polyhedron> L2_proxy_fitting;
typedef CGAL::VSA_approximation<Polyhedron, Vertex_point_map,
L2_metric, L2_proxy_fitting> L2_approx;
typedef L2_approx::Proxy Plane_proxy;

View File

@ -32,7 +32,7 @@ int test() {
CGAL::vsa_mesh_approximation(tm,
std::back_inserter(points),
std::back_inserter(triangles),
CGAL::VSA::parameters::max_nb_proxies(6).
CGAL::Surface_mesh_approximation::parameters::max_nb_proxies(6).
nb_of_iterations(30).
nb_of_relaxations(5).
mesh_chord_error(0.5).

View File

@ -26,14 +26,14 @@ int main()
std::vector<std::vector<std::size_t> > triangles;
std::vector<Kernel::Point_3> points;
std::list<Polyhedron::Vertex_handle> anchors;
std::vector<CGAL::VSA::Plane_proxy<Kernel> > proxies;
std::vector<CGAL::Plane_proxy<Kernel> > proxies;
std::map<Polyhedron::Facet_handle, std::size_t> fidxmap;
boost::associative_property_map<std::map<Polyhedron::Facet_handle, std::size_t> > fpxmap(fidxmap);
CGAL::vsa_mesh_approximation(mesh,
std::back_inserter(points),
std::back_inserter(triangles),
CGAL::VSA::parameters::seeding_method(CGAL::Incremental).
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Incremental).
max_nb_proxies(6).
nb_of_iterations(30).
nb_of_relaxations(5).

View File

@ -6,7 +6,7 @@
#include <CGAL/vsa_mesh_segmentation.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::VSA::Plane_proxy<Kernel> Plane_proxy;
typedef CGAL::Plane_proxy<Kernel> Plane_proxy;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef typename boost::graph_traits<Polyhedron>::face_descriptor face_descriptor;
typedef boost::unordered_map<face_descriptor, std::size_t> Facet_index_map;
@ -34,7 +34,7 @@ int main()
// free function interface with named parameters
CGAL::vsa_mesh_segmentation(input,
fpxmap, // output indexed face set
CGAL::VSA::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
max_nb_proxies(200). // both maximum number of proxies stop criterion,
min_error_drop(0.05). // and minimum error drop stop criterion are specified
nb_of_iterations(30). // number of clustering iterations after seeding