Visual Computing Library  devel
Loading...
Searching...
No Matches
face_requirements.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_REQUIREMENTS_FACE_REQUIREMENTS_H
24#define VCL_MESH_REQUIREMENTS_FACE_REQUIREMENTS_H
25
26#include "../containers/face_container.h"
27#include "element_requirements.h"
28
45namespace vcl {
46
47/************
48 * concepts *
49 ************/
50
51template<typename MeshType>
52concept HasTriangles =
53 HasFaces<MeshType> && RemoveRef<MeshType>::FaceType::VERTEX_NUMBER == 3;
54
55template<typename MeshType>
56concept HasQuads =
57 HasFaces<MeshType> && RemoveRef<MeshType>::FaceType::VERTEX_NUMBER == 4;
58
59template<typename MeshType>
60concept HasPolygons =
61 HasFaces<MeshType> && RemoveRef<MeshType>::FaceType::VERTEX_NUMBER == -1;
62
69template<typename T>
71
72template<typename T>
74
75template<typename T>
77
78template<typename T>
80
92template<typename MeshType>
96
108template<typename MeshType>
112
124template<typename MeshType>
128
140template<typename MeshType>
144
156template<typename MeshType>
160
172template<typename MeshType>
175
187template<typename MeshType>
191
203template<typename MeshType>
207
219template<typename MeshType>
223
235template<typename MeshType>
239
251template<typename MeshType>
255
267template<typename MeshType>
271
283template<typename MeshType>
287
299template<typename MeshType>
303
315template<typename MeshType>
319
320/*************************
321 * is/enableIf functions *
322 *************************/
323
335template<FaceMeshConcept MeshType>
336bool isFaceContainerCompact(const MeshType& m)
337{
339}
340
341// Face AdjacentEdges
342
369template<FaceMeshConcept MeshType>
375
394template<FaceMeshConcept MeshType>
396{
398 ElemId::FACE,
399 CompId::ADJACENT_EDGES>(m);
400}
401
402// Face AdjacentFaces
403
430template<FaceMeshConcept MeshType>
436
455template<FaceMeshConcept MeshType>
457{
459 ElemId::FACE,
460 CompId::ADJACENT_FACES>(m);
461}
462
463// Face Color
464
491template<FaceMeshConcept MeshType>
496
515template<FaceMeshConcept MeshType>
520
521// Face Mark
522
549template<FaceMeshConcept MeshType>
554
573template<FaceMeshConcept MeshType>
578
579// Face MaterialIndex
580
607template<FaceMeshConcept MeshType>
613
632template<FaceMeshConcept MeshType>
634{
636 ElemId::FACE,
637 CompId::MATERIAL_INDEX>(m);
638}
639
640// Face Normal
641
668template<FaceMeshConcept MeshType>
673
692template<FaceMeshConcept MeshType>
697
698// Face PrincipalCurvature
699
727template<FaceMeshConcept MeshType>
729{
731 ElemId::FACE,
732 CompId::PRINCIPAL_CURVATURE>(m);
733}
734
753template<FaceMeshConcept MeshType>
755{
757 ElemId::FACE,
758 CompId::PRINCIPAL_CURVATURE>(m);
759}
760
761// Face Quality
762
789template<FaceMeshConcept MeshType>
794
813template<FaceMeshConcept MeshType>
819
820// Face WedgeColors
821
848template<FaceMeshConcept MeshType>
854
873template<FaceMeshConcept MeshType>
875{
877 ElemId::FACE,
878 CompId::WEDGE_COLORS>(m);
879}
880
881// Face WedgeTexCoords
882
909template<FaceMeshConcept MeshType>
911{
913 ElemId::FACE,
914 CompId::WEDGE_TEX_COORDS>(m);
915}
916
935template<FaceMeshConcept MeshType>
937{
939 ElemId::FACE,
940 CompId::WEDGE_TEX_COORDS>(m);
941}
942
943/*********************
944 * require functions *
945 *********************/
946
965template<FaceMeshConcept MeshType>
970
971// Face AdjacentEdges
972
1000template<FaceMeshConcept MeshType>
1006
1007// Face AdjacentFaces
1008
1036template<FaceMeshConcept MeshType>
1042
1043// Face Color
1044
1072template<FaceMeshConcept MeshType>
1077
1078// Face Mark
1079
1107template<FaceMeshConcept MeshType>
1112
1113// Face MaterialIndex
1114
1142template<FaceMeshConcept MeshType>
1148
1149// Face Normal
1150
1178template<FaceMeshConcept MeshType>
1183
1184// Face PrincipalCurvature
1185
1213template<FaceMeshConcept MeshType>
1219
1220// Face Quality
1221
1249template<FaceMeshConcept MeshType>
1255
1256// Face WedgeColors
1257
1285template<FaceMeshConcept MeshType>
1291
1292// Face WedgeTexCoords
1293
1321template<FaceMeshConcept MeshType>
1327
1328} // namespace vcl
1329
1330#endif // VCL_MESH_REQUIREMENTS_FACE_REQUIREMENTS_H
A class representing a box in N-dimensional space.
Definition box.h:46
The FaceMeshConcept is evaluated true if the type T is a Mesh (it satisfies the vcl::MeshConcept) and...
Definition face_requirements.h:70
HasFaces concepts is satisfied when at least one of its template types is (or inherits from) a vcl::m...
Definition face_container.h:1429
Concept that checks if a Mesh has the per Face AdjacentEdges component.
Definition face_requirements.h:93
Concept that checks if a Mesh has the per Face AdjacentFaces component.
Definition face_requirements.h:109
Concept that checks if a Mesh has the per Face BitFlags component.
Definition face_requirements.h:125
Concept that checks if a Mesh has the per Face Color component.
Definition face_requirements.h:141
Concept that checks if a Mesh has the per Face CustomComponents component.
Definition face_requirements.h:157
Concept that checks if a Mesh has the per Face Mark component.
Definition face_requirements.h:173
Concept that checks if a Mesh has the per Face MaterialIndex component.
Definition face_requirements.h:188
Concept that checks if a Mesh has the per Face Normal component.
Definition face_requirements.h:204
Concept that checks if a Mesh has the per Face PolygonBitFlags component.
Definition face_requirements.h:220
Concept that checks if a Mesh has the per Face PrincipalCurvature component.
Definition face_requirements.h:236
Concept that checks if a Mesh has the per Face Quality component.
Definition face_requirements.h:252
Concept that checks if a Mesh has the per Face TriangleBitFlags component.
Definition face_requirements.h:268
Concept that checks if a Mesh has the per Face VertexPointers component.
Definition face_requirements.h:284
Concept that checks if a Mesh has the per Face WedgeColors component.
Definition face_requirements.h:300
Concept that checks if a Mesh has the per Face WedgeTexCoords component.
Definition face_requirements.h:316
Definition face_requirements.h:60
Definition face_requirements.h:56
Definition face_requirements.h:52
A concept that checks whether a class is (inherits from) a Mesh class.
Definition mesh.h:2169
Definition face_requirements.h:79
Definition face_requirements.h:76
Definition face_requirements.h:73
Definition face_components.h:69
Definition face_components.h:73
Definition face_components.h:77
Definition face_components.h:79
Definition face_components.h:83
Definition face_components.h:87
Definition face_components.h:91
Definition face_components.h:95
Definition face_components.h:99
Definition face_components.h:101
Definition face_components.h:105
Definition face_components.h:109
Definition face_components.h:111
Definition face_components.h:113
Definition face_components.h:117
A concept that checks whether a class has (inherits from) an FaceContainer class.
Definition face_container.h:1389
bool enableIfPerFaceQualityOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a Quality Component,...
Definition face_requirements.h:814
bool enableIfPerFaceMarkOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a Mark Component, this function enabl...
Definition face_requirements.h:574
bool isPerFaceAdjacentEdgesAvailable(const MeshType &m)
Returns true if the AdjacentEdges component is available (enabled) in the Face element of the input m...
Definition face_requirements.h:370
bool isPerFaceAdjacentFacesAvailable(const MeshType &m)
Returns true if the AdjacentFaces component is available (enabled) in the Face element of the input m...
Definition face_requirements.h:431
bool enableIfPerFaceWedgeTexCoordsOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a WedgeTexCoords Component,...
Definition face_requirements.h:936
bool isPerFaceWedgeTexCoordsAvailable(const MeshType &m)
Returns true if the WedgeTexCoords component is available (enabled) in the Face element of the input ...
Definition face_requirements.h:910
bool isPerFaceNormalAvailable(const MeshType &m)
Returns true if the Normal component is available (enabled) in the Face element of the input mesh m.
Definition face_requirements.h:669
bool isPerFaceQualityAvailable(const MeshType &m)
Returns true if the Quality component is available (enabled) in the Face element of the input mesh m.
Definition face_requirements.h:790
void requirePerFaceQuality(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a Quality Component,...
Definition face_requirements.h:1250
bool enableIfPerFacePrincipalCurvatureOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a PrincipalCurvature Component,...
Definition face_requirements.h:754
void requirePerFaceWedgeTexCoords(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a WedgeTexCoords Component,...
Definition face_requirements.h:1322
void requirePerFaceAdjacentEdges(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a AdjacentEdges Component,...
Definition face_requirements.h:1001
bool isPerFaceWedgeColorsAvailable(const MeshType &m)
Returns true if the WedgeColors component is available (enabled) in the Face element of the input mes...
Definition face_requirements.h:849
void requirePerFacePrincipalCurvature(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a PrincipalCurvature Component,...
Definition face_requirements.h:1214
bool isPerFaceMarkAvailable(const MeshType &m)
Returns true if the Mark component is available (enabled) in the Face element of the input mesh m.
Definition face_requirements.h:550
bool isPerFaceMaterialIndexAvailable(const MeshType &m)
Returns true if the MaterialIndex component is available (enabled) in the Face element of the input m...
Definition face_requirements.h:608
void requirePerFaceMaterialIndex(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a MaterialIndex Component,...
Definition face_requirements.h:1143
void requireFaceContainerCompactness(const MeshType &m)
This function asserts that a Mesh has the FaceContainer compact (no elements flagged as deleted).
Definition face_requirements.h:966
bool enableIfPerFaceMaterialIndexOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a MaterialIndex Component,...
Definition face_requirements.h:633
bool enableIfPerFaceAdjacentEdgesOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a AdjacentEdges Component,...
Definition face_requirements.h:395
bool isPerFaceColorAvailable(const MeshType &m)
Returns true if the Color component is available (enabled) in the Face element of the input mesh m.
Definition face_requirements.h:492
void requirePerFaceNormal(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a Normal Component,...
Definition face_requirements.h:1179
void requirePerFaceMark(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a Mark Component,...
Definition face_requirements.h:1108
bool isFaceContainerCompact(const MeshType &m)
Returns true if the given mesh has its FaceContainer compact.
Definition face_requirements.h:336
bool enableIfPerFaceAdjacentFacesOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a AdjacentFaces Component,...
Definition face_requirements.h:456
void requirePerFaceColor(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a Color Component,...
Definition face_requirements.h:1073
void requirePerFaceWedgeColors(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a WedgeColors Component,...
Definition face_requirements.h:1286
bool enableIfPerFaceNormalOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a Normal Component,...
Definition face_requirements.h:693
bool enableIfPerFaceWedgeColorsOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a WedgeColors Component,...
Definition face_requirements.h:874
bool enableIfPerFaceColorOptional(MeshType &m)
If the input mesh has a FaceContainer, and the Face Element has a Color Component,...
Definition face_requirements.h:516
bool isPerFacePrincipalCurvatureAvailable(const MeshType &m)
Returns true if the PrincipalCurvature component is available (enabled) in the Face element of the in...
Definition face_requirements.h:728
void requirePerFaceAdjacentFaces(const MeshType &m)
This function asserts that a Mesh has a FaceContainer, the Face has a AdjacentFaces Component,...
Definition face_requirements.h:1037
bool isPerElementComponentAvailable(const MeshType &m)
Returns true if the given component is available in the given element of the input mesh m.
Definition element_requirements.h:82
bool enableIfPerElementComponentOptional(MeshType &m)
Makes available the given Component in the given Element of the input mesh m, and returns true if it ...
Definition element_requirements.h:120