summaryrefslogtreecommitdiff
path: root/assetFactory/faceController.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-20 23:30:21 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-20 23:30:21 +0000
commit2508112e2853e1a6c012b19c7232aa09f98d3969 (patch)
tree4e650d6d0d912eacd6c4e38561b175232e717529 /assetFactory/faceController.cpp
parentAdd persistence support for std::optional<>s (diff)
downloadilt-2508112e2853e1a6c012b19c7232aa09f98d3969.tar.bz2
ilt-2508112e2853e1a6c012b19c7232aa09f98d3969.tar.xz
ilt-2508112e2853e1a6c012b19c7232aa09f98d3969.zip
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
Diffstat (limited to 'assetFactory/faceController.cpp')
-rw-r--r--assetFactory/faceController.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/assetFactory/faceController.cpp b/assetFactory/faceController.cpp
index bafbee2..2367f8d 100644
--- a/assetFactory/faceController.cpp
+++ b/assetFactory/faceController.cpp
@@ -48,12 +48,10 @@ FaceController::applySingle(ModelFactoryMesh & mesh, const StyleStack & parents,
faces.merge(std::move(newFaces));
}
else {
- mesh.property(mesh.smoothFaceProperty, faceHandle) = smooth;
applyStyle(mesh, parents + this, faceHandle);
}
}
for (const auto & [faceName, faceHandle] : controlledFaces) {
- mesh.property(mesh.smoothFaceProperty, faceHandle) = smooth;
applyStyle(mesh, parents + this, faceHandle);
}
}
@@ -89,9 +87,8 @@ FaceController::extrude(ModelFactoryMesh & mesh, const std::string & faceName, O
auto & newFaceName = mesh.property(mesh.nameFaceProperty, newFace);
newFaceName = getAdjacentFaceName(mesh, ofrange, newFace);
newFaces.emplace(newFaceName, newFace);
- mesh.property(mesh.smoothFaceProperty, newFace) = smooth;
}
- mesh.property(mesh.smoothFaceProperty, newFaces.emplace(faceName, mesh.add_face(vertices))->second) = smooth;
+ newFaces.emplace(faceName, mesh.add_face(vertices));
return newFaces;
}
@@ -99,7 +96,6 @@ FaceController::extrude(ModelFactoryMesh & mesh, const std::string & faceName, O
bool
FaceController::persist(Persistence::PersistenceStore & store)
{
- return STORE_TYPE && STORE_MEMBER(id) && Style::persist(store) && STORE_MEMBER(type) && STORE_MEMBER(smooth)
- && Mutation::persist(store)
+ return STORE_TYPE && STORE_MEMBER(id) && Style::persist(store) && STORE_MEMBER(type) && Mutation::persist(store)
&& STORE_NAME_HELPER("face", faceControllers, Persistence::MapByMember<FaceControllers>);
}