remove Proxy template parameter in main class

This commit is contained in:
Lingjie Zhu 2017-08-27 11:17:43 +08:00
parent d7bb0e1a68
commit 2f6e3be1d8
10 changed files with 33 additions and 33 deletions

View File

@ -14,9 +14,9 @@ typedef Kernel::FT FT;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::type VertexPointMap;
typedef CGAL::L21Metric<Polyhedron> L21Metric;
typedef CGAL::L21ProxyFitting<Polyhedron> L21ProxyFitting;
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap> VSAL21;
typedef VSAL21::ErrorMetric L21Metric;
typedef VSAL21::ProxyFitting L21ProxyFitting;
typedef CGAL::Timer Timer;

View File

@ -13,9 +13,9 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::type VertexPointMap;
typedef CGAL::L21Metric<Polyhedron> L21Metric;
typedef CGAL::L21ProxyFitting<Polyhedron> L21ProxyFitting;
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap> VSAL21;
typedef VSAL21::ErrorMetric L21Metric;
typedef VSAL21::ProxyFitting L21ProxyFitting;
typedef CGAL::Timer Timer;

View File

@ -13,9 +13,9 @@ typedef Kernel::Point_3 Point_3;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::type VertexPointMap;
typedef CGAL::L21Metric<Polyhedron> L21Metric;
typedef CGAL::L21ProxyFitting<Polyhedron> L21ProxyFitting;
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap> VSAL21;
typedef VSAL21::ErrorMetric L21Metric;
typedef VSAL21::ProxyFitting L21ProxyFitting;
int main()
{

View File

@ -77,7 +77,7 @@ struct PointProxyFitting {
const FacetAreaMap area_pmap;
};
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap,
PointProxy, CompactMetric, PointProxyFitting> CompactVSA;
CompactMetric, PointProxyFitting> CompactVSA;
int main()
{

View File

@ -34,31 +34,38 @@ namespace CGAL
* @brief Main class for Variational Shape Approximation algorithm.
* @tparam TriangleMesh a CGAL TriangleMesh
* @tparam VertexPointMap vertex point map
* @tparam Proxy proxy type
* @tparam ErrorMetric error metric type
* @tparam ProxyFitting proxy fitting type
* @tparam GeomTraits geometric traits type
*/
template <typename TriangleMesh,
typename VertexPointMap,
typename Proxy_ = CGAL::Default,
typename ErrorMetric_ = CGAL::Default,
typename ProxyFitting_ = CGAL::Default,
typename GeomTraits_ = CGAL::Default>
class VSA_approximation {
// Default typdefs
// public typedefs
public:
// Default typdefs
typedef typename CGAL::Default::Get<
GeomTraits_,
typename Kernel_traits<
typename boost::property_traits<VertexPointMap>::value_type
>::Kernel >::type GeomTraits;
typedef typename CGAL::Default::Get<Proxy_,
CGAL::PlaneProxy<GeomTraits> >::type Proxy;
typedef typename CGAL::Default::Get<ErrorMetric_,
CGAL::L21Metric<TriangleMesh, VertexPointMap, GeomTraits, Proxy> >::type ErrorMetric;
CGAL::L21Metric<TriangleMesh, VertexPointMap, GeomTraits> >::type ErrorMetric;
typedef typename CGAL::Default::Get<ProxyFitting_,
CGAL::L21ProxyFitting<TriangleMesh, VertexPointMap, GeomTraits, Proxy> >::type ProxyFitting;
CGAL::L21ProxyFitting<TriangleMesh, VertexPointMap, GeomTraits> >::type ProxyFitting;
typedef typename ErrorMetric::Proxy Proxy;
enum Initialization {
RandomInit,
IncrementalInit,
HierarchicalInit
};
// private typedefs and data member
private:
// GeomTraits typedefs
typedef typename GeomTraits::FT FT;
typedef typename GeomTraits::Point_3 Point_3;
@ -218,14 +225,8 @@ class VSA_approximation {
// The indexed triangle approximation.
std::vector<int> tris;
//member functions
//member functions
public:
enum Initialization {
RandomInit,
IncrementalInit,
HierarchicalInit
};
/*!
* %Default constructor.
*/
@ -834,6 +835,7 @@ public:
return bdrs;
}
// private member functions
private:
/*!
* @brief Random initialize proxies.

View File

@ -78,11 +78,9 @@ bool vsa_mesh_approximation(const TriangleMesh &tm_in,
get(boost::vertex_point, const_cast<TriangleMesh &>(tm_in)));
// get_property_map(vertex_point, tm_in));
typedef CGAL::PlaneProxy<GeomTraits> PlaneProxy;
typedef CGAL::L21Metric<TriangleMesh> L21Metric;
typedef CGAL::L21ProxyFitting<TriangleMesh> L21ProxyFitting;
typedef CGAL::VSA_approximation<TriangleMesh, VPMap,
PlaneProxy, L21Metric, L21ProxyFitting> VSAL21;
typedef CGAL::VSA_approximation<TriangleMesh, VPMap> VSAL21;
typedef typename VSAL21::ErrorMetric L21Metric;
typedef typename VSAL21::ProxyFitting L21ProxyFitting;
VSAL21 vsa_l21(tm_in, point_pmap);
L21Metric l21_metric(tm_in);

View File

@ -17,11 +17,11 @@ typedef Polyhedron::Facet_handle Facet_handle;
typedef boost::associative_property_map<std::map<Facet_handle, std::size_t> > FacetProxyMap;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::type VertexPointMap;
typedef CGAL::PlaneProxy<Kernel> PlaneProxy;
typedef CGAL::L2Metric<Polyhedron> L2Metric;
typedef CGAL::L2ProxyFitting<Polyhedron> L2ProxyFitting;
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap,
CGAL::Default, L2Metric, L2ProxyFitting> VSA;
L2Metric, L2ProxyFitting> VSA;
typedef VSA::Proxy PlaneProxy;
/**
* This file tests the VSA class API and the L2 metric.

View File

@ -14,9 +14,9 @@ typedef Kernel::Point_3 Point_3;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::type VertexPointMap;
typedef CGAL::L21Metric<Polyhedron> L21Metric;
typedef CGAL::L21ProxyFitting<Polyhedron> L21ProxyFitting;
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap> VSAL21;
typedef VSAL21::ErrorMetric L21Metric;
typedef VSAL21::ProxyFitting L21ProxyFitting;
bool test_shape(const char *file_name, const std::size_t target_num_proxies)
{

View File

@ -13,9 +13,9 @@ typedef Kernel::FT FT;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::type VertexPointMap;
typedef CGAL::L21Metric<Polyhedron> L21Metric;
typedef CGAL::L21ProxyFitting<Polyhedron> L21ProxyFitting;
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap> VSAL21;
typedef VSAL21::ErrorMetric L21Metric;
typedef VSAL21::ProxyFitting L21ProxyFitting;
bool check_strict_ordering(const std::vector<FT> &error)
{

View File

@ -68,7 +68,7 @@ struct PointProxyFitting {
const FacetAreaMap area_pmap;
};
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap,
PointProxy, CompactMetric, PointProxyFitting> CompactVSA;
CompactMetric, PointProxyFitting> CompactVSA;
/**
* This file tests the user defined metric.