Skip to content

Commit

Permalink
Further fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
MaelRL committed Jul 24, 2024
1 parent ce80ad7 commit 0ba7267
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class IsosurfacingDomainWithGradient_3
/// @{

/*!
returns the gradient at the position `p`.
returns the gradient at the point `p`.
*/
Vector_3 gradient(Point_3 p) const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class IsosurfacingDomain_3
Geom_traits geom_traits();

/*!
returns the 3D position of the vertex `v`.
returns the 3D location of the vertex `v`.
*/
Point_3 point(vertex_descriptor v) const;

Expand Down Expand Up @@ -167,8 +167,8 @@ class IsosurfacingDomain_3
/*!
Constructs the intersection - if it exists - between an edge and an isosurface.
\param p_0 the geometric position of the first vertex of the edge
\param p_1 the geometric position of the second vertex of the edge
\param p_0 the location of the first vertex of the edge
\param p_1 the location of the second vertex of the edge
\param val_0 the value at the first vertex of the edge
\param val_1 the value at the second vertex of the edge
\param isovalue the isovalue defining the isosurface with which we seek an intersection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class IsosurfacingEdgeIntersectionOracle_3
*
* \tparam Domain must be a model of `IsosurfacingDomain_3`
*
* \param p_0 the geometric position of the first vertex of the edge
* \param p_1 the geometric position of the second vertex of the edge
* \param p_0 the location of the first vertex of the edge
* \param p_1 the location of the second vertex of the edge
* \param val_0 the value at the first vertex of the edge
* \param val_1 the value at the second vertex of the edge
* \param domain the isosurfacing domain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class IsosurfacingGradientField_3
typedef unspecified_type Vector_3;

/*!
returns the gradient at the position `p`.
returns the gradient at the point `p`.
*/
Vector_3 operator()(Point_3 p) const;
};
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class partition_traits
typedef unspecified_type Cell_edges;

/*!
* \returns the 3D position of the vertex `v`.
* \returns the 3D location of the vertex `v`.
*/
static Point_3 point(vertex_descriptor v, IsosurfacingPartition_3 partition);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ using FT = typename Kernel::FT;
using Point = typename Kernel::Point_3;
using Vector = typename Kernel::Vector_3;

// using Grid = CGAL::Isosurfacing::Cartesian_grid_3<Kernel, CGAL::Isosurfacing::Do_not_cache_positions>;
using Grid = CGAL::Isosurfacing::Cartesian_grid_3<Kernel, CGAL::Isosurfacing::Cache_positions>;
// using Grid = CGAL::Isosurfacing::Cartesian_grid_3<Kernel, CGAL::Isosurfacing::Do_not_cache_vertex_locations>;
using Grid = CGAL::Isosurfacing::Cartesian_grid_3<Kernel, CGAL::Isosurfacing::Cache_vertex_locations>;
using Values = CGAL::Isosurfacing::Value_function_3<Grid>;
using Gradients = CGAL::Isosurfacing::Gradient_function_3<Grid>;

Expand Down
46 changes: 23 additions & 23 deletions Isosurfacing_3/include/CGAL/Isosurfacing_3/Cartesian_grid_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,40 @@ namespace Isosurfacing {
/**
* \ingroup IS_Partitions_helpers_grp
*
* A policy to choose whether grid vertex positions should be cached, or recomputed at each access.
* A policy to choose whether grid vertex locations should be cached, or recomputed at each access.
*
* \tparam Tag a tag that is either `Tag_true` (positions are cached) or `Tag_false` (positions are not cached).
* \tparam Tag a tag that is either `Tag_true` (locations are cached) or `Tag_false` (locations are not cached).
*/
template <typename Tag>
struct Grid_vertex_memory_policy : public Tag { };

/**
* \ingroup IS_Partitions_helpers_grp
*
* A convenience alias for the policy that caches grid vertex positions.
* A convenience alias for the policy that caches grid vertex locations.
*/
using Cache_positions = Grid_vertex_memory_policy<Tag_true>;
using Cache_vertex_locations = Grid_vertex_memory_policy<Tag_true>;

/**
* \ingroup IS_Partitions_helpers_grp
*
* A convenience alias for the policy that does not cache grid vertex positions.
* A convenience alias for the policy that does not cache grid vertex locations.
*/
using Do_not_cache_positions = Grid_vertex_memory_policy<Tag_false>;
using Do_not_cache_vertex_locations = Grid_vertex_memory_policy<Tag_false>;

namespace internal {

template <typename GeomTraits,
typename MemoryPolicy = Do_not_cache_positions>
struct Cartesian_grid_position
typename MemoryPolicy = Do_not_cache_vertex_locations>
struct Cartesian_grid_location
{
using Point_3 = typename GeomTraits::Point_3;
using Vector_3 = typename GeomTraits::Vector_3;
using Iso_cuboid_3 = typename GeomTraits::Iso_cuboid_3;

Cartesian_grid_position() { } // just for compilation
Cartesian_grid_location() { } // just for compilation

Cartesian_grid_position(const Iso_cuboid_3& /*span*/,
Cartesian_grid_location(const Iso_cuboid_3& /*span*/,
const std::array<std::size_t, 3>& /*dims*/,
const Vector_3& /*spacing*/)
{ }
Expand All @@ -89,17 +89,17 @@ struct Cartesian_grid_position
};

template <typename GeomTraits>
struct Cartesian_grid_position<GeomTraits, Cache_positions>
struct Cartesian_grid_location<GeomTraits, Cache_vertex_locations>
{
using Point_3 = typename GeomTraits::Point_3;
using Vector_3 = typename GeomTraits::Vector_3;
using Iso_cuboid_3 = typename GeomTraits::Iso_cuboid_3;

std::vector<Point_3> m_points;

Cartesian_grid_position() { } // just for compilation
Cartesian_grid_location() { } // just for compilation

Cartesian_grid_position(const Iso_cuboid_3& span,
Cartesian_grid_location(const Iso_cuboid_3& span,
const std::array<std::size_t, 3>& dims,
const Vector_3& spacing)
{
Expand Down Expand Up @@ -136,14 +136,14 @@ struct Cartesian_grid_position<GeomTraits, Cache_positions>
* that can be used along with value and gradient fields to make up a domain.
*
* \tparam GeomTraits must be a model of `IsosurfacingTraits_3`.
* \tparam MemoryPolicy whether the geometric positions of the grid vertices are stored or not.
* Possible values are `CGAL::Isosurfacing::Cache_positions` and `CGAL::Isosurfacing::Do_not_cache_positions`.
* \tparam MemoryPolicy whether the geometric locations of the grid vertices are stored or not.
* Possible values are `CGAL::Isosurfacing::Cache_vertex_locations` and `CGAL::Isosurfacing::Do_not_cache_vertex_locations`.
*
* \sa `CGAL::Isosurfacing::Marching_cubes_domain_3()`
* \sa `CGAL::Isosurfacing::Dual_contouring_domain_3()`
*/
template <typename GeomTraits,
typename MemoryPolicy = Do_not_cache_positions>
typename MemoryPolicy = Do_not_cache_vertex_locations>
class Cartesian_grid_3
{
public:
Expand All @@ -153,7 +153,7 @@ class Cartesian_grid_3
using Vector_3 = typename Geom_traits::Vector_3;
using Iso_cuboid_3 = typename Geom_traits::Iso_cuboid_3;

using Positioner = internal::Cartesian_grid_position<GeomTraits, MemoryPolicy>;
using Positioner = internal::Cartesian_grid_location<GeomTraits, MemoryPolicy>;

private:
Iso_cuboid_3 m_span;
Expand Down Expand Up @@ -228,7 +228,7 @@ class Cartesian_grid_3
* \param dimensions the number of grid vertices in the `x`, `y`, and `z` directions
* \param gt the geometric traits
*
* \pre all dimensions are (strictly) positive.
* \pre all dimensions are strictly positive.
*/
Cartesian_grid_3(const Iso_cuboid_3& span,
const std::array<std::size_t, 3>& dimensions,
Expand All @@ -251,8 +251,8 @@ class Cartesian_grid_3
* \param dimensions the number of grid vertices in the `x`, `y`, and `z` directions
* \param gt the geometric traits
*
* \pre `p` is lexicographically (strictly) smaller than `q`
* \pre all dimensions are (strictly) positive.
* \pre `p` is lexicographically strictly smaller than `q`
* \pre all dimensions are strictly positive.
*/
Cartesian_grid_3(const Point_3& p, const Point_3& q,
const std::array<std::size_t, 3>& dimensions,
Expand Down Expand Up @@ -291,7 +291,7 @@ class Cartesian_grid_3
* \param spacing the dimension of the paving cell, in the `x`, `y`, and `z` directions, respectively.
* \param gt the geometric traits
*
* \pre `p` is lexicographically (strictly) smaller than `q`
* \pre `p` is lexicographically strictly smaller than `q`
* \pre the diagonal of the iso-cuboid has length a multiple of `spacing`
*/
Cartesian_grid_3(const Point_3& p, const Point_3& q,
Expand Down Expand Up @@ -380,9 +380,9 @@ class Cartesian_grid_3
// Geometry
public:
/**
* \brief returns the geometric position of the grid vertex described by its three indices.
* \brief returns the geometric location of the grid vertex described by its three indices.
*
* Depending on the value of the template parameter `cache_points`, positions might not be stored
* Depending on the value of the template parameter `MemoryPolicy`, locations might not be stored
* but calculated on-the-fly.
*
* \param i the index in the `x` direction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Finite_difference_gradient_3
/**
* \brief returns the value the gradient at a point in 3D space.
*
* \param p the position at which the gradient is computed.
* \param p the point at which the gradient is computed.
*/
Vector_3 operator()(const Point_3& p) const
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace Isosurfacing {
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{constrain_to_cell}
* \cgalParamDescription{whether to constrain the vertex position to the geometrical space of its cell}
* \cgalParamDescription{whether to constrain the vertex location to the geometrical space of its cell}
* \cgalParamType{Boolean}
* \cgalParamDefault{`false`}
* \cgalParamExtra{Constraining the vertex to its dual cell guarantees that the resulting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ struct Dichotomy_edge_intersection
*
* \tparam Domain must be a model of `IsosurfacingDomain_3`
*
* \param p_0 the geometric position of the first vertex of the edge
* \param p_1 the geometric position of the second vertex of the edge
* \param p_0 the location of the first vertex of the edge
* \param p_1 the location of the second vertex of the edge
* \param val_0 the value at the first vertex of the edge
* \param val_1 the value at the second vertex of the edge
* \param domain the isosurfacing domain
Expand Down Expand Up @@ -149,8 +149,8 @@ struct Linear_interpolation_edge_intersection
*
* \tparam Domain must be a model of `IsosurfacingDomain_3`
*
* \param p_0 the geometric position of the first vertex of the edge
* \param p_1 the geometric position of the second vertex of the edge
* \param p_0 the location of the first vertex of the edge
* \param p_1 the location of the second vertex of the edge
* \param val_0 the value at the first vertex of the edge
* \param val_1 the value at the second vertex of the edge
* \param domain the isosurfacing domain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Isosurfacing_domain_3
public:
// The following functions are dispatching to the partition_traits' static functions.

// returns the position of vertex `v`
// returns the location of vertex `v`
decltype(auto) /*Point_3*/ point(const vertex_descriptor& v) const
{
return PT::point(v, m_partition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ class Octree_wrapper
// std::array<Vertex_handle, 8> v;
// for(int v_id=0; v_id<Tables::N_VERTICES; ++v_id)
// {
// const auto& l = Tables::local_vertex_position[v_id];
// const auto& l = Tables::local_vertex_location[v_id];
// const auto lex = lex_index(i + df * l[0], j + df * l[1], k + df * l[2], max_depth_);
// v[v_id] = lex;
// }
Expand Down Expand Up @@ -487,7 +487,7 @@ class Octree_wrapper
std::array<Vertex_handle, 8> v;
for(int v_id=0; v_id<Tables::N_VERTICES; ++v_id)
{
const int* l = Tables::local_vertex_position[v_id];
const int* l = Tables::local_vertex_location[v_id];
const std::size_t lex = lex_index(i + df * l[0], j + df * l[1], k + df * l[2], max_depth_);
v[v_id] = lex;
}
Expand All @@ -507,7 +507,7 @@ class Octree_wrapper
// std::array<Vertex_handle, 8> v;
// for(int v_id=0; v_id<Tables::N_VERTICES; ++v_id)
// {
// const auto& l = Tables::local_vertex_position[v_id];
// const auto& l = Tables::local_vertex_location[v_id];
// const auto lex = lex_index(i + df * l[0], j + df * l[1], k + df * l[2], max_depth_);
// v[v_id] = lex;
// }
Expand All @@ -518,7 +518,7 @@ class Octree_wrapper
// return s;
// }

std::array<Point_3, 8> voxel_vertex_positions(const Voxel_handle& vox) const
std::array<Point_3, 8> voxel_vertex_locations(const Voxel_handle& vox) const
{
Node_index node_index = get_node(vox);
return node_points(node_index);
Expand All @@ -541,7 +541,7 @@ class Octree_wrapper
// v1
const std::size_t e_local_index = Tables::edge_store_index[e_global_id % 3];
const int* v1_local = Tables::local_vertex_position[Tables::edge_to_vertex[e_local_index][1]];
const int* v1_local = Tables::local_vertex_location[Tables::edge_to_vertex[e_local_index][1]];
const std::size_t i1 = i0 + v1_local[0];
const std::size_t j1 = j0 + v1_local[1];
Expand All @@ -568,7 +568,7 @@ class Octree_wrapper

// v1
const std::size_t e_local_index = Tables::edge_store_index[e_global_id % 3];
const int* v1_local = Tables::local_vertex_position[Tables::edge_to_vertex[e_local_index][1]];
const int* v1_local = Tables::local_vertex_location[Tables::edge_to_vertex[e_local_index][1]];

const std::size_t i1 = i0 + v1_local[0];
const std::size_t j1 = j0 + v1_local[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace CGAL {
namespace Isosurfacing {
namespace internal {

// Interpolate linearly between two vertex positions v0, v1 with values d0 and d1 according to the isovalue
// Interpolate linearly between two vertex locations v0, v1 with values d0 and d1 according to the isovalue
template <typename GeomTraits>
typename GeomTraits::Point_3 vertex_interpolation(const typename GeomTraits::Point_3& p0,
const typename GeomTraits::Point_3& p1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct partition_traits<Cartesian_grid_3<GeomTraits, MemoryPolicy> >
for(std::size_t j=0; j<c.size(); ++j)
{
// lookup the relative vertex indices and offset them by the cell position
cv[i][j] = c[j] + internal::Cube_table::local_vertex_position[i][j];
cv[i][j] = c[j] + internal::Cube_table::local_vertex_location[i][j];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ constexpr int edge_to_vertex[N_EDGES][2] =
};

// The local vertex coordinates within a voxel.
constexpr int local_vertex_position[N_VERTICES][3] =
constexpr int local_vertex_location[N_VERTICES][3] =
{
{0, 0, 0}, // v0
{1, 0, 0}, // v1
Expand Down

0 comments on commit 0ba7267

Please sign in to comment.