CGAL 6.0 - 3D Isosurfacing
|
#include <CGAL/Isosurfacing_3/Cartesian_grid_3.h>
The class Cartesian_grid_3
represents a 3D Cartesian grid, that is the partition of an iso-cuboid into identical iso-cuboidal cells.
IsosurfacingPartition_3
The class Cartesian_grid_3
is one of the possible space partitioning data structures that can be used along with value and gradient fields to make up a domain.
GeomTraits | must be a model of IsosurfacingTraits_3 . |
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 . |
Public Member Functions | |
Cartesian_grid_3 () | |
Default constructor. | |
Cartesian_grid_3 (const Iso_cuboid_3 &span, const std::array< std::size_t, 3 > &dimensions, const Geom_traits >=Geom_traits()) | |
creates a Cartesian grid with dimensions[0]*dimensions[1]*dimensions[2] grid vertices. | |
Cartesian_grid_3 (const Point_3 &p, const Point_3 &q, const std::array< std::size_t, 3 > &dimensions, const Geom_traits >=Geom_traits()) | |
creates a Cartesian grid with dimensions[0]*dimensions[1]*dimensions[2] grid vertices. | |
Cartesian_grid_3 (const Iso_cuboid_3 &span, const Vector_3 &spacing, const Geom_traits >=Geom_traits()) | |
creates a Cartesian grid using a prescribed grid step spacing . | |
Cartesian_grid_3 (const Point_3 &p, const Point_3 &q, const Vector_3 &spacing, const Geom_traits >=Geom_traits()) | |
creates a Cartesian grid using a prescribed grid step. | |
const Geom_traits & | geom_traits () const |
returns the geometric traits class. | |
const Iso_cuboid_3 & | span () const |
returns an iso-cuboid representing the geometric span of the Cartesian grid. | |
std::size_t | xdim () const |
returns the number of grid vertices in the x direction. | |
std::size_t | ydim () const |
returns the number of grid vertices in the y direction. | |
std::size_t | zdim () const |
returns the number of grid vertices in the z direction. | |
const Vector_3 & | spacing () const |
returns the spacing of the Cartesian grid, that is a vector whose coordinates are the grid steps in the x , y , and z directions, respectively. | |
std::size_t | linear_index (const std::size_t i, const std::size_t j, const std::size_t k) const |
returns the index of a grid cell given its indices (i.e., (k * y_dim + j) * x_dim + i ). | |
std::array< std::size_t, 3 > | index (const Point_3 &p) const |
returns the coordinates of the grid cell that contains a given point. | |
decltype(auto) | point (const std::size_t i, const std::size_t j, const std::size_t k) const |
returns the geometric location of the grid vertex described by its three indices. | |
CGAL::Isosurfacing::Cartesian_grid_3< GeomTraits, MemoryPolicy >::Cartesian_grid_3 | ( | const Iso_cuboid_3 & | span, |
const std::array< std::size_t, 3 > & | dimensions, | ||
const Geom_traits & | gt = Geom_traits() |
||
) |
creates a Cartesian grid with dimensions[0]*dimensions[1]*dimensions[2]
grid vertices.
The grid covers the space described by the iso-cuboid span
.
span | the geometric span of the grid |
dimensions | the number of grid vertices in the x , y , and z directions |
gt | the geometric traits |
CGAL::Isosurfacing::Cartesian_grid_3< GeomTraits, MemoryPolicy >::Cartesian_grid_3 | ( | const Point_3 & | p, |
const Point_3 & | q, | ||
const std::array< std::size_t, 3 > & | dimensions, | ||
const Geom_traits & | gt = Geom_traits() |
||
) |
creates a Cartesian grid with dimensions[0]*dimensions[1]*dimensions[2]
grid vertices.
The grid covers the space described by the iso-cuboid span, itself described through two diagonal corners p
and q
.
p | the lexicographically smallest corner of the iso-cuboid |
q | the lexicographically largest corner of the iso-cuboid |
dimensions | the number of grid vertices in the x , y , and z directions |
gt | the geometric traits |
p
is lexicographically strictly smaller than q
CGAL::Isosurfacing::Cartesian_grid_3< GeomTraits, MemoryPolicy >::Cartesian_grid_3 | ( | const Iso_cuboid_3 & | span, |
const Vector_3 & | spacing, | ||
const Geom_traits & | gt = Geom_traits() |
||
) |
creates a Cartesian grid using a prescribed grid step spacing
.
The grid covers the space described by the iso-cuboid span
.
span | the geometric span of the grid |
spacing | the dimension of the paving cell, in the x , y , and z directions |
gt | the geometric traits |
span
has length a multiple of spacing
CGAL::Isosurfacing::Cartesian_grid_3< GeomTraits, MemoryPolicy >::Cartesian_grid_3 | ( | const Point_3 & | p, |
const Point_3 & | q, | ||
const Vector_3 & | spacing, | ||
const Geom_traits & | gt = Geom_traits() |
||
) |
creates a Cartesian grid using a prescribed grid step.
The grid covers the space described by an iso-cuboid, itself described through two diagonal corners.
p | the lexicographically smallest corner of the iso-cuboid |
q | the lexicographically largest corner of the iso-cuboid |
spacing | the dimension of the paving cell, in the x , y , and z directions, respectively. |
gt | the geometric traits |
p
is lexicographically strictly smaller than q
spacing
std::array< std::size_t, 3 > CGAL::Isosurfacing::Cartesian_grid_3< GeomTraits, MemoryPolicy >::index | ( | const Point_3 & | p | ) | const |
returns the coordinates of the grid cell that contains a given point.
For points on the boundary between two cells, the smaller index is returned.
p | the point to be located |
p
is inside the grid. decltype(auto) CGAL::Isosurfacing::Cartesian_grid_3< GeomTraits, MemoryPolicy >::point | ( | const std::size_t | i, |
const std::size_t | j, | ||
const std::size_t | k | ||
) | const |
returns the geometric location of the grid vertex described by its three indices.
Depending on the value of the template parameter MemoryPolicy
, locations might not be stored but calculated on-the-fly.
i | the index in the x direction |
j | the index in the y direction |
k | the index in the z direction |