Geogram Version 1.9.6-rc
A programming library of geometric algorithms
|
The vertices of a mesh. More...
#include <geogram/mesh/mesh.h>
Public Member Functions | |
MeshVertices (Mesh &mesh) | |
void | remove_isolated () |
Removes the vertices that have no mesh element incident to them. | |
void | delete_elements (vector< index_t > &to_delete, bool remove_isolated_vertices=true) override |
Deletes a set of elements. | |
void | permute_elements (vector< index_t > &permutation) override |
Applies a permutation to the elements and their attributes. | |
index_t | create_vertex () |
Creates a new vertex. | |
index_t | create_vertex (const double *coords) |
Creates a new vertex. | |
template<index_t DIM> | |
index_t | create_vertex (const vecng< DIM, double > &p) |
Creates a vertex from a 3d point. | |
index_t | create_vertices (index_t nb) |
Creates a contiguous chunk of vertices. | |
void | clear (bool keep_attributes=true, bool keep_memory=false) override |
Removes all the elements and attributes. | |
void | set_single_precision () |
Sets single precision mode. | |
void | set_double_precision () |
Sets double precision mode. | |
bool | single_precision () const |
Tests whether vertices are stored in single-precision mode. | |
bool | double_precision () const |
Tests whether vertices are stored in double-precision mode. | |
index_t | dimension () const |
Gets the dimension of the vertices. | |
void | set_dimension (index_t dim) |
Sets the dimension of the vertices. | |
const double * | point_ptr (index_t v) const |
Gets a point. | |
double * | point_ptr (index_t v) |
Gets a point. | |
template<index_t DIM = 3> | |
vecng< DIM, double > & | point (index_t v) |
Gets a point. | |
template<index_t DIM = 3> | |
const vecng< DIM, double > & | point (index_t v) const |
Gets a point. | |
const float * | single_precision_point_ptr (index_t v) const |
Gets a (single-precision) point. | |
float * | single_precision_point_ptr (index_t v) |
Gets a (single-precision) point. | |
void | assign_points (vector< double > &points, index_t dim, bool steal_arg) |
Assigns all the points. | |
void | assign_points (const double *points, index_t dim, index_t nb_pts) |
Assigns all the points. | |
void | pop () override |
Removes the last element. | |
template<index_t DIM = 3> | |
auto | points () const |
Gets the 3D points of the mesh as an iterable sequence. | |
template<index_t DIM = 3> | |
auto | points () |
Gets the 3D points of the mesh as an iterable sequence. | |
![]() | |
MeshSubElementsStore (Mesh &mesh) | |
Constructs a new MeshSubElementStore. | |
virtual | ~MeshSubElementsStore () |
MeshElementStore destructor. | |
index_t | nb () const |
Gets the number of (sub-)elements. | |
AttributesManager & | attributes () const |
Gets the attributes manager. | |
index_as_iterator | begin () const |
Used by range-based for. | |
index_as_iterator | end () const |
Used by range-based for. | |
Protected Member Functions | |
void | clear_store (bool keep_attributes, bool keep_memory=false) override |
Removes all the elements and attributes. | |
void | resize_store (index_t new_size) override |
Resizes this MeshSubElementsStore. | |
void | bind_point_attribute (index_t dim, bool single_precision=false) |
void | copy (const MeshVertices &rhs, bool copy_attributes=true) |
![]() | |
void | reserve_store (index_t nb_to_reserve) |
Reserves space for new elements. | |
index_t | create_sub_elements (index_t nb) |
Creates a contiguous chunk of attributes for sub-elements. | |
index_t | create_sub_element () |
Creates attributes for a sub-element. | |
void | adjust_store () |
Makes the size of the store tightly match the number of the elements. | |
void | copy (const MeshSubElementsStore &rhs, bool copy_attributes=true) |
Copies a MeshSubElementsStore into this one. | |
Protected Attributes | |
MeshEdges & | edges_ |
MeshFacetCornersStore & | facet_corners_ |
MeshCellCornersStore & | cell_corners_ |
Attribute< double > | point_ |
Attribute< float > | point_fp32_ |
![]() | |
Mesh & | mesh_ |
AttributesManager | attributes_ |
index_t | nb_ |
Friends | |
class | Mesh |
class | GeogramIOHandler |
Additional Inherited Members | |
![]() | |
static bool | has_non_zero (const GEO::vector< index_t > &I) |
Tests whether a vector contains a non-zero value. | |
Assigns all the points.
[in] | points | a const pointer to the (dim * nb_pts ) coordinates of al the points |
[in] | dim | the dimension of the points, i.e. number of coordinates per point |
[in] | nb_pts | number of points |
Assigns all the points.
[in] | points | a vector that contains all the coordinates of the points |
[in] | dim | the dimension of the points, i.e. number of coordinates per point |
[in] | steal_arg | if true, memory is stolen from points , using std::vector::swap (no memory copy). |
|
overridevirtual |
Removes all the elements and attributes.
[in] | keep_attributes | if true, then all the existing attribute names / bindings are kept (but they are cleared). If false, they are destroyed. |
[in] | keep_memory | if true, then memory is kept and can be reused by subsequent mesh element creations. |
Implements GEO::MeshElements.
|
overrideprotectedvirtual |
Removes all the elements and attributes.
[in] | keep_attributes | if true, then all the existing attribute names / bindings are kept (but they are cleared). If false, they are destroyed. |
[in] | keep_memory | if true, then memory is kept and can be reused by subsequent mesh element creations. |
Reimplemented from GEO::MeshSubElementsStore.
|
inlineprotected |
|
inline |
|
inline |
Creates a new vertex.
[in] | coords | a pointer to dimension() coordinates |
|
inline |
Creates a vertex from a 3d point.
[in] | p | a const reference to the 3d point |
|
overridevirtual |
Deletes a set of elements.
[in] | to_delete | a vector of size nb(). If to_delete[e] is different from 0, then element e will be destroyed, else it will be kept. On exit, to_delete is modified (it is used for internal bookkeeping). |
[in] | remove_isolated_vertices | if true, then the vertices that are no longer incident to any element are deleted. |
Implements GEO::MeshElements.
|
inline |
|
inline |
Applies a permutation to the elements and their attributes.
On exit, permutation is modified (used for internal bookkeeping). Applying a permutation permutation
is equivalent to:
Implements GEO::MeshElements.
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Removes the last element.
Implements GEO::MeshElements.
|
overrideprotectedvirtual |
Resizes this MeshSubElementsStore.
On exit, nb() == new_size, elements are created or destroyed if needed.
[in] | new_size | the desired size |
Reimplemented from GEO::MeshSubElementsStore.
|
inline |
void GEO::MeshVertices::set_double_precision | ( | ) |
Sets double precision mode.
Double precision mode is the default. Single-precision mode is used for instance by Vorpaview, to make it more memory efficient. Existing point coordinates are copied and converted to double precision.
void GEO::MeshVertices::set_single_precision | ( | ) |
Sets single precision mode.
Single-precision mode is used for instance by Vorpaview, to make it more memory efficient. Existing point coordinates are copied and converted to single precision.
|
inline |
|
inline |
Gets a (single-precision) point.
[in] | v | the index of the vertex |
|
inline |
Gets a (single-precision) point.
[in] | v | the index of the vertex |
|
protected |
|
protected |