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_NUMBER;
57 using VertexType =
typename VRefs::VertexType;
95 VRefs::setVertices(
r);
98 if constexpr (NV < 0) {
117 template<
typename... V>
119 (std::convertible_to<V, VertexType*> || std::convertible_to<V, uint>) &&
142 VRefs::resizeVertices(
n);
148 void pushVertex(VertexType* v)
requires (NV < 0)
150 VRefs::pushVertex(v);
156 void pushVertex(uint vi)
requires (NV < 0)
158 VRefs::pushVertex(vi);
161 (pushBackTTVNComponent<Comps>(), ...);
164 void insertVertex(uint i, VertexType* v)
requires (NV < 0)
166 VRefs::insertVertex(i, v);
169 (insertTTVNComponent<Comps>(i), ...);
172 void insertVertex(uint i, uint vi)
requires (NV < 0)
174 VRefs::insertVertex(i, vi);
177 (insertTTVNComponent<Comps>(i), ...);
180 void eraseVertex(uint i)
requires (NV < 0)
182 VRefs::eraseVertex(i);
185 (eraseTTVNComponent<Comps>(i), ...);
188 void clearVertices()
requires (NV < 0)
190 VRefs::clearVertices();
193 (clearTTVNComponent<Comps>(), ...);
196 template<
typename ElType>
197 void importFrom(
const ElType& v,
bool importRefs =
true)
199 if constexpr (comp::HasVertexReferences<ElType> && NV < 0) {
200 VRefs::resizeVertices(v.vertexNumber());
202 (resizeTTVNComponent<Comps>(v.vertexNumber()), ...);
205 Base::importFrom(v, importRefs);
213 template<
typename Comp>
217 if (Comp::isAvailable())
226 template<
typename Comp>
230 if (Comp::isAvailable())
239 template<
typename Comp>
243 if (Comp::isAvailable())
252 template<
typename Comp>
256 if (Comp::isAvailable())
265 template<
typename Comp>
269 if (Comp::isAvailable())
275template<
typename MeshType, comp::ComponentConcept... Comps>
304 IsDerivedFromSpecializationOfV<T, Face> &&
307 (RemoveRef<T>::VERTEX_NUMBER < 0 || RemoveRef<T>::VERTEX_NUMBER >= 3) &&
A class representing a box in N-dimensional space.
Definition box.h:46
The Element class.
Definition element.h:75
The Face class represents an Face element of the vcl::Mesh class.
Definition face.h:48
void eraseTTVNComponent(uint i)
Definition face.h:253
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:140
void setVertices(Rng &&r)
Sets all the Vertices to the face.
Definition face.h:92
Face()=default
Empty constructor.
void clearTTVNComponent()
Definition face.h:266
void pushBackTTVNComponent()
Definition face.h:227
void insertTTVNComponent(uint i)
Definition face.h:240
void setVertices(V... args)
Sets a list of Vertices to the face.
Definition face.h:118
void resizeTTVNComponent(uint n)
Definition face.h:214
friend void swap(Face &a, Face &b)
Swap function that delegates to the base Element swap.
Definition face.h:74
A concept that checks whether a class has (inherits from) an Face class.
Definition face.h:303
A concpet that checks whether a class has (inherits from) a Face class and that the Face is polygonal...
Definition face.h:326
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:715
SanityCheckAdjacentFaces concept.
Definition adjacent_faces.h:719
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