Visual Computing Library  devel
Loading...
Searching...
No Matches
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_EDGE_MESH_H
24#define VCL_MESHES_EDGE_MESH_H
25
26#include <vclib/mesh.h>
27
28namespace vcl {
29
30template<typename ScalarType, bool INDEXED>
31class EdgeMeshT;
32
33} // namespace vcl
34
35namespace vcl::edgemesh {
36
37template<typename Scalar, bool INDEXED>
38class Vertex;
39
40template<typename Scalar, bool INDEXED>
41class Edge;
42
64template<typename Scalar, bool I>
65class Vertex :
66 public vcl::Vertex<
67 EdgeMeshT<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::OptionalAdjacentEdges<I, Edge<Scalar, I>, Vertex<Scalar, I>>,
74 vert::OptionalAdjacentVertices<I, Vertex<Scalar, I>>,
75 vert::OptionalTexCoord<Scalar, Vertex<Scalar, I>>,
76 vert::OptionalMaterialIndex<Vertex<Scalar, I>>,
77 vert::OptionalMark<Vertex<Scalar, I>>,
78 vert::CustomComponents<Vertex<Scalar, I>>>
79{
80public:
81 friend void swap(Vertex& a, Vertex& b) { a.swap(b); }
82};
83
102template<typename Scalar, bool I>
103class Edge :
104 public vcl::Edge<
105 EdgeMeshT<Scalar, I>,
106 edge::BitFlags,
107 edge::VertexReferences<I, Vertex<Scalar, I>, Edge<Scalar, I>>,
108 edge::OptionalNormal3<Scalar, Edge<Scalar, I>>,
109 edge::OptionalColor<Edge<Scalar, I>>,
110 edge::OptionalQuality<Scalar, Edge<Scalar, I>>,
111 edge::OptionalAdjacentEdges<I, Edge<Scalar, I>>,
112 edge::OptionalMark<Edge<Scalar, I>>,
113 edge::CustomComponents<Edge<Scalar, I>>>
114{
115public:
116 friend void swap(Edge& a, Edge& b) { a.swap(b); }
117};
118
119} // namespace vcl::edgemesh
120
121namespace vcl {
122
149template<typename Scalar, bool INDEXED>
151 public Mesh<
152 mesh::VertexContainer<edgemesh::Vertex<Scalar, INDEXED>>,
153 mesh::EdgeContainer<edgemesh::Edge<Scalar, INDEXED>>,
154 mesh::BoundingBox3<Scalar>,
155 mesh::Mark,
156 mesh::Materials,
157 mesh::Name,
158 mesh::TransformMatrix<Scalar>,
159 mesh::CustomComponents>
160{
161public:
163 using ScalarType = Scalar;
164};
165
173
181
189
197
198} // namespace vcl
199
200#endif // VCL_MESHES_EDGE_MESH_H
A class representing a box in N-dimensional space.
Definition box.h:46
The EdgeMeshT class is a mesh class that represents a mesh that stores only vertices and edges (no fa...
Definition edge_mesh.h:160
Scalar ScalarType
The scalar used to store all the data of the Mesh.
Definition edge_mesh.h:163
The Edge class represents an Edge element of the vcl::Mesh class.
Definition edge.h:47
The Mesh class represents a generic 3D mesh. A mesh is composed of a generic number of containers of ...
Definition mesh.h:68
The Vertex class represents an Vertex element of the vcl::Mesh class.
Definition vertex.h:46
The Edge type used by the EdgeMeshT class.
Definition edge_mesh.h:114
The Vertex type used by the EdgeMeshT class.
Definition edge_mesh.h:79