Geogram
Version 1.9.1
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. More... | |
void | permute_elements (vector< index_t > &permutation) override |
Applies a permutation to the elements and their attributes. More... | |
index_t | create_vertex () |
Creates a new vertex. More... | |
index_t | create_vertex (const double *coords) |
Creates a new vertex. More... | |
index_t | create_vertices (index_t nb) |
Creates a contiguous chunk of vertices. More... | |
void | clear (bool keep_attributes=true, bool keep_memory=false) override |
Removes all the elements and attributes. More... | |
void | set_single_precision () |
Sets single precision mode. More... | |
void | set_double_precision () |
Sets double precision mode. More... | |
bool | single_precision () const |
Tests whether vertices are stored in single-precision mode. More... | |
bool | double_precision () const |
Tests whether vertices are stored in double-precision mode. More... | |
index_t | dimension () const |
Gets the dimension of the vertices. More... | |
void | set_dimension (index_t dim) |
Sets the dimension of the vertices. More... | |
const double * | point_ptr (index_t v) const |
Gets a point. More... | |
double * | point_ptr (index_t v) |
Gets a point. More... | |
vec3 & | point (index_t v) |
Gets a point. More... | |
const vec3 & | point (index_t v) const |
Gets a point. More... | |
const float * | single_precision_point_ptr (index_t v) const |
Gets a (single-precision) point. More... | |
float * | single_precision_point_ptr (index_t v) |
Gets a (single-precision) point. More... | |
void | assign_points (vector< double > &points, index_t dim, bool steal_arg) |
Assigns all the points. More... | |
void | assign_points (const double *points, index_t dim, index_t nb_pts) |
Assigns all the points. More... | |
void | pop () override |
Removes the last element. | |
Public Member Functions inherited from GEO::MeshSubElementsStore | |
MeshSubElementsStore (Mesh &mesh) | |
Constructs a new MeshSubElementStore. More... | |
virtual | ~MeshSubElementsStore () |
MeshElementStore destructor. | |
index_t | nb () const |
Gets the number of (sub-)elements. More... | |
AttributesManager & | attributes () const |
Gets the attributes manager. More... | |
index_as_iterator | begin () const |
Used by range-based for. More... | |
index_as_iterator | end () const |
Used by range-based for. More... | |
Protected Member Functions | |
void | clear_store (bool keep_attributes, bool keep_memory=false) override |
Removes all the elements and attributes. More... | |
void | resize_store (index_t new_size) override |
Resizes this MeshSubElementsStore. More... | |
void | bind_point_attribute (index_t dim, bool single_precision=false) |
void | copy (const MeshVertices &rhs, bool copy_attributes=true) |
Protected Member Functions inherited from GEO::MeshSubElementsStore | |
void | reserve_store (index_t nb_to_reserve) |
Reserves space for new elements. More... | |
index_t | create_sub_elements (index_t nb) |
Creates a contiguous chunk of attributes for sub-elements. More... | |
index_t | create_sub_element () |
Creates attributes for a sub-element. More... | |
void | adjust_store () |
Makes the size of the store tightly match the number of the elements. More... | |
void | copy (const MeshSubElementsStore &rhs, bool copy_attributes=true) |
Copies a MeshSubElementsStore into this one. More... | |
Protected Attributes | |
MeshEdges & | edges_ |
MeshFacetCornersStore & | facet_corners_ |
MeshCellCornersStore & | cell_corners_ |
Attribute< double > | point_ |
Attribute< float > | point_fp32_ |
Protected Attributes inherited from GEO::MeshSubElementsStore | |
Mesh & | mesh_ |
AttributesManager | attributes_ |
index_t | nb_ |
Friends | |
class | Mesh |
class | GeogramIOHandler |
Additional Inherited Members | |
Static Protected Member Functions inherited from GEO::MeshElements | |
static bool | has_non_zero (const GEO::vector< index_t > &I) |
Tests whether a vector contains a non-zero value. More... | |
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.
|
inline |
|
inline |
Creates a new vertex.
[in] | coords | a pointer to dimension() coordinates |
|
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 |
|
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 |