Update calls of parallelized PSP function in other packages

This commit is contained in:
Simon Giraudot 2015-09-08 11:01:09 +02:00
parent 95682d11e0
commit 59552881a7
9 changed files with 51 additions and 13 deletions

View File

@ -25,6 +25,13 @@
#endif
#endif
// Concurrency
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
class Polyhedron_demo_normal_estimation_plugin :
public QObject,
public Polyhedron_demo_plugin_helper
@ -144,7 +151,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger
std::cerr << "Estimates normal direction by PCA (k=" << dialog.directionNbNeighbors() <<")...\n";
// Estimates normals direction.
CGAL::pca_estimate_normals(points->begin(), points->end(),
CGAL::pca_estimate_normals<Concurrency_tag>(points->begin(), points->end(),
CGAL::make_normal_of_point_with_normal_pmap(Point_set::value_type()),
dialog.directionNbNeighbors());
@ -162,7 +169,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger
std::cerr << "Estimates normal direction by Jet Fitting (k=" << dialog.directionNbNeighbors() <<")...\n";
// Estimates normals direction.
CGAL::jet_estimate_normals(points->begin(), points->end(),
CGAL::jet_estimate_normals<Concurrency_tag>(points->begin(), points->end(),
CGAL::make_normal_of_point_with_normal_pmap(Point_set::value_type()),
dialog.directionNbNeighbors());

View File

@ -15,6 +15,14 @@
#include <QInputDialog>
#include <QMessageBox>
// Concurrency
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
class Polyhedron_demo_point_set_average_spacing_plugin :
public QObject,
public Polyhedron_demo_plugin_helper
@ -83,7 +91,7 @@ void Polyhedron_demo_point_set_average_spacing_plugin::on_actionAverageSpacing_t
std::cerr << "Average spacing (k=" << nb_neighbors <<")...\n";
// Computes average spacing
double average_spacing = CGAL::compute_average_spacing(
double average_spacing = CGAL::compute_average_spacing<Concurrency_tag>(
points->begin(), points->end(),
nb_neighbors);

View File

@ -18,6 +18,14 @@
#include "ui_Polyhedron_demo_point_set_simplification_plugin.h"
// Concurrency
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
class Polyhedron_demo_point_set_simplification_plugin :
public QObject,
public Polyhedron_demo_plugin_helper
@ -103,7 +111,7 @@ void Polyhedron_demo_point_set_simplification_plugin::on_actionSimplify_triggere
std::cerr << "Point cloud simplification by clustering (cell size = " << dialog.gridCellSize() <<" * average spacing)...\n";
// Computes average spacing
double average_spacing = CGAL::compute_average_spacing(
double average_spacing = CGAL::compute_average_spacing<Concurrency_tag>(
points->begin(), points->end(),
6 /* knn = 1 ring */);

View File

@ -12,6 +12,14 @@
#include <CGAL/jet_smooth_point_set.h>
// Concurrency
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
class Polyhedron_demo_point_set_smoothing_plugin :
public QObject,
public Polyhedron_demo_plugin_helper
@ -71,7 +79,7 @@ void Polyhedron_demo_point_set_smoothing_plugin::on_actionJetSmoothing_triggered
QApplication::setOverrideCursor(Qt::WaitCursor);
CGAL::jet_smooth_point_set(points->begin(), points->end(), nb_neighbors);
CGAL::jet_smooth_point_set<Concurrency_tag>(points->begin(), points->end(), nb_neighbors);
points->invalidate_bounds();

View File

@ -40,6 +40,14 @@ typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
typedef CGAL::AABB_traits<Kernel, Primitive> AABB_traits;
typedef CGAL::AABB_tree<AABB_traits> AABB_tree;
// Concurrency
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// Poisson reconstruction method:
// Reconstructs a surface mesh from a point set and returns it as a polyhedron.
@ -123,7 +131,7 @@ Polyhedron* poisson_reconstruct(const Point_set& points,
std::cerr << "Surface meshing...\n";
// Computes average spacing
Kernel::FT average_spacing = CGAL::compute_average_spacing(points.begin(), points.end(),
Kernel::FT average_spacing = CGAL::compute_average_spacing<Concurrency_tag>(points.begin(), points.end(),
6 /* knn = 1 ring */);
// Gets one point inside the implicit surface

View File

@ -64,7 +64,6 @@ typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
typedef CGAL::AABB_traits<Kernel, Primitive> AABB_traits;
typedef CGAL::AABB_tree<AABB_traits> AABB_tree;
struct Counter {
int i, N;
Counter(int N)
@ -296,7 +295,7 @@ int main(int argc, char * argv[])
std::cerr << "Surface meshing...\n";
// Computes average spacing
FT average_spacing = CGAL::compute_average_spacing(points.begin(), points.end(),
FT average_spacing = CGAL::compute_average_spacing<CGAL::Sequential_tag>(points.begin(), points.end(),
6 /* knn = 1 ring */);
// Gets one point inside the implicit surface

View File

@ -65,7 +65,7 @@ int main(void)
return EXIT_FAILURE;
// Computes average spacing
FT average_spacing = CGAL::compute_average_spacing(points.begin(), points.end(),
FT average_spacing = CGAL::compute_average_spacing<CGAL::Sequential_tag>(points.begin(), points.end(),
6 /* knn = 1 ring */);
// Gets one point inside the implicit surface

View File

@ -300,7 +300,7 @@ public:
NormalPMap normal_pmap ///< property map: `value_type of InputIterator` -> `Vector` (the *oriented* normal of an input point).
)
: m_tr(new Triangulation), m_Bary(new std::vector<boost::array<double,9> > )
, average_spacing(CGAL::compute_average_spacing(first, beyond, point_pmap, 6))
, average_spacing(CGAL::compute_average_spacing<CGAL::Sequential_tag>(first, beyond, point_pmap, 6))
{
forward_constructor(first, beyond, point_pmap, normal_pmap, Poisson_visitor());
}
@ -318,7 +318,7 @@ public:
NormalPMap normal_pmap, ///< property map: `value_type of InputIterator` -> `Vector` (the *oriented* normal of an input point).
Visitor visitor)
: m_tr(new Triangulation), m_Bary(new std::vector<boost::array<double,9> > )
, average_spacing(CGAL::compute_average_spacing(first, beyond, point_pmap, 6))
, average_spacing(CGAL::compute_average_spacing<CGAL::Sequential_tag>(first, beyond, point_pmap, 6))
{
forward_constructor(first, beyond, point_pmap, normal_pmap, visitor);
}
@ -336,7 +336,7 @@ public:
>::type* = 0
)
: m_tr(new Triangulation), m_Bary(new std::vector<boost::array<double,9> > )
, average_spacing(CGAL::compute_average_spacing(first, beyond, 6))
, average_spacing(CGAL::compute_average_spacing<CGAL::Sequential_tag>(first, beyond, 6))
{
forward_constructor(first, beyond,
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1

View File

@ -233,7 +233,7 @@ int main(int argc, char * argv[])
std::cerr << "Surface meshing...\n";
// Computes average spacing
FT average_spacing = CGAL::compute_average_spacing(points.begin(), points.end(),
FT average_spacing = CGAL::compute_average_spacing<CGAL::Sequential_tag>(points.begin(), points.end(),
6 /* knn = 1 ring */);
// Gets one point inside the implicit surface