diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-09 18:18:43 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-09 18:18:43 +0000 |
commit | 92c1aed7a471f34e18eb8d0077aad90fd8b7344b (patch) | |
tree | bf78c2ec29a06e22c7cd8c695b22de83694cc5a4 /assetFactory/modelFactoryMesh.h | |
parent | Refactor of asset factory to address mutation/face controller logic (diff) | |
download | ilt-92c1aed7a471f34e18eb8d0077aad90fd8b7344b.tar.bz2 ilt-92c1aed7a471f34e18eb8d0077aad90fd8b7344b.tar.xz ilt-92c1aed7a471f34e18eb8d0077aad90fd8b7344b.zip |
Make add_namedFace a thin template wrapper
Diffstat (limited to 'assetFactory/modelFactoryMesh.h')
-rw-r--r-- | assetFactory/modelFactoryMesh.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/assetFactory/modelFactoryMesh.h b/assetFactory/modelFactoryMesh.h index 258913b..ea5f011 100644 --- a/assetFactory/modelFactoryMesh.h +++ b/assetFactory/modelFactoryMesh.h @@ -35,5 +35,12 @@ struct ModelFactoryMesh : public OpenMesh::PolyMesh_ArrayKernelT<ModelFactoryTra OpenMesh::FPropHandleT<bool> smoothFaceProperty; OpenMesh::FPropHandleT<std::string> nameFaceProperty; - std::pair<std::string, OpenMesh::FaceHandle> add_namedFace(std::string name, std::vector<OpenMesh::VertexHandle> p); + template<typename... Vs> + std::pair<std::string, OpenMesh::FaceHandle> + add_namedFace(std::string name, Vs &&... vs) + { + const auto handle = add_face(std::forward<Vs>(vs)...); + property(nameFaceProperty, handle) = name; + return std::make_pair(name, handle); + } }; |