Visual Computing Library  devel
Loading...
Searching...
No Matches
vcl::Face< MeshType, Comps > Class Template Reference

The Face class represents an Face element of the vcl::Mesh class. More...

#include <vclib/mesh/elements/face.h>

Inheritance diagram for vcl::Face< MeshType, Comps >:

Public Types

using VertexType = typename VRefs::VertexType
 
- Public Types inherited from vcl::Element< ElemId::FACE, MeshType, Comps... >
using Components = TypeWrapper< Comps... >
 Components is an alias to a vcl::TypeWrapper that wraps all the Components from which the Element inherits (Comps).
 
using ParentMeshType = MeshType
 
- Public Types inherited from vcl::comp::ParentMeshPointer< MeshType >
using ParentMeshType = MeshType
 

Public Member Functions

void clearVertices ()
 
void eraseVertex (uint i)
 
 Face ()=default
 Empty constructor.
 
template<typename ElType >
void importFrom (const ElType &v, bool importRefs=true)
 
void insertVertex (uint i, uint vi)
 
void insertVertex (uint i, VertexType *v)
 
void pushVertex (uint vi)
 
void pushVertex (VertexType *v)
 
void resizeVertices (uint n)
 Resize the number of Vertex Pointers of the Face, taking care of updating also the other components of the Face that are tied to that number.
 
template<Range Rng>
requires (InputRange<Rng, VertexType*> || InputRange<Rng, uint>)
void setVertices (Rng &&r)
 Sets all the Vertices to the face.
 
template<typename... V>
requires ( (std::convertible_to<V, VertexType*> || std::convertible_to<V, uint>) && ...)
void setVertices (V... args)
 Sets a list of Vertices to the face.
 
- Public Member Functions inherited from vcl::Element< ElemId::FACE, MeshType, Comps... >
autocomponent ()
 
const autocomponent () const
 
void deserialize (std::istream &in)
 
void importFrom (const ElType &v, bool importRefs=true)
 
uint index () const
 
void serialize (std::ostream &out) const
 
- Public Member Functions inherited from vcl::comp::ParentMeshPointer< MeshType >
ParentMeshPointeroperator= (const ParentMeshPointer< MeshType > &)
 
constexpr MeshType * parentMesh ()
 
constexpr const MeshType * parentMesh () const
 
 ParentMeshPointer (const ParentMeshPointer< MeshType > &)
 
 ParentMeshPointer (ParentMeshPointer< MeshType > &&)
 

Private Types

using Base = Element< ElemId::FACE, MeshType, Comps... >
 
using VRefs = typename Face::VertexReferences
 

Private Member Functions

template<typename Comp >
void clearTTVNComponent ()
 
template<typename Comp >
void eraseTTVNComponent (uint i)
 
template<typename Comp >
void insertTTVNComponent (uint i)
 
template<typename Comp >
void pushBackTTVNComponent ()
 
template<typename Comp >
void resizeTTVNComponent (uint n)
 

Static Private Attributes

static const int NV = VRefs::VERTEX_NUMBER
 

Additional Inherited Members

- Static Public Attributes inherited from vcl::Element< ElemId::FACE, MeshType, Comps... >
static const uint ELEMENT_ID
 
- Protected Member Functions inherited from vcl::comp::ParentMeshPointer< MeshType >
void setParentMesh (void *parentMesh)
 

Detailed Description

template<typename MeshType, comp::ComponentConcept... Comps>
class vcl::Face< MeshType, Comps >

The Face class represents an Face element of the vcl::Mesh class.

Using the FaceContainer class, it is possible to add a vector of Face elements to a mesh, and manage them with the member functions exposed by the FaceContainer. Each Face element exposes all the member functions of its Component types.

Template Parameters
MeshTypeThe type of the parent mesh.
CompsThe types of the components of the element.

Constructor & Destructor Documentation

◆ Face()

template<typename MeshType , comp::ComponentConcept... Comps>
vcl::Face< MeshType, Comps >::Face ( )
default

Empty constructor.

Calls automatically all the empty constructors of all the components available in the Face (for all the components non-available, their empty constructor is called only when they become available).

Member Function Documentation

◆ clearTTVNComponent()

template<typename MeshType , comp::ComponentConcept... Comps>
template<typename Comp >
void vcl::Face< MeshType, Comps >::clearTTVNComponent ( )
inlineprivate

Calls the clear() on all the component containers that are tied to the vertex number

◆ eraseTTVNComponent()

template<typename MeshType , comp::ComponentConcept... Comps>
template<typename Comp >
void vcl::Face< MeshType, Comps >::eraseTTVNComponent ( uint  i)
inlineprivate

Calls the erase(i) on all the component containers that are tied to the vertex number

◆ insertTTVNComponent()

template<typename MeshType , comp::ComponentConcept... Comps>
template<typename Comp >
void vcl::Face< MeshType, Comps >::insertTTVNComponent ( uint  i)
inlineprivate

Calls the insert(i) on all the component containers that are tied to the vertex number

◆ pushBackTTVNComponent()

template<typename MeshType , comp::ComponentConcept... Comps>
template<typename Comp >
void vcl::Face< MeshType, Comps >::pushBackTTVNComponent ( )
inlineprivate

Calls the pushBack() on all the component containers that are tied to the vertex number

◆ resizeTTVNComponent()

template<typename MeshType , comp::ComponentConcept... Comps>
template<typename Comp >
void vcl::Face< MeshType, Comps >::resizeTTVNComponent ( uint  n)
inlineprivate

Calls the resize(n) on all the component containers that are tied to the vertex number

◆ resizeVertices()

template<typename MeshType , comp::ComponentConcept... Comps>
void vcl::Face< MeshType, Comps >::resizeVertices ( uint  n)
inline

Resize the number of Vertex Pointers of the Face, taking care of updating also the other components of the Face that are tied to that number.

If n is greater than the old number of vertex pointers, n vertex pointers (and relative tied components) will be added. If n is lower than the old number of vertex pointers, the difference of vertex pointers (and relative tied components) will be removed.

This member function is available only if the face is polygonal (its size is dynamic, N < 0).

Parameters
nthe new number of vertices.

◆ setVertices() [1/2]

template<typename MeshType , comp::ComponentConcept... Comps>
template<Range Rng>
requires (InputRange<Rng, VertexType*> || InputRange<Rng, uint>)
void vcl::Face< MeshType, Comps >::setVertices ( Rng &&  r)
inline

Sets all the Vertices to the face.

If the Face size is static, the number of vertices of the input range must be equal to the size of the Face (the value returned by vertexNumber()). If the Face size is dynamic, it will take care to update the also the size of the components tied to the vertex number of the face.

Template Parameters
RngA range of vertex pointers or vertex indices in counterclockwise order.
Parameters
[in]ra range of vertex pointers or vertex indices in counterclockwise order that will be set as vertices of the face.

◆ setVertices() [2/2]

template<typename MeshType , comp::ComponentConcept... Comps>
template<typename... V>
requires ( (std::convertible_to<V, VertexType*> || std::convertible_to<V, uint>) && ...)
void vcl::Face< MeshType, Comps >::setVertices ( V...  args)
inline

Sets a list of Vertices to the face.

If the Face size is static, the number of vertices of the list must be equal to the size of the Face (the value returned by vertexNumber()). If the Face size is dynamic, it will take care to update the also the size of the components tied to the vertex number of the face.

Template Parameters
VA list of vertex pointers or vertex indices in counterclockwise order.
Parameters
[in]argsa variable number of vertex pointers or vertex indices in counterclockwise order that will be set as vertices of the face.

The documentation for this class was generated from the following file: