Skip to content

Commit

Permalink
fix demo to new metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
aboudev committed Aug 21, 2017
1 parent 6d70100 commit 4558af6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Expand Up @@ -62,7 +62,6 @@ int Scene::open(QString filename)

// construct facet property maps
m_fidx_map.clear();
m_facet_normals.clear();
m_facet_centers.clear();
m_facet_areas.clear();
for(Facet_iterator fitr = m_pmesh->facets_begin();
Expand All @@ -74,9 +73,6 @@ int Scene::open(QString filename)
const Point_3 p2 = he->vertex()->point();
const Point_3 p3 = he->next()->vertex()->point();

Vector_3 normal = CGAL::unit_normal(p1, p2, p3);
m_facet_normals.insert(std::pair<Facet_handle, Vector_3>(fitr, normal));

m_facet_centers.insert(std::pair<Facet_handle, Point_3>(fitr,
CGAL::centroid(p1, p2, p3)));

Expand All @@ -98,9 +94,9 @@ int Scene::open(QString filename)
if (m_pcompact_proxy_fitting)
delete m_pcompact_proxy_fitting;

m_pl21_metric = new L21Metric(m_normal_pmap, m_area_pmap);
m_pl21_proxy_fitting = new L21ProxyFitting(m_normal_pmap, m_area_pmap);
m_pl2_metric = new L2Metric(*m_pmesh, m_area_pmap);
m_pl21_metric = new L21Metric(*m_pmesh);
m_pl21_proxy_fitting = new L21ProxyFitting(*m_pmesh);
m_pl2_metric = new L2Metric(*m_pmesh);
m_pl2_proxy_fitting = new L2ProxyFitting(*m_pmesh);
m_pcompact_metric = new CompactMetric(m_center_pmap);
m_pcompact_proxy_fitting = new PointProxyFitting(m_center_pmap, m_area_pmap);
Expand Down
Expand Up @@ -34,11 +34,11 @@ typedef boost::property_map<Polyhedron_3, boost::vertex_point_t>::type VertexPoi

typedef CGAL::PlaneProxy<Polyhedron_3> PlaneProxy;

typedef CGAL::L21Metric<Polyhedron_3, FacetNormalMap, FacetAreaMap> L21Metric;
typedef CGAL::L21ProxyFitting<Polyhedron_3, FacetNormalMap, FacetAreaMap> L21ProxyFitting;
typedef CGAL::L21Metric<Polyhedron_3> L21Metric;
typedef CGAL::L21ProxyFitting<Polyhedron_3> L21ProxyFitting;
typedef CGAL::VSA_approximation<Polyhedron_3, PlaneProxy, L21Metric, L21ProxyFitting> VSAL21;

typedef CGAL::L2Metric<Polyhedron_3, FacetAreaMap> L2Metric;
typedef CGAL::L2Metric<Polyhedron_3> L2Metric;
typedef CGAL::L2ProxyFitting<Polyhedron_3> L2ProxyFitting;
typedef CGAL::VSA_approximation<Polyhedron_3, PlaneProxy, L2Metric, L2ProxyFitting> VSAL2;

Expand Down Expand Up @@ -103,7 +103,6 @@ class Scene
Scene() :
m_pmesh(NULL),
m_fidx_pmap(m_fidx_map),
m_normal_pmap(m_facet_normals),
m_center_pmap(m_facet_centers),
m_area_pmap(m_facet_areas),
m_pl21_metric(NULL),
Expand Down Expand Up @@ -193,10 +192,8 @@ class Scene
boost::associative_property_map<std::map<Facet_handle, std::size_t> > m_fidx_pmap;

// facet property maps
std::map<Facet_handle, Vector_3> m_facet_normals;
std::map<Facet_handle, Point_3> m_facet_centers;
std::map<Facet_handle, FT> m_facet_areas;
FacetNormalMap m_normal_pmap;
FacetCenterMap m_center_pmap;
FacetAreaMap m_area_pmap;

Expand Down

0 comments on commit 4558af6

Please sign in to comment.