Visual Computing Library  devel
Loading...
Searching...
No Matches
tri_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_TRI_MESH_H
24#define VCL_MESHES_TRI_MESH_H
25
26#include <vclib/mesh.h>
27
28namespace vcl {
29
30template<typename ScalarType, bool INDEXED>
31class TriMeshT;
32
33} // namespace vcl
34
35namespace vcl::trimesh {
36
37template<typename Scalar, bool INDEXED>
38class Vertex;
39
40template<typename Scalar, bool INDEXED>
41class Face;
42
64template<typename Scalar, bool I>
65class Vertex :
66 public vcl::Vertex<
67 TriMeshT<Scalar, I>,
68 vert::BitFlags,
69 vert::Position3<Scalar>,
70 vert::Normal3<Scalar>,
71 vert::OptionalColor<Vertex<Scalar, I>>,
72 vert::OptionalQuality<Scalar, Vertex<Scalar, I>>,
73 vert::OptionalAdjacentFaces<I, Face<Scalar, I>, Vertex<Scalar, I>>,
74 vert::OptionalAdjacentVertices<I, Vertex<Scalar, I>>,
75 vert::OptionalPrincipalCurvature<Scalar, Vertex<Scalar, I>>,
76 vert::OptionalTexCoord<Scalar, Vertex<Scalar, I>>,
77 vert::OptionalMark<Vertex<Scalar, I>>,
78 vert::CustomComponents<Vertex<Scalar, I>>>
79{
80};
81
101template<typename Scalar, bool I>
102class Face :
103 public vcl::Face<
104 TriMeshT<Scalar, I>,
105 face::TriangleBitFlags,
106 face::TriangleVertexRefs<I, Vertex<Scalar, I>, Face<Scalar, I>>,
107 face::Normal3<Scalar>,
108 face::OptionalColor<Face<Scalar, I>>,
109 face::OptionalQuality<Scalar, Face<Scalar, I>>,
110 face::OptionalAdjacentTriangles<I, Face<Scalar, I>>,
111 face::OptionalTriangleWedgeTexCoords<Scalar, Face<Scalar, I>>,
112 face::OptionalMark<Face<Scalar, I>>,
113 face::CustomComponents<Face<Scalar, I>>>
114{
115};
116
117} // namespace vcl::trimesh
118
119namespace vcl {
120
146template<typename Scalar, bool INDEXED>
147class TriMeshT :
148 public Mesh<
149 mesh::VertexContainer<trimesh::Vertex<Scalar, INDEXED>>,
150 mesh::FaceContainer<trimesh::Face<Scalar, INDEXED>>,
151 mesh::BoundingBox3<Scalar>,
152 mesh::Color,
153 mesh::Mark,
154 mesh::Name,
155 mesh::TextureImages,
156 mesh::TransformMatrix<Scalar>,
157 mesh::CustomComponents>
158{
159public:
161 using ScalarType = Scalar;
162};
163
170
177
185
193
194} // namespace vcl
195
196#endif // VCL_MESHES_TRI_MESH_H
A class representing a box in N-dimensional space.
Definition box.h:46
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 TriMeshT class is a mesh class that represents a triangle mesh.
Definition tri_mesh.h:158
Scalar ScalarType
The scalar used to store all the data of the Mesh.
Definition tri_mesh.h:161
The Vertex class represents an Vertex element of the vcl::Mesh class.
Definition vertex.h:46
The Face type used by the TriMeshT class.
Definition tri_mesh.h:114
The Vertex type used by the TriMeshT class.
Definition tri_mesh.h:79