Removed OpenMP stuff
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@709 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -55,9 +55,6 @@
|
|||||||
//== INCLUDES =================================================================
|
//== INCLUDES =================================================================
|
||||||
|
|
||||||
#include "ModHausdorffT.hh"
|
#include "ModHausdorffT.hh"
|
||||||
#ifdef USE_OPENMP
|
|
||||||
#include <omp.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//== NAMESPACES ===============================================================
|
//== NAMESPACES ===============================================================
|
||||||
@@ -83,14 +80,10 @@ distPointTriangleSquared( const Point& _p,
|
|||||||
|
|
||||||
// Check if the triangle is degenerated
|
// Check if the triangle is degenerated
|
||||||
if (d < FLT_MIN && d > -FLT_MIN) {
|
if (d < FLT_MIN && d > -FLT_MIN) {
|
||||||
// std::cerr << "distPointTriangleSquared: Degenerated triangle !\n";
|
|
||||||
// std::cerr << "Points are : " << _v0 << " " << _v1 << " " << _v2 << std::endl;
|
|
||||||
// std::cerr << "d is " << d << std::endl;
|
|
||||||
return -1.0;
|
return -1.0;
|
||||||
}
|
}
|
||||||
const double invD = 1.0 / d;
|
const double invD = 1.0 / d;
|
||||||
|
|
||||||
|
|
||||||
// these are not needed for every point, should still perform
|
// these are not needed for every point, should still perform
|
||||||
// better with many points against one triangle
|
// better with many points against one triangle
|
||||||
const Point v1v2 = _v2 - _v1;
|
const Point v1v2 = _v2 - _v1;
|
||||||
@@ -105,7 +98,6 @@ distPointTriangleSquared( const Point& _p,
|
|||||||
const double a = (t | v0v2) * -invD;
|
const double a = (t | v0v2) * -invD;
|
||||||
const double b = (t | v0v1) * invD;
|
const double b = (t | v0v1) * invD;
|
||||||
|
|
||||||
|
|
||||||
if (a < 0)
|
if (a < 0)
|
||||||
{
|
{
|
||||||
// Calculate the distance to an edge or a corner vertex
|
// Calculate the distance to an edge or a corner vertex
|
||||||
@@ -215,7 +207,7 @@ collapse_priority(const CollapseInfo& _ci)
|
|||||||
std::vector<FaceHandle> faces; faces.reserve(20);
|
std::vector<FaceHandle> faces; faces.reserve(20);
|
||||||
typename Mesh::VertexFaceIter vf_it;
|
typename Mesh::VertexFaceIter vf_it;
|
||||||
typename Mesh::FaceHandle fh;
|
typename Mesh::FaceHandle fh;
|
||||||
typename Mesh::Scalar sqr_tolerace = tolerance_*tolerance_;
|
const typename Mesh::Scalar sqr_tolerace = tolerance_*tolerance_;
|
||||||
typename Mesh::CFVIter fv_it;
|
typename Mesh::CFVIter fv_it;
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
@@ -321,19 +313,14 @@ postprocess_collapse(const CollapseInfo& _ci)
|
|||||||
pts.clear();
|
pts.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// add the deleted point
|
// add the deleted point
|
||||||
points.push_back(_ci.p0);
|
points.push_back(_ci.p0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// setup iterators
|
// setup iterators
|
||||||
typename std::vector<FaceHandle>::iterator fh_it, fh_end(faces.end());
|
typename std::vector<FaceHandle>::iterator fh_it, fh_end(faces.end());
|
||||||
typename Points::const_iterator p_it, p_end(points.end());
|
typename Points::const_iterator p_it, p_end(points.end());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// re-distribute points
|
// re-distribute points
|
||||||
Scalar emin, e;
|
Scalar emin, e;
|
||||||
typename Mesh::CFVIter fv_it;
|
typename Mesh::CFVIter fv_it;
|
||||||
@@ -381,24 +368,12 @@ compute_sqr_error(FaceHandle _fh, const Point& _p) const
|
|||||||
Scalar emax = distPointTriangleSquared(_p, p0, p1, p2);
|
Scalar emax = distPointTriangleSquared(_p, p0, p1, p2);
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_OPENMP
|
|
||||||
int pointsCount = points.size();
|
|
||||||
#pragma omp parallel for private(e) shared(emax)
|
|
||||||
for (int i = 0; i < pointsCount; ++i) {
|
|
||||||
e = distPointTriangleSquared(points[i], p0, p1, p2);
|
|
||||||
#pragma omp critical(emaxUpdate)
|
|
||||||
{
|
|
||||||
if (e > emax)
|
|
||||||
emax = e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
for (; p_it!=p_end; ++p_it) {
|
for (; p_it!=p_end; ++p_it) {
|
||||||
e = distPointTriangleSquared(*p_it, p0, p1, p2);
|
e = distPointTriangleSquared(*p_it, p0, p1, p2);
|
||||||
if (e > emax)
|
if (e > emax)
|
||||||
emax = e;
|
emax = e;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return emax;
|
return emax;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user