Visual Computing Library
|
The EdgeMeshT class is a mesh class that represents a mesh that stores only vertices and edges (no faces). More...
Public Types | |
using | ScalarType = Scalar |
The scalar used to store all the data of the Mesh. | |
![]() | |
using | Vertex = T |
using | VertexType = T |
using | VertexIterator = Base::ElementIterator |
using | ConstVertexIterator = Base::ConstElementIterator |
![]() | |
using | Edge = T |
using | EdgeType = T |
using | EdgeIterator = Base::ElementIterator |
using | ConstEdgeIterator = Base::ConstElementIterator |
![]() | |
using | BoundingBoxType = Box< PointType > |
Expose the type of the bounding box. | |
![]() | |
using | ColorType = vcl::Color |
Expose the type of the Color. | |
![]() | |
using | TextureType = Texture |
Expose the type of the Texture. | |
using | TextureIterator = std::vector< Texture >::iterator |
using | ConstTextureIterator = std::vector< Texture >::const_iterator |
using | TexFileNamesIterator = decltype(std::declval< detail::TData >().pathBegin()) |
using | ConstTexFileNamesIterator = decltype(std::declval< const detail::TData >().pathBegin()) |
![]() | |
using | TransformMatrixType = Matrix44< Scalar > |
Expose the type of the transform matrix. | |
![]() | |
using | Containers = FilterTypesByCondition< mesh::IsElementContainerPred, TypeWrapper< Args... > >::type |
Containers is a vcl::TypeWrapper that wraps all the types from which the Mesh inherits (Args) that are ElementContainers (they satisfy the ElementContainerConcept). | |
using | Components = FilterTypesByCondition< comp::IsComponentPred, TypeWrapper< Args... > >::type |
Components is an alias to a vcl::TypeWrapper that wraps all the types from which the Mesh inherits (Args) that are Components (they satisfy the ComponentConcept). | |
using | ContainerType = ContainerOfElement< ELEM_ID >::type |
ContainerType is an alias that exposes the type of the Container that stores the Element identified by the template parameter ELEM_ID. | |
using | ElementType = ContainerType< ELEM_ID >::ElementType |
ElementType is an alias that exposes the type of the Element identified by the template parameter ELEM_ID. | |
Additional Inherited Members | |
![]() | |
VertexContainer ()=default | |
Empty constructor that creates an empty container of Vertices. | |
const VertexType & | vertex (uint i) const |
Returns a const reference of the vertex at the i-th position in the Vertex Container of the Mesh, which will be the vertex having index = i. | |
VertexType & | vertex (uint i) |
Returns a reference of the vertex at the i-th position in the Vertex Container of the Mesh, which will be the vertex having index = i. | |
uint | vertexNumber () const |
Returns the number of non-deleted vertices contained in the Vertex container of the Mesh. | |
uint | vertexContainerSize () const |
Returns the number of vertices (also deleted) contained in the Vertex container of the Mesh. | |
uint | deletedVertexNumber () const |
Returns the number of deleted vertices in the Vertex container, that is vertexContainerSize() - vertexNumber(). | |
uint | addVertex () |
Add a new vertex into the vertex container, returning the index of the added vertex. | |
uint | addVertex (const typename T::CoordType &p) |
Add a new vertex with the given coordinate into the vertex container, returning the id of the added vertex. | |
uint | addVertices (uint n) |
Add an arbitrary number of n vertices, returning the id of the first added vertex. | |
template<typename... VC> | |
uint | addVertices (const typename T::CoordType &p, const VC &... v) |
Add an arbitrary number of vertices with the given coordinates, returning the id of the first added vertex. | |
template<vcl::Range R> requires RangeOf<R, typename T::CoordType> | |
uint | addVertices (R &&range) |
Add an arbitrary number of vertices with the coordinates contained in the given range, returning the id of the first added vertex. | |
void | clearVertices () |
Clears the Vertex container of the Mesh, deleting all the vertices. | |
void | resizeVertices (uint n) |
Resizes the Vertex container to contain n vertices. | |
void | reserveVertices (uint n) |
Reserve a number of vertices in the container of Vertices. This is useful when you know (or you have an idea) of how much vertices are going to add into a newly or existing mesh. Calling this function before any add_vertex() call will avoid unuseful reallocations of the container, saving execution time. | |
void | compactVertices () |
Compacts the Vertex Container, removing all the vertices marked as deleted. Vertices indices will change accordingly. The function will automatically take care of updating all the Vertex pointers contained in the Mesh. | |
void | deleteVertex (uint i) |
Marks as deleted the vertex with the given id. | |
void | deleteVertex (const VertexType *v) |
Marks as deleted the given vertex, before asserting that the vertex belongs to this container. | |
uint | vertexIndexIfCompact (uint i) const |
This is an utility member function that returns the index of an element if the container would be compact, that is the number of non-deleted elements before the vertex with the given index. | |
std::vector< uint > | vertexCompactIndices () const |
Returns a vector that tells, for each actual vertex index, the new index that the vertex would have in a compacted container. For each deleted vertex index, the value of the vector will be UINT_NULL. | |
void | updateVertexIndices (const std::vector< uint > &newIndices) |
Updates all the indices and pointers of the vertices of this container that are stored in any container of the mesh, according to the mapping stored in the newIndices vector, that tells for each old vertex index, the new vertex index. | |
VertexIterator | vertexBegin (bool jumpDeleted=true) |
Returns an iterator to the beginning of the container. | |
VertexIterator | vertexEnd () |
Returns an iterator to the end of the container. | |
ConstVertexIterator | vertexBegin (bool jumpDeleted=true) const |
Returns a const iterator to the beginning of the container. | |
ConstVertexIterator | vertexEnd () const |
Returns a const iterator to the end of the container. | |
auto | vertices (bool jumpDeleted=true) |
Returns a small utility object that allows to iterate over the vertices of the containers, providing two member functions begin() and end(). | |
auto | vertices (bool jumpDeleted=true) const |
Returns a small utility object that allows to iterate over the vertices of the containers, providing two member functions begin() and end(). | |
void | enableAllPerVertexOptionalComponents () |
Enables all the optional components associated to the Vertex type contained in the VertexContainer. | |
void | disableAllPerVertexOptionalComponents () |
Disables all the optional components associated to the Vertex type contained in the VertexContainer. | |
bool | isPerVertexAdjacentEdgesEnabled () const |
Checks if the vertex Optional Adjacent Edges component is enabled. | |
void | enablePerVertexAdjacentEdges () |
Enables the Optional Adjacent Edges of the vertex. | |
void | disablePerVertexAdjacentEdges () |
Disables the Optional Adjacent Edges of the vertex. | |
bool | isPerVertexAdjacentFacesEnabled () const |
Checks if the vertex Optional Adjacent Faces component is enabled. | |
void | enablePerVertexAdjacentFaces () |
Enables the Optional Adjacent Faces of the vertex. | |
void | disablePerVertexAdjacentFaces () |
Disables the Optional Adjacent Faces of the vertex. | |
bool | isPerVertexAdjacentVerticesEnabled () const |
Checks if the vertex Optional Adjacent Vertices component is enabled. | |
void | enablePerVertexAdjacentVertices () |
Enables the Optional Adjacent Vertices of the vertex. | |
void | disablePerVertexAdjacentVertices () |
Disables the Optional Adjacent Vertices of the vertex. | |
bool | isPerVertexColorEnabled () const |
Checks if the vertex Optional Color is enabled. | |
void | enablePerVertexColor () |
Enables the Optional Color of the vertex. | |
void | disablePerVertexColor () |
Disables the Optional Color of the vertex. | |
bool | isPerVertexMarkEnabled () const |
Checks if the vertex Optional Mark is enabled. | |
void | enablePerVertexMark () |
Enables the Optional Mark of the vertex. | |
void | disablePerVertexMark () |
Container::disableVertexMark disables the Optional Mark of the vertex. | |
bool | isPerVertexNormalEnabled () const |
Checks if the vertex Optional Normal is enabled. | |
void | enablePerVertexNormal () |
Enables the Optional Normal of the vertex. | |
void | disablePerVertexNormal () |
Checks if the vertex Optional PrincipalCurvature is enabled. | |
bool | isPerVertexPrincipalCurvatureEnabled () const |
Checks if the vertex Optional PrincipalCurvature is enabled. | |
void | enablePerVertexPrincipalCurvature () |
Enables the Optional PrincipalCurvature of the vertex. | |
void | disablePerVertexPrincipalCurvature () |
Disables the Optional PrincipalCurvature of the vertex. | |
bool | isPerVertexQualityEnabled () const |
Checks if the vertex Optional Quality is enabled. | |
void | enablePerVertexQuality () |
Enables the Optional Quality of the vertex. | |
void | disablePerVertexQuality () |
Disables the Optional Quality of the vertex. | |
bool | isPerVertexTexCoordEnabled () const |
Checks if the vertex Optional TexCoord is enabled. | |
void | enablePerVertexTexCoord () |
Enables the Optional TexCoord of the vertex. | |
void | disablePerVertexTexCoord () |
Disables the Optional TexCoord of the vertex. | |
bool | hasPerVertexCustomComponent (const std::string &name) const |
Checks if vertices have a custom component with the given name. | |
std::vector< std::string > | perVertexCustomComponentNames () const |
Returns a vector containing all the names of the custom components of any type associated to the Vertex Element. | |
template<typename K > requires vert::HasCustomComponents<T> | |
bool | isPerVertexCustomComponentOfType (const std::string &name) const |
Checks if the custom component of the Vertex Element having the given name has the same type of the given template argument type of this function. | |
std::type_index | perVertexCustomComponentType (const std::string &name) const |
Returns the std::type_index of the custom component of the Vertex Element having the given input name. | |
template<typename K > requires vert::HasCustomComponents<T> | |
std::vector< std::string > | perVertexCustomComponentNamesOfType () const |
Returns a vector containing all the names of the custom components associated to the Vertex Element having the same type of the given template argument type of this function. | |
template<typename K > requires vert::HasCustomComponents<T> | |
void | addPerVertexCustomComponent (const std::string &name) |
Adds a custom component of type K to the Vertex, having the given name. | |
void | deletePerVertexCustomComponent (const std::string &name) |
Deletes the custom component of the given name from the Vertex Element. | |
template<typename K > requires vert::HasCustomComponents<T> | |
CustomComponentVectorHandle< K > | perVertexCustomComponentVectorHandle (const std::string &name) |
Returns a vector handle to the custom component having the type K and the given name. | |
template<typename K > requires vert::HasCustomComponents<T> | |
ConstCustomComponentVectorHandle< K > | perVertexCustomComponentVectorHandle (const std::string &name) const |
Returns a const vector handle to the custom component having type K and the given name. | |
![]() | |
EdgeContainer ()=default | |
Empty constructor that creates an empty container of Edges. | |
const EdgeType & | edge (uint i) const |
Returns a const reference of the Edge at the i-th position in the Edge Container of the Mesh, which will be the Edge having index = i. | |
EdgeType & | edge (uint i) |
Returns a reference of the Edge at the i-th position in the Edge Container of the Mesh, which will be the Edge having index = i. | |
uint | edgeNumber () const |
Returns the number of non-deleted Edges contained in the Edge container of the Mesh. | |
uint | edgeContainerSize () const |
Returns the number of Edges (also deleted) contained in the Edge container of the Mesh. | |
uint | deletedEdgeNumber () const |
Returns the number of deleted Edges in the Edge container, that is edgeContainerSize() - edgeNumber(). | |
uint | addEdge () |
Add an Edge to the container, returning its index. | |
uint | addEdge (uint v0, uint v1) |
Add an Edge having the two given vertices to the container, returning its index. | |
uint | addEdge (typename T::VertexType *v0, typename T::VertexType *v1) |
Add an Edge having the two given vertices to the container, returning its index. | |
uint | addEdges (uint n) |
Add an arbitrary number of n Edges, returning the id of the first added Edge. | |
void | clearEdges () |
Clears the Edge container of the Mesh, deleting all the Edges. | |
void | resizeEdges (uint n) |
Resizes the Edge container to contain n Edges. | |
void | reserveEdges (uint n) |
Reserve a number of Edges in the container of Edges. This is useful when you know (or you have an idea) of how much Edges are going to add into a newly of existing mesh. Calling this function before any addEdge() call will avoid unuseful reallocations of the container, saving execution time. | |
void | compactEdges () |
Compacts the EdgeContainer, removing all the Edges marked as deleted. Edges indices will change accordingly. The function will automatically take care of updating all the Edge pointers contained in the Mesh. | |
void | deleteEdge (uint i) |
Marks as deleted the Edge with the given id. | |
void | deleteEdge (const EdgeType *e) |
Marks as deleted the given Edge, before asserting that the Edge belongs to this container. | |
uint | edgeIndexIfCompact (uint i) const |
This is an utility member function that returns the index of an element if the container would be compact, that is the number of non-deleted elements before the Edge with the given index. | |
std::vector< uint > | edgeCompactIndices () const |
Returns a vector that tells, for each actual Edge index, the new index that the Edge would have in a compacted container. For each deleted Edge index, the value of the vector will be UINT_NULL. | |
void | updateEdgeIndices (const std::vector< uint > &newIndices) |
Updates all the indices and pointers of the Edges of this container that are stored in any container of the mesh, according to the mapping stored in the newIndices vector, that tells for each old Edge index, the new Edge index. | |
EdgeIterator | edgeBegin (bool jumpDeleted=true) |
Returns an iterator to the beginning of the container. | |
EdgeIterator | edgeEnd () |
Returns an iterator to the end of the container. | |
ConstEdgeIterator | edgeBegin (bool jumpDeleted=true) const |
Returns a const iterator to the beginning of the container. | |
ConstEdgeIterator | edgeEnd () const |
Returns a const iterator to the end of the container. | |
auto | edges (bool jumpDeleted=true) |
Returns a small view object that allows to iterate over the Edges of the containers, providing two member functions begin() and end(). | |
auto | edges (bool jumpDeleted=true) const |
Returns a small view object that allows to iterate over the Edges of the containers, providing two member functions begin() and end(). | |
void | enableAllPerEdgeOptionalComponents () |
Enables all the optional components associated to the Edge type contained in the EdgeContainer. | |
void | disableAllPerEdgeOptionalComponents () |
Disables all the optional components associated to the Edge type contained in the EdgeContainer. | |
bool | isPerEdgeAdjacentEdgesEnabled () const |
Checks if the Edge Optional AdjacentEdges is enabled. | |
void | enablePerEdgeAdjacentEdges () |
Enable the Optional AdjacentEdges of the Edge. | |
void | disablePerEdgeAdjacentEdges () |
Disables the Optional AdjacentEdges of the Edge. | |
bool | isPerEdgeAdjacentFacesEnabled () const |
Checks if the Edge Optional AdjacentFaces is enabled. | |
void | enablePerEdgeAdjacentFaces () |
Enable the Optional AdjacentFaces of the Edge. | |
void | disablePerEdgeAdjacentFaces () |
Disables the Optional AdjacentFaces of the Edge. | |
bool | isPerEdgeColorEnabled () const |
Checks if the Edge Optional Color is enabled. | |
void | enablePerEdgeColor () |
Enable the Optional Color of the Edge. | |
void | disablePerEdgeColor () |
Disables the Optional Color of the Edge. | |
bool | isPerEdgeMarkEnabled () const |
Checks if the Edge Optional Mark is enabled. | |
void | enablePerEdgeMark () |
Enable the Optional Mark of the Edge. | |
void | disablePerEdgeMark () |
Disables the Optional Mark of the Edge. | |
bool | isPerEdgeQualityEnabled () const |
Checks if the Edge Optional Quality is enabled. | |
void | enablePerEdgeQuality () |
Enable the Optional Quality of the Edge. | |
void | disablePerEdgeQuality () |
Disables the Optional Quality of the Edge. | |
bool | hasPerEdgeCustomComponent (const std::string &name) const |
Checks if Edges have a custom component with the given name. | |
std::vector< std::string > | perEdgeCustomComponentNames () const |
Returns a vector containing all the names of the custom components of any type associated to the Edge Element. | |
template<typename K > requires edge::HasCustomComponents<T> | |
bool | isPerEdgeCustomComponentOfType (const std::string &name) const |
Checks if the custom component of the Edge Element having the given name has the same type of the given template argument type of this function. | |
std::type_index | perEdgeCustomComponentType (const std::string &name) const |
Returns the std::type_index of the custom component of the Edge Element having the given input name. | |
template<typename K > requires edge::HasCustomComponents<T> | |
std::vector< std::string > | perEdgeCustomComponentNamesOfType () const |
Returns a vector containing all the names of the custom components associated to the Edge Element having the same type of the given template argument type of this function. | |
template<typename K > requires edge::HasCustomComponents<T> | |
void | addPerEdgeCustomComponent (const std::string &name) |
Adds a custom component of type K to the Edge, having the given name. | |
void | deletePerEdgeCustomComponent (const std::string &name) |
Deletes the custom component of the given name from the Edge Element. | |
template<typename K > requires edge::HasCustomComponents<T> | |
CustomComponentVectorHandle< K > | perEdgeCustomComponentVectorHandle (const std::string &name) |
Returns a vector handle to the custom component having the type K and the given name. | |
template<typename K > requires edge::HasCustomComponents<T> | |
ConstCustomComponentVectorHandle< K > | perEdgeCustomComponentVectorHandle (const std::string &name) const |
Returns a const vector handle to the custom component having type K and the given name. | |
![]() | |
BoundingBox ()=default | |
Initilizes the bounding box to an invalid bounding box. | |
const BoundingBoxType & | boundingBox () const |
Returns a const reference to the bounding box of this object. | |
BoundingBoxType & | boundingBox () |
Returns a reference to the bounding box of this object. | |
![]() | |
Color ()=default | |
Initilizes the color to black (with alpha 255). | |
const vcl::Color & | color () const |
Returns a const reference of the color of the element. | |
vcl::Color & | color () |
Returns a reference pf the color of the element. | |
![]() | |
Mark () | |
Constructor that initializes the mark to 0. | |
int | mark () const |
Returns the value of the mark. | |
void | resetMark () |
Resets the mark to 0. | |
template<typename E > | |
bool | hasSameMark (const E &e) const |
Checks if the current element/mesh has the same mark of the given input element/mesh e . | |
void | incrementMark () |
Increments the mark of the current element/mesh by 1. | |
void | decrementMark () |
Decrements the mark of the current element/mesh by 1. | |
![]() | |
Name ()=default | |
Initilizes an empty name. | |
std::string & | name () |
Returns the name of this object. | |
const std::string & | name () const |
Returns the name of this object. | |
![]() | |
TextureImages ()=default | |
Initializes the component with an empty vector of textures and an empty string as mesh base path. | |
uint | textureNumber () const |
Returns the number of texture of the mesh. | |
const Texture & | texture (uint i) const |
Returns the i-th texture of the mesh. The path of the texture is relative to the mesh base path. | |
Texture & | texture (uint i) |
Returns a reference to the i-th texture of the mesh. The path of the texture is relative to the mesh base path. | |
const std::string & | texturePath (uint i) const |
Returns the path of the i-th texture of the mesh. The path is relative to the mesh base path. | |
std::string & | texturePath (uint i) |
Returns a reference to the path of the i-th texture of the mesh. The path is relative to the mesh base path. | |
const std::string & | meshBasePath () const |
Returns the mesh base path. | |
std::string & | meshBasePath () |
Returns a reference to the mesh base path. | |
void | clearTextures () |
Clears the vector of textures. | |
void | clearTexturePaths () |
Clears the vector of textures. | |
void | pushTexture (const Texture &texture) |
Adds a texture to the vector of textures. | |
void | pushTexturePath (const std::string &textPath) |
Adds a texture to the vector of textures. The image of the texture is left empty. | |
TextureIterator | textureBegin () |
Returns an iterator to the beginning of the vector of textures. | |
TextureIterator | textureEnd () |
Returns an iterator to the end of the vector of textures. | |
ConstTextureIterator | textureBegin () const |
Returns a const iterator to the beginning of the vector of textures. | |
ConstTextureIterator | textureEnd () const |
Returns a const iterator to the end of the vector of textures. | |
TexFileNamesIterator | texturePathBegin () |
Returns an iterator to the beginning of the vector of texture paths. | |
TexFileNamesIterator | texturePathEnd () |
Returns an iterator to the end of the vector of texture paths. | |
ConstTexFileNamesIterator | texturePathBegin () const |
Returns a const iterator to the beginning of the vector of texture paths. | |
ConstTexFileNamesIterator | texturePathEnd () const |
Returns a const iterator to the end of the vector of texture paths. | |
View< TextureIterator > | textures () |
Returns a lightweigth view object that stores the begin and end iterators of the vector of textures. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops: | |
View< ConstTextureIterator > | textures () const |
Returns a lightweigth const view object that stores the begin and end iterators of the vector of textures. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops: | |
auto | texturePaths () |
Returns a lightweigth view object that stores the begin and end iterators of the vector of texture paths. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops: | |
auto | texturePaths () const |
Returns a lightweigth const view object that stores the begin and end iterators of the vector of texture paths. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops: | |
![]() | |
TransformMatrix () | |
Initializes the transform matrix to identity. | |
const TransformMatrixType & | transformMatrix () const |
Returns a const reference to the transform matrix. | |
TransformMatrixType & | transformMatrix () |
Returns a reference to the transform matrix. | |
![]() | |
CustomComponents ()=default | |
Initilizes an empty container of custom components. | |
bool | hasCustomComponent (const std::string &compName) const |
Returns true if the element has a custom component with the given name, false otherwise. The type of the custom component is not checked. | |
template<typename CompType > | |
bool | isCustomComponentOfType (const std::string &compName) const |
Returns true if the custom component of the given name is of the type given as template argument, false otherwise. | |
std::type_index | customComponentType (const std::string &compName) const |
Returns the std::type_index of the custom component of the given name. | |
template<typename CompType > | |
std::vector< std::string > | customComponentNamesOfType () const |
Returns a std::vector of std::strings containing the names of the custom components of the type given as template argument. | |
template<typename CompType > | |
const CompType & | customComponent (const std::string &compName) const |
Returns the const reference to the custom component of the given name having the type given as template argument. | |
template<typename CompType > | |
CompType & | customComponent (const std::string &compName) |
Returns the reference to the custom component of the given name having the type given as template argument. | |
template<typename CompType > requires (!IS_VERTICAL) | |
void | addCustomComponent (const std::string &compName, const CompType &value=CompType()) |
void | deleteCustomComponent (const std::string &compName) |
![]() | |
Mesh () | |
Empty constructor, constructs an empty mesh. | |
Mesh (const Mesh &oth) | |
Copy constructor of the Mesh. Will create a deep copy of the given input mesh, taking care of copying everithing and then update all the pointers. | |
Mesh (Mesh &&oth) | |
Move constructor, moves the given mesh into this one, without any other resource acquisition. | |
bool | isCompact () const |
Returns true if this mesh is compact, meaning that all its containers have no deleted elements (size == element number). | |
void | clear () |
Clears all the Elements contained in the mesh. | |
void | compact () |
Compacts all the containers of the mesh. | |
void | enableAllOptionalComponents () |
Enables all the optional components of the elements of the containers if the mesh. | |
void | disableAllOptionalComponents () |
Disables all the optional components of the elements of the containers if the mesh. | |
void | enableSameOptionalComponentsOf (const OtherMeshType &m) |
Enables all the OptionalComponents of this mesh according to the Components available on the OtherMeshType m. | |
void | append (const Mesh &m) |
Appends all the elements contained in the mesh m to this mesh. | |
void | importFrom (const OtherMeshType &m) |
Imports all the components that can be imported from another type of mesh. | |
void | swap (Mesh &m2) |
Swaps this mesh with the other input Mesh m2. | |
Mesh & | operator= (Mesh oth) |
Assignment operator of the Mesh. | |
uint | index (const El &e) const |
Returns the index of the given element in its Container of the Mesh. | |
uint | index (const El *e) const |
Returns the index of the given element in its Container of the Mesh. | |
const auto & | element (uint i) const |
Returns the element of the given type at the given index inside its container of this mesh. | |
auto & | element (uint i) |
Returns the element of the given type at the given index inside its container of this mesh. | |
uint | number () const |
Returns the number of elements of the given type in this mesh. | |
uint | containerSize () const |
Returns the size of the container of elements of the given type in this mesh. | |
uint | deletedNumber () const |
Returns the number of deleted elements of the given type in this mesh. | |
uint | add () |
Adds a new element of the given type into its container, returning the index of the added element in its container. | |
uint | add (uint n) |
Adds n new elements of the given type into its container, returning the index of the first added element in its container. | |
void | clearElements () |
Clears the container of ELEM_ID elements the Mesh, deleting all the Elements. | |
void | resize (uint n) |
Resizes the Element container to contain n Elements of type ELEM_ID. | |
void | reserve (uint n) |
Reserves a number of elements of the given type in its container. The function does not add any element to the container, but it just reserves a number of elements that can be added without causing a reallocation of the container. | |
void | compactElements () |
Compacts the Container of the given element, removing all the elements marked as deleted. Element indices will change accordingly. The function will automatically take care of updating all the Element pointers contained in the Mesh. | |
void | deleteElement (uint i) |
Marks as deleted the element at the given index from its container, deduced from the template index ELEM_ID. | |
void | deleteElement (const El *e) const |
Marks as deleted the given element from its container. | |
void | deleteElement (const El &e) const |
Marks as deleted the given element from its container. | |
std::vector< uint > | compactIndices () const |
Returns a vector that tells, for each element of the container of ELEM_ID in the mesh, the new index of the element after the container has been compacted. For each deleted element, its position will be set to UINT_NULL. | |
void | updateIndices (const std::vector< uint > &newIndices) |
Updates all the indices and pointers of the elements of the container of ELEM_ID in the mesh, according to the mapping stored in the newIndices vector, that tells for each old element index, the new index of the element in the same container (or UINT_NULL if the element must be left as unreferenced - useful when a vertex is deleted). | |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
auto | begin (bool jumpDeleted=true) |
Returns an iterator to the begining of the container of the elements having ID ELEM_ID in the mesh. | |
auto | begin (bool jumpDeleted=true) const |
Returns a const iterator to the begining of the container of the elements having ID ELEM_ID in the mesh. | |
auto | end () |
Returns an iterator to the end of the container of the elements having ID ELEM_ID in the mesh. | |
auto | end () const |
Returns a const iterator to the end of the container of the elements having ID ELEM_ID in the mesh. | |
auto | elements (bool jumpDeleted=true) |
auto | elements (bool jumpDeleted=true) const |
bool | isPerElementComponentEnabled () const |
Returns true if optional Component having ID COMP_ID is enabled for elements having ID ELEM_ID in the mesh. | |
void | enablePerElementComponent () |
Enables the optional Component having ID COMP_ID for elements having ID ELEM_ID in the mesh. | |
void | disablePerElementComponent () |
Disables the optional Component having ID COMP_ID for elements having ID ELEM_ID in the mesh. | |
bool | hasPerElementCustomComponent (const std::string &name) const |
Returns true if the Element having ID ELEM_ID has a custom component with the given name. | |
std::vector< std::string > | perElementCustomComponentNames () const |
Returns a vector containing all the names of the custom components of any type associated to the Element having ID ELEM_ID . | |
bool | isPerElementCustomComponentOfType (const std::string &name) const |
Returns true if the Element having ID ELEM_ID has a custom component of type K with the given name. | |
std::type_index | perElementCustomComponentType (const std::string &name) const |
Returns the std::type_index of the custom component having the given name associated to the Element having ID ELEM_ID . | |
std::vector< std::string > | perElementCustomComponentNamesOfType () const |
Returns a vector containing all the names of the custom components of type K associated to the Element having ID ELEM_ID . | |
void | addPerElementCustomComponent (const std::string &name) |
Adds a custom component of type K having the given name to the Element having ID ELEM_ID . | |
void | deletePerElementCustomComponent (const std::string &name) |
Deletes the custom component of the given name from the Element having ID ELEM_ID . | |
CustomComponentVectorHandle< K > | perElementCustomComponentVectorHandle (const std::string &name) |
Returns a vector handle to the custom component of type K having the given name associated to the Element having ID ELEM_ID . | |
ConstCustomComponentVectorHandle< K > | perElementCustomComponentVectorHandle (const std::string &name) const |
Returns a const vector handle to the custom component of type K having the given name associated to the Element having ID ELEM_ID . | |
![]() | |
static constexpr bool | hasContainerOf () |
Returns true if this Mesh has a container of elements having the same Element ID of the template Element El. | |
static constexpr bool | hasContainerOf () |
Returns true if this Mesh has a container of elements having the same Element ID of the template ELEM_ID. | |
static constexpr bool | hasPerElementComponent () |
Returns true if this Mesh has a container of elements having the same Element ID of the template ELEM_ID and the Element of that container has a Component having the same Component ID of the template COMP_ID. | |
static constexpr bool | hasPerElementOptionalComponent () |
Returns true if this Mesh has a container of elements having the same Element ID of the template ELEM_ID and the Element of that container has an Optional Component having the same Component ID of the template COMP_ID. | |
![]() | |
static const uint | COMPONENT_ID = CompId::CUSTOM_COMPONENTS |
The ID of component. | |
![]() | |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
![]() | |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
![]() | |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
![]() | |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
![]() | |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
![]() | |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
![]() | |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
![]() | |
bool | isContainerCompact () const |
void | compactContainer () |
void | enableAllOptionalComponentsInContainer () |
void | disableAllOptionalComponentsInContainer () |
void | clearContainer () |
void | updateAllReferences (const Element *oldBase) |
void | updateAllReferences (const std::vector< uint > &newIndices) |
void | updateReferences (const Element *oldBase, TypeWrapper< A... >) |
void | updateReferences (const Element *oldBase) |
void | updateReferences (const Element *oldBase, TypeWrapper< A... >, const std::array< std::size_t, N > &sizes=std::array< std::size_t, 0 >(), uint offset=0) |
void | updateReferences (const Element *oldBase, const std::array< std::size_t, N > &sizes=std::array< std::size_t, 0 >(), uint offset=0) |
void | updateReferences (const std::vector< uint > &newIndices) |
The EdgeMeshT class is a mesh class that represents a mesh that stores only vertices and edges (no faces).
The mesh is templated over the scalar type and a boolean flag that indicates whether the mesh uses indices to store vertices of edges and adjacency information.
Scalar | The scalar type used for the mesh. |
INDEXED | A boolean flag that indicates whether the mesh uses indices or pointers to store references. |