Visual Computing Library  devel
Loading...
Searching...
No Matches
poly_edge_mesh.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_MESHES_POLY_EDGE_MESH_H
24#define VCL_MESHES_POLY_EDGE_MESH_H
25
26#include <vclib/mesh.h>
27
28namespace vcl {
29
30template<typename ScalarType, bool INDEXED>
31class PolyEdgeMeshT;
32
33} // namespace vcl
34
35namespace vcl::polyedgemesh {
36
37template<typename Scalar, bool INDEXED>
38class Vertex;
39
40template<typename Scalar, bool INDEXED>
41class Face;
42
43template<typename Scalar, bool INDEXED>
44class Edge;
45
70template<typename Scalar, bool I>
71class Vertex :
72 public vcl::Vertex<
73 PolyEdgeMeshT<Scalar, I>,
74 vert::BitFlags,
75 vert::Position3<Scalar>,
76 vert::Normal3<Scalar>,
77 vert::OptionalColor<Vertex<Scalar, I>>,
78 vert::OptionalQuality<Scalar, Vertex<Scalar, I>>,
79 vert::OptionalAdjacentEdges<I, Edge<Scalar, I>, Vertex<Scalar, I>>,
80 vert::OptionalAdjacentFaces<I, Face<Scalar, I>, Vertex<Scalar, I>>,
81 vert::OptionalAdjacentVertices<I, Vertex<Scalar, I>>,
82 vert::OptionalPrincipalCurvature<Scalar, Vertex<Scalar, I>>,
83 vert::OptionalTexCoord<Scalar, Vertex<Scalar, I>>,
84 vert::OptionalMaterialIndex<Vertex<Scalar, I>>,
85 vert::OptionalTangent3<Scalar, Vertex<Scalar, I>>,
86 vert::OptionalMark<Vertex<Scalar, I>>,
87 vert::CustomComponents<Vertex<Scalar, I>>>
88{
89public:
90 friend void swap(Vertex& a, Vertex& b) { a.swap(b); }
91};
92
114template<typename Scalar, bool I>
115class Face :
116 public vcl::Face<
117 PolyEdgeMeshT<Scalar, I>,
118 face::PolygonBitFlags,
119 face::PolygonVertexRefs<I, Vertex<Scalar, I>, Face<Scalar, I>>,
120 face::Normal3<Scalar>,
121 face::OptionalColor<Face<Scalar, I>>,
122 face::OptionalQuality<Scalar, Face<Scalar, I>>,
123 face::OptionalAdjacentPolygons<I, Face<Scalar, I>>,
124 face::OptionalAdjacentEdges<I, Edge<Scalar, I>, Face<Scalar, I>>,
125 face::OptionalPolygonWedgeTexCoords<Scalar, Face<Scalar, I>>,
126 face::OptionalMaterialIndex<Face<Scalar, I>>,
127 face::OptionalMark<Face<Scalar, I>>,
128 face::CustomComponents<Face<Scalar, I>>>
129{
130public:
131 friend void swap(Face& a, Face& b) { a.swap(b); }
132};
133
153template<typename Scalar, bool I>
154class Edge :
155 public vcl::Edge<
156 PolyEdgeMeshT<Scalar, I>,
157 edge::BitFlags,
158 edge::VertexReferences<I, Vertex<Scalar, I>, Edge<Scalar, I>>,
159 edge::OptionalNormal3<Scalar, Edge<Scalar, I>>,
160 edge::OptionalColor<Edge<Scalar, I>>,
161 edge::OptionalQuality<Scalar, Edge<Scalar, I>>,
162 edge::OptionalAdjacentEdges<I, Edge<Scalar, I>>,
163 edge::OptionalAdjacentFaces<I, Face<Scalar, I>, Edge<Scalar, I>>,
164 edge::OptionalMark<Edge<Scalar, I>>,
165 edge::CustomComponents<Edge<Scalar, I>>>
166{
167public:
168 friend void swap(Edge& a, Edge& b) { a.swap(b); }
169};
170
171} // namespace vcl::polyedgemesh
172
173namespace vcl {
174
200template<typename Scalar, bool INDEXED>
202 public Mesh<
203 mesh::VertexContainer<polyedgemesh::Vertex<Scalar, INDEXED>>,
204 mesh::FaceContainer<polyedgemesh::Face<Scalar, INDEXED>>,
205 mesh::EdgeContainer<polyedgemesh::Edge<Scalar, INDEXED>>,
206 mesh::BoundingBox3<Scalar>,
207 mesh::Color,
208 mesh::Mark,
209 mesh::Materials,
210 mesh::Name,
211 mesh::TransformMatrix<Scalar>,
212 mesh::CustomComponents>
213{
214public:
216 using ScalarType = Scalar;
217};
218
226
234
242
250
251} // namespace vcl
252
253#endif // VCL_MESHES_POLY_EDGE_MESH_H
A class representing a box in N-dimensional space.
Definition box.h:46
The Edge class represents an Edge element of the vcl::Mesh class.
Definition edge.h:47
The Face class represents an Face element of the vcl::Mesh class.
Definition face.h:48
The Mesh class represents a generic 3D mesh. A mesh is composed of a generic number of containers of ...
Definition mesh.h:68
The PolyEdgeMeshT class is a mesh class that represents a polygonal mesh with edges.
Definition poly_edge_mesh.h:213
Scalar ScalarType
The scalar used to store all the data of the Mesh.
Definition poly_edge_mesh.h:216
The Vertex class represents an Vertex element of the vcl::Mesh class.
Definition vertex.h:46
The Edge type used by the PolyEdgeMeshT class.
Definition poly_edge_mesh.h:166
The Face type used by the PolyEdgeMeshT class.
Definition poly_edge_mesh.h:129
The Vertex type used by the PolyEdgeMeshT class.
Definition poly_edge_mesh.h:88