Remove pointless template from Zero_gradient

This commit is contained in:
Mael Rouxel-Labbé 2023-01-09 11:06:54 +01:00
parent d7bc1ecc21
commit 88c79dc237
3 changed files with 9 additions and 20 deletions

View File

@ -74,7 +74,7 @@ using Implicit_cartesian_grid_domain =
*/
template <typename GeomTraits,
typename PointFunction,
typename Gradient_ = Zero_gradient<GeomTraits> >
typename Gradient_ = Zero_gradient>
Implicit_cartesian_grid_domain<GeomTraits, PointFunction, Gradient_>
create_implicit_cartesian_grid_domain(const Bbox_3& bbox,
const typename GeomTraits::Vector_3& spacing,

View File

@ -71,7 +71,7 @@ using Implicit_octree_domain =
*/
template <typename GeomTraits,
typename PointFunction,
typename Gradient_ = Zero_gradient<GeomTraits> >
typename Gradient_ = Zero_gradient>
Implicit_octree_domain<GeomTraits, PointFunction, Gradient_>
create_implicit_octree_domain(const std::shared_ptr<internal::Octree_wrapper<GeomTraits> > octree,
const PointFunction& point_function,

View File

@ -14,6 +14,8 @@
#include <CGAL/license/Isosurfacing_3.h>
#include <CGAL/Origin.h>
namespace CGAL {
namespace Isosurfacing {
@ -23,32 +25,19 @@ namespace Isosurfacing {
* \brief Class template for a gradient that is always zero.
*
* \details This gradient function can be used for Marching Cubes, which does not require a gradient.
*
* \tparam GeomTraits the traits for this gradient.
*/
template <typename GeomTraits>
class Zero_gradient
struct Zero_gradient
{
public:
using Geom_traits = GeomTraits;
using Point = typename Geom_traits::Point_3;
using Vector = typename Geom_traits::Vector_3;
public:
/**
* \ingroup PkgIsosurfacing3Ref
*
* \brief Evaluate the gradient at a point in space.
*
* \param point the point at which the gradient is computed
* \return the null vector
*/
Vector operator()(const Point& point) const
template <typename P>
Null_vector operator()(const P&) const
{
return zero;
return NULL_VECTOR;
}
private:
const Vector zero = Vector(0, 0, 0);
};
} // namespace Isosurfacing