23#ifndef VCL_MESH_CONTAINERS_VERTEX_CONTAINER_H
24#define VCL_MESH_CONTAINERS_VERTEX_CONTAINER_H
26#include "element_container.h"
28#include <vclib/mesh/elements/vertex.h>
29#include <vclib/mesh/elements/vertex_components.h>
49template<VertexConcept T>
52 template<VertexConcept U>
61 using VertexIterator = Base::ElementIterator;
62 using ConstVertexIterator = Base::ConstElementIterator;
80 const VertexType&
vertex(
uint i)
const {
return Base::element(
i); }
192 template<
typename...
VC>
216 template<vcl::Range R>
221 for (
const auto& v :
range) {
347 return Base::elementIndexIfCompact(
i);
363 return Base::elementCompactIndices();
415 VertexIterator
vertexEnd() {
return Base::elementEnd(); }
437 ConstVertexIterator
vertexEnd()
const {
return Base::elementEnd(); }
501 Base::enableAllOptionalComponents();
510 Base::disableAllOptionalComponents();
524 requires vert::HasOptionalAdjacentEdges<T>
527 typename T::AdjacentEdges>();
537 requires vert::HasOptionalAdjacentEdges<T>
549 requires vert::HasOptionalAdjacentEdges<T>
565 requires vert::HasOptionalAdjacentFaces<T>
568 typename T::AdjacentFaces>();
578 requires vert::HasOptionalAdjacentFaces<T>
590 requires vert::HasOptionalAdjacentFaces<T>
608 requires vert::HasOptionalAdjacentVertices<T>
611 typename T::AdjacentVertices>();
621 requires vert::HasOptionalAdjacentVertices<T>
633 requires vert::HasOptionalAdjacentVertices<T>
762 requires vert::HasOptionalPrincipalCurvature<T>
765 typename T::PrincipalCurvature>();
775 requires vert::HasOptionalPrincipalCurvature<T>
778 typename T::PrincipalCurvature>();
788 requires vert::HasOptionalPrincipalCurvature<T>
791 typename T::PrincipalCurvature>();
842 requires vert::HasOptionalTexCoord<T>
845 typename T::TexCoord>();
887 return Base::hasElemCustomComponent(name);
903 return Base::elemCustomComponentNames();
954 return Base::elemComponentType(name);
1015 Base::deleteElemCustomComponent(name);
1059 template<
typename K>
1110 template<
typename K>
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
The Vertex Container class, will be used when the template argument given to the Mesh is a Vertex.
Definition vertex_container.h:51
uint addVertices(R &&range)
Add an arbitrary number of vertices with the coordinates contained in the given range,...
Definition vertex_container.h:217
void disablePerVertexPrincipalCurvature()
Disables the Optional PrincipalCurvature of the vertex.
Definition vertex_container.h:787
void updateVertexIndices(const std::vector< uint > &newIndices)
Updates all the indices and pointers of the vertices of this container that are stored in any contain...
Definition vertex_container.h:390
void disablePerVertexTexCoord()
Disables the Optional TexCoord of the vertex.
Definition vertex_container.h:865
auto vertices(bool jumpDeleted=true)
Returns a small utility object that allows to iterate over the vertices of the containers,...
Definition vertex_container.h:462
bool isPerVertexColorEnabled() const
Checks if the vertex Optional Color is enabled.
Definition vertex_container.h:648
void enablePerVertexAdjacentEdges()
Enables the Optional Adjacent Edges of the vertex.
Definition vertex_container.h:536
void deleteVertex(uint i)
Marks as deleted the vertex with the given id.
Definition vertex_container.h:315
VertexType & vertex(uint i)
Returns a reference of the vertex at the i-th position in the Vertex Container of the Mesh,...
Definition vertex_container.h:92
void clearVertices()
Clears the Vertex container of the Mesh, deleting all the vertices.
Definition vertex_container.h:243
bool isPerVertexQualityEnabled() const
Checks if the vertex Optional Quality is enabled.
Definition vertex_container.h:804
auto vertices(bool jumpDeleted=true) const
Returns a small utility object that allows to iterate over the vertices of the containers,...
Definition vertex_container.h:490
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 v...
Definition vertex_container.h:147
void disablePerVertexQuality()
Disables the Optional Quality of the vertex.
Definition vertex_container.h:826
ConstVertexIterator vertexEnd() const
Returns a const iterator to the end of the container.
Definition vertex_container.h:437
std::vector< std::string > perVertexCustomComponentNames() const
Returns a vector containing all the names of the custom components of any type associated to the Vert...
Definition vertex_container.h:900
ConstCustomComponentVectorHandle< K > perVertexCustomComponentVectorHandle(const std::string &name) const
Returns a const vector handle to the custom component having type K and the given name.
Definition vertex_container.h:1111
void disablePerVertexAdjacentFaces()
Disables the Optional Adjacent Faces of the vertex.
Definition vertex_container.h:589
void disablePerVertexNormal()
Checks if the vertex Optional PrincipalCurvature is enabled.
Definition vertex_container.h:745
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 v...
Definition vertex_container.h:193
void resizeVertices(uint n)
Resizes the Vertex container to contain n vertices.
Definition vertex_container.h:273
void compactVertices()
Compacts the Vertex Container, removing all the vertices marked as deleted. Vertices indices will cha...
Definition vertex_container.h:301
bool hasPerVertexCustomComponent(const std::string &name) const
Checks if vertices have a custom component with the given name.
Definition vertex_container.h:884
void deletePerVertexCustomComponent(const std::string &name)
Deletes the custom component of the given name from the Vertex Element.
Definition vertex_container.h:1012
void enablePerVertexColor()
Enables the Optional Color of the vertex.
Definition vertex_container.h:659
uint vertexNumber() const
Returns the number of non-deleted vertices contained in the Vertex container of the Mesh.
Definition vertex_container.h:103
ConstVertexIterator vertexBegin(bool jumpDeleted=true) const
Returns a const iterator to the beginning of the container.
Definition vertex_container.h:428
void addPerVertexCustomComponent(const std::string &name)
Adds a custom component of type K to the Vertex, having the given name.
Definition vertex_container.h:994
uint vertexIndexIfCompact(uint i) const
This is an utility member function that returns the index of an element if the container would be com...
Definition vertex_container.h:345
void disableAllPerVertexOptionalComponents()
Disables all the optional components associated to the Vertex type contained in the VertexContainer.
Definition vertex_container.h:508
CustomComponentVectorHandle< K > perVertexCustomComponentVectorHandle(const std::string &name)
Returns a vector handle to the custom component having the type K and the given name.
Definition vertex_container.h:1060
uint addVertices(uint n)
Add an arbitrary number of n vertices, returning the id of the first added vertex.
Definition vertex_container.h:168
bool isPerVertexAdjacentVerticesEnabled() const
Checks if the vertex Optional Adjacent Vertices component is enabled.
Definition vertex_container.h:607
void enablePerVertexPrincipalCurvature()
Enables the Optional PrincipalCurvature of the vertex.
Definition vertex_container.h:774
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...
Definition vertex_container.h:951
uint addVertex()
Add a new vertex into the vertex container, returning the index of the added vertex.
Definition vertex_container.h:134
bool isPerVertexPrincipalCurvatureEnabled() const
Checks if the vertex Optional PrincipalCurvature is enabled.
Definition vertex_container.h:761
void enablePerVertexTexCoord()
Enables the Optional TexCoord of the vertex.
Definition vertex_container.h:854
void enablePerVertexAdjacentVertices()
Enables the Optional Adjacent Vertices of the vertex.
Definition vertex_container.h:620
bool isPerVertexAdjacentEdgesEnabled() const
Checks if the vertex Optional Adjacent Edges component is enabled.
Definition vertex_container.h:523
std::vector< std::string > perVertexCustomComponentNamesOfType() const
Returns a vector containing all the names of the custom components associated to the Vertex Element h...
Definition vertex_container.h:977
void enablePerVertexNormal()
Enables the Optional Normal of the vertex.
Definition vertex_container.h:734
uint vertexContainerSize() const
Returns the number of vertices (also deleted) contained in the Vertex container of the Mesh.
Definition vertex_container.h:114
void disablePerVertexAdjacentEdges()
Disables the Optional Adjacent Edges of the vertex.
Definition vertex_container.h:548
void enablePerVertexMark()
Enables the Optional Mark of the vertex.
Definition vertex_container.h:696
VertexIterator vertexBegin(bool jumpDeleted=true)
Returns an iterator to the beginning of the container.
Definition vertex_container.h:406
bool isPerVertexAdjacentFacesEnabled() const
Checks if the vertex Optional Adjacent Faces component is enabled.
Definition vertex_container.h:564
void enablePerVertexAdjacentFaces()
Enables the Optional Adjacent Faces of the vertex.
Definition vertex_container.h:577
void disablePerVertexAdjacentVertices()
Disables the Optional Adjacent Vertices of the vertex.
Definition vertex_container.h:632
void disablePerVertexMark()
Container::disableVertexMark disables the Optional Mark of the vertex.
Definition vertex_container.h:708
void disablePerVertexColor()
Disables the Optional Color of the vertex.
Definition vertex_container.h:670
void reserveVertices(uint n)
Reserve a number of vertices in the container of Vertices. This is useful when you know (or you have ...
Definition vertex_container.h:293
VertexContainer()=default
Empty constructor that creates an empty container of Vertices.
bool isPerVertexTexCoordEnabled() const
Checks if the vertex Optional TexCoord is enabled.
Definition vertex_container.h:841
void enableAllPerVertexOptionalComponents()
Enables all the optional components associated to the Vertex type contained in the VertexContainer.
Definition vertex_container.h:499
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 g...
Definition vertex_container.h:930
VertexIterator vertexEnd()
Returns an iterator to the end of the container.
Definition vertex_container.h:415
bool isPerVertexNormalEnabled() const
Checks if the vertex Optional Normal is enabled.
Definition vertex_container.h:723
bool isPerVertexMarkEnabled() const
Checks if the vertex Optional Mark is enabled.
Definition vertex_container.h:685
uint deletedVertexNumber() const
Returns the number of deleted vertices in the Vertex container, that is vertexContainerSize() - verte...
Definition vertex_container.h:122
void enablePerVertexQuality()
Enables the Optional Quality of the vertex.
Definition vertex_container.h:815
std::vector< uint > vertexCompactIndices() const
Returns a vector that tells, for each actual vertex index, the new index that the vertex would have i...
Definition vertex_container.h:361
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,...
Definition vertex_container.h:80
void deleteVertex(const VertexType *v)
Marks as deleted the given vertex, before asserting that the vertex belongs to this container.
Definition vertex_container.h:330
Utility concept that is evaluated true the Range R has a value_type that is exactly T.
Definition range.h:66