Visual Computing Library
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/mesh.h>
27#include <vclib/mesh/requirements.h>
28
29namespace vcl {
30
31template<typename ScalarType, bool INDEXED>
32class TriMeshT;
33
34} // namespace vcl
35
36namespace vcl::trimesh {
37
38template<typename Scalar, bool INDEXED>
39class Vertex;
40
41template<typename Scalar, bool INDEXED>
42class Face;
43
44template<typename Scalar, bool I>
45class Vertex :
46 public vcl::Vertex<
47 TriMeshT<Scalar, I>,
48 vert::BitFlags,
49 vert::Coordinate3<Scalar>,
50 vert::Normal3<Scalar>,
51 vert::OptionalColor<Vertex<Scalar, I>>,
52 vert::OptionalQuality<Scalar, Vertex<Scalar, I>>,
53 vert::OptionalAdjacentFaces<I, Face<Scalar, I>, Vertex<Scalar, I>>,
54 vert::OptionalAdjacentVertices<I, Vertex<Scalar, I>>,
55 vert::OptionalPrincipalCurvature<Scalar, Vertex<Scalar, I>>,
56 vert::OptionalTexCoord<Scalar, Vertex<Scalar, I>>,
57 vert::OptionalMark<Vertex<Scalar, I>>,
58 vert::CustomComponents<Vertex<Scalar, I>>>
59{
60};
61
62template<typename Scalar, bool I>
63class Face :
64 public vcl::Face<
65 TriMeshT<Scalar, I>,
66 face::TriangleBitFlags,
67 face::TriangleVertexRefs<I, Vertex<Scalar, I>, Face<Scalar, I>>,
68 face::Normal3<Scalar>,
69 face::OptionalColor<Face<Scalar, I>>,
70 face::OptionalQuality<Scalar, Face<Scalar, I>>,
71 face::OptionalAdjacentTriangles<I, Face<Scalar, I>>,
72 face::OptionalTriangleWedgeTexCoords<Scalar, Face<Scalar, I>>,
73 face::OptionalMark<Face<Scalar, I>>,
74 face::CustomComponents<Face<Scalar, I>>>
75{
76};
77
78} // namespace vcl::trimesh
79
80namespace vcl {
81
107template<typename Scalar, bool INDEXED>
108class TriMeshT :
109 public Mesh<
110 mesh::VertexContainer<trimesh::Vertex<Scalar, INDEXED>>,
111 mesh::FaceContainer<trimesh::Face<Scalar, INDEXED>>,
112 mesh::BoundingBox3<Scalar>,
113 mesh::Color,
114 mesh::Mark,
115 mesh::Name,
116 mesh::TextureImages,
117 mesh::TransformMatrix<Scalar>,
118 mesh::CustomComponents>
119{
120public:
122 using ScalarType = Scalar;
123};
124
131
138
146
154
155} // namespace vcl
156
157#endif // VCL_MESHES_TRI_MESH_H
The Face class represents an Face element of the vcl::Mesh class.
Definition face.h:49
The Mesh class represents a generic 3D mesh. A mesh is composed of a generic number of containers of ...
Definition mesh.h:68
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
The TriMeshT class is a mesh class that represents a triangle mesh.
Definition tri_mesh.h:119
Scalar ScalarType
The scalar used to store all the data of the Mesh.
Definition tri_mesh.h:122
The Vertex class represents an Vertex element of the vcl::Mesh class.
Definition vertex.h:47
Definition tri_mesh.h:75
Definition tri_mesh.h:59