23#ifndef VCL_MESH_CONTAINERS_EDGE_CONTAINER_H
24#define VCL_MESH_CONTAINERS_EDGE_CONTAINER_H
26#include "element_container.h"
28#include <vclib/mesh/containers/custom_component_vector_handle.h>
29#include <vclib/mesh/elements/edge.h>
30#include <vclib/mesh/elements/edge_components.h>
51template<EdgeConcept T>
54 template<EdgeConcept U>
63 using EdgeIterator = Base::ElementIterator;
64 using ConstEdgeIterator = Base::ConstElementIterator;
82 const EdgeType&
edge(
uint i)
const {
return Base::element(
i); }
297 void deleteEdge(
const EdgeType* e) { Base::deleteElement(e); }
314 return Base::elementIndexIfCompact(
i);
330 return Base::elementCompactIndices();
383 EdgeIterator
edgeEnd() {
return Base::elementEnd(); }
405 ConstEdgeIterator
edgeEnd()
const {
return Base::elementEnd(); }
466 Base::enableAllOptionalComponents();
475 Base::disableAllOptionalComponents();
489 requires edge::HasOptionalAdjacentEdges<T>
492 typename T::AdjacentEdges>();
513 requires edge::HasOptionalAdjacentEdges<T>
529 requires edge::HasOptionalAdjacentFaces<T>
532 typename T::AdjacentFaces>();
553 requires edge::HasOptionalAdjacentFaces<T>
686 return Base::hasElemCustomComponent(name);
702 return Base::elemCustomComponentNames();
755 return Base::elemComponentType(name);
816 Base::deleteElemCustomComponent(name);
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
The EdgeContainer class represents a container of Edge elements that can be used in a Mesh class.
Definition edge_container.h:53
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 giv...
Definition edge_container.h:731
std::vector< std::string > perEdgeCustomComponentNames() const
Returns a vector containing all the names of the custom components of any type associated to the Edge...
Definition edge_container.h:699
EdgeIterator edgeEnd()
Returns an iterator to the end of the container.
Definition edge_container.h:383
auto edges(bool jumpDeleted=true) const
Returns a small view object that allows to iterate over the Edges of the containers,...
Definition edge_container.h:455
uint addEdge(uint v0, uint v1)
Add an Edge having the two given vertices to the container, returning its index.
Definition edge_container.h:150
uint addEdge()
Add an Edge to the container, returning its index.
Definition edge_container.h:136
void disableAllPerEdgeOptionalComponents()
Disables all the optional components associated to the Edge type contained in the EdgeContainer.
Definition edge_container.h:473
bool isPerEdgeAdjacentFacesEnabled() const
Checks if the Edge Optional AdjacentFaces is enabled.
Definition edge_container.h:528
void clearEdges()
Clears the Edge container of the Mesh, deleting all the Edges.
Definition edge_container.h:210
auto edges(bool jumpDeleted=true)
Returns a small view object that allows to iterate over the Edges of the containers,...
Definition edge_container.h:430
std::vector< std::string > perEdgeCustomComponentNamesOfType() const
Returns a vector containing all the names of the custom components associated to the Edge Element hav...
Definition edge_container.h:778
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,...
Definition edge_container.h:82
void resizeEdges(uint n)
Resizes the Edge container to contain n Edges.
Definition edge_container.h:240
uint addEdge(typename T::VertexType *v0, typename T::VertexType *v1)
Add an Edge having the two given vertices to the container, returning its index.
Definition edge_container.h:170
bool isPerEdgeColorEnabled() const
Checks if the Edge Optional Color is enabled.
Definition edge_container.h:568
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 ...
Definition edge_container.h:328
uint edgeContainerSize() const
Returns the number of Edges (also deleted) contained in the Edge container of the Mesh.
Definition edge_container.h:117
ConstCustomComponentVectorHandle< K > perEdgeCustomComponentVectorHandle(const std::string &name) const
Returns a const vector handle to the custom component having type K and the given name.
Definition edge_container.h:910
void enablePerEdgeColor()
Enable the Optional Color of the Edge.
Definition edge_container.h:579
void enablePerEdgeMark()
Enable the Optional Mark of the Edge.
Definition edge_container.h:616
void enableAllPerEdgeOptionalComponents()
Enables all the optional components associated to the Edge type contained in the EdgeContainer.
Definition edge_container.h:464
CustomComponentVectorHandle< K > perEdgeCustomComponentVectorHandle(const std::string &name)
Returns a vector handle to the custom component having the type K and the given name.
Definition edge_container.h:861
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.
Definition edge_container.h:752
void disablePerEdgeAdjacentFaces()
Disables the Optional AdjacentFaces of the Edge.
Definition edge_container.h:552
uint deletedEdgeNumber() const
Returns the number of deleted Edges in the Edge container, that is edgeContainerSize() - edgeNumber()...
Definition edge_container.h:125
void disablePerEdgeColor()
Disables the Optional Color of the Edge.
Definition edge_container.h:590
void disablePerEdgeMark()
Disables the Optional Mark of the Edge.
Definition edge_container.h:627
void disablePerEdgeAdjacentEdges()
Disables the Optional AdjacentEdges of the Edge.
Definition edge_container.h:512
ConstEdgeIterator edgeEnd() const
Returns a const iterator to the end of the container.
Definition edge_container.h:405
void addPerEdgeCustomComponent(const std::string &name)
Adds a custom component of type K to the Edge, having the given name.
Definition edge_container.h:795
uint edgeNumber() const
Returns the number of non-deleted Edges contained in the Edge container of the Mesh.
Definition edge_container.h:106
void reserveEdges(uint n)
Reserve a number of Edges in the container of Edges. This is useful when you know (or you have an ide...
Definition edge_container.h:260
void deleteEdge(const EdgeType *e)
Marks as deleted the given Edge, before asserting that the Edge belongs to this container.
Definition edge_container.h:297
EdgeIterator edgeBegin(bool jumpDeleted=true)
Returns an iterator to the beginning of the container.
Definition edge_container.h:374
bool isPerEdgeQualityEnabled() const
Checks if the Edge Optional Quality is enabled.
Definition edge_container.h:642
void enablePerEdgeAdjacentFaces()
Enable the Optional AdjacentFaces of the Edge.
Definition edge_container.h:541
bool hasPerEdgeCustomComponent(const std::string &name) const
Checks if Edges have a custom component with the given name.
Definition edge_container.h:683
bool isPerEdgeMarkEnabled() const
Checks if the Edge Optional Mark is enabled.
Definition edge_container.h:605
ConstEdgeIterator edgeBegin(bool jumpDeleted=true) const
Returns a const iterator to the beginning of the container.
Definition edge_container.h:396
uint addEdges(uint n)
Add an arbitrary number of n Edges, returning the id of the first added Edge.
Definition edge_container.h:192
void enablePerEdgeAdjacentEdges()
Enable the Optional AdjacentEdges of the Edge.
Definition edge_container.h:501
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 ...
Definition edge_container.h:358
uint edgeIndexIfCompact(uint i) const
This is an utility member function that returns the index of an element if the container would be com...
Definition edge_container.h:312
bool isPerEdgeAdjacentEdgesEnabled() const
Checks if the Edge Optional AdjacentEdges is enabled.
Definition edge_container.h:488
void deleteEdge(uint i)
Marks as deleted the Edge with the given id.
Definition edge_container.h:282
EdgeContainer()=default
Empty constructor that creates an empty container of Edges.
void enablePerEdgeQuality()
Enable the Optional Quality of the Edge.
Definition edge_container.h:653
void disablePerEdgeQuality()
Disables the Optional Quality of the Edge.
Definition edge_container.h:664
EdgeType & edge(uint i)
Returns a reference of the Edge at the i-th position in the Edge Container of the Mesh,...
Definition edge_container.h:95
void deletePerEdgeCustomComponent(const std::string &name)
Deletes the custom component of the given name from the Edge Element.
Definition edge_container.h:813
void compactEdges()
Compacts the EdgeContainer, removing all the Edges marked as deleted. Edges indices will change accor...
Definition edge_container.h:268