Concept fixes

This commit is contained in:
Mael Rouxel-Labbé 2023-01-14 19:05:26 +01:00
parent 085ac024ac
commit 1ee5b90f1b
5 changed files with 10 additions and 32 deletions

View File

@ -43,8 +43,6 @@ public:
using Point_3 = typename Geom_traits::Point_3; using Point_3 = typename Geom_traits::Point_3;
using Vector_3 = typename Geom_traits::Vector_3; using Vector_3 = typename Geom_traits::Vector_3;
using Vertex_descriptor = Isosurfacing::internal::Grid_topology_3::Vertex_descriptor;
private: private:
Bbox_3 m_bbox; Bbox_3 m_bbox;
Vector_3 m_spacing; Vector_3 m_spacing;
@ -187,11 +185,6 @@ public:
m_bbox.zmin() + z * x_coord(m_spacing)); m_bbox.zmin() + z * x_coord(m_spacing));
} }
const Point_3& point(const Vertex_descriptor& v) const
{
return point(v[0], v[1], v[2]);
}
/** /**
* \brief gets the scalar value stored at the grid vertex described by a set of indices. * \brief gets the scalar value stored at the grid vertex described by a set of indices.
* *
@ -208,11 +201,6 @@ public:
return m_values[linear_index(x, y, z)]; return m_values[linear_index(x, y, z)];
} }
FT value(const Vertex_descriptor& v) const
{
return value(v[0], v[1], v[2]);
}
/** /**
* \brief gets the scalar value stored at the grid vertex described by a set of indices. * \brief gets the scalar value stored at the grid vertex described by a set of indices.
* *
@ -231,11 +219,6 @@ public:
return m_values[linear_index(x, y, z)]; return m_values[linear_index(x, y, z)];
} }
FT& value(const Vertex_descriptor& v)
{
return value(v[0], v[1], v[2]);
}
/** /**
* \brief gets the gradient stored at the grid vertex described by a set of indices. * \brief gets the gradient stored at the grid vertex described by a set of indices.
* *
@ -250,11 +233,6 @@ public:
return m_gradients[linear_index(x, y, z)]; return m_gradients[linear_index(x, y, z)];
} }
const Vector_3& gradient(const Vertex_descriptor& v) const
{
return gradient(v[0], v[1], v[2]);
}
/** /**
* \brief gets the gradient stored at the grid vertex described by a set of indices. * \brief gets the gradient stored at the grid vertex described by a set of indices.
* *
@ -273,11 +251,6 @@ public:
return m_gradients[linear_index(x, y, z)]; return m_gradients[linear_index(x, y, z)];
} }
Vector_3& gradient(const Vertex_descriptor& v)
{
return gradient(v[0], v[1], v[2]);
}
private: private:
std::size_t linear_index(const std::size_t x, std::size_t linear_index(const std::size_t x,
const std::size_t y, const std::size_t y,

View File

@ -34,7 +34,7 @@ namespace Isosurfacing {
* \tparam Gradient the type of the gradient functor. It must be a model of `CopyConstructible` and implement * \tparam Gradient the type of the gradient functor. It must be a model of `CopyConstructible` and implement
* `GeomTraits::Vector_3 operator()(const GeomTraits::Point_3& point) const`. * `GeomTraits::Vector_3 operator()(const GeomTraits::Point_3& point) const`.
*/ */
#ifdef DOXYGEN_RUNNING // Allow more than a CGAL::Cartesian_grid_3 #ifdef DOXYGEN_RUNNING // Allow more than a Cartesian_grid_3
template <template <typename GeomTraits> class Cartesian_grid_3, template <template <typename GeomTraits> class Cartesian_grid_3,
typename Gradient = Zero_gradient> typename Gradient = Zero_gradient>
class Explicit_Cartesian_grid_domain_3; class Explicit_Cartesian_grid_domain_3;
@ -69,7 +69,7 @@ using Explicit_Cartesian_grid_domain_3 =
* *
* \return a new `Explicit_Cartesian_grid_domain_3` * \return a new `Explicit_Cartesian_grid_domain_3`
*/ */
#ifdef DOXYGEN_RUNNING // Allow more than CGAL::Cartesian_grid_3 #ifdef DOXYGEN_RUNNING // Allow more than Cartesian_grid_3
template <typename GeomTraits, template <typename GeomTraits,
typename Gradient = Zero_gradient> typename Gradient = Zero_gradient>
Explicit_Cartesian_grid_domain_3<Grid, Gradient> Explicit_Cartesian_grid_domain_3<Grid, Gradient>

View File

@ -26,10 +26,15 @@ namespace Isosurfacing {
* *
* \details The gradient at any point is calculated using trilinear interpolation. * \details The gradient at any point is calculated using trilinear interpolation.
* *
* \tparam Grid must be a model of `CartesianGrid_3`. * \tparam GeomTraits must be a model of `IsosurfacingTraits_3`.
*/ */
#ifdef DOXYGEN_RUNNING // Allow more than just Cartesian_grid_3
template <template <typename GeomTraits> class Cartesian_grid_3>
class Explicit_Cartesian_grid_gradient_3
#else
template <typename Grid> template <typename Grid>
class Explicit_Cartesian_grid_gradient_3 class Explicit_Cartesian_grid_gradient_3
#endif
{ {
public: public:
using Geom_traits = typename Grid::Geom_traits; using Geom_traits = typename Grid::Geom_traits;

View File

@ -38,7 +38,7 @@ public:
// gets the value at vertex `v` // gets the value at vertex `v`
FT operator()(const Vertex_descriptor& v) const FT operator()(const Vertex_descriptor& v) const
{ {
return grid.value(v); return grid.value(v[0], v[1], v[2]);
} }
private: private:

View File

@ -33,7 +33,7 @@ public:
// gets the position of vertex `v` // gets the position of vertex `v`
decltype(auto) /*Point_3*/ operator()(const Vertex_descriptor& v) const decltype(auto) /*Point_3*/ operator()(const Vertex_descriptor& v) const
{ {
return m_grid.point(v); return m_grid.point(v[0], v[1], v[2]);
} }
private: private: