23#ifndef VCL_MESH_ELEMENTS_FACE_H
24#define VCL_MESH_ELEMENTS_FACE_H
26#include "base/element.h"
27#include "face_components.h"
29#include <vclib/base.h>
46template<
typename MeshType, comp::ComponentConcept... Comps>
49 using Base =
Element<ElemId::FACE, MeshType, Comps...>;
52 using VRefs =
typename Face::VertexReferences;
54 static const int NV = VRefs::VERTEX_COUNT;
57 using VertexType =
typename VRefs::VertexType;
94 VRefs::setVertices(
r);
97 if constexpr (NV < 0) {
116 template<
typename... V>
118 (std::convertible_to<V, VertexType*> || std::convertible_to<V, uint>) &&
141 VRefs::resizeVertices(
n);
147 void pushVertex(VertexType* v)
requires (NV < 0)
149 VRefs::pushVertex(v);
155 void pushVertex(uint vi)
requires (NV < 0)
157 VRefs::pushVertex(vi);
160 (pushBackTTVCComponent<Comps>(), ...);
163 void insertVertex(uint i, VertexType* v)
requires (NV < 0)
165 VRefs::insertVertex(i, v);
168 (insertTTVCComponent<Comps>(i), ...);
171 void insertVertex(uint i, uint vi)
requires (NV < 0)
173 VRefs::insertVertex(i, vi);
176 (insertTTVCComponent<Comps>(i), ...);
179 void eraseVertex(uint i)
requires (NV < 0)
181 VRefs::eraseVertex(i);
184 (eraseTTVCComponent<Comps>(i), ...);
187 void clearVertices()
requires (NV < 0)
189 VRefs::clearVertices();
192 (clearTTVCComponent<Comps>(), ...);
195 template<
typename ElType>
196 void importFrom(
const ElType& v,
bool importRefs =
true)
198 if constexpr (comp::HasVertexReferences<ElType> && NV < 0) {
199 VRefs::resizeVertices(v.vertexCount());
201 (resizeTTVCComponent<Comps>(v.vertexCount()), ...);
204 Base::importFrom(v, importRefs);
212 template<
typename Comp>
216 if (Comp::isAvailable())
225 template<
typename Comp>
229 if (Comp::isAvailable())
238 template<
typename Comp>
242 if (Comp::isAvailable())
251 template<
typename Comp>
255 if (Comp::isAvailable())
264 template<
typename Comp>
268 if (Comp::isAvailable())
274template<
typename MeshType, comp::ComponentConcept... Comps>
303 IsDerivedFromSpecializationOfV<T, Face> &&
306 (RemoveRef<T>::VERTEX_COUNT < 0 || RemoveRef<T>::VERTEX_COUNT >= 3) &&
The Element class.
Definition element.h:75
The Face class represents an Face element of the vcl::Mesh class.
Definition face.h:48
void resizeVertices(uint n)
Resize the number of Vertex Pointers of the Face, taking care of updating also the other components o...
Definition face.h:139
void eraseTTVCComponent(uint i)
Definition face.h:252
void setVertices(Rng &&r)
Sets all the Vertices to the face.
Definition face.h:91
Face()=default
Empty constructor.
void resizeTTVCComponent(uint n)
Definition face.h:213
void pushBackTTVCComponent()
Definition face.h:226
void insertTTVCComponent(uint i)
Definition face.h:239
void setVertices(V... args)
Sets a list of Vertices to the face.
Definition face.h:117
void clearTTVCComponent()
Definition face.h:265
friend void swap(Face &a, Face &b)
Swap function that delegates to the base Element swap.
Definition face.h:74
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:41
A concept that checks whether a class has (inherits from) an Face class.
Definition face.h:302
A concpet that checks whether a class has (inherits from) a Face class and that the Face is polygonal...
Definition face.h:324
Evaluates to true if the type T is tied to the number of vertices in the face.
Definition component.h:126
SanityCheckAdjacentEdges concept.
Definition adjacent_edges.h:714
SanityCheckAdjacentFaces concept.
Definition adjacent_faces.h:716
SanityCheckWedgeColors concept.
Definition wedge_colors.h:380
SanityCheckWedgeTexCoords concept.
Definition wedge_tex_coords.h:417
Definition face_components.h:77
Definition face_components.h:109
Definition face_components.h:111
A simple structure that wraps a list of variadic templates, without instantiating anything....
Definition type_wrapper.h:39