Graphite
Version 3
An experimental 3D geometry processing program
|
Base class for mesh sub-element storage. More...
#include <geogram/mesh/mesh.h>
Public Member Functions | |
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 | |
virtual void | clear_store (bool keep_attributes, bool keep_memory=false) |
Removes all the elements and attributes. More... | |
virtual void | resize_store (index_t new_size) |
Resizes this MeshSubElementsStore. More... | |
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 | |
Mesh & | mesh_ |
AttributesManager | attributes_ |
index_t | nb_ |
Base class for mesh sub-element storage.
Sub-elements are those that cannot exist independently (such as MeshFacetCorner, MeshCellCorner and MeshCellFacet).
GEO::MeshSubElementsStore::MeshSubElementsStore | ( | Mesh & | mesh | ) |
Constructs a new MeshSubElementStore.
[in] | mesh | a reference to the mesh this MeshElementStore belongs to. |
|
inlineprotected |
Makes the size of the store tightly match the number of the elements.
When elements are created one by one, the system may allocate more memory than necessary, to amortize the cost of container reallocation. Once the object is constructed, this function may be called to release the memory that was not used.
|
inline |
|
inline |
|
protectedvirtual |
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 in GEO::MeshCellFacetsStore, GEO::MeshCellCornersStore, GEO::MeshCellsStore, GEO::MeshFacetCornersStore, GEO::MeshFacetsStore, GEO::MeshEdges, and GEO::MeshVertices.
|
inlineprotected |
Copies a MeshSubElementsStore into this one.
[in] | rhs | a const reference to the MeshSubElementsStore to be copied. |
[in] | copy_attributes | if true, copies also the attributes, else attributes are cleared. |
|
inlineprotected |
|
inline |
|
inline |
|
inlineprotected |
|
protectedvirtual |
Resizes this MeshSubElementsStore.
On exit, nb() == new_size, elements are created or destroyed if needed.
[in] | new_size | the desired size |
Reimplemented in GEO::MeshCellFacetsStore, GEO::MeshCellCornersStore, GEO::MeshCellsStore, GEO::MeshFacetCornersStore, GEO::MeshFacetsStore, GEO::MeshEdges, and GEO::MeshVertices.