summaryrefslogtreecommitdiff
path: root/assetFactory/modelFactoryMesh.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-01-05 01:09:01 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2025-01-05 01:09:01 +0000
commit917c081ddc1651381f83d8a9b0e095440419814a (patch)
tree978c5fcc7b79b5ebe1c2abd938124eb8bee52adb /assetFactory/modelFactoryMesh.h
parentFix curve walk edge case where the curve legitimately returns to the previous... (diff)
downloadilt-917c081ddc1651381f83d8a9b0e095440419814a.tar.bz2
ilt-917c081ddc1651381f83d8a9b0e095440419814a.tar.xz
ilt-917c081ddc1651381f83d8a9b0e095440419814a.zip
Helper to declare and add OpenMesh property declaratively
Diffstat (limited to 'assetFactory/modelFactoryMesh.h')
-rw-r--r--assetFactory/modelFactoryMesh.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/assetFactory/modelFactoryMesh.h b/assetFactory/modelFactoryMesh.h
index 299986e..6a18155 100644
--- a/assetFactory/modelFactoryMesh.h
+++ b/assetFactory/modelFactoryMesh.h
@@ -8,6 +8,7 @@
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include <thirdparty/openmesh/glmcompat.h>
+#include <thirdparty/openmesh/helpers.h>
struct ModelFactoryTraits : public OpenMesh::DefaultTraits {
FaceAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status | OpenMesh::Attributes::Color);
@@ -21,13 +22,11 @@ struct ModelFactoryTraits : public OpenMesh::DefaultTraits {
};
struct ModelFactoryMesh : public OpenMesh::PolyMesh_ArrayKernelT<ModelFactoryTraits> {
- ModelFactoryMesh();
-
bool normalsProvidedProperty {};
- OpenMesh::FPropHandleT<bool> smoothFaceProperty;
- OpenMesh::FPropHandleT<GLuint> materialFaceProperty;
- OpenMesh::FPropHandleT<std::string> nameFaceProperty;
- OpenMesh::HPropHandleT<std::string> nameAdjFaceProperty;
+ const OpenMesh::Helpers::Property<bool, OpenMesh::FPropHandleT> smoothFaceProperty {this};
+ const OpenMesh::Helpers::Property<GLuint, OpenMesh::FPropHandleT> materialFaceProperty {this};
+ const OpenMesh::Helpers::Property<std::string, OpenMesh::FPropHandleT> nameFaceProperty {this};
+ const OpenMesh::Helpers::Property<std::string, OpenMesh::HPropHandleT> nameAdjFaceProperty {this};
template<typename... Vs>
std::pair<std::string, OpenMesh::FaceHandle>