Visual Computing Library  devel
Loading...
Searching...
No Matches
face_container.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_MESH_CONTAINERS_FACE_CONTAINER_H
24#define VCL_MESH_CONTAINERS_FACE_CONTAINER_H
25
26#include "base/element_container.h"
27
28#include <vclib/mesh/elem_algorithms.h>
29#include <vclib/mesh/elements/face.h>
30#include <vclib/mesh/elements/face_components.h>
31
32#include <vclib/algorithms/core.h>
33
34namespace vcl {
35namespace mesh {
36
53template<FaceConcept T>
55{
56 template<FaceConcept U>
57 friend class FaceContainer;
58
61
62public:
63 using Face = T;
64 using FaceType = T;
65 using FaceIterator = Base::ElementIterator;
66 using ConstFaceIterator = Base::ConstElementIterator;
67
71 FaceContainer() = default;
72
83 const FaceType& face(uint i) const { return Base::element(i); }
84
95 FaceType& face(uint i) { return Base::element(i); }
96
106 uint faceNumber() const { return Base::elementNumber(); }
107
117 uint faceContainerSize() const { return Base::elementContainerSize(); }
118
125 uint deletedFaceNumber() const { return Base::deletedElementNumber(); }
126
136 uint addFace() { return Base::addElement(); }
137
138 template<typename... V>
139 uint addFace(V... args) requires (sizeof...(args) >= 3)
140 {
141 uint fid = addFace();
142 Face& f = face(fid);
143
144 constexpr uint n = sizeof...(args);
145
146 if constexpr (T::VERTEX_NUMBER < 0) {
147 f.resizeVertices(n);
148 }
149 else {
150 static_assert(
151 n == T::VERTEX_NUMBER,
152 "Wrong number of vertices in Mesh::addFace.");
153 }
154
155 addFaceHelper(f, args...);
156 return fid;
157 }
158
159 template<Range Rng>
160 uint addFace(Rng&& r) requires (
161 InputRange<Rng, typename Face::VertexType*> || InputRange<Rng, uint>)
162 {
163 auto begin = std::ranges::begin(r);
164 auto end = std::ranges::end(r);
165
166 if (begin == end)
167 return UINT_NULL;
168 uint n = std::distance(begin, end);
169
170 uint fid = UINT_NULL;
171
172 assert(n >= 3);
173 if (n < 3)
174 return UINT_NULL;
175
176 if constexpr (T::VERTEX_NUMBER < 0) {
177 fid = addFace();
178 face(fid).resizeVertices(n);
179 }
180 else {
181 assert(n == T::VERTEX_NUMBER);
182 if (n == T::VERTEX_NUMBER)
183 fid = addFace();
184 }
185
186 if (fid != UINT_NULL) {
187 Face& f = face(fid);
188
189 unsigned int i = 0;
190 for (auto it = begin; it != end; ++it) {
191 f.setVertex(i, *it);
192 ++i;
193 }
194 }
195 return fid;
196 }
197
212 uint addFaces(uint n) { return Base::addElements(n); }
213
230 void clearFaces() { Base::clearElements(); }
231
260 void resizeFaces(uint n) { Base::resizeElements(n); }
261
280 void reserveFaces(uint n) { Base::reserveElements(n); }
281
288 void compactFaces() { Base::compactElements(); }
289
302 void deleteFace(uint i) { Base::deleteElement(i); }
303
317 void deleteFace(const FaceType* f) { Base::deleteElement(f); }
318
333 {
334 return Base::elementIndexIfCompact(i);
335 }
336
348 std::vector<uint> faceCompactIndices() const
349 {
350 return Base::elementCompactIndices();
351 }
352
377 void updateFaceIndices(const std::vector<uint>& newIndices)
378 {
379 Base::updateElementIndices(newIndices);
380 }
381
393 FaceIterator faceBegin(bool jumpDeleted = true)
394 {
395 return Base::elementBegin(jumpDeleted);
396 }
397
402 FaceIterator faceEnd() { return Base::elementEnd(); }
403
415 ConstFaceIterator faceBegin(bool jumpDeleted = true) const
416 {
417 return Base::elementBegin(jumpDeleted);
418 }
419
424 ConstFaceIterator faceEnd() const { return Base::elementEnd(); }
425
448 auto faces(bool jumpDeleted = true) { return Base::elements(jumpDeleted); }
449
474 auto faces(uint begin, uint end = UINT_NULL)
475 {
476 return Base::elements(begin, end);
477 }
478
501 auto faces(bool jumpDeleted = true) const
502 {
503 return Base::elements(jumpDeleted);
504 }
505
530 auto faces(uint begin, uint end = UINT_NULL) const
531 {
532 return Base::elements(begin, end);
533 }
534
540 {
541 Base::enableAllOptionalComponents();
542 }
543
549 {
550 Base::disableAllOptionalComponents();
551 }
552
553 // AdjacentEdges
554
564 requires face::HasOptionalAdjacentEdges<T>
565 {
566 return Base::template isOptionalComponentEnabled<
567 typename T::AdjacentEdges>();
568 }
569
581 void enablePerFaceAdjacentEdges() requires face::HasOptionalAdjacentEdges<T>
582 {
584 }
585
593 requires face::HasOptionalAdjacentEdges<T>
594 {
596 }
597
598 // AdjacentFaces
599
609 requires face::HasOptionalAdjacentFaces<T>
610 {
611 return Base::template isOptionalComponentEnabled<
612 typename T::AdjacentFaces>();
613 }
614
626 void enablePerFaceAdjacentFaces() requires face::HasOptionalAdjacentFaces<T>
627 {
629 }
630
638 requires face::HasOptionalAdjacentFaces<T>
639 {
641 }
642
643 // Color
644
653 bool isPerFaceColorEnabled() const requires face::HasOptionalColor<T>
654 {
655 return Base::template isOptionalComponentEnabled<typename T::Color>();
656 }
657
664 void enablePerFaceColor() requires face::HasOptionalColor<T>
665 {
667 }
668
675 void disablePerFaceColor() requires face::HasOptionalColor<T>
676 {
678 }
679
680 // Mark
681
690 bool isPerFaceMarkEnabled() const requires face::HasOptionalMark<T>
691 {
692 return Base::template isOptionalComponentEnabled<typename T::Mark>();
693 }
694
701 void enablePerFaceMark() requires face::HasOptionalMark<T>
702 {
704 }
705
712 void disablePerFaceMark() requires face::HasOptionalMark<T>
713 {
715 }
716
717 // Normal
718
727 bool isPerFaceNormalEnabled() const requires face::HasOptionalNormal<T>
728 {
730 }
731
738 void enablePerFaceNormal() requires face::HasOptionalNormal<T>
739 {
741 }
742
749 void disablePerFaceNormal() requires face::HasOptionalNormal<T>
750 {
752 }
753
754 // PrincipalCurvature
755
766 requires face::HasOptionalPrincipalCurvature<T>
767 {
768 return Base::template isOptionalComponentEnabled<
769 typename T::PrincipalCurvature>();
770 }
771
779 requires face::HasOptionalPrincipalCurvature<T>
780 {
781 Base::template enableOptionalComponent<
782 typename T::PrincipalCurvature>();
783 }
784
792 requires face::HasOptionalPrincipalCurvature<T>
793 {
794 Base::template disableOptionalComponent<
795 typename T::PrincipalCurvature>();
796 }
797
798 // Quality
799
808 bool isPerFaceQualityEnabled() const requires face::HasOptionalQuality<T>
809 {
811 }
812
819 void enablePerFaceQuality() requires face::HasOptionalQuality<T>
820 {
822 }
823
830 void disablePerFaceQuality() requires face::HasOptionalQuality<T>
831 {
833 }
834
835 // WedgeColors
836
846 requires face::HasOptionalWedgeColors<T>
847 {
848 return Base::template isOptionalComponentEnabled<
849 typename T::WedgeColors>();
850 }
851
863 void enablePerFaceWedgeColors() requires face::HasOptionalWedgeColors<T>
864 {
866 }
867
874 void disablePerFaceWedgeColors() requires face::HasOptionalWedgeColors<T>
875 {
877 }
878
879 // WedgeTexCoords
880
890 requires face::HasOptionalWedgeTexCoords<T>
891 {
892 return Base::template isOptionalComponentEnabled<
893 typename T::WedgeTexCoords>();
894 }
895
908 requires face::HasOptionalWedgeTexCoords<T>
909 {
911 }
912
920 requires face::HasOptionalWedgeTexCoords<T>
921 {
923 }
924
925 // Custom Components
926
939 bool hasPerFaceCustomComponent(const std::string& name) const
941 {
942 return Base::hasElemCustomComponent(name);
943 }
944
955 std::vector<std::string> perFaceCustomComponentNames() const
957 {
958 return Base::elemCustomComponentNames();
959 }
960
986 template<typename K>
987 bool isPerFaceCustomComponentOfType(const std::string& name) const
989 {
990 return Base::template isElemCustomComponentOfType<K>(name);
991 }
992
1008 std::type_index perFaceCustomComponentType(const std::string& name) const
1010 {
1011 return Base::elemComponentType(name);
1012 }
1013
1033 template<typename K>
1034 std::vector<std::string> perFaceCustomComponentNamesOfType() const
1036 {
1037 return Base::template elemCustomComponentNamesOfType<K>();
1038 }
1039
1050 template<typename K>
1051 void addPerFaceCustomComponent(const std::string& name)
1053 {
1054 Base::template addElemCustomComponent<K>(name);
1055 }
1056
1069 void deletePerFaceCustomComponent(const std::string& name)
1071 {
1072 Base::deleteElemCustomComponent(name);
1073 }
1074
1116 template<typename K>
1118 const std::string& name) requires face::HasCustomComponents<T>
1119 {
1120 return Base::template customComponentVectorHandle<K>(name);
1121 }
1122
1164 template<typename K>
1166 const std::string& name) const requires face::HasCustomComponents<T>
1167 {
1168 return Base::template customComponentVectorHandle<K>(name);
1169 }
1170
1181 template<typename K>
1184 {
1186 }
1187
1198 template<typename K>
1201 {
1203 }
1204
1205protected:
1212 template<typename OthMesh>
1214 {
1215 using ParentMesh = Base::ParentMeshType;
1216 using VertexType = ParentMesh::VertexType;
1217 using MVertexType = OthMesh::VertexType;
1218 using MFaceType = OthMesh::FaceType;
1219
1220 using VertexContainer = ParentMesh::VertexContainer;
1221
1222 // if this is not a triangle mesh nor a polygon mesh (meaning that we
1223 // can't control the number of vertex pointers in this mesh), and this
1224 // mesh does not have the same number of vertex pointers of the other,
1225 // it means that we don't know how to convert these type of meshes (e.g.
1226 // we don't know how to convert a polygon mesh into a quad mesh, or
1227 // convert a quad mesh into a pentagonal mesh...)
1228 static_assert(
1229 !(FaceType::VERTEX_NUMBER != 3 && FaceType::VERTEX_NUMBER > 0 &&
1230 FaceType::VERTEX_NUMBER != MFaceType::VERTEX_NUMBER),
1231 "Cannot import from that type of Mesh. Don't know how to "
1232 "convert faces.");
1233
1234 // we need to manage conversion from poly or faces with cardinality > 3
1235 // (e.g. quads) to triangle meshes. In this case, we triangulate the
1236 // polygon using the earcut algorithm.
1237 if constexpr (
1238 FaceType::VERTEX_NUMBER == 3 &&
1239 (MFaceType::VERTEX_NUMBER > 3 || MFaceType::VERTEX_NUMBER < 0)) {
1240 VertexType* base = &Base::mParentMesh->vertex(0);
1241 const MVertexType* mvbase = &m.vertex(0);
1242
1243 for (const MFaceType& mf : m.faces()) {
1244 // if the current face has the same number of vertices of this
1245 // faces (3), then the vertex pointers have been correctly
1246 // imported from the import pointers function. The import
1247 // pointers function does nothing when importing from a face
1248 // with at least 4 vertices
1249 if (mf.vertexNumber() != FaceType::VERTEX_NUMBER) {
1250 // triangulate mf; the first triangle of the triangulation
1251 // will be this->face(m.index(mf)); the other triangles will
1252 // be added at the end of the container
1253 std::vector<uint> tris =
1254 earCut(mf.vertices() | views::positions);
1255 FaceType& f = face(m.index(mf));
1256 importTriPointersHelper(f, mf, base, mvbase, tris, 0);
1257
1258 // number of other faces to add
1259 uint nf = tris.size() / 3 - 1;
1260 uint fid = addFaces(nf);
1261
1262 uint i = 3; // index that cycles into tris
1263 for (; fid < faceContainerSize(); ++fid) {
1264 FaceType& f = face(fid);
1265 importTriPointersHelper(f, mf, base, mvbase, tris, i);
1266 i += 3;
1267 }
1268 }
1269 }
1270 }
1271 }
1272
1273private:
1274 void addFaceHelper(T& f) { /* base case: no need to add vertices */ }
1275
1276 template<typename... V>
1277 void addFaceHelper(T& f, typename T::VertexType* v, V... args)
1278 {
1279 // position on which add the vertex
1280 const std::size_t n = f.vertexNumber() - sizeof...(args) - 1;
1281 f.setVertex(n, v); // set the vertex
1282 // set the remanining vertices, recursive variadics
1283 addFaceHelper(f, args...);
1284 }
1285
1286 template<typename... V>
1287 void addFaceHelper(T& f, uint vid, V... args)
1288 {
1289 // position on which add the vertex
1290 const std::size_t n = f.vertexNumber() - sizeof...(args) - 1;
1291 f.setVertex(n, vid); // set the vertex
1292 // set the remanining vertices, recursive variadics
1293 addFaceHelper(f, args...);
1294 }
1295
1296 template<typename MFaceType, typename VertexType, typename MVertexType>
1297 static void importTriPointersHelper(
1298 FaceType& f,
1299 const MFaceType& mf,
1300 VertexType* base,
1301 const MVertexType* mvbase,
1302 const std::vector<uint>& tris,
1303 uint basetri)
1304 {
1305 f.importFrom(mf); // import all the components from mf
1306 for (uint i = basetri, j = 0; i < basetri + 3; i++, j++) {
1307 f.setVertex(j, base + (mf.vertex(tris[i]) - mvbase));
1308
1309 // wedge colors
1310 if constexpr (
1311 face::HasWedgeColors<FaceType> &&
1312 face::HasWedgeColors<MFaceType>) {
1313 if (comp::isWedgeColorsAvailableOn(f) &&
1314 comp::isWedgeColorsAvailableOn(mf)) {
1315 f.wedgeColor(j) = mf.wedgeColor(tris[i]);
1316 }
1317 }
1318
1319 // wedge texcoords
1320 if constexpr (
1321 face::HasWedgeTexCoords<FaceType> &&
1322 face::HasWedgeTexCoords<MFaceType>) {
1323 if (comp::isWedgeTexCoordsAvailableOn(f) &&
1324 comp::isWedgeTexCoordsAvailableOn(mf)) {
1325 using ST = typename FaceType::WedgeTexCoordType::ScalarType;
1326 f.wedgeTexCoord(j) =
1327 mf.wedgeTexCoord(tris[i]).template cast<ST>();
1328 }
1329 }
1330 }
1331 }
1332};
1333
1334/* Concepts */
1335
1348template<typename T>
1349concept HasFaceContainer = std::derived_from< // same type or derived type
1350 std::remove_cvref_t<T>,
1351 FaceContainer<typename RemoveRef<T>::FaceType>>;
1352
1353} // namespace mesh
1354
1388template<typename... Args>
1390
1391} // namespace vcl
1392
1393#endif // VCL_MESH_CONTAINERS_FACE_CONTAINER_H
A class representing a box in N-dimensional space.
Definition box.h:46
PointT size() const
Computes the size of the box.
Definition box.h:267
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:132
Definition element.h:64
The FaceContainer class represents a container of Face elements that can be used in a Mesh class.
Definition face_container.h:55
FaceType & face(uint i)
Returns a reference of the Face at the i-th position in the Face Container of the Mesh,...
Definition face_container.h:95
void disablePerFacePrincipalCurvature()
Disables the Optional PrincipalCurvature of the Face.
Definition face_container.h:791
ConstFaceIterator faceEnd() const
Returns a const iterator to the end of the container.
Definition face_container.h:424
void enablePerFaceQuality()
Enable the Optional Quality of the Face.
Definition face_container.h:819
FaceIterator faceBegin(bool jumpDeleted=true)
Returns an iterator to the beginning of the container.
Definition face_container.h:393
void disablePerFaceAdjacentEdges()
Disables the Optional AdjacentEdges of the Face.
Definition face_container.h:592
std::vector< std::string > perFaceCustomComponentNames() const
Returns a vector containing all the names of the custom components of any type associated to the Face...
Definition face_container.h:955
bool isPerFaceMarkEnabled() const
Checks if the Face Optional Mark is enabled.
Definition face_container.h:690
bool isPerFaceAdjacentFacesEnabled() const
Checks if the Face Optional AdjacentFaces is enabled.
Definition face_container.h:608
void disablePerFaceAdjacentFaces()
Disables the Optional AdjacentFaces of the Face.
Definition face_container.h:637
FaceIterator faceEnd()
Returns an iterator to the end of the container.
Definition face_container.h:402
bool isPerFaceWedgeColorsEnabled() const
Checks if the Face Optional WedgeColors is enabled.
Definition face_container.h:845
void disablePerFaceQuality()
Disables the Optional Quality of the Face.
Definition face_container.h:830
CustomComponentVectorHandle< K > perFaceCustomComponentVectorHandle(const std::string &name)
Returns a vector handle to the custom component having the type K and the given name.
Definition face_container.h:1117
void enablePerFacePrincipalCurvature()
Enable the Optional PrincipalCurvature of the Face.
Definition face_container.h:778
bool isPerFacePrincipalCurvatureEnabled() const
Checks if the Face Optional PrincipalCurvature is enabled.
Definition face_container.h:765
uint faceContainerSize() const
Returns the number of Faces (also deleted) contained in the Face container of the Mesh.
Definition face_container.h:117
std::vector< uint > faceCompactIndices() const
Returns a vector that tells, for each actual Face index, the new index that the Face would have in a ...
Definition face_container.h:348
auto faces(bool jumpDeleted=true) const
Returns a small view object that allows to iterate over the Faces of the containers,...
Definition face_container.h:501
bool hasPerFaceCustomComponent(const std::string &name) const
Checks if Faces have a custom component with the given name.
Definition face_container.h:939
void disablePerFaceWedgeTexCoords()
Disables the Optional WedgeTexCoords of the Face.
Definition face_container.h:919
void enablePerFaceColor()
Enable the Optional Color of the Face.
Definition face_container.h:664
void addPerFaceCustomComponent(const std::string &name)
Adds a custom component of type K to the Face, having the given name.
Definition face_container.h:1051
auto faces(bool jumpDeleted=true)
Returns a small view object that allows to iterate over the Faces of the containers,...
Definition face_container.h:448
FaceContainer()=default
Empty constructor that creates an empty container of Faces.
void clearFaces()
Clears the Face container of the Mesh, deleting all the Faces.
Definition face_container.h:230
void disableAllPerFaceOptionalComponents()
Disables all the optional components associated to the Face type contained in the FaceContainer.
Definition face_container.h:548
bool isPerFaceQualityEnabled() const
Checks if the Face Optional Quality is enabled.
Definition face_container.h:808
void disablePerFaceMark()
Disables the Optional Mark of the Face.
Definition face_container.h:712
bool isPerFaceNormalEnabled() const
Checks if the Face Optional Normal is enabled.
Definition face_container.h:727
void deserializePerFaceCustomComponentsOfType(std::istream &is)
Deserializes in the given input stream all the custom components of the Face Element of type K.
Definition face_container.h:1199
auto faces(uint begin, uint end=UINT_NULL) const
Returns a view object that allows to iterate over the Faces of the container in the given range:
Definition face_container.h:530
void reserveFaces(uint n)
Reserve a number of Faces in the container of Faces. This is useful when you know (or you have an ide...
Definition face_container.h:280
uint deletedFaceNumber() const
Returns the number of deleted Faces in the Face container, that is faceContainerSize() - faceNumber()...
Definition face_container.h:125
void deleteFace(const FaceType *f)
Marks as deleted the given Face, before asserting that the Face belongs to this container.
Definition face_container.h:317
std::vector< std::string > perFaceCustomComponentNamesOfType() const
Returns a vector containing all the names of the custom components associated to the Edge Element hav...
Definition face_container.h:1034
void deleteFace(uint i)
Marks as deleted the Face with the given id.
Definition face_container.h:302
void disablePerFaceColor()
Disables the Optional Color of the Face.
Definition face_container.h:675
auto faces(uint begin, uint end=UINT_NULL)
Returns a view object that allows to iterate over the Faces of the container in the given range:
Definition face_container.h:474
bool isPerFaceCustomComponentOfType(const std::string &name) const
Checks if the custom component of the Face Element having the given name has the same type of the giv...
Definition face_container.h:987
void enablePerFaceNormal()
Enable the Optional Normal of the Face.
Definition face_container.h:738
void disablePerFaceWedgeColors()
Disables the Optional WedgeColors of the Face.
Definition face_container.h:874
bool isPerFaceWedgeTexCoordsEnabled() const
Checks if the Face Optional WedgeTexCoords is enabled.
Definition face_container.h:889
void deletePerFaceCustomComponent(const std::string &name)
Deletes the custom component of the given name from the Face Element.
Definition face_container.h:1069
void disablePerFaceNormal()
Disables the Optional Normal of the Face.
Definition face_container.h:749
ConstCustomComponentVectorHandle< K > perFaceCustomComponentVectorHandle(const std::string &name) const
Returns a const vector handle to the custom component having type K and the given name.
Definition face_container.h:1165
void compactFaces()
Compacts the FaceContainer, removing all the Faces marked as deleted. Faces indices will change accor...
Definition face_container.h:288
std::type_index perFaceCustomComponentType(const std::string &name) const
Returns the std::type_index of the custom component of the Face Element having the given input name.
Definition face_container.h:1008
ConstFaceIterator faceBegin(bool jumpDeleted=true) const
Returns a const iterator to the beginning of the container.
Definition face_container.h:415
void enablePerFaceWedgeTexCoords()
Enable the Optional WedgeTexCoords of the Face.
Definition face_container.h:907
void enablePerFaceAdjacentFaces()
Enable the Optional AdjacentFaces of the Face.
Definition face_container.h:626
uint faceNumber() const
Returns the number of non-deleted Faces contained in the Face container of the Mesh.
Definition face_container.h:106
void manageImportTriFromPoly(const OthMesh &m)
This function manages the case where we try to import into a TriMesh a PolyMesh Faces have been alrea...
Definition face_container.h:1213
void enablePerFaceWedgeColors()
Enable the Optional WedgeColors of the Face.
Definition face_container.h:863
uint addFaces(uint n)
Add an arbitrary number of n Faces, returning the id of the first added Face.
Definition face_container.h:212
uint faceIndexIfCompact(uint i) const
This is an utility member function that returns the index of an element if the container would be com...
Definition face_container.h:332
void enablePerFaceMark()
Enable the Optional Mark of the Face.
Definition face_container.h:701
uint addFace()
Add a Face to the container, returning its index.
Definition face_container.h:136
void updateFaceIndices(const std::vector< uint > &newIndices)
Updates all the indices and pointers of the Faces of this container that are stored in any container ...
Definition face_container.h:377
bool isPerFaceAdjacentEdgesEnabled() const
Checks if the Face Optional AdjacentEdges is enabled.
Definition face_container.h:563
void enablePerFaceAdjacentEdges()
Enable the Optional AdjacentEdges of the Face.
Definition face_container.h:581
void enableAllPerFaceOptionalComponents()
Enables all the optional components associated to the Face type contained in the FaceContainer.
Definition face_container.h:539
bool isPerFaceColorEnabled() const
Checks if the Face Optional Color is enabled.
Definition face_container.h:653
const FaceType & face(uint i) const
Returns a const reference of the Face at the i-th position in the Face Container of the Mesh,...
Definition face_container.h:83
void serializePerFaceCustomComponentsOfType(std::ostream &os) const
Serializes in the given output stream all the custom components of the Face Element of type K.
Definition face_container.h:1182
void resizeFaces(uint n)
Resizes the Face container to contain n Faces.
Definition face_container.h:260
The Vertex Container class, will be used when the template argument given to the Mesh is a Vertex.
Definition vertex_container.h:52
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:81
HasFaces concepts is satisfied when at least one of its template types is (or inherits from) a vcl::m...
Definition face_container.h:1389
Definition face_components.h:82
Definition mesh_components.h:52
A concept that checks whether a class has (inherits from) an FaceContainer class.
Definition face_container.h:1349
constexpr uint UINT_NULL
The UINT_NULL value represent a null value of uint that is the maximum value that can be represented ...
Definition base.h:48
std::vector< uint > earCut(Iterator begin, Iterator end)
Triangulates a simple polygon with no holes using the ear-cutting algorithm.
Definition ear_cut.h:90