mirror of https://github.com/CGAL/cgal
add const qualifier to functors
This commit is contained in:
parent
b2ce689f7f
commit
6eb9659b83
|
|
@ -30,7 +30,7 @@ struct CompactMetric {
|
||||||
CompactMetric(const FacetCenterMap &_center_pmap)
|
CompactMetric(const FacetCenterMap &_center_pmap)
|
||||||
: center_pmap(_center_pmap) {}
|
: center_pmap(_center_pmap) {}
|
||||||
|
|
||||||
FT operator()(const Facet_const_handle &f, const PointProxy &px) {
|
FT operator()(const Facet_const_handle &f, const PointProxy &px) const {
|
||||||
return FT(std::sqrt(CGAL::to_double(
|
return FT(std::sqrt(CGAL::to_double(
|
||||||
CGAL::squared_distance(center_pmap[f], px.center))));
|
CGAL::squared_distance(center_pmap[f], px.center))));
|
||||||
}
|
}
|
||||||
|
|
@ -45,7 +45,7 @@ struct PointProxyFitting {
|
||||||
area_pmap(_area_pmap) {}
|
area_pmap(_area_pmap) {}
|
||||||
|
|
||||||
template<typename FacetIterator>
|
template<typename FacetIterator>
|
||||||
PointProxy operator()(const FacetIterator beg, const FacetIterator end) {
|
PointProxy operator()(const FacetIterator beg, const FacetIterator end) const {
|
||||||
CGAL_assertion(beg != end);
|
CGAL_assertion(beg != end);
|
||||||
|
|
||||||
// fitting center
|
// fitting center
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,10 @@ private:
|
||||||
std::vector<Proxy> proxies;
|
std::vector<Proxy> proxies;
|
||||||
|
|
||||||
// The error metric.
|
// The error metric.
|
||||||
ErrorMetric fit_error;
|
const ErrorMetric &fit_error;
|
||||||
|
|
||||||
// The proxy fitting functor.
|
// The proxy fitting functor.
|
||||||
ProxyFitting proxy_fitting;
|
const ProxyFitting &proxy_fitting;
|
||||||
|
|
||||||
//member functions
|
//member functions
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ struct L21Metric
|
||||||
typedef typename GeomTraits::Compute_scalar_product_3 Compute_scalar_product_3;
|
typedef typename GeomTraits::Compute_scalar_product_3 Compute_scalar_product_3;
|
||||||
typedef typename FacetAreaMap::key_type face_descriptor;
|
typedef typename FacetAreaMap::key_type face_descriptor;
|
||||||
|
|
||||||
FT operator()(const face_descriptor &f, const PlaneProxy &px) {
|
FT operator()(const face_descriptor &f, const PlaneProxy &px) const {
|
||||||
Vector_3 v = sum_functor(normal_pmap[f], scale_functor(px.normal, FT(-1)));
|
Vector_3 v = sum_functor(normal_pmap[f], scale_functor(px.normal, FT(-1)));
|
||||||
return area_pmap[f] * scalar_product_functor(v, v);
|
return area_pmap[f] * scalar_product_functor(v, v);
|
||||||
}
|
}
|
||||||
|
|
@ -78,7 +78,7 @@ struct L21ProxyFitting
|
||||||
|
|
||||||
// Fit and construct a proxy
|
// Fit and construct a proxy
|
||||||
template<typename FacetIterator>
|
template<typename FacetIterator>
|
||||||
PlaneProxy operator()(const FacetIterator beg, const FacetIterator end) {
|
PlaneProxy operator()(const FacetIterator beg, const FacetIterator end) const {
|
||||||
CGAL_assertion(beg != end);
|
CGAL_assertion(beg != end);
|
||||||
|
|
||||||
// fitting normal
|
// fitting normal
|
||||||
|
|
@ -222,7 +222,7 @@ struct L2Metric
|
||||||
typedef typename boost::graph_traits<TriangleMesh>::face_descriptor face_descriptor;
|
typedef typename boost::graph_traits<TriangleMesh>::face_descriptor face_descriptor;
|
||||||
typedef typename boost::graph_traits<TriangleMesh>::halfedge_descriptor halfedge_descriptor;
|
typedef typename boost::graph_traits<TriangleMesh>::halfedge_descriptor halfedge_descriptor;
|
||||||
|
|
||||||
FT operator()(const face_descriptor &f, const PlaneProxy &px) {
|
FT operator()(const face_descriptor &f, const PlaneProxy &px) const {
|
||||||
halfedge_descriptor he = halfedge(f, mesh);
|
halfedge_descriptor he = halfedge(f, mesh);
|
||||||
const Point_3 &p0 = point_pmap[source(he, mesh)];
|
const Point_3 &p0 = point_pmap[source(he, mesh)];
|
||||||
const Point_3 &p1 = point_pmap[target(he, mesh)];
|
const Point_3 &p1 = point_pmap[target(he, mesh)];
|
||||||
|
|
@ -257,7 +257,7 @@ struct L2ProxyFitting
|
||||||
: mesh(_mesh), point_pmap(_point_pmap) {}
|
: mesh(_mesh), point_pmap(_point_pmap) {}
|
||||||
|
|
||||||
template<typename FacetIterator>
|
template<typename FacetIterator>
|
||||||
PlaneProxy operator()(const FacetIterator beg, const FacetIterator end) {
|
PlaneProxy operator()(const FacetIterator beg, const FacetIterator end) const {
|
||||||
CGAL_assertion(beg != end);
|
CGAL_assertion(beg != end);
|
||||||
|
|
||||||
std::list<Triangle_3> tris;
|
std::list<Triangle_3> tris;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue