Visual Computing Library
Loading...
Searching...
No Matches
face_components.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_ELEMENTS_FACE_COMPONENTS_H
24#define VCL_MESH_ELEMENTS_FACE_COMPONENTS_H
25
26#include "../components/adjacent_edges.h"
27#include "../components/adjacent_faces.h"
28#include "../components/bit_flags.h"
29#include "../components/color.h"
30#include "../components/custom_components.h"
31#include "../components/mark.h"
32#include "../components/normal.h"
33#include "../components/parent_mesh_pointer.h"
34#include "../components/polygon_bit_flags.h"
35#include "../components/principal_curvature.h"
36#include "../components/quality.h"
37#include "../components/triangle_bit_flags.h"
38#include "../components/vertex_references.h"
39#include "../components/wedge_colors.h"
40#include "../components/wedge_tex_coords.h"
41
52namespace vcl::face {
53
59/* Port AdjacentEdges class into face namespace */
60template<bool INDEXED, typename EdgeType>
61using AdjacentEdges = comp::AdjacentEdges<INDEXED, EdgeType, -1, false>;
62
63template<bool INDEXED, typename EdgeType, typename ParentFaceType>
64using AdjacentPolygonEdges =
65 comp::AdjacentEdges<INDEXED, EdgeType, -1, true, ParentFaceType>;
66
67template<bool INDEXED, typename EdgeType, typename ParentFaceType>
68using AdjacentTriangleEdges =
69 comp::AdjacentEdges<INDEXED, EdgeType, 3, true, ParentFaceType>;
70
71template<bool INDEXED, typename EdgeType, typename ParentFaceType>
72using VerticalAdjacentEdges =
73 comp::AdjacentEdges<INDEXED, EdgeType, -1, false, ParentFaceType, true>;
74
75template<bool INDEXED, typename EdgeType, typename ParentFaceType>
76using VerticalAdjacentPolygonEdges =
77 comp::AdjacentEdges<INDEXED, EdgeType, -1, true, ParentFaceType, true>;
78
79template<bool INDEXED, typename EdgeType, typename ParentFaceType>
80using VerticalAdjacentTriangleEdges =
81 comp::AdjacentEdges<INDEXED, EdgeType, 3, true, ParentFaceType, true>;
82
83template<bool INDEXED, typename EdgeType, typename ParentFaceType>
84using OptionalAdjacentEdges = comp::
85 AdjacentEdges<INDEXED, EdgeType, -1, false, ParentFaceType, true, true>;
86
87template<bool INDEXED, typename EdgeType, typename ParentFaceType>
88using OptionalAdjacentPolygonEdges = comp::
89 AdjacentEdges<INDEXED, EdgeType, -1, true, ParentFaceType, true, true>;
90
91template<bool INDEXED, typename EdgeType, typename ParentFaceType>
92using OptionalAdjacentTriangleEdges =
93 comp::AdjacentEdges<INDEXED, EdgeType, 3, true, ParentFaceType, true, true>;
94
95template<typename EdgeType>
96using AdjacentEdgeIndices = comp::AdjacentEdges<true, EdgeType, -1, false>;
97
98template<typename EdgeType, typename ParentFaceType>
99using AdjacentPolygonEdgeIndices =
100 comp::AdjacentEdges<true, EdgeType, -1, true, ParentFaceType>;
101
102template<typename EdgeType, typename ParentFaceType>
103using AdjacentTriangleEdgeIndices =
104 comp::AdjacentEdges<true, EdgeType, 3, true, ParentFaceType>;
105
106template<typename EdgeType, typename ParentFaceType>
107using VerticalAdjacentEdgeIndices =
108 comp::AdjacentEdges<true, EdgeType, -1, false, ParentFaceType, true>;
109
110template<typename EdgeType, typename ParentFaceType>
111using VerticalAdjacentPolygonEdgeIndices =
112 comp::AdjacentEdges<true, EdgeType, -1, true, ParentFaceType, true>;
113
114template<typename EdgeType, typename ParentFaceType>
115using VerticalAdjacentTriangleEdgeIndices =
116 comp::AdjacentEdges<true, EdgeType, 3, true, ParentFaceType, true>;
117
118template<typename EdgeType, typename ParentFaceType>
119using OptionalAdjacentEdgeIndices =
120 comp::AdjacentEdges<true, EdgeType, -1, false, ParentFaceType, true, true>;
121
122template<typename EdgeType, typename ParentFaceType>
123using OptionalAdjacentPolygonEdgeIndices =
124 comp::AdjacentEdges<true, EdgeType, -1, true, ParentFaceType, true, true>;
125
126template<typename EdgeType, typename ParentFaceType>
127using OptionalAdjacentTriangleEdgeIndices =
128 comp::AdjacentEdges<true, EdgeType, 3, true, ParentFaceType, true, true>;
129
130template<typename EdgeType>
131using AdjacentEdgePointers = comp::AdjacentEdges<false, EdgeType, -1, false>;
132
133template<typename EdgeType, typename ParentFaceType>
134using AdjacentPolygonEdgePointers =
135 comp::AdjacentEdges<false, EdgeType, -1, true, ParentFaceType>;
136
137template<typename EdgeType, typename ParentFaceType>
138using AdjacentTriangleEdgePointers =
139 comp::AdjacentEdges<false, EdgeType, 3, true, ParentFaceType>;
140
141template<typename EdgeType, typename ParentFaceType>
142using VerticalAdjacentEdgePointers =
143 comp::AdjacentEdges<false, EdgeType, -1, false, ParentFaceType, true>;
144
145template<typename EdgeType, typename ParentFaceType>
146using VerticalAdjacentPolygonEdgePointers =
147 comp::AdjacentEdges<false, EdgeType, -1, true, ParentFaceType, true>;
148
149template<typename EdgeType, typename ParentFaceType>
150using VerticalAdjacentTriangleEdgePointers =
151 comp::AdjacentEdges<false, EdgeType, 3, true, ParentFaceType, true>;
152
153template<typename EdgeType, typename ParentFaceType>
154using OptionalAdjacentEdgePointers =
155 comp::AdjacentEdges<false, EdgeType, -1, false, ParentFaceType, true, true>;
156
157template<typename EdgeType, typename ParentFaceType>
158using OptionalAdjacentPolygonEdgePointers =
159 comp::AdjacentEdges<false, EdgeType, -1, true, ParentFaceType, true, true>;
160
161template<typename EdgeType, typename ParentFaceType>
162using OptionalAdjacentTriangleEdgePointers =
163 comp::AdjacentEdges<false, EdgeType, 3, true, ParentFaceType, true, true>;
164
165/* Port AdjacentFaces class into face namespace */
166template<bool INDEXED, typename ParentFaceType>
167using AdjacentPolygons =
168 comp::AdjacentFaces<INDEXED, ParentFaceType, -1, true, ParentFaceType>;
169
170template<bool INDEXED, typename ParentFaceType>
171using AdjacentTriangles =
172 comp::AdjacentFaces<INDEXED, ParentFaceType, 3, true, ParentFaceType>;
173
174template<bool INDEXED, typename ParentFaceType>
175using VerticalAdjacentPolygons = comp::
176 AdjacentFaces<INDEXED, ParentFaceType, -1, true, ParentFaceType, true>;
177
178template<bool INDEXED, typename ParentFaceType>
179using VerticalAdjacentTriangles =
180 comp::AdjacentFaces<INDEXED, ParentFaceType, 3, true, ParentFaceType, true>;
181
182template<bool INDEXED, typename ParentFaceType>
183using OptionalAdjacentPolygons = comp::AdjacentFaces<
184 INDEXED,
185 ParentFaceType,
186 -1,
187 true,
188 ParentFaceType,
189 true,
190 true>;
191
192template<bool INDEXED, typename ParentFaceType>
193using OptionalAdjacentTriangles = comp::
194 AdjacentFaces<INDEXED, ParentFaceType, 3, true, ParentFaceType, true, true>;
195
196template<typename ParentFaceType>
197using AdjacentPolygonIndices =
198 comp::AdjacentFaces<true, ParentFaceType, -1, true, ParentFaceType>;
199
200template<typename ParentFaceType>
201using AdjacentTriangleIndices =
202 comp::AdjacentFaces<true, ParentFaceType, 3, true, ParentFaceType>;
203
204template<typename ParentFaceType>
205using VerticalAdjacentPolygonIndices =
206 comp::AdjacentFaces<true, ParentFaceType, -1, true, ParentFaceType, true>;
207
208template<typename ParentFaceType>
209using VerticalAdjacentTriangleIndices =
210 comp::AdjacentFaces<true, ParentFaceType, 3, true, ParentFaceType, true>;
211
212template<typename ParentFaceType>
213using OptionalAdjacentPolygonIndices = comp::
214 AdjacentFaces<true, ParentFaceType, -1, true, ParentFaceType, true, true>;
215
216template<typename ParentFaceType>
217using OptionalAdjacentTriangleIndices = comp::
218 AdjacentFaces<true, ParentFaceType, 3, true, ParentFaceType, true, true>;
219
220template<typename ParentFaceType>
221using AdjacentPolygonPointers =
222 comp::AdjacentFaces<false, ParentFaceType, -1, true, ParentFaceType>;
223
224template<typename ParentFaceType>
225using AdjacentTrianglePointers =
226 comp::AdjacentFaces<false, ParentFaceType, 3, true, ParentFaceType>;
227
228template<typename ParentFaceType>
229using VerticalAdjacentPolygonPointers =
230 comp::AdjacentFaces<false, ParentFaceType, -1, true, ParentFaceType, true>;
231
232template<typename ParentFaceType>
233using VerticalAdjacentTrianglePointers =
234 comp::AdjacentFaces<false, ParentFaceType, 3, true, ParentFaceType, true>;
235
236template<typename ParentFaceType>
237using OptionalAdjacentPolygonPointers = comp::
238 AdjacentFaces<false, ParentFaceType, -1, true, ParentFaceType, true, true>;
239
240template<typename ParentFaceType>
241using OptionalAdjacentTrianglePointers = comp::
242 AdjacentFaces<false, ParentFaceType, 3, true, ParentFaceType, true, true>;
243
244/* Port BitFlags class into face namespace */
245using BitFlags = comp::BitFlags<>;
246
247template<typename ParentFaceType>
248using VerticalBitFlags = comp::BitFlags<ParentFaceType>;
249
250/* Port Color class into face namespace */
251using Color = comp::Color<>;
252
253template<typename VertexType>
254using VerticalColor = comp::Color<VertexType>;
255
256template<typename ParentFaceType>
257using OptionalColor = comp::Color<ParentFaceType, true>;
258
259/* Port CustomComponents class into face namespace */
260template<typename ParentFaceType>
261using CustomComponents = comp::CustomComponents<ParentFaceType>;
262
263/* Port Mark class into face namespace */
264using Mark = comp::Mark<>;
265
266template<typename ParentFaceType>
267using VerticalMark = comp::Mark<ParentFaceType>;
268
269template<typename ParentFaceType>
270using OptionalMark = comp::Mark<ParentFaceType, true>;
271
272/* Port Normal classes into face namespace */
273template<typename ScalarType, int N>
274using Normal = comp::Normal<Point<ScalarType, N>>;
275
276template<typename ScalarType>
277using Normal3 = comp::Normal3<ScalarType>;
278
279using Normal3f = comp::Normal3f<>;
280using Normal3d = comp::Normal3d<>;
281
282template<typename ScalarType, int N, typename VertexType>
283using VerticalNormal = comp::Normal<Point<ScalarType, N>, VertexType>;
284
285template<typename ScalarType, typename VertexType>
286using VerticalNormal3 = comp::Normal3<ScalarType, VertexType>;
287
288template<typename VertexType>
289using VerticalNormal3f = comp::Normal3f<VertexType>;
290
291template<typename VertexType>
292using VerticalNormal3d = comp::Normal3d<VertexType>;
293
294template<typename ScalarType, int N, typename ParentFaceType>
295using OptionalNormal = comp::Normal<Point<ScalarType, N>, ParentFaceType, true>;
296
297template<typename ScalarType, typename ParentFaceType>
298using OptionalNormal3 = comp::Normal3<ScalarType, ParentFaceType, true>;
299
300template<typename ParentFaceType>
301using OptionalNormal3f = comp::Normal3f<ParentFaceType, true>;
302
303template<typename ParentFaceType>
304using OptionalNormal3d = comp::Normal3d<ParentFaceType, true>;
305
306/* Port ParentMeshPointer class into vert namespace */
307template<typename MeshType>
308using ParentMeshPointer = comp::ParentMeshPointer<MeshType>;
309
310/* Port PolygonBitFlags class into face namespace */
311using PolygonBitFlags = comp::PolygonBitFlags<-1>;
312
313template<typename ParentFaceType>
314using VerticalPolygonBitFlags = comp::PolygonBitFlags<-1, ParentFaceType>;
315
316/* Port PrincipalCurvature class into face namespace */
317template<typename ParentFaceType>
318using PrincipalCurvature = comp::PrincipalCurvature<ParentFaceType>;
319
320using PrincipalCurvaturef = comp::PrincipalCurvaturef<>;
321using PrincipalCurvatured = comp::PrincipalCurvatured<>;
322
323template<typename ScalarType, typename ParentFaceType>
324using VerticalPrincipalCurvature =
325 comp::PrincipalCurvature<ScalarType, ParentFaceType>;
326
327template<typename ParentFaceType>
328using VerticalPrincipalCurvaturef = comp::PrincipalCurvaturef<ParentFaceType>;
329template<typename ParentFaceType>
330using VerticalPrincipalCurvatured = comp::PrincipalCurvatured<ParentFaceType>;
331
332template<typename ScalarType, typename ParentFaceType>
333using OptionalPrincipalCurvature =
334 comp::PrincipalCurvature<ScalarType, ParentFaceType, true>;
335
336template<typename ParentFaceType>
337using OptionalPrincipalCurvaturef =
338 comp::PrincipalCurvaturef<ParentFaceType, true>;
339template<typename ParentFaceType>
340using OptionalPrincipalCurvatured =
341 comp::PrincipalCurvatured<ParentFaceType, true>;
342
343/* Port Quality class into face namespace */
344template<typename QualityType>
345using Quality = comp::Quality<QualityType>;
346
347using Qualityf = comp::Qualityf<>;
348using Qualityd = comp::Qualityd<>;
349
350template<typename QualityType, typename ParentFaceType>
351using VerticalQuality = comp::Quality<QualityType, ParentFaceType>;
352
353template<typename ParentFaceType>
354using VerticalQualityf = comp::Quality<float, ParentFaceType>;
355
356template<typename ParentFaceType>
357using VerticalQualityd = comp::Quality<double, ParentFaceType>;
358
359template<typename QualityType, typename ParentFaceType>
360using OptionalQuality = comp::Quality<QualityType, ParentFaceType, true>;
361
362template<typename ParentFaceType>
363using OptionalQualityf = comp::Quality<float, ParentFaceType, true>;
364
365template<typename ParentFaceType>
366using OptionalQualityd = comp::Quality<double, ParentFaceType, true>;
367
368/* Port TriangleBitFlags class into face namespace */
369using TriangleBitFlags = comp::TriangleBitFlags<>;
370
371template<typename ParentFaceType>
372using VerticalTriangleBitFlags = comp::TriangleBitFlags<ParentFaceType>;
373
374/* Port VertexReferences alias into face namespace */
375template<bool INDEXED, typename Vertex, int N, typename FaceType>
376using VertexReferences = comp::VertexReferences<INDEXED, Vertex, N, FaceType>;
377
378template<bool INDEXED, typename Vertex, typename FaceType>
379using TriangleVertexRefs = comp::VertexReferences<INDEXED, Vertex, 3, FaceType>;
380
381template<bool INDEXED, typename Vertex, typename FaceType>
382using PolygonVertexRefs = comp::VertexReferences<INDEXED, Vertex, -1, FaceType>;
383
384template<typename Vertex, int N, typename FaceType>
385using VertexIndices = comp::VertexReferences<true, Vertex, N, FaceType>;
386
387template<typename Vertex, typename FaceType>
388using TriangleVertexInds = comp::VertexReferences<true, Vertex, 3, FaceType>;
389
390template<typename Vertex, typename FaceType>
391using PolygonVertexInds = comp::VertexReferences<true, Vertex, -1, FaceType>;
392
393template<typename Vertex, int N, typename FaceType>
394using VertexPointers = comp::VertexReferences<false, Vertex, N, FaceType>;
395
396template<typename Vertex, typename FaceType>
397using TriangleVertexPtrs = comp::VertexReferences<false, Vertex, 3, FaceType>;
398
399template<typename Vertex, typename FaceType>
400using PolygonVertexPtrs = comp::VertexReferences<false, Vertex, -1, FaceType>;
401
402/* Port WedgeColors class into face namespace */
403using PolygonWedgeColors = comp::WedgeColors<-1>;
404
405using TriangleWedgeColors = comp::WedgeColors<3>;
406
407template<typename ParentFaceType>
408using VerticalPolygonWedgeColors = comp::WedgeColors<-1, ParentFaceType>;
409
410template<typename ParentFaceType>
411using VerticalTriangleWedgeColors = comp::WedgeColors<3, ParentFaceType>;
412
413template<typename ParentFaceType>
414using OptionalPolygonWedgeColors = comp::WedgeColors<-1, ParentFaceType, true>;
415
416template<typename ParentFaceType>
417using OptionalTriangleWedgeColors = comp::WedgeColors<3, ParentFaceType, true>;
418
419/* Port WedgeTexCoords class into face namespace */
420template<typename ScalarType>
421using PolygonWedgeTexCoords = comp::WedgeTexCoords<ScalarType, -1>;
422
423template<typename ScalarType>
424using TriangleWedgeTexCoords = comp::WedgeTexCoords<ScalarType, 3>;
425
426using PolygonWedgeTexCoordsf = PolygonWedgeTexCoords<float>;
427using PolygonWedgeTexCoordsd = PolygonWedgeTexCoords<double>;
428using TriangleWedgeTexCoordsf = TriangleWedgeTexCoords<float>;
429using TriangleWedgeTexCoordsd = TriangleWedgeTexCoords<double>;
430
431template<typename ScalarType, typename ParentFaceType>
432using VerticalPolygonWedgeTexCoords =
433 comp::WedgeTexCoords<ScalarType, -1, ParentFaceType, true>;
434
435template<typename ScalarType, typename ParentFaceType>
436using VerticalTriangleWedgeTexCoords =
437 comp::WedgeTexCoords<ScalarType, 3, ParentFaceType, true>;
438
439template<typename ParentFaceType>
440using VerticalPolygonWedgeTexCoordsf =
441 comp::WedgeTexCoords<float, -1, ParentFaceType>;
442template<typename ParentFaceType>
443using VerticalPolygonWedgeTexCoordsd =
444 comp::WedgeTexCoords<double, -1, ParentFaceType>;
445template<typename ParentFaceType>
446using VerticalTriangleWedgeTexCoordsf =
447 comp::WedgeTexCoords<float, 3, ParentFaceType>;
448template<typename ParentFaceType>
449using VerticalTriangleWedgeTexCoordsd =
450 comp::WedgeTexCoords<double, 3, ParentFaceType>;
451
452template<typename ScalarType, typename ParentFaceType>
453using OptionalPolygonWedgeTexCoords =
454 comp::WedgeTexCoords<ScalarType, -1, ParentFaceType, true>;
455
456template<typename ScalarType, typename ParentFaceType>
457using OptionalTriangleWedgeTexCoords =
458 comp::WedgeTexCoords<ScalarType, 3, ParentFaceType, true>;
459
460template<typename ParentFaceType>
461using OptionalPolygonWedgeTexCoordsf =
462 comp::WedgeTexCoords<float, -1, ParentFaceType, true>;
463template<typename ParentFaceType>
464using OptionalPolygonWedgeTexCoordsd =
465 comp::WedgeTexCoords<double, -1, ParentFaceType, true>;
466template<typename ParentFaceType>
467using OptionalTriangleWedgeTexCoordsf =
468 comp::WedgeTexCoords<float, 3, ParentFaceType, true>;
469template<typename ParentFaceType>
470using OptionalTriangleWedgeTexCoordsd =
471 comp::WedgeTexCoords<double, 3, ParentFaceType, true>;
472
// end of edge_components group
474
475} // namespace vcl::face
476
477#endif // VCL_MESH_ELEMENTS_FACE_COMPONENTS_H
Normal< Point3< Scalar >, ElementType, OPT > Normal3
The Normal3 class is an alias of the Normal component that uses 3 dimensional Points.
Definition normal.h:156
PrincipalCurvature< float, ElementType, OPT > PrincipalCurvaturef
Definition principal_curvature.h:167
Normal3< double, ElementType, OPT > Normal3d
The Normal3d class is an alias of the Normal component that uses 3 dimensional Points with double pre...
Definition normal.h:186
Quality< float, ElementType, OPT > Qualityf
Definition quality.h:153
PrincipalCurvature< double, ElementType, OPT > PrincipalCurvatured
Definition principal_curvature.h:182
Normal3< float, ElementType, OPT > Normal3f
The Normal3f class is an alias of the Normal component that uses 3 dimensional Points with float prec...
Definition normal.h:171
Quality< double, ElementType, OPT > Qualityd
Definition quality.h:168