Commit 398844b1 authored by Jan Möbius's avatar Jan Möbius

Removed OpenMP stuff

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@709 fdac6126-5c0c-442c-9429-916003d36597
parent db14a8a1
......@@ -55,9 +55,6 @@
//== INCLUDES =================================================================
#include "ModHausdorffT.hh"
#ifdef USE_OPENMP
#include <omp.h>
#endif
//== NAMESPACES ===============================================================
......@@ -83,14 +80,10 @@ distPointTriangleSquared( const Point& _p,
// Check if the triangle is degenerated
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;
}
const double invD = 1.0 / d;
// these are not needed for every point, should still perform
// better with many points against one triangle
const Point v1v2 = _v2 - _v1;
......@@ -105,7 +98,6 @@ distPointTriangleSquared( const Point& _p,
const double a = (t | v0v2) * -invD;
const double b = (t | v0v1) * invD;
if (a < 0)
{
// 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);
typename Mesh::VertexFaceIter vf_it;
typename Mesh::FaceHandle fh;
typename Mesh::Scalar sqr_tolerace = tolerance_*tolerance_;
const typename Mesh::Scalar sqr_tolerace = tolerance_*tolerance_;
typename Mesh::CFVIter fv_it;
bool ok;
......@@ -321,19 +313,14 @@ postprocess_collapse(const CollapseInfo& _ci)
pts.clear();
}
// add the deleted point
points.push_back(_ci.p0);
// setup iterators
typename std::vector<FaceHandle>::iterator fh_it, fh_end(faces.end());
typename Points::const_iterator p_it, p_end(points.end());
// re-distribute points
Scalar emin, e;
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);
#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) {
e = distPointTriangleSquared(*p_it, p0, p1, p2);
if (e > emax)
emax = e;
}
#endif
return emax;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment