From b76d161a968ff4a2817e9cfe5c02d3538ef6029f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 25 Feb 2023 03:05:24 +0000 Subject: Add face name property and wrapper to add a named face --- assetFactory/modelFactoryMesh.cpp | 9 +++++++++ assetFactory/modelFactoryMesh.h | 3 +++ 2 files changed, 12 insertions(+) (limited to 'assetFactory') diff --git a/assetFactory/modelFactoryMesh.cpp b/assetFactory/modelFactoryMesh.cpp index 6c772ad..f9ee6a0 100644 --- a/assetFactory/modelFactoryMesh.cpp +++ b/assetFactory/modelFactoryMesh.cpp @@ -3,4 +3,13 @@ ModelFactoryMesh::ModelFactoryMesh() { add_property(smoothFaceProperty); + add_property(nameFaceProperty); +} + +std::pair +ModelFactoryMesh::add_namedFace(std::string name, std::vector p) +{ + const auto handle = add_face(std::move(p)); + property(nameFaceProperty, handle) = name; + return std::make_pair(name, handle); } diff --git a/assetFactory/modelFactoryMesh.h b/assetFactory/modelFactoryMesh.h index 7d222f5..b4f5254 100644 --- a/assetFactory/modelFactoryMesh.h +++ b/assetFactory/modelFactoryMesh.h @@ -32,4 +32,7 @@ struct ModelFactoryMesh : public OpenMesh::PolyMesh_ArrayKernelT smoothFaceProperty; + OpenMesh::FPropHandleT nameFaceProperty; + + std::pair add_namedFace(std::string name, std::vector p); }; -- cgit v1.2.3