mirror of https://github.com/CGAL/cgal
Replace handle and tag parameter
This commit is contained in:
parent
533e23fab1
commit
b617e090bd
|
|
@ -13,7 +13,7 @@
|
|||
#ifndef CGAL_DUAL_CONTOURING_3_H
|
||||
#define CGAL_DUAL_CONTOURING_3_H
|
||||
|
||||
#include <CGAL/Cell_type.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Cell_type.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Dual_contouring_internal.h>
|
||||
#include <CGAL/license/Isosurfacing_3.h>
|
||||
#include <CGAL/tags.h>
|
||||
|
|
@ -54,10 +54,10 @@ void dual_contouring(const Domain_& domain, const typename Domain_::FT iso_value
|
|||
// static_assert(Domain_::CELL_TYPE & ANY_CELL);
|
||||
|
||||
internal::Dual_contouring_vertex_positioning<Domain_, Positioning> pos_func(domain, iso_value, positioning);
|
||||
domain.iterate_cells(pos_func, Concurrency_tag());
|
||||
domain.iterate_cells<Concurrency_tag>(pos_func);
|
||||
|
||||
internal::Dual_contouring_face_generation<Domain_> face_generation(domain, iso_value);
|
||||
domain.iterate_edges(face_generation, Concurrency_tag());
|
||||
domain.iterate_edges<Concurrency_tag>(face_generation);
|
||||
|
||||
// write points and faces in ranges
|
||||
points.resize(pos_func.points_counter);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public:
|
|||
*/
|
||||
template <class Domain_>
|
||||
bool position(const Domain_& domain, const typename Domain_::FT iso_value,
|
||||
const typename Domain_::Cell_handle& cell, typename Domain_::Point& point) const {
|
||||
const typename Domain_::Cell_descriptor& cell, typename Domain_::Point& point) const {
|
||||
typedef typename Domain_::Point Point;
|
||||
typedef typename Domain_::Geom_traits::Vector_3 Vector;
|
||||
typedef typename Domain_::FT FT;
|
||||
|
|
@ -170,7 +170,7 @@ public:
|
|||
* \return true, if the voxel intersects the isosurface
|
||||
*/
|
||||
template <class Domain_>
|
||||
bool position(const Domain_& domain, const typename Domain_::FT iso_value, const typename Domain_::Cell_handle& vh,
|
||||
bool position(const Domain_& domain, const typename Domain_::FT iso_value, const typename Domain_::Cell_descriptor& vh,
|
||||
typename Domain_::Point& point) const {
|
||||
typedef typename Domain_::Point Point;
|
||||
typedef typename Domain_::Geom_traits::Vector_3 Vector;
|
||||
|
|
@ -225,7 +225,7 @@ public:
|
|||
*/
|
||||
template <class Domain_>
|
||||
bool position(const Domain_& domain, const typename Domain_::FT iso_value,
|
||||
const typename Domain_::Cell_handle& cell, typename Domain_::Point& point) const {
|
||||
const typename Domain_::Cell_descriptor& cell, typename Domain_::Point& point) const {
|
||||
typedef typename Domain_::Point Point;
|
||||
typedef typename Domain_::Geom_traits::Vector_3 Vector;
|
||||
typedef typename Domain_::FT FT;
|
||||
|
|
@ -273,13 +273,13 @@ private:
|
|||
|
||||
typedef typename Domain::FT FT;
|
||||
typedef typename Domain::Point Point;
|
||||
typedef typename Domain::Cell_handle Cell_handle;
|
||||
typedef typename Domain::Cell_descriptor Cell_descriptor;
|
||||
|
||||
public:
|
||||
Dual_contouring_vertex_positioning(const Domain& domain, FT iso_value, const Positioning& positioning)
|
||||
: domain(domain), iso_value(iso_value), positioning(positioning), points_counter(0) {}
|
||||
|
||||
void operator()(const Cell_handle& v) {
|
||||
void operator()(const Cell_descriptor& v) {
|
||||
// compute dc-vertices
|
||||
Point p;
|
||||
if (positioning.position(domain, iso_value, v, p)) {
|
||||
|
|
@ -295,8 +295,8 @@ public:
|
|||
FT iso_value;
|
||||
const Positioning& positioning;
|
||||
|
||||
std::map<Cell_handle, std::size_t> map_voxel_to_point_id;
|
||||
std::map<Cell_handle, Point> map_voxel_to_point;
|
||||
std::map<Cell_descriptor, std::size_t> map_voxel_to_point_id;
|
||||
std::map<Cell_descriptor, Point> map_voxel_to_point;
|
||||
std::size_t points_counter;
|
||||
|
||||
std::mutex mutex;
|
||||
|
|
@ -308,13 +308,13 @@ private:
|
|||
typedef Domain_ Domain;
|
||||
|
||||
typedef typename Domain_::FT FT;
|
||||
typedef typename Domain_::Edge_handle Edge_handle;
|
||||
typedef typename Domain_::Cell_handle Cell_handle;
|
||||
typedef typename Domain_::Edge_descriptor Edge_descriptor;
|
||||
typedef typename Domain_::Cell_descriptor Cell_descriptor;
|
||||
|
||||
public:
|
||||
Dual_contouring_face_generation(const Domain& domain, FT iso_value) : domain(domain), iso_value(iso_value) {}
|
||||
|
||||
void operator()(const Edge_handle& e) {
|
||||
void operator()(const Edge_descriptor& e) {
|
||||
// save all faces
|
||||
const auto& vertices = domain.edge_vertices(e);
|
||||
const FT s0 = domain.value(vertices[0]);
|
||||
|
|
@ -335,7 +335,7 @@ public:
|
|||
}
|
||||
|
||||
// private:
|
||||
std::map<Edge_handle, std::vector<Cell_handle>> faces;
|
||||
std::map<Edge_descriptor, std::vector<Cell_descriptor>> faces;
|
||||
|
||||
const Domain& domain;
|
||||
FT iso_value;
|
||||
|
|
|
|||
|
|
@ -78,15 +78,15 @@ Point_3 vertex_interpolation(const Point_3& p0, const Point_3& p1, const FT d0,
|
|||
}
|
||||
|
||||
template <class Domain_, typename Corners_, typename Values_>
|
||||
std::size_t get_cell_corners(const Domain_& domain, const typename Domain_::Cell_handle& cell,
|
||||
std::size_t get_cell_corners(const Domain_& domain, const typename Domain_::Cell_descriptor& cell,
|
||||
const typename Domain_::FT iso_value, Corners_& corners, Values_& values) {
|
||||
|
||||
typedef typename Domain_::Vertex_handle Vertex_handle;
|
||||
typedef typename Domain_::Vertex_descriptor Vertex_descriptor;
|
||||
|
||||
// collect function values and build index
|
||||
std::size_t v_id = 0;
|
||||
std::bitset<Domain_::VERTICES_PER_CELL> index = 0;
|
||||
for (const Vertex_handle& v : domain.cell_vertices(cell)) {
|
||||
for (const Vertex_descriptor& v : domain.cell_vertices(cell)) {
|
||||
// collect scalar values and computex index
|
||||
corners[v_id] = domain.position(v);
|
||||
values[v_id] = domain.value(v);
|
||||
|
|
@ -163,7 +163,7 @@ private:
|
|||
typedef Domain_ Domain;
|
||||
typedef typename Domain::FT FT;
|
||||
typedef typename Domain::Point Point;
|
||||
typedef typename Domain::Cell_handle Cell_handle;
|
||||
typedef typename Domain::Cell_descriptor Cell_descriptor;
|
||||
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
typedef tbb::concurrent_vector<std::array<Point, 3>> Triangle_list;
|
||||
|
|
@ -175,7 +175,7 @@ public:
|
|||
Marching_cubes_functor(const Domain& domain, const FT iso_value) : domain(domain), iso_value(iso_value) {}
|
||||
|
||||
|
||||
void operator()(const Cell_handle& cell) {
|
||||
void operator()(const Cell_descriptor& cell) {
|
||||
|
||||
assert(domain.cell_vertices(cell).size() == 8);
|
||||
assert(domain.cell_edges(cell).size() == 12);
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@
|
|||
#ifndef CGAL_TMC_INTERNAL_TMC_H
|
||||
#define CGAL_TMC_INTERNAL_TMC_H
|
||||
|
||||
#include <CGAL/license/Isosurfacing_3.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Marching_cubes_3_internal.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Tables.h>
|
||||
#include <CGAL/license/Isosurfacing_3.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <array>
|
||||
|
|
@ -65,8 +65,8 @@ private:
|
|||
typedef typename Domain::FT FT;
|
||||
typedef typename Domain::Point Point;
|
||||
typedef typename Domain::Vector Vector;
|
||||
typedef typename Domain::Edge_handle Edge_handle;
|
||||
typedef typename Domain::Cell_handle Cell_handle;
|
||||
typedef typename Domain::Edge_descriptor Edge_descriptor;
|
||||
typedef typename Domain::Cell_descriptor Cell_descriptor;
|
||||
|
||||
typedef unsigned int uint;
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ public:
|
|||
TMC_functor(const Domain& domain, const FT iso_value, Point_range& points, Polygon_range& polygons)
|
||||
: domain(domain), iso_value(iso_value), points(points), polygons(polygons) {}
|
||||
|
||||
void operator()(const Cell_handle& cell) {
|
||||
void operator()(const Cell_descriptor& cell) {
|
||||
|
||||
FT values[8];
|
||||
Point corners[8];
|
||||
|
|
@ -135,7 +135,7 @@ public:
|
|||
triangle.push_back(p2);
|
||||
}
|
||||
|
||||
void p_slice(const Cell_handle& cell, const double i0, FT* values, Point* corners, const int i_case) {
|
||||
void p_slice(const Cell_descriptor& cell, const double i0, FT* values, Point* corners, const int i_case) {
|
||||
// there are 12 edges, assign to each vertex three edges, the global edge numbering
|
||||
// consist of 3*global_vertex_id + edge_offset.
|
||||
const unsigned long long gei_pattern_ = 670526590282893600ull;
|
||||
|
|
@ -960,7 +960,7 @@ private:
|
|||
|
||||
// compute a unique global index for vertices
|
||||
// use as key the unique edge number
|
||||
std::map<Edge_handle, std::size_t> vertex_map;
|
||||
std::map<Edge_descriptor, std::size_t> vertex_map;
|
||||
|
||||
std::mutex mutex;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#ifndef CGAL_MARCHING_CUBES_3_H
|
||||
#define CGAL_MARCHING_CUBES_3_H
|
||||
|
||||
#include <CGAL/Cell_type.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Cell_type.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Tmc_internal.h>
|
||||
#include <CGAL/license/Isosurfacing_3.h>
|
||||
#include <CGAL/tags.h>
|
||||
|
|
@ -49,10 +49,10 @@ void marching_cubes(const Domain_& domain, const typename Domain_::FT iso_value,
|
|||
|
||||
if (topologically_correct) {
|
||||
internal::TMC_functor<Domain_, PointRange, TriangleRange> functor(domain, iso_value, points, polygons);
|
||||
domain.iterate_cells(functor, Concurrency_tag());
|
||||
domain.iterate_cells<Concurrency_tag>(functor);
|
||||
} else {
|
||||
internal::Marching_cubes_functor<Domain_> functor(domain, iso_value);
|
||||
domain.iterate_cells(functor, Concurrency_tag());
|
||||
domain.iterate_cells<Concurrency_tag>(functor);
|
||||
internal::to_indexed_face_set(functor.get_triangles(), points, polygons);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue