utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
mesh.hpp
1/*
2** ETIB PROJECT, 2026
3** utility
4** File description:
5** mesh
6*/
7
8#pragma once
9
10#include <utility/graphic/vertex.hpp>
11
12namespace utility::graphic
13{
24 class Mesh
25 {
26 public:
36 Mesh(const std::vector<VertexF> &vertices,
37 const std::vector<uint32_t> &indices);
38
42 ~Mesh();
43
53 void addVertex(const VertexF &vertex);
54
64 void addIndex(uint32_t index);
65
75 const std::vector<VertexF> &getVertices() const;
76
86 const std::vector<uint32_t> &getIndices() const;
87
95 void reset(void);
96
102 bool operator==(const Mesh &other) const
103 {
104 return _vertices == other._vertices && _indices == other._indices;
105 }
106
112 bool operator!=(const Mesh &other) const
113 {
114 return !(*this == other);
115 }
116
117 private:
121 std::vector<VertexF> _vertices;
122
126 std::vector<uint32_t> _indices;
127 };
128} // namespace utility::graphic
The Mesh class represents a 3D mesh used for rendering in a graphics application.
Definition mesh.hpp:25
bool operator==(const Mesh &other) const
Equality comparison.
Definition mesh.hpp:102
void addVertex(const VertexF &vertex)
Add a vertex to the mesh.
Definition mesh.cpp:23
bool operator!=(const Mesh &other) const
Inequality comparison.
Definition mesh.hpp:112
const std::vector< VertexF > & getVertices() const
Get the vertices of the mesh.
Definition mesh.cpp:33
void reset(void)
Reset the mesh by clearing all vertices and indices.
Definition mesh.cpp:43
const std::vector< uint32_t > & getIndices() const
Get the indices of the mesh.
Definition mesh.cpp:38
void addIndex(uint32_t index)
Add an index to the mesh.
Definition mesh.cpp:28
~Mesh()
Destructs the Mesh object, releasing any allocated resources.
Definition mesh.cpp:19
Vertex type containing common mesh attributes.
Definition vertex.hpp:38