From 5010e4b58accd5ea56beb9f1d2194bc20f1e723f Mon Sep 17 00:00:00 2001 From: Laurent Saboret Date: Tue, 28 Oct 2008 09:18:02 +0000 Subject: [PATCH] Port to g++ 4.3.1 --- .../normal_estimation.cpp | 32 +++++++++---------- .../CGAL/IO/surface_reconstruction_output.h | 2 ++ .../include/CGAL/taucs_solver.h | 4 +-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Surface_reconstruction_3/examples/Surface_reconstruction_3/normal_estimation.cpp b/Surface_reconstruction_3/examples/Surface_reconstruction_3/normal_estimation.cpp index b6784f9b46a..c7a770500b4 100644 --- a/Surface_reconstruction_3/examples/Surface_reconstruction_3/normal_estimation.cpp +++ b/Surface_reconstruction_3/examples/Surface_reconstruction_3/normal_estimation.cpp @@ -174,18 +174,18 @@ int main(int argc, char * argv[]) estimate = argv[++i]; if (estimate != "plane" && estimate != "quadric") std::cerr << "invalid option " << argv[i] << "\n"; - } + } else if (std::string(argv[i])=="-estimate_neighbors") { estimate_neighbors = atoi(argv[++i]); - } + } else if (std::string(argv[i])=="-orient") { orient = argv[++i]; if (orient != "MST") std::cerr << "invalid option " << argv[i] << "\n"; - } + } else if (std::string(argv[i])=="-orient_neighbors") { orient_neighbors = atoi(argv[++i]); - } + } else { std::cerr << "invalid option " << argv[i] << "\n"; } @@ -278,17 +278,17 @@ int main(int argc, char * argv[]) //*************************************** std::deque computed_normals; - + // Estimate normals direction if (estimate == "plane") estimate_normals_pca(pwns, computed_normals, estimate_neighbors); else if (estimate == "quadric") estimate_normals_jet_fitting(pwns, computed_normals, estimate_neighbors); - + // Orient normals if (orient == "MST") orient_normals_MST(pwns, computed_normals, orient_neighbors); - + // Check computed normals int unoriented_normals = 0; std::deque::iterator n; @@ -298,7 +298,7 @@ int main(int argc, char * argv[]) Vector v = *n; double norm = std::sqrt( v*v ); assert(norm > 0.99 || norm < 1.01); - + // Check orientation if ( ! n->is_oriented() ) unoriented_normals++; @@ -318,13 +318,13 @@ int main(int argc, char * argv[]) if (input_points_have_normals) { std::cerr << "Compare with original normals..." << std::endl; - - PointList::iterator p; - /*std::deque::iterator*/ n; + double min_normal_deviation = DBL_MAX; double max_normal_deviation = DBL_MIN; double avg_normal_deviation = 0; int flipped_normals = 0; + PointList::iterator p; + //std::deque::iterator n; for (p = pwns.begin(), n = computed_normals.begin(); p != pwns.end(); p++, n++) { Vector v1 = p->normal(); // input normal @@ -341,13 +341,13 @@ int main(int argc, char * argv[]) flipped_normals++; } double normal_deviation = std::acos(cos_normal_deviation); - + min_normal_deviation = (std::min)(min_normal_deviation, normal_deviation); max_normal_deviation = (std::max)(max_normal_deviation, normal_deviation); avg_normal_deviation += normal_deviation; } avg_normal_deviation /= double(pwns.size()); - + if (flipped_normals > 0) { std::cerr << "Error: " << flipped_normals << " normal(s) are flipped\n"; @@ -364,15 +364,15 @@ int main(int argc, char * argv[]) //*************************************** // Save the point set //*************************************** - + // Replace old normals by new ones PointList::iterator p; - /*std::deque::iterator*/ n; + //std::deque::iterator n; for (p = pwns.begin(), n = computed_normals.begin(); p != pwns.end(); p++, n++) p->normal() = *n; std::cerr << "Write file " << output_filename << std::endl << std::endl; - + /*std::string*/ extension = output_filename.substr(output_filename.find_last_of('.')); if (extension == ".pwn" || extension == ".PWN") { diff --git a/Surface_reconstruction_3/include/CGAL/IO/surface_reconstruction_output.h b/Surface_reconstruction_3/include/CGAL/IO/surface_reconstruction_output.h index 09b7a976278..8a0797d35b1 100644 --- a/Surface_reconstruction_3/include/CGAL/IO/surface_reconstruction_output.h +++ b/Surface_reconstruction_3/include/CGAL/IO/surface_reconstruction_output.h @@ -19,6 +19,8 @@ #ifndef CGAL_SURFACE_RECONSTRUCTION_OUTPUT_H #define CGAL_SURFACE_RECONSTRUCTION_OUTPUT_H +#include + CGAL_BEGIN_NAMESPACE diff --git a/Surface_reconstruction_3/include/CGAL/taucs_solver.h b/Surface_reconstruction_3/include/CGAL/taucs_solver.h index b940279913c..3845c6931ae 100644 --- a/Surface_reconstruction_3/include/CGAL/taucs_solver.h +++ b/Surface_reconstruction_3/include/CGAL/taucs_solver.h @@ -59,10 +59,10 @@ public: Taucs_solver(unsigned int size, ///< Number of rows = number of columns unsigned int nb_elements_per_line=0) ///< Number of non null elements per line ///< (ignored if 0). - : n_rows(size), - PAP(0), + : PAP(0), L(0), SL(0), + n_rows(size), row_index(0), perm(0), invperm(0),