From b5db39e7de50cff669920ab1f279df223d257a51 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 20 Mar 2023 00:26:16 +0000 Subject: Support applying a single face controller to multiple faces --- assetFactory/faceController.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'assetFactory/faceController.h') diff --git a/assetFactory/faceController.h b/assetFactory/faceController.h index 10a226a..890aafa 100644 --- a/assetFactory/faceController.h +++ b/assetFactory/faceController.h @@ -12,7 +12,7 @@ class FaceController : public Mutation, public Style, public Persistence::Persis public: using FaceControllers = std::map>; - void apply(ModelFactoryMesh & mesh, const Style::StyleStack & parents, const std::string & name, + void apply(ModelFactoryMesh & mesh, const Style::StyleStack & parents, const std::string & names, Shape::CreatedFaces & faces) const; std::string id; @@ -28,4 +28,7 @@ private: { return {}; }; + + void applySingle(ModelFactoryMesh & mesh, const Style::StyleStack & parents, const std::string & name, + Shape::CreatedFaces & faces) const; }; -- cgit v1.2.3 From fe1913b3f3742077763d7a6fc9fcac219900a4ae Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 20 Mar 2023 18:55:44 +0000 Subject: Slightly tidier FaceController? It's still a mess --- assetFactory/faceController.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'assetFactory/faceController.h') diff --git a/assetFactory/faceController.h b/assetFactory/faceController.h index 890aafa..962a516 100644 --- a/assetFactory/faceController.h +++ b/assetFactory/faceController.h @@ -31,4 +31,7 @@ private: void applySingle(ModelFactoryMesh & mesh, const Style::StyleStack & parents, const std::string & name, Shape::CreatedFaces & faces) const; + static std::string getAdjacentFaceName(const ModelFactoryMesh & mesh, + const std::span ofrange, OpenMesh::FaceHandle nf); + Shape::CreatedFaces extrude(ModelFactoryMesh & mesh, const std::string & faceName, OpenMesh::FaceHandle) const; }; -- cgit v1.2.3 From 2508112e2853e1a6c012b19c7232aa09f98d3969 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 20 Mar 2023 23:30:21 +0000 Subject: Move smooth property into Style and make it optional This allows it to cascade down as faces are created and also be overridden as required --- assetFactory/faceController.h | 1 - 1 file changed, 1 deletion(-) (limited to 'assetFactory/faceController.h') diff --git a/assetFactory/faceController.h b/assetFactory/faceController.h index 962a516..851292a 100644 --- a/assetFactory/faceController.h +++ b/assetFactory/faceController.h @@ -17,7 +17,6 @@ public: std::string id; std::string type; - bool smooth {false}; FaceControllers faceControllers; private: -- cgit v1.2.3 From 2bcbb86db4061e32005adea8806e4ac552691bcf Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 7 Apr 2023 23:55:09 +0100 Subject: Extend face controller to support splitting a face along a plane Individual parts of the splits faces can then be styled separately --- assetFactory/faceController.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'assetFactory/faceController.h') diff --git a/assetFactory/faceController.h b/assetFactory/faceController.h index 851292a..91860f4 100644 --- a/assetFactory/faceController.h +++ b/assetFactory/faceController.h @@ -10,7 +10,22 @@ class FaceController : public Mutation, public Style, public Persistence::Persistable { public: + class Split : public Persistable { + public: + std::string id; + glm::vec3 origin, normal; + + private: + friend Persistence::SelectionPtrBase>; + bool persist(Persistence::PersistenceStore & store) override; + std::string + getId() const override + { + return {}; + }; + }; using FaceControllers = std::map>; + using Splits = std::map>; void apply(ModelFactoryMesh & mesh, const Style::StyleStack & parents, const std::string & names, Shape::CreatedFaces & faces) const; @@ -18,6 +33,7 @@ public: std::string id; std::string type; FaceControllers faceControllers; + Splits splits; private: friend Persistence::SelectionPtrBase>; @@ -33,4 +49,6 @@ private: static std::string getAdjacentFaceName(const ModelFactoryMesh & mesh, const std::span ofrange, OpenMesh::FaceHandle nf); Shape::CreatedFaces extrude(ModelFactoryMesh & mesh, const std::string & faceName, OpenMesh::FaceHandle) const; + Shape::CreatedFaces split( + ModelFactoryMesh & mesh, const std::string & faceName, OpenMesh::FaceHandle &, const Split &) const; }; -- cgit v1.2.3 From 144f9b57295f7fee9306ee1a4480c165a834e6ca Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 8 Apr 2023 11:48:17 +0100 Subject: Remove no longer required getAdjacentFaceName --- assetFactory/faceController.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'assetFactory/faceController.h') diff --git a/assetFactory/faceController.h b/assetFactory/faceController.h index 91860f4..8d30dc6 100644 --- a/assetFactory/faceController.h +++ b/assetFactory/faceController.h @@ -46,8 +46,6 @@ private: void applySingle(ModelFactoryMesh & mesh, const Style::StyleStack & parents, const std::string & name, Shape::CreatedFaces & faces) const; - static std::string getAdjacentFaceName(const ModelFactoryMesh & mesh, - const std::span ofrange, OpenMesh::FaceHandle nf); Shape::CreatedFaces extrude(ModelFactoryMesh & mesh, const std::string & faceName, OpenMesh::FaceHandle) const; Shape::CreatedFaces split( ModelFactoryMesh & mesh, const std::string & faceName, OpenMesh::FaceHandle &, const Split &) const; -- cgit v1.2.3 From b222c21715384efc2eaa53d3ba295fb34da5b599 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 9 Apr 2023 12:24:55 +0100 Subject: Start to factor out geometric place from face controller split --- assetFactory/faceController.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'assetFactory/faceController.h') diff --git a/assetFactory/faceController.h b/assetFactory/faceController.h index 8d30dc6..0376241 100644 --- a/assetFactory/faceController.h +++ b/assetFactory/faceController.h @@ -1,5 +1,6 @@ #pragma once +#include "geometricPlane.h" #include "modelFactoryMesh_fwd.h" #include "mutation.h" #include "persistence.h" @@ -10,10 +11,9 @@ class FaceController : public Mutation, public Style, public Persistence::Persistable { public: - class Split : public Persistable { + class Split : public Persistable, public GeometricPlane { public: std::string id; - glm::vec3 origin, normal; private: friend Persistence::SelectionPtrBase>; -- cgit v1.2.3