surface mesh approximation range loop analysis copy to ref warning fixed

This commit is contained in:
Dmitry Anisimov 2021-01-08 10:15:12 +01:00
parent 3fbb269392
commit fbbff6794f
6 changed files with 9 additions and 9 deletions

View File

@ -46,7 +46,7 @@ struct Compact_metric_point_proxy
// fitting center
Vector_3 center = CGAL::NULL_VECTOR;
FT sum_areas = FT(0.0);
for(const face_descriptor f : faces) {
for(const face_descriptor& f : faces) {
center = center + (center_pmap[f] - CGAL::ORIGIN) * area_pmap[f];
sum_areas += area_pmap[f];
}

View File

@ -127,7 +127,7 @@ public:
// fitting normal
Vector_3 norm = CGAL::NULL_VECTOR;
for(const face_descriptor f : faces) {
for(const face_descriptor& f : faces) {
norm = m_sum_functor(norm,
m_scale_functor(get(m_fnmap, f), get(m_famap, f)));
}

View File

@ -125,7 +125,7 @@ public:
CGAL_assertion(!faces.empty());
std::list<Triangle_3> tris;
for(const face_descriptor f : faces) {
for(const face_descriptor& f : faces) {
const halfedge_descriptor he = halfedge(f, *m_tm);
const Point_3 &p0 = m_vpmap[source(he, *m_tm)];
const Point_3 &p1 = m_vpmap[target(he, *m_tm)];

View File

@ -1552,7 +1552,7 @@ private:
std::cerr << "#chord_anchor " << m_bcycles.back().num_anchors << std::endl;
#endif
for(const halfedge_descriptor he : chord)
for(const halfedge_descriptor& he : chord)
he_candidates.erase(he);
} while (he_start != he_mark);
}
@ -1600,7 +1600,7 @@ private:
FT dist_max(0.0);
chord_vec = scale_functor(chord_vec,
FT(1.0) / CGAL::approximate_sqrt(chord_vec.squared_length()));
for(const halfedge_descriptor he : chord) {
for(const halfedge_descriptor& he : chord) {
Vector_3 vec = vector_functor(pt_begin, m_vpoint_map[target(he, *m_ptm)]);
vec = cross_product_functor(chord_vec, vec);
const FT dist = CGAL::approximate_sqrt(vec.squared_length());
@ -1612,7 +1612,7 @@ private:
}
else {
FT dist_max(0.0);
for(const halfedge_descriptor he : chord) {
for(const halfedge_descriptor& he : chord) {
const FT dist = CGAL::approximate_sqrt(CGAL::squared_distance(
pt_begin, m_vpoint_map[target(he, *m_ptm)]));
if (dist > dist_max) {

View File

@ -46,7 +46,7 @@ struct Compact_metric_point_proxy {
// fitting center
Vector_3 center = CGAL::NULL_VECTOR;
FT sum_areas = FT(0.0);
for(const face_descriptor f : faces) {
for(const face_descriptor& f : faces) {
center = center + (center_pmap[f] - CGAL::ORIGIN) * area_pmap[f];
sum_areas += area_pmap[f];
}

View File

@ -104,7 +104,7 @@ int main()
CGAL::Bbox_3 bbox;
for(const vertex_descriptor v : vertices(mesh))
for(const vertex_descriptor& v : vertices(mesh))
bbox += vpmap[v].bbox();
const FT ymin = bbox.ymin(), ymax = bbox.ymax(), yrange = ymax - ymin;
std::cout << "Range along y axis: [" << ymin << ", " << ymax << "]" << std::endl;
@ -113,7 +113,7 @@ int main()
std::size_t planar_pxidx = static_cast<std::size_t>(-1);
std::size_t num_planar_faces = 0;
bool first = true;
for(const face_descriptor f : faces(mesh)) {
for(const face_descriptor& f : faces(mesh)) {
const halfedge_descriptor he = halfedge(f, mesh);
const Point_3 &p0 = vpmap[source(he, mesh)];
const Point_3 &p1 = vpmap[target(he, mesh)];