mirror of https://github.com/CGAL/cgal
Replace Explicit_Cartesian_grid_geometry with Implicit_cartesian_grid_geometry
This commit is contained in:
parent
155a844e38
commit
40deb97794
|
|
@ -16,9 +16,10 @@
|
|||
|
||||
#include <CGAL/Isosurfacing_3/internal/Isosurfacing_domain_3.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Explicit_Cartesian_grid_function.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Explicit_Cartesian_grid_geometry_3.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Implicit_Cartesian_grid_geometry_3.h>
|
||||
#include <CGAL/Isosurfacing_3/internal/Grid_topology_3.h>
|
||||
#include <CGAL/Isosurfacing_3/Zero_gradient.h>
|
||||
#include <CGAL/Bbox_3.h>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Isosurfacing {
|
||||
|
|
@ -44,7 +45,7 @@ using Explicit_Cartesian_grid_domain_3 = unspecified_type;
|
|||
template <typename Grid,
|
||||
typename Gradient = Zero_gradient,
|
||||
typename Topology = internal::Grid_topology_3,
|
||||
typename Geometry = internal::Explicit_Cartesian_grid_geometry_3<Grid>,
|
||||
typename Geometry = internal::Implicit_Cartesian_grid_geometry_3<typename Grid::Geom_traits>,
|
||||
typename Function = internal::Explicit_Cartesian_grid_function<Grid> >
|
||||
using Explicit_Cartesian_grid_domain_3 =
|
||||
internal::Isosurfacing_domain_3<typename Grid::Geom_traits,
|
||||
|
|
@ -96,8 +97,11 @@ create_explicit_Cartesian_grid_domain(const Grid& grid,
|
|||
const std::size_t size_j = grid.ydim();
|
||||
const std::size_t size_k = grid.zdim();
|
||||
|
||||
const Bbox_3& bbox = grid.bbox();
|
||||
const typename Geometry::Vector_3 offset{bbox.xmin(), bbox.ymin(), bbox.zmin()};
|
||||
|
||||
const Topology topo { size_i, size_j, size_k };
|
||||
const Geometry geom { grid };
|
||||
const Geometry geom { offset, grid.spacing() };
|
||||
const Function func { grid };
|
||||
|
||||
return Domain{ topo, geom, func, grad, grid.geom_traits() };
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
// Copyright (c) 2022-2023 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Julian Stahl
|
||||
|
||||
#ifndef CGAL_ISOSURFACING_3_INTERNAL_EXPLICIT_CARTESIAN_GRID_GEOMETRY_3_H
|
||||
#define CGAL_ISOSURFACING_3_INTERNAL_EXPLICIT_CARTESIAN_GRID_GEOMETRY_3_H
|
||||
|
||||
#include <CGAL/license/Isosurfacing_3.h>
|
||||
|
||||
#include <CGAL/Isosurfacing_3/internal/Grid_topology_3.h>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Isosurfacing {
|
||||
namespace internal {
|
||||
|
||||
template <typename Grid>
|
||||
class Explicit_Cartesian_grid_geometry_3
|
||||
{
|
||||
using Vertex_descriptor = typename Grid_topology_3::Vertex_descriptor;
|
||||
|
||||
public:
|
||||
Explicit_Cartesian_grid_geometry_3(const Grid& grid)
|
||||
: m_grid{grid}
|
||||
{ }
|
||||
|
||||
// gets the position of vertex `v`
|
||||
decltype(auto) /*Point_3*/ operator()(const Vertex_descriptor& v) const
|
||||
{
|
||||
return m_grid.point(v[0], v[1], v[2]);
|
||||
}
|
||||
|
||||
private:
|
||||
const Grid& m_grid;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Isosurfacing
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_ISOSURFACING_3_INTERNAL_EXPLICIT_CARTESIAN_GRID_GEOMETRY_3_H
|
||||
Loading…
Reference in New Issue