mirror of https://github.com/CGAL/cgal
Doc improvements
This commit is contained in:
parent
4ca692378b
commit
225fe9f89d
|
|
@ -57,7 +57,7 @@ int main(int argc, char** argv)
|
|||
for (std::size_t k=0; k<grid.zdim(); ++k)
|
||||
values(i, j, k) = - values(i, j, k); // inside out
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ int main(int argc, char** argv)
|
|||
const CGAL::Bbox_3 bbox = {-2., -2., -2., 2., 2., 2.};
|
||||
Grid grid { bbox, CGAL::make_array<std::size_t>(150, 150, 150) };
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
The concept `GradientField_3` describes the set of requirements to be fulfilled
|
||||
by the gradient field template parameter of the domain class `CGAL::Isosurfacing::Dual_contouring_domain_3`.
|
||||
|
||||
Gradient fields must be continuous and defined over the bounding box of whatever
|
||||
space partitioning data structure (also known as "partition") is being used.
|
||||
Gradient fields must be continuous and defined over the geometric span of the
|
||||
space partitioning data structure (also known as "partition") being used.
|
||||
|
||||
\cgalHasModelsBegin
|
||||
\cgalHasModels{CGAL::Isosurfacing::Gradient_function_3}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
The concept `ValueField_3` describes the set of requirements to be fulfilled
|
||||
by the value field template parameter of the domain classes `CGAL::Isosurfacing::Marching_cubes_domain_3` and `CGAL::Isosurfacing::Dual_contouring_domain_3`.
|
||||
|
||||
Value fields must be continuous and defined over the bounding box of whatever
|
||||
space partitioning data structure (also known as "partition") is being used.
|
||||
Value fields must be continuous and defined over the geometric span of the
|
||||
space partitioning data structure (also known as "partition") being used.
|
||||
|
||||
\cgalHasModelsBegin
|
||||
\cgalHasModels{CGAL::Isosurfacing::Value_function_3}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ int main(int argc, char** argv)
|
|||
const CGAL::Bbox_3 bbox { -1., -1., -1., 1., 1., 1. };
|
||||
Grid grid { bbox, CGAL::make_array<std::size_t>(30, 30, 30) };
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ int main(int argc, char* argv[])
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ int main(int argc, char** argv)
|
|||
const std::array<FT, 3> spacing { step, step, step };
|
||||
const Grid grid { bbox, spacing };
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ int main(int argc, char** argv)
|
|||
bbox = CGAL::Bbox_3{ -5, -5, -5, 15, 15, 15 };
|
||||
Grid grid { bbox, CGAL::make_array<std::size_t>(nv, nv, nv) };
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ int main(int argc, char** argv)
|
|||
const CGAL::Bbox_3 bbox { -1., -1., -1., 1., 1., 1. };
|
||||
Grid grid { bbox, CGAL::make_array<std::size_t>(30, 30, 30) };
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ int main(int argc, char** argv)
|
|||
const CGAL::Bbox_3 bbox = {-2., -2., -2., 2., 2., 2.};
|
||||
Grid grid { bbox, CGAL::make_array<std::size_t>(50, 50, 50) };
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ int main(int argc, char** argv)
|
|||
const CGAL::Bbox_3 bbox = {-2., -2., -2., 2., 2., 2.};
|
||||
Grid grid { bbox, CGAL::make_array<std::size_t>(50, 50, 50) };
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ int main(int argc, char** argv)
|
|||
const CGAL::Bbox_3 bbox { -1., -1., -1., 1., 1., 1. };
|
||||
Grid grid { bbox, CGAL::make_array<std::size_t>(30, 30, 30) };
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ int main(int argc, char** argv)
|
|||
const CGAL::Bbox_3 bbox { -1., -1., -1., 1., 1., 1. };
|
||||
Grid grid { bbox, CGAL::make_array<std::size_t>(30, 30, 30) };
|
||||
|
||||
std::cout << "Bbox: " << grid.bbox() << std::endl;
|
||||
std::cout << "Span: " << grid.span() << std::endl;
|
||||
std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl;
|
||||
std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#include <CGAL/Isosurfacing_3/IO/OBJ.h>
|
||||
|
||||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/Bbox_3.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
|
||||
|
|
@ -83,7 +82,7 @@ public:
|
|||
using Iso_cuboid_3 = typename Geom_traits::Iso_cuboid_3;
|
||||
|
||||
private:
|
||||
Iso_cuboid_3 m_bbox;
|
||||
Iso_cuboid_3 m_span;
|
||||
std::array<std::size_t, 3> m_sizes;
|
||||
Vector_3 m_spacing;
|
||||
|
||||
|
|
@ -99,8 +98,8 @@ private:
|
|||
auto vertex = m_gt.construct_vertex_3_object();
|
||||
|
||||
// calculate grid spacing
|
||||
const Point_3& min_p = vertex(m_bbox, 0);
|
||||
const Point_3& max_p = vertex(m_bbox, 7);
|
||||
const Point_3& min_p = vertex(m_span, 0);
|
||||
const Point_3& max_p = vertex(m_span, 7);
|
||||
const FT x_span = x_coord(max_p) - x_coord(min_p);
|
||||
const FT y_span = y_coord(max_p) - y_coord(min_p);
|
||||
const FT z_span = z_coord(max_p) - z_coord(min_p);
|
||||
|
|
@ -117,7 +116,7 @@ public:
|
|||
* \brief Default constructor
|
||||
*/
|
||||
Cartesian_grid_3()
|
||||
: m_bbox{Point_3{0, 0, 0}, Point_3{0, 0, 0}},
|
||||
: m_span{Point_3{0, 0, 0}, Point_3{0, 0, 0}},
|
||||
m_sizes{2, 2, 2},
|
||||
m_spacing{0, 0, 0},
|
||||
m_gt{Geom_traits()}
|
||||
|
|
@ -126,18 +125,18 @@ public:
|
|||
/**
|
||||
* \brief creates a %Cartesian grid with `xdim * ydim * zdim` grid vertices.
|
||||
*
|
||||
* The grid covers the space described by a bounding box.
|
||||
* The grid covers the space described by an iso-cuboid.
|
||||
*
|
||||
* \param bbox the bounding box of the grid
|
||||
* \param span the geometric span of the grid
|
||||
* \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.
|
||||
*/
|
||||
Cartesian_grid_3(const Iso_cuboid_3& bbox,
|
||||
Cartesian_grid_3(const Iso_cuboid_3& span,
|
||||
const std::array<std::size_t, 3>& dimensions,
|
||||
const Geom_traits& gt = Geom_traits())
|
||||
: m_bbox{bbox},
|
||||
: m_span{span},
|
||||
m_sizes{dimensions},
|
||||
m_gt{gt}
|
||||
{
|
||||
|
|
@ -147,10 +146,11 @@ public:
|
|||
/**
|
||||
* \brief creates a %Cartesian grid with `xdim * ydim * zdim` grid vertices.
|
||||
*
|
||||
* The grid covers the space described by a bounding box, itself described through two diagonal corners.
|
||||
* The grid covers the space described by an iso-cuboid,
|
||||
* itself described through two diagonal corners.
|
||||
*
|
||||
* \param p the lowest corner of the bounding box of the grid
|
||||
* \param q the upper corner of the bounding box of the grid
|
||||
* \param p the lexicographically smallest corner of the iso-cuboid
|
||||
* \param q the lexicographically largest corner of the iso-cuboid
|
||||
* \param dimensions the number of grid vertices in the `x`, `y`, and `z` directions
|
||||
* \param gt the geometric traits
|
||||
*
|
||||
|
|
@ -166,18 +166,18 @@ public:
|
|||
/**
|
||||
* \brief creates a %Cartesian grid using a prescribed grid step.
|
||||
*
|
||||
* The grid covers the space described by a bounding box.
|
||||
* The grid covers the space described by an iso-cuboid.
|
||||
*
|
||||
* \param bbox the bounding box of the grid
|
||||
* \param spacing the dimension of the paving cell, in the `x`, `y`, and `z` directions, respectively.
|
||||
* \param span the geometric span of the grid
|
||||
* \param spacing the dimension of the paving cell, in the `x`, `y`, and `z` directions
|
||||
* \param gt the geometric traits
|
||||
*
|
||||
* \pre the diagonal of `bbox` has length a multiple of `spacing`
|
||||
* \pre the diagonal of `span` has length a multiple of `spacing`
|
||||
*/
|
||||
Cartesian_grid_3(const Iso_cuboid_3& bbox,
|
||||
Cartesian_grid_3(const Iso_cuboid_3& span,
|
||||
const Vector_3& spacing,
|
||||
const Geom_traits& gt = Geom_traits())
|
||||
: m_bbox{bbox},
|
||||
: m_span{span},
|
||||
m_spacing{spacing},
|
||||
m_gt{gt}
|
||||
{
|
||||
|
|
@ -186,8 +186,8 @@ public:
|
|||
auto z_coord = gt.compute_z_3_object();
|
||||
auto vertex = gt.construct_vertex_3_object();
|
||||
|
||||
const Point_3& min_p = vertex(bbox, 0);
|
||||
const Point_3& max_p = vertex(bbox, 7);
|
||||
const Point_3& min_p = vertex(span, 0);
|
||||
const Point_3& max_p = vertex(span, 7);
|
||||
const FT x_span = x_coord(max_p) - x_coord(min_p);
|
||||
const FT y_span = y_coord(max_p) - y_coord(min_p);
|
||||
const FT z_span = z_coord(max_p) - z_coord(min_p);
|
||||
|
|
@ -200,15 +200,15 @@ public:
|
|||
/**
|
||||
* \brief creates a %Cartesian grid using a prescribed grid step.
|
||||
*
|
||||
* The grid covers the space described by a bounding box, itself described through two diagonal corners.
|
||||
* The grid covers the space described by an iso-cuboid, itself described through two diagonal corners.
|
||||
*
|
||||
* \param p the lowest corner of the bounding box of the grid
|
||||
* \param q the upper corner of the bounding box of the grid
|
||||
* \param p the lexicographically smallest corner of the iso-cuboid
|
||||
* \param q the lexicographically largest corner of the iso-cuboid
|
||||
* \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 the diagonal of the bounding box has length a multiple of `spacing`
|
||||
* \pre the diagonal of the iso-cuboid has length a multiple of `spacing`
|
||||
*/
|
||||
Cartesian_grid_3(const Point_3& p, const Point_3& q,
|
||||
const Vector_3& spacing,
|
||||
|
|
@ -226,16 +226,16 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* returns the bounding box of the %Cartesian grid
|
||||
* returns an iso-cuboid representing the geometric span of the %Cartesian grid
|
||||
*/
|
||||
const Iso_cuboid_3& bbox() const { return m_bbox; }
|
||||
const Iso_cuboid_3& span() const { return m_span; }
|
||||
|
||||
/**
|
||||
* sets the bounding box of the %Cartesian grid and recomputes the spacing.
|
||||
* sets the geometric span of the %Cartesian grid and recomputes the spacing.
|
||||
*/
|
||||
void set_bbox(const Iso_cuboid_3& bbox)
|
||||
void set_span(const Iso_cuboid_3& span)
|
||||
{
|
||||
m_bbox = bbox;
|
||||
m_span = span;
|
||||
compute_spacing();
|
||||
}
|
||||
|
||||
|
|
@ -288,7 +288,7 @@ public:
|
|||
*
|
||||
* \param p the point to be located
|
||||
*
|
||||
* \pre `p` is inside the bounding box of the grid.
|
||||
* \pre `p` is inside the grid.
|
||||
*/
|
||||
std::array<std::size_t, 3> index(const Point_3& p) const
|
||||
{
|
||||
|
|
@ -297,7 +297,7 @@ public:
|
|||
auto z_coord = m_gt.compute_z_3_object();
|
||||
auto vertex = m_gt.construct_vertex_3_object();
|
||||
|
||||
const Point_3& min_p = vertex(m_bbox, 0);
|
||||
const Point_3& min_p = vertex(m_span, 0);
|
||||
std::size_t i = (x_coord(p) - x_coord(min_p)) / m_spacing[0];
|
||||
std::size_t j = (y_coord(p) - y_coord(min_p)) / m_spacing[1];
|
||||
std::size_t k = (z_coord(p) - z_coord(min_p)) / m_spacing[2];
|
||||
|
|
@ -318,7 +318,7 @@ public:
|
|||
* \brief returns the geometric position of the grid vertex described by a set of indices.
|
||||
*
|
||||
* Depending on the value of the template parameter `cache_points`, positions might not be stored
|
||||
* but calculated using the lowest corner of the bounding box and grid spacing.
|
||||
* but calculated on-the-fly.
|
||||
*
|
||||
* \param i the index in the `x` direction
|
||||
* \param j the index in the `y` direction
|
||||
|
|
@ -336,7 +336,7 @@ public:
|
|||
typename Geom_traits::Construct_point_3 point = m_gt.construct_point_3_object();
|
||||
typename Geom_traits::Construct_vertex_3 vertex = m_gt.construct_vertex_3_object();
|
||||
|
||||
const Point_3& min_p = vertex(m_bbox, 0);
|
||||
const Point_3& min_p = vertex(m_span, 0);
|
||||
return point(x_coord(min_p) + i * m_spacing[0],
|
||||
y_coord(min_p) + j * m_spacing[1],
|
||||
z_coord(min_p) + k * m_spacing[2]);
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ public:
|
|||
* \brief constructs a domain that can be used with the %Dual Contouring algorithm.
|
||||
*
|
||||
* \param partition the space partitioning data structure
|
||||
* \param values a continuous field of scalar values, defined over the bounding box of `partition`
|
||||
* \param gradients a continuous field of normalized vectors, defined over the bounding box of `partition`
|
||||
* \param values a continuous field of scalar values, defined over the geometric span of `partition`
|
||||
* \param gradients a continuous field of normalized vectors, defined over the geometric span of `partition`
|
||||
* \param intersection_oracle the oracle for edge-isosurface intersection computation
|
||||
*
|
||||
* \warning the domain class keeps a reference to the `partition`, `values` and `gradients` objects.
|
||||
|
|
@ -84,8 +84,8 @@ public:
|
|||
* \tparam EdgeIntersectionOracle must be a model of `EdgeIntersectionOracle_3`
|
||||
*
|
||||
* \param partition the space partitioning data structure
|
||||
* \param values a continuous field of scalar values, defined over the bounding box of `partition`
|
||||
* \param gradients a continuous field of normalized vectors, defined over the bounding box of `partition`
|
||||
* \param values a continuous field of scalar values, defined over the geometric span of `partition`
|
||||
* \param gradients a continuous field of normalized vectors, defined over the geometric span of `partition`
|
||||
* \param intersection_oracle the oracle for edge-isosurface intersection computation
|
||||
*
|
||||
* \warning the domain class keeps a reference to the `partition`, `values` and `gradients` objects.
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace IO {
|
|||
*
|
||||
* \brief creates a grid from a `CGAL::Image_3`.
|
||||
*
|
||||
* The dimensions and bounding box are read from the image. The values stored
|
||||
* The dimensions and geometric span are read from the image. The values stored
|
||||
* in the image must be of type `Geom_traits::FT` or implicitly convertible to it.
|
||||
*
|
||||
* \tparam Grid must be `CGAL::Cartesian_grid_3<GeomTraits>` whose `GeomTraits` is a model of `IsosurfacingTraits_3`
|
||||
|
|
@ -52,18 +52,18 @@ bool read_Image_3(const CGAL::Image_3& image,
|
|||
auto point = grid.geom_traits().construct_point_3_object();
|
||||
auto iso_cuboid = grid.geom_traits().construct_iso_cuboid_3_object();
|
||||
|
||||
// compute bounding box
|
||||
// compute span
|
||||
const FT max_x = image.tx() + (image.xdim() - 1) * image.vx();
|
||||
const FT max_y = image.ty() + (image.ydim() - 1) * image.vy();
|
||||
const FT max_z = image.tz() + (image.zdim() - 1) * image.vz();
|
||||
Iso_cuboid_3 bbox = iso_cuboid(point(image.tx(), image.ty(), image.tz()),
|
||||
Iso_cuboid_3 span = iso_cuboid(point(image.tx(), image.ty(), image.tz()),
|
||||
point(max_x, max_y, max_z));
|
||||
|
||||
// get spacing
|
||||
// std::array<FT, 3> spacing = make_array(image.vx(), image.vy(), image.vz());
|
||||
|
||||
// get sizes
|
||||
grid.set_bbox(bbox);
|
||||
grid.set_span(span);
|
||||
grid.set_sizes(image.xdim(), image.ydim(), image.zdim());
|
||||
|
||||
// copy values
|
||||
|
|
@ -133,7 +133,7 @@ CGAL::Image_3 write_Image_3(const Grid& grid,
|
|||
throw std::bad_alloc(); // @todo idk?
|
||||
|
||||
// set min coordinates
|
||||
const Point_3& min_p = vertex(grid.bbox(), 0);
|
||||
const Point_3& min_p = vertex(grid.span(), 0);
|
||||
im->tx = float(CGAL::to_double(x_coord(min_p)));
|
||||
im->ty = float(CGAL::to_double(y_coord(min_p)));
|
||||
im->tz = float(CGAL::to_double(z_coord(min_p)));
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ bool write_OBJ(std::ostream& out,
|
|||
for(std::size_t y=0; y<grid.ydim(); ++y) {
|
||||
for(std::size_t z=0; z<grid.zdim(); ++z)
|
||||
{
|
||||
const Point_3& p = vertex(grid.bbox(), 0);
|
||||
const Point_3& p = vertex(grid.span(), 0);
|
||||
const double x_coord_d = CGAL::to_double(x_coord(p) + x * grid.spacing()[0]);
|
||||
const double y_coord_d = CGAL::to_double(y_coord(p) + y * grid.spacing()[1]);
|
||||
const double z_coord_d = CGAL::to_double(z_coord(p) + z * grid.spacing()[2]);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public:
|
|||
* \brief constructs a domain that can be used with the Marching Cubes algorithm.
|
||||
*
|
||||
* \param partition the space partitioning data structure
|
||||
* \param values a continuous field of scalar values, defined over the bounding box of `partition`
|
||||
* \param values a continuous field of scalar values, defined over the geometric span of `partition`
|
||||
* \param intersection_oracle the oracle for edge-isosurface intersection computation
|
||||
*
|
||||
* \warning the domain class keeps a reference to the `partition`, `values` and `gradients` objects.
|
||||
|
|
@ -79,7 +79,7 @@ public:
|
|||
* \tparam EdgeIntersectionOracle must be a model of `EdgeIntersectionOracle_3`
|
||||
*
|
||||
* \param partition the space partitioning data structure
|
||||
* \param values a continuous field of scalar values, defined over the bounding box of `partition`
|
||||
* \param values a continuous field of scalar values, defined over the geometric span of `partition`
|
||||
* \param intersection_oracle the oracle for edge-isosurface intersection computation
|
||||
*
|
||||
* \warning the domain class keeps a reference to the `partition`, `values` and `gradients` objects.
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ bool cell_position_QEM(const typename Domain::Cell_descriptor& c,
|
|||
#endif
|
||||
|
||||
FT x_min, y_min, z_min, x_max, y_max, z_max;
|
||||
x_min = y_min = z_min = std::numeric_limits<FT>::max(); // @todo domain.bbox()
|
||||
x_min = y_min = z_min = std::numeric_limits<FT>::max(); // @todo domain.span()
|
||||
x_max = y_max = z_max = std::numeric_limits<FT>::lowest();
|
||||
FT x(0), y(0), z(0);
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public:
|
|||
*
|
||||
* \param p the point at which to interpolate the values
|
||||
* \param g the grid
|
||||
* \param values the continuous field of scalar values, defined over the bounding box of `g`
|
||||
* \param values the continuous field of scalar values, defined over the geometric span of `g`
|
||||
*/
|
||||
FT interpolate_values(const Point_3& p,
|
||||
const Grid& g,
|
||||
|
|
@ -61,11 +61,11 @@ public:
|
|||
typename Geom_traits::Construct_vertex_3 vertex = g.geom_traits().construct_vertex_3_object();
|
||||
|
||||
// trilinear interpolation of stored values
|
||||
const Iso_cuboid_3& bbox = g.bbox();
|
||||
const Iso_cuboid_3& span = g.span();
|
||||
const Vector_3& spacing = g.spacing();
|
||||
|
||||
// calculate min index including border case
|
||||
const Point_3& min_p = vertex(bbox, 0);
|
||||
const Point_3& min_p = vertex(span, 0);
|
||||
std::size_t i = (x_coord(p) - x_coord(min_p)) / x_coord(spacing);
|
||||
std::size_t j = (y_coord(p) - y_coord(min_p)) / y_coord(spacing);
|
||||
std::size_t k = (z_coord(p) - z_coord(min_p)) / z_coord(spacing);
|
||||
|
|
@ -119,7 +119,7 @@ public:
|
|||
*
|
||||
* \param p the point at which to interpolate the gradients
|
||||
* \param g the grid
|
||||
* \param gradients the continuous field of vector values, defined over the bounding box of `g`
|
||||
* \param gradients the continuous field of vector values, defined over the geometric span of `g`
|
||||
*/
|
||||
Vector_3 interpolate_gradients(const Point_3& p,
|
||||
const Grid& g,
|
||||
|
|
@ -132,11 +132,11 @@ public:
|
|||
typename Geom_traits::Construct_vertex_3 vertex = g.geom_traits().construct_vertex_3_object();
|
||||
|
||||
// trilinear interpolation of stored gradients
|
||||
const Iso_cuboid_3& bbox = g.bbox();
|
||||
const Iso_cuboid_3& span = g.span();
|
||||
const Vector_3& spacing = g.spacing();
|
||||
|
||||
// calculate min index including border case
|
||||
const Point_3& min_p = vertex(bbox, 0);
|
||||
const Point_3& min_p = vertex(span, 0);
|
||||
std::size_t i = static_cast<std::size_t>((x_coord(p) - x_coord(min_p)) / x_coord(spacing));
|
||||
std::size_t j = static_cast<std::size_t>((y_coord(p) - y_coord(min_p)) / y_coord(spacing));
|
||||
std::size_t k = static_cast<std::size_t>((z_coord(p) - z_coord(min_p)) / z_coord(spacing));
|
||||
|
|
|
|||
Loading…
Reference in New Issue