summaryrefslogtreecommitdiff
path: root/assetFactory/faceController.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-20 00:26:16 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-20 17:53:55 +0000
commitb5db39e7de50cff669920ab1f279df223d257a51 (patch)
tree1fb620c7ad3d1df8bf31e7fb36a6373ff8594e69 /assetFactory/faceController.cpp
parentFix left/right swap of cuboid face names (diff)
downloadilt-b5db39e7de50cff669920ab1f279df223d257a51.tar.bz2
ilt-b5db39e7de50cff669920ab1f279df223d257a51.tar.xz
ilt-b5db39e7de50cff669920ab1f279df223d257a51.zip
Support applying a single face controller to multiple faces
Diffstat (limited to 'assetFactory/faceController.cpp')
-rw-r--r--assetFactory/faceController.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/assetFactory/faceController.cpp b/assetFactory/faceController.cpp
index 1e563b2..6493300 100644
--- a/assetFactory/faceController.cpp
+++ b/assetFactory/faceController.cpp
@@ -4,7 +4,18 @@
#include "modelFactoryMesh.h"
void
-FaceController::apply(ModelFactoryMesh & mesh, const StyleStack & parents, const std::string & name,
+FaceController::apply(ModelFactoryMesh & mesh, const StyleStack & parents, const std::string & names,
+ Shape::CreatedFaces & faces) const
+{
+ std::stringstream nameStream {names};
+ std::for_each(std::istream_iterator<std::string>(nameStream), std::istream_iterator<std::string> {},
+ [&](const auto & name) {
+ applySingle(mesh, parents, name, faces);
+ });
+}
+
+void
+FaceController::applySingle(ModelFactoryMesh & mesh, const StyleStack & parents, const std::string & name,
Shape::CreatedFaces & faces) const
{
const auto getAdjacentFaceName = [&mesh](const auto & ofrange, OpenMesh::FaceHandle nf) -> std::string {