Visual Computing Library
devel
|
The TriMeshT class is a mesh class that represents a triangle mesh. More...
Public Types | |
using | ScalarType = Scalar |
The scalar used to store all the data of the Mesh. | |
![]() | |
using | ConstVertexIterator = Base::ConstElementIterator |
using | Vertex = T |
using | VertexIterator = Base::ElementIterator |
using | VertexType = T |
![]() | |
using | ConstFaceIterator = Base::ConstElementIterator |
using | Face = T |
using | FaceIterator = Base::ElementIterator |
using | FaceType = T |
![]() | |
using | BoundingBoxType = Box< PointType > |
Expose the type of the bounding box. | |
![]() | |
using | ColorType = vcl::Color |
Expose the type of the Color. | |
![]() | |
using | ConstTexFileNamesIterator = decltype(std::declval< const detail::TData >().pathBegin()) |
using | ConstTextureIterator = std::vector< Texture >::const_iterator |
using | TexFileNamesIterator = decltype(std::declval< detail::TData >().pathBegin()) |
using | TextureIterator = std::vector< Texture >::iterator |
using | TextureType = Texture |
Expose the type of the Texture. | |
![]() | |
using | TransformMatrixType = Matrix44< Scalar > |
Expose the type of the transform matrix. | |
![]() | |
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 | 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 | 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 | |
![]() | |
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. | |
uint | addVertex () |
Add a new vertex into the vertex container, returning the index of the added vertex. | |
uint | addVertex (const typename T::PositionType &p) |
Add a new vertex with the given position into the vertex container, returning the id of the added vertex. | |
template<typename... VC> | |
uint | addVertices (const typename T::PositionType &p, const VC &... v) |
Add an arbitrary number of vertices with the given positions, returning the id of the first added vertex. | |
template<vcl::Range R> requires RangeOf<R, typename T::PositionType> | |
uint | addVertices (R &&range) |
Add an arbitrary number of vertices with the positions contained in the given range, returning the id of the first added vertex. | |
uint | addVertices (uint n) |
Add an arbitrary number of n vertices, returning the id of the first added vertex. | |
void | clearVertices () |
Clears the Vertex container of the Mesh, deleting all the vertices. | |
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. | |
uint | deletedVertexNumber () const |
Returns the number of deleted vertices in the Vertex container, that is vertexContainerSize() - vertexNumber(). | |
void | deletePerVertexCustomComponent (const std::string &name) |
Deletes the custom component of the given name from the Vertex Element. | |
void | deleteVertex (const VertexType *v) |
Marks as deleted the given vertex, before asserting that the vertex belongs to this container. | |
void | deleteVertex (uint i) |
Marks as deleted the vertex with the given id. | |
template<typename K > requires vert::HasCustomComponents<T> | |
void | deserializePerVertexCustomComponentsOfType (std::istream &is) |
Deserializes in the given input stream all the custom components of the Vertex Element of type K. | |
void | disableAllPerVertexOptionalComponents () |
Disables all the optional components associated to the Vertex type contained in the VertexContainer. | |
void | disablePerVertexAdjacentEdges () |
Disables the Optional Adjacent Edges of the vertex. | |
void | disablePerVertexAdjacentFaces () |
Disables the Optional Adjacent Faces of the vertex. | |
void | disablePerVertexAdjacentVertices () |
Disables the Optional Adjacent Vertices of the vertex. | |
void | disablePerVertexColor () |
Disables the Optional Color of the vertex. | |
void | disablePerVertexMark () |
Container::disableVertexMark disables the Optional Mark of the vertex. | |
void | disablePerVertexNormal () |
Checks if the vertex Optional PrincipalCurvature is enabled. | |
void | disablePerVertexPrincipalCurvature () |
Disables the Optional PrincipalCurvature of the vertex. | |
void | disablePerVertexQuality () |
Disables the Optional Quality of the vertex. | |
void | disablePerVertexTexCoord () |
Disables the Optional TexCoord of the vertex. | |
void | enableAllPerVertexOptionalComponents () |
Enables all the optional components associated to the Vertex type contained in the VertexContainer. | |
void | enablePerVertexAdjacentEdges () |
Enables the Optional Adjacent Edges of the vertex. | |
void | enablePerVertexAdjacentFaces () |
Enables the Optional Adjacent Faces of the vertex. | |
void | enablePerVertexAdjacentVertices () |
Enables the Optional Adjacent Vertices of the vertex. | |
void | enablePerVertexColor () |
Enables the Optional Color of the vertex. | |
void | enablePerVertexMark () |
Enables the Optional Mark of the vertex. | |
void | enablePerVertexNormal () |
Enables the Optional Normal of the vertex. | |
void | enablePerVertexPrincipalCurvature () |
Enables the Optional PrincipalCurvature of the vertex. | |
void | enablePerVertexQuality () |
Enables the Optional Quality of the vertex. | |
void | enablePerVertexTexCoord () |
Enables the Optional TexCoord of the vertex. | |
bool | hasPerVertexCustomComponent (const std::string &name) const |
Checks if vertices have a custom component with the given name. | |
bool | isPerVertexAdjacentEdgesEnabled () const |
Checks if the vertex Optional Adjacent Edges component is enabled. | |
bool | isPerVertexAdjacentFacesEnabled () const |
Checks if the vertex Optional Adjacent Faces component is enabled. | |
bool | isPerVertexAdjacentVerticesEnabled () const |
Checks if the vertex Optional Adjacent Vertices component is enabled. | |
bool | isPerVertexColorEnabled () const |
Checks if the vertex Optional Color is enabled. | |
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. | |
bool | isPerVertexMarkEnabled () const |
Checks if the vertex Optional Mark is enabled. | |
bool | isPerVertexNormalEnabled () const |
Checks if the vertex Optional Normal is enabled. | |
bool | isPerVertexPrincipalCurvatureEnabled () const |
Checks if the vertex Optional PrincipalCurvature is enabled. | |
bool | isPerVertexQualityEnabled () const |
Checks if the vertex Optional Quality is enabled. | |
bool | isPerVertexTexCoordEnabled () const |
Checks if the vertex Optional TexCoord is enabled. | |
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> | |
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. | |
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> | |
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. | |
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 | resizeVertices (uint n) |
Resizes the Vertex container to contain n vertices. | |
template<typename K > requires vert::HasCustomComponents<T> | |
void | serializePerVertexCustomComponentsOfType (std::ostream &os) const |
Serializes in the given output stream all the custom components of the Vertex Element of type K. | |
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. | |
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. | |
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. | |
VertexIterator | vertexBegin (bool jumpDeleted=true) |
Returns an iterator to the beginning of the container. | |
ConstVertexIterator | vertexBegin (bool jumpDeleted=true) const |
Returns a const iterator to the beginning of the container. | |
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. | |
VertexContainer ()=default | |
Empty constructor that creates an empty container of Vertices. | |
uint | vertexContainerSize () const |
Returns the number of vertices (also deleted) contained in the Vertex container of the Mesh. | |
VertexIterator | vertexEnd () |
Returns an iterator to the end of the container. | |
ConstVertexIterator | vertexEnd () const |
Returns a const iterator to the end of the 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. | |
uint | vertexNumber () const |
Returns the number of non-deleted vertices contained in the Vertex container of the Mesh. | |
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(). | |
auto | vertices (uint begin, uint end=UINT_NULL) |
Returns a view object that allows to iterate over the Vertices of the container in the given range: | |
auto | vertices (uint begin, uint end=UINT_NULL) const |
Returns a view object that allows to iterate over the Vertices of the container in the given range: | |
![]() | |
uint | addFace () |
Add a Face to the container, returning its index. | |
template<Range Rng> requires ( InputRange<Rng, typename Face::VertexType*> || InputRange<Rng, uint>) | |
uint | addFace (Rng &&r) |
template<typename... V> requires (sizeof...(args) >= 3) | |
uint | addFace (V... args) |
uint | addFaces (uint n) |
Add an arbitrary number of n Faces, returning the id of the first added Face. | |
template<typename K > requires face::HasCustomComponents<T> | |
void | addPerFaceCustomComponent (const std::string &name) |
Adds a custom component of type K to the Face, having the given name. | |
void | clearFaces () |
Clears the Face container of the Mesh, deleting all the Faces. | |
void | compactFaces () |
Compacts the FaceContainer, removing all the Faces marked as deleted. Faces indices will change accordingly. The function will automatically take care of updating all the Face pointers contained in the Mesh. | |
uint | deletedFaceNumber () const |
Returns the number of deleted Faces in the Face container, that is faceContainerSize() - faceNumber(). | |
void | deleteFace (const FaceType *f) |
Marks as deleted the given Face, before asserting that the Face belongs to this container. | |
void | deleteFace (uint i) |
Marks as deleted the Face with the given id. | |
void | deletePerFaceCustomComponent (const std::string &name) |
Deletes the custom component of the given name from the Face Element. | |
template<typename K > requires face::HasCustomComponents<T> | |
void | deserializePerFaceCustomComponentsOfType (std::istream &is) |
Deserializes in the given input stream all the custom components of the Face Element of type K. | |
void | disableAllPerFaceOptionalComponents () |
Disables all the optional components associated to the Face type contained in the FaceContainer. | |
void | disablePerFaceAdjacentEdges () |
Disables the Optional AdjacentEdges of the Face. | |
void | disablePerFaceAdjacentFaces () |
Disables the Optional AdjacentFaces of the Face. | |
void | disablePerFaceColor () |
Disables the Optional Color of the Face. | |
void | disablePerFaceMark () |
Disables the Optional Mark of the Face. | |
void | disablePerFaceNormal () |
Disables the Optional Normal of the Face. | |
void | disablePerFacePrincipalCurvature () |
Disables the Optional PrincipalCurvature of the Face. | |
void | disablePerFaceQuality () |
Disables the Optional Quality of the Face. | |
void | disablePerFaceWedgeColors () |
Disables the Optional WedgeColors of the Face. | |
void | disablePerFaceWedgeTexCoords () |
Disables the Optional WedgeTexCoords of the Face. | |
void | enableAllPerFaceOptionalComponents () |
Enables all the optional components associated to the Face type contained in the FaceContainer. | |
void | enablePerFaceAdjacentEdges () |
Enable the Optional AdjacentEdges of the Face. | |
void | enablePerFaceAdjacentFaces () |
Enable the Optional AdjacentFaces of the Face. | |
void | enablePerFaceColor () |
Enable the Optional Color of the Face. | |
void | enablePerFaceMark () |
Enable the Optional Mark of the Face. | |
void | enablePerFaceNormal () |
Enable the Optional Normal of the Face. | |
void | enablePerFacePrincipalCurvature () |
Enable the Optional PrincipalCurvature of the Face. | |
void | enablePerFaceQuality () |
Enable the Optional Quality of the Face. | |
void | enablePerFaceWedgeColors () |
Enable the Optional WedgeColors of the Face. | |
void | enablePerFaceWedgeTexCoords () |
Enable the Optional WedgeTexCoords of the Face. | |
FaceType & | face (uint i) |
Returns a reference of the Face at the i-th position in the Face Container of the Mesh, which will be the Face having index = i. | |
const FaceType & | face (uint i) const |
Returns a const reference of the Face at the i-th position in the Face Container of the Mesh, which will be the Face having index = i. | |
FaceIterator | faceBegin (bool jumpDeleted=true) |
Returns an iterator to the beginning of the container. | |
ConstFaceIterator | faceBegin (bool jumpDeleted=true) const |
Returns a const iterator to the beginning of the container. | |
std::vector< uint > | faceCompactIndices () const |
Returns a vector that tells, for each actual Face index, the new index that the Face would have in a compacted container. For each deleted Face index, the value of the vector will be UINT_NULL. | |
FaceContainer ()=default | |
Empty constructor that creates an empty container of Faces. | |
uint | faceContainerSize () const |
Returns the number of Faces (also deleted) contained in the Face container of the Mesh. | |
FaceIterator | faceEnd () |
Returns an iterator to the end of the container. | |
ConstFaceIterator | faceEnd () const |
Returns a const iterator to the end of the container. | |
uint | faceIndexIfCompact (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 Face with the given index. | |
uint | faceNumber () const |
Returns the number of non-deleted Faces contained in the Face container of the Mesh. | |
auto | faces (bool jumpDeleted=true) |
Returns a small view object that allows to iterate over the Faces of the containers, providing two member functions begin() and end(). | |
auto | faces (bool jumpDeleted=true) const |
Returns a small view object that allows to iterate over the Faces of the containers, providing two member functions begin() and end(). | |
auto | faces (uint begin, uint end=UINT_NULL) |
Returns a view object that allows to iterate over the Faces of the container in the given range: | |
auto | faces (uint begin, uint end=UINT_NULL) const |
Returns a view object that allows to iterate over the Faces of the container in the given range: | |
bool | hasPerFaceCustomComponent (const std::string &name) const |
Checks if Faces have a custom component with the given name. | |
bool | isPerFaceAdjacentEdgesEnabled () const |
Checks if the Face Optional AdjacentEdges is enabled. | |
bool | isPerFaceAdjacentFacesEnabled () const |
Checks if the Face Optional AdjacentFaces is enabled. | |
bool | isPerFaceColorEnabled () const |
Checks if the Face Optional Color is enabled. | |
template<typename K > requires face::HasCustomComponents<T> | |
bool | isPerFaceCustomComponentOfType (const std::string &name) const |
Checks if the custom component of the Face Element having the given name has the same type of the given template argument type of this function. | |
bool | isPerFaceMarkEnabled () const |
Checks if the Face Optional Mark is enabled. | |
bool | isPerFaceNormalEnabled () const |
Checks if the Face Optional Normal is enabled. | |
bool | isPerFacePrincipalCurvatureEnabled () const |
Checks if the Face Optional PrincipalCurvature is enabled. | |
bool | isPerFaceQualityEnabled () const |
Checks if the Face Optional Quality is enabled. | |
bool | isPerFaceWedgeColorsEnabled () const |
Checks if the Face Optional WedgeColors is enabled. | |
bool | isPerFaceWedgeTexCoordsEnabled () const |
Checks if the Face Optional WedgeTexCoords is enabled. | |
std::vector< std::string > | perFaceCustomComponentNames () const |
Returns a vector containing all the names of the custom components of any type associated to the Face Element. | |
template<typename K > requires face::HasCustomComponents<T> | |
std::vector< std::string > | perFaceCustomComponentNamesOfType () 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. | |
std::type_index | perFaceCustomComponentType (const std::string &name) const |
Returns the std::type_index of the custom component of the Face Element having the given input name. | |
template<typename K > requires face::HasCustomComponents<T> | |
CustomComponentVectorHandle< K > | perFaceCustomComponentVectorHandle (const std::string &name) |
Returns a vector handle to the custom component having the type K and the given name. | |
template<typename K > requires face::HasCustomComponents<T> | |
ConstCustomComponentVectorHandle< K > | perFaceCustomComponentVectorHandle (const std::string &name) const |
Returns a const vector handle to the custom component having type K and the given name. | |
void | reserveFaces (uint n) |
Reserve a number of Faces in the container of Faces. This is useful when you know (or you have an idea) of how much Faces are going to add into a newly of existing mesh. Calling this function before any addFace() call will avoid unuseful reallocations of the container, saving execution time. | |
void | resizeFaces (uint n) |
Resizes the Face container to contain n Faces. | |
template<typename K > requires face::HasCustomComponents<T> | |
void | serializePerFaceCustomComponentsOfType (std::ostream &os) const |
Serializes in the given output stream all the custom components of the Face Element of type K. | |
void | updateFaceIndices (const std::vector< uint > &newIndices) |
Updates all the indices and pointers of the Faces 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 Face index, the new Face index. | |
![]() | |
BoundingBoxType & | boundingBox () |
Returns a reference to the bounding box of this object. | |
const BoundingBoxType & | boundingBox () const |
Returns a const reference to the bounding box of this object. | |
BoundingBox ()=default | |
Initilizes the bounding box to an invalid bounding box. | |
![]() | |
vcl::Color & | color () |
Returns a reference pf the color of the element. | |
const vcl::Color & | color () const |
Returns a const reference of the color of the element. | |
Color ()=default | |
Initilizes the color to black (with alpha 255). | |
![]() | |
void | decrementMark () |
Decrements the mark of the current element/mesh by 1. | |
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. | |
Mark () | |
Constructor that initializes the mark to 0. | |
int | mark () const |
Returns the value of the mark. | |
void | resetMark () |
Resets the mark to 0. | |
![]() | |
std::string & | name () |
Returns the name of this object. | |
const std::string & | name () const |
Returns the name of this object. | |
Name ()=default | |
Initilizes an empty name. | |
![]() | |
void | clearTexturePaths () |
Clears the vector of textures. | |
void | clearTextures () |
Clears the vector of textures. | |
uint | indexOfTexturePath (const std::string &path) const |
Returns the index of the texture with the given path, or UINT_NULL if the texture is not found. | |
std::string & | meshBasePath () |
Returns a reference to the mesh base path. | |
const std::string & | meshBasePath () const |
Returns the mesh base path. | |
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. | |
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 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. | |
TextureIterator | textureBegin () |
Returns an iterator to the beginning of the vector of textures. | |
ConstTextureIterator | textureBegin () const |
Returns a const iterator to the beginning of the vector of textures. | |
TextureIterator | textureEnd () |
Returns an iterator to the end of the vector of textures. | |
ConstTextureIterator | textureEnd () const |
Returns a const iterator to the end of the vector of textures. | |
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. | |
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 & | texturePath (uint i) const |
Returns the path of the i-th texture of the mesh. The path is relative to the mesh base path. | |
TexFileNamesIterator | texturePathBegin () |
Returns an iterator to the beginning of the vector of texture paths. | |
ConstTexFileNamesIterator | texturePathBegin () const |
Returns a const 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 | texturePathEnd () const |
Returns a const iterator to the end of the vector of texture paths. | |
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: | |
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: | |
![]() | |
TransformMatrix () | |
Initializes the transform matrix to identity. | |
TransformMatrixType & | transformMatrix () |
Returns a reference to the transform matrix. | |
const TransformMatrixType & | transformMatrix () const |
Returns a const reference to the transform matrix. | |
![]() | |
template<typename CompType > requires (!IS_VERTICAL) | |
void | addCustomComponent (const std::string &compName, const CompType &value=CompType()) |
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 > | |
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 > | |
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. | |
CustomComponents ()=default | |
Initilizes an empty container of custom components. | |
std::type_index | customComponentType (const std::string &compName) const |
Returns the std::type_index of the custom component of the given name. | |
void | deleteCustomComponent (const std::string &compName) |
template<typename CompType > requires (!IS_VERTICAL) | |
void | deserializeCustomComponentsOfType (std::istream &is) |
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. | |
template<typename CompType > requires (!IS_VERTICAL) | |
void | serializeCustomComponentsOfType (std::ostream &os) const |
![]() | |
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 | addPerElementCustomComponent (const std::string &name) |
Adds a custom component of type K having the given name to the Element having ID ELEM_ID . | |
void | append (const Mesh &m) |
Appends all the elements contained in the mesh m to this mesh. | |
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. | |
void | clear () |
Clears all the Elements contained in the mesh. | |
void | clearElements () |
Clears the container of ELEM_ID elements the Mesh, deleting all the Elements. | |
void | compact () |
Compacts all the containers of the mesh. | |
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. | |
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. | |
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. | |
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. | |
void | deleteElement (uint i) |
Marks as deleted the element at the given index from its container, deduced from the template index ELEM_ID. | |
void | deletePerElementCustomComponent (const std::string &name) |
Deletes the custom component of the given name from the Element having ID ELEM_ID . | |
void | deserialize (std::istream &is) |
void | deserializePerElementCustomComponentsOfType (std::istream &is) |
Deserializes the custom components of type K of the element with ID ELEM_ID. | |
void | disableAllOptionalComponents () |
Disables all the optional components of the elements of the containers if the mesh. | |
void | disablePerElementComponent () |
Disables the optional Component having ID COMP_ID for elements having ID ELEM_ID in the mesh. | |
auto & | element (uint i) |
Returns the element of the given type at the given index inside its container of this 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 | elements (bool jumpDeleted=true) |
auto | elements (bool jumpDeleted=true) const |
auto | elements (uint begin, uint end=UINT_NULL) |
auto | elements (uint begin, uint end=UINT_NULL) const |
Returns a lightweight const view object that stores the begin and end const iterators of the container of the elements having ID ELEM_ID in the mesh. 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: | |
void | enableAllOptionalComponents () |
Enables all the optional components of the elements of the containers if the mesh. | |
void | enablePerElementComponent () |
Enables the optional Component having ID COMP_ID for elements having ID ELEM_ID in the mesh. | |
void | enableSameOptionalComponentsOf (const OtherMeshType &m) |
Enables all the OptionalComponents of this mesh according to the Components available on the OtherMeshType m. | |
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. | |
bool | hasPerElementCustomComponent (const std::string &name) const |
Returns true if the Element having ID ELEM_ID has a custom component with the given name. | |
void | importFrom (const OtherMeshType &m) |
Imports all the components that can be imported from another type of 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. | |
bool | isCompact () const |
Returns true if this mesh is compact, meaning that all its containers have no deleted elements (size == element number). | |
bool | isPerElementComponentEnabled () const |
Returns true if optional Component having ID COMP_ID is enabled for elements having ID ELEM_ID in the mesh. | |
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. | |
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. | |
uint | number () const |
Returns the number of elements of the given type in this mesh. | |
Mesh & | operator= (Mesh oth) |
Assignment operator of the Mesh. | |
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 . | |
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 . | |
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 . | |
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 . | |
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 | resize (uint n) |
Resizes the Element container to contain n Elements of type ELEM_ID. | |
void | serialize (std::ostream &os) const |
void | serializePerElementCustomComponentsOfType (std::ostream &os) const |
Serializes the custom components of type K of the element with ID ELEM_ID. | |
void | swap (Mesh &m2) |
Swaps this mesh with the other input Mesh m2. | |
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). | |
![]() | |
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 OthMesh > | |
void | manageImportTriFromPoly (const OthMesh &m) |
This function manages the case where we try to import into a TriMesh a PolyMesh Faces have been already imported, but without vertex pointers and other components that depend on the number of vertices (e.g. wedges) | |
![]() | |
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) |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
![]() | |
void | clearContainer () |
void | compactContainer () |
void | disableAllOptionalComponentsInContainer () |
void | enableAllOptionalComponentsInContainer () |
bool | isContainerCompact () const |
void | updateAllReferences (const Element *oldBase) |
void | updateAllReferences (const std::vector< uint > &newIndices) |
void | updateReferences (const Element *oldBase) |
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 Element *oldBase, TypeWrapper< A... >) |
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 std::vector< uint > &newIndices) |
The TriMeshT class is a mesh class that represents a triangle mesh.
It allows to store trimesh::Vertex and trimesh::Face elements.
The mesh is templated over the scalar type and a boolean flag that indicates whether the mesh uses indices to store vertices of faces 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. |