|
CGAL 6.2 - Homological Discrete Vector Fields
|
#include <CGAL/HDVF/Cub_object_io.h>
The class Cub_object_io is an intermediate IO class, used to load binary volumes and produce cubical complexes.
Public Member Functions | |
| Cub_object_io () | |
| Default constructor. | |
| Cub_object_io (int d, const std::vector< IOCubCellType > &vcubs, bool khal=false) | |
| Constructor from a vector of cells. | |
| Cub_object_io (const Cub_object_io &m) | |
| void | clear_cubs () |
| Removes all cells of the list. | |
| void | add_cub (const IOCubCellType &c) |
| Adds a cell to the list. | |
| void | frame () |
| Adds one empty cell of higher dimension all around the complex. | |
| bool | read_pgm (const std::string &filename, bool khal=false) |
| Imports a PGM file (PGM version 2). | |
| bool | read_cub (const std::string &filename, bool khalimsky=false) |
| Imports a CUB file. | |
| void | print_infos (size_t level=0) const |
| Prints synthetic informations related to the object. | |
Public Attributes | |
| int | dim = 0 |
| Dimension of the complex. | |
| std::vector< size_t > | ncubs |
| Number of cubs in each dimension. | |
| std::vector< size_t > | N |
| Size of the bounding box along each dimension. | |
| std::vector< IOCubCellType > | cubs |
| List of cubs in each dimension. | |
| bool | khalimsky |
| Khalimsky or coordinates mode. | |
| CGAL::Homological_discrete_vector_field::Cub_object_io< Traits >::Cub_object_io | ( | ) |
Default constructor.
Create an empty Cub_object_io of dimension 3.
| CGAL::Homological_discrete_vector_field::Cub_object_io< Traits >::Cub_object_io | ( | int | d, |
| const std::vector< IOCubCellType > & | vcubs, | ||
| bool | khal = false |
||
| ) |
Constructor from a vector of cells.
Cells coordinates are given in Khalimsky coordinates if the boolean khal is true, or as integer coordinates of voxels of dimension dim otherwise.
| void CGAL::Homological_discrete_vector_field::Cub_object_io< Traits >::frame | ( | ) |
Adds one empty cell of higher dimension all around the complex.
The function enlarges the bounding box with 1 cell of higher dimension on each of its sides. Cubs coordinates are shifted accordingly.
| bool CGAL::Homological_discrete_vector_field::Cub_object_io< Traits >::read_cub | ( | const std::string & | filename, |
| bool | khalimsky = false |
||
| ) |
Imports a CUB file.
| filename | Name of the CUB file (cells are described in Khalimsky coordinates). |
| khalimsky | If true, Khalimsky coordinates are loaded in cubs (for PRIMAL construction of a cubical complex), otherwise, checks that all cells provided are of maximal dimension and load the integer coordinates of voxels in cubs(for DUAL construction). |
| File_not_found | If `filename` does not exist, raise a `std::runtime_error` exception. |
| Incoherent_dimension | Raises a `std::runtime_error` if dimensions of the `Traits` and of the CUB file do not match. |
| Incoherent_cell | A `std::runtime_error` is raised if `khalimsky` is false but a cell of non-maximal dimension is encoutered. |
| bool CGAL::Homological_discrete_vector_field::Cub_object_io< Traits >::read_pgm | ( | const std::string & | filename, |
| bool | khal = false |
||
| ) |
Imports a PGM file (PGM version 2).
| filename | Name of the PGM file. |
| khal | If true, Khalimsky coordinates of voxels are stored in cubs (for PRIMAL construction of a cubical complex), otherwise, integer coordinates of voxels are stored in cubs(for DUAL construction). |
| File_not_found | If `filename` does not exist, raise a `std::runtime_error` exception. |
| Incoherent_dimension | Raises a `std::runtime_error` if dimensions of the `Traits` of the PGM file do not match. |
| bool CGAL::Homological_discrete_vector_field::Cub_object_io< Traits >::khalimsky |
Khalimsky or coordinates mode.
If true, cubs contains cubical cells encoded with Khalismky coordinates, if false, cubs contains voxel coordinates (i.e. cells of dimension dim).