EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
EBGeometry_OBJ.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Robert Marskar <robert.marskar@sintef.no>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
11#ifndef EBGEOMETRY_OBJ_HPP
12#define EBGEOMETRY_OBJ_HPP
13
14// Std includes
15#include <cstddef>
16#include <memory>
17#include <string>
18#include <type_traits>
19#include <vector>
20
21// Our includes
22#include "EBGeometry_DCEL.hpp"
23#include "EBGeometry_Vec.hpp"
24
25namespace EBGeometry {
26
32template <typename T>
33class OBJ
34{
35 static_assert(std::is_floating_point_v<T>, "OBJ<T>: T must be a floating-point type");
36
37public:
42
47 OBJ(const std::string& a_id) noexcept;
48
54
60
66 OBJ&
68
74 OBJ&
76
81
86 [[nodiscard]] std::string&
88
93 [[nodiscard]] const std::string&
95
100 [[nodiscard]] std::vector<Vec3T<T>>&
102
107 [[nodiscard]] const std::vector<Vec3T<T>>&
109
114 [[nodiscard]] std::vector<std::vector<size_t>>&
116
121 [[nodiscard]] const std::vector<std::vector<size_t>>&
123
131 [[nodiscard]] std::shared_ptr<EBGeometry::DCEL::MeshT<T, Meta>>
133
138 std::string m_id;
139
143 std::vector<Vec3T<T>> m_vertexCoordinates;
144
148 std::vector<std::vector<size_t>> m_facets;
149};
150
151} // namespace EBGeometry
152
153#include "EBGeometry_OBJImplem.hpp"
154
155#endif
Namespace documentation.
Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools.
Class for storing contents of Wavefront OBJ files.
Definition EBGeometry_OBJ.hpp:34
std::shared_ptr< EBGeometry::DCEL::MeshT< T, Meta > > convertToDCEL() const noexcept
Turn the OBJ mesh into a DCEL mesh.
std::vector< std::vector< size_t > > & getFacets() noexcept
Get the polygon facet indices.
std::string & getID() noexcept
Get the identifier for this object.
std::string m_id
OBJ object ID.
Definition EBGeometry_OBJ.hpp:138
std::vector< Vec3T< T > > m_vertexCoordinates
Vertex coordinates.
Definition EBGeometry_OBJ.hpp:143
OBJ() noexcept=default
Default constructor. Initializes empty member data holder.
std::vector< Vec3T< T > > & getVertexCoordinates() noexcept
Get the vertex coordinates.
std::vector< std::vector< size_t > > m_facets
Polygon facets.
Definition EBGeometry_OBJ.hpp:148
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:225
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:31