mirror of https://github.com/CGAL/cgal
Port to g++ 4.3.1
This commit is contained in:
parent
cb2fe127ab
commit
5010e4b58a
|
|
@ -174,18 +174,18 @@ int main(int argc, char * argv[])
|
||||||
estimate = argv[++i];
|
estimate = argv[++i];
|
||||||
if (estimate != "plane" && estimate != "quadric")
|
if (estimate != "plane" && estimate != "quadric")
|
||||||
std::cerr << "invalid option " << argv[i] << "\n";
|
std::cerr << "invalid option " << argv[i] << "\n";
|
||||||
}
|
}
|
||||||
else if (std::string(argv[i])=="-estimate_neighbors") {
|
else if (std::string(argv[i])=="-estimate_neighbors") {
|
||||||
estimate_neighbors = atoi(argv[++i]);
|
estimate_neighbors = atoi(argv[++i]);
|
||||||
}
|
}
|
||||||
else if (std::string(argv[i])=="-orient") {
|
else if (std::string(argv[i])=="-orient") {
|
||||||
orient = argv[++i];
|
orient = argv[++i];
|
||||||
if (orient != "MST")
|
if (orient != "MST")
|
||||||
std::cerr << "invalid option " << argv[i] << "\n";
|
std::cerr << "invalid option " << argv[i] << "\n";
|
||||||
}
|
}
|
||||||
else if (std::string(argv[i])=="-orient_neighbors") {
|
else if (std::string(argv[i])=="-orient_neighbors") {
|
||||||
orient_neighbors = atoi(argv[++i]);
|
orient_neighbors = atoi(argv[++i]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << "invalid option " << argv[i] << "\n";
|
std::cerr << "invalid option " << argv[i] << "\n";
|
||||||
}
|
}
|
||||||
|
|
@ -278,17 +278,17 @@ int main(int argc, char * argv[])
|
||||||
//***************************************
|
//***************************************
|
||||||
|
|
||||||
std::deque<Orientable_normal> computed_normals;
|
std::deque<Orientable_normal> computed_normals;
|
||||||
|
|
||||||
// Estimate normals direction
|
// Estimate normals direction
|
||||||
if (estimate == "plane")
|
if (estimate == "plane")
|
||||||
estimate_normals_pca(pwns, computed_normals, estimate_neighbors);
|
estimate_normals_pca(pwns, computed_normals, estimate_neighbors);
|
||||||
else if (estimate == "quadric")
|
else if (estimate == "quadric")
|
||||||
estimate_normals_jet_fitting(pwns, computed_normals, estimate_neighbors);
|
estimate_normals_jet_fitting(pwns, computed_normals, estimate_neighbors);
|
||||||
|
|
||||||
// Orient normals
|
// Orient normals
|
||||||
if (orient == "MST")
|
if (orient == "MST")
|
||||||
orient_normals_MST(pwns, computed_normals, orient_neighbors);
|
orient_normals_MST(pwns, computed_normals, orient_neighbors);
|
||||||
|
|
||||||
// Check computed normals
|
// Check computed normals
|
||||||
int unoriented_normals = 0;
|
int unoriented_normals = 0;
|
||||||
std::deque<Orientable_normal>::iterator n;
|
std::deque<Orientable_normal>::iterator n;
|
||||||
|
|
@ -298,7 +298,7 @@ int main(int argc, char * argv[])
|
||||||
Vector v = *n;
|
Vector v = *n;
|
||||||
double norm = std::sqrt( v*v );
|
double norm = std::sqrt( v*v );
|
||||||
assert(norm > 0.99 || norm < 1.01);
|
assert(norm > 0.99 || norm < 1.01);
|
||||||
|
|
||||||
// Check orientation
|
// Check orientation
|
||||||
if ( ! n->is_oriented() )
|
if ( ! n->is_oriented() )
|
||||||
unoriented_normals++;
|
unoriented_normals++;
|
||||||
|
|
@ -318,13 +318,13 @@ int main(int argc, char * argv[])
|
||||||
if (input_points_have_normals)
|
if (input_points_have_normals)
|
||||||
{
|
{
|
||||||
std::cerr << "Compare with original normals..." << std::endl;
|
std::cerr << "Compare with original normals..." << std::endl;
|
||||||
|
|
||||||
PointList::iterator p;
|
|
||||||
/*std::deque<Orientable_normal>::iterator*/ n;
|
|
||||||
double min_normal_deviation = DBL_MAX;
|
double min_normal_deviation = DBL_MAX;
|
||||||
double max_normal_deviation = DBL_MIN;
|
double max_normal_deviation = DBL_MIN;
|
||||||
double avg_normal_deviation = 0;
|
double avg_normal_deviation = 0;
|
||||||
int flipped_normals = 0;
|
int flipped_normals = 0;
|
||||||
|
PointList::iterator p;
|
||||||
|
//std::deque<Orientable_normal>::iterator n;
|
||||||
for (p = pwns.begin(), n = computed_normals.begin(); p != pwns.end(); p++, n++)
|
for (p = pwns.begin(), n = computed_normals.begin(); p != pwns.end(); p++, n++)
|
||||||
{
|
{
|
||||||
Vector v1 = p->normal(); // input normal
|
Vector v1 = p->normal(); // input normal
|
||||||
|
|
@ -341,13 +341,13 @@ int main(int argc, char * argv[])
|
||||||
flipped_normals++;
|
flipped_normals++;
|
||||||
}
|
}
|
||||||
double normal_deviation = std::acos(cos_normal_deviation);
|
double normal_deviation = std::acos(cos_normal_deviation);
|
||||||
|
|
||||||
min_normal_deviation = (std::min)(min_normal_deviation, normal_deviation);
|
min_normal_deviation = (std::min)(min_normal_deviation, normal_deviation);
|
||||||
max_normal_deviation = (std::max)(max_normal_deviation, normal_deviation);
|
max_normal_deviation = (std::max)(max_normal_deviation, normal_deviation);
|
||||||
avg_normal_deviation += normal_deviation;
|
avg_normal_deviation += normal_deviation;
|
||||||
}
|
}
|
||||||
avg_normal_deviation /= double(pwns.size());
|
avg_normal_deviation /= double(pwns.size());
|
||||||
|
|
||||||
if (flipped_normals > 0)
|
if (flipped_normals > 0)
|
||||||
{
|
{
|
||||||
std::cerr << "Error: " << flipped_normals << " normal(s) are flipped\n";
|
std::cerr << "Error: " << flipped_normals << " normal(s) are flipped\n";
|
||||||
|
|
@ -364,15 +364,15 @@ int main(int argc, char * argv[])
|
||||||
//***************************************
|
//***************************************
|
||||||
// Save the point set
|
// Save the point set
|
||||||
//***************************************
|
//***************************************
|
||||||
|
|
||||||
// Replace old normals by new ones
|
// Replace old normals by new ones
|
||||||
PointList::iterator p;
|
PointList::iterator p;
|
||||||
/*std::deque<Orientable_normal>::iterator*/ n;
|
//std::deque<Orientable_normal>::iterator n;
|
||||||
for (p = pwns.begin(), n = computed_normals.begin(); p != pwns.end(); p++, n++)
|
for (p = pwns.begin(), n = computed_normals.begin(); p != pwns.end(); p++, n++)
|
||||||
p->normal() = *n;
|
p->normal() = *n;
|
||||||
|
|
||||||
std::cerr << "Write file " << output_filename << std::endl << std::endl;
|
std::cerr << "Write file " << output_filename << std::endl << std::endl;
|
||||||
|
|
||||||
/*std::string*/ extension = output_filename.substr(output_filename.find_last_of('.'));
|
/*std::string*/ extension = output_filename.substr(output_filename.find_last_of('.'));
|
||||||
if (extension == ".pwn" || extension == ".PWN")
|
if (extension == ".pwn" || extension == ".PWN")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@
|
||||||
#ifndef CGAL_SURFACE_RECONSTRUCTION_OUTPUT_H
|
#ifndef CGAL_SURFACE_RECONSTRUCTION_OUTPUT_H
|
||||||
#define CGAL_SURFACE_RECONSTRUCTION_OUTPUT_H
|
#define CGAL_SURFACE_RECONSTRUCTION_OUTPUT_H
|
||||||
|
|
||||||
|
#include <CGAL/value_type_traits.h>
|
||||||
|
|
||||||
CGAL_BEGIN_NAMESPACE
|
CGAL_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@ public:
|
||||||
Taucs_solver(unsigned int size, ///< Number of rows = number of columns
|
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
|
unsigned int nb_elements_per_line=0) ///< Number of non null elements per line
|
||||||
///< (ignored if 0).
|
///< (ignored if 0).
|
||||||
: n_rows(size),
|
: PAP(0),
|
||||||
PAP(0),
|
|
||||||
L(0),
|
L(0),
|
||||||
SL(0),
|
SL(0),
|
||||||
|
n_rows(size),
|
||||||
row_index(0),
|
row_index(0),
|
||||||
perm(0),
|
perm(0),
|
||||||
invperm(0),
|
invperm(0),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue