summaryrefslogtreecommitdiff
path: root/assetFactory/style.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-02-24 19:30:30 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-02-24 19:30:30 +0000
commit7d0decccaac3aa564b549d91a36279e7aca0814e (patch)
tree749ceff26556ed201a055b8d8a70636b50c562f7 /assetFactory/style.h
parentSupport for model colours mixed with textures (diff)
downloadilt-7d0decccaac3aa564b549d91a36279e7aca0814e.tar.bz2
ilt-7d0decccaac3aa564b549d91a36279e7aca0814e.tar.xz
ilt-7d0decccaac3aa564b549d91a36279e7aca0814e.zip
Support for recursive colouring of asset factory faces
Updates colours in sample model.
Diffstat (limited to 'assetFactory/style.h')
-rw-r--r--assetFactory/style.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/assetFactory/style.h b/assetFactory/style.h
new file mode 100644
index 0000000..0c7ad5a
--- /dev/null
+++ b/assetFactory/style.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "modelFactoryMesh.h"
+#include "persistence.h"
+#include "shape.h"
+#include <string>
+
+class Style {
+public:
+ using StyleStack = std::vector<const Style *>;
+
+ static ModelFactoryMesh::Color parseColour(const std::string_view &);
+ void applyStyle(ModelFactoryMesh &, const StyleStack & parents, const Shape::CreatedFaces &) const;
+ void applyStyle(ModelFactoryMesh &, const StyleStack & parents, const ModelFactoryMesh::FaceHandle &) const;
+
+ static std::string_view getProperty(const StyleStack & parents, std::string Style::*member);
+
+ std::string colour;
+
+protected:
+ bool persist(Persistence::PersistenceStore & store);
+};