src/vertexmap.h

changeset 118
8e1c9f18ae15
parent 117
121a40d5e34c
child 119
24275a4064f4
--- a/src/vertexmap.h	Tue Jul 27 13:23:34 2021 +0300
+++ b/src/vertexmap.h	Tue Jul 27 16:29:00 2021 +0300
@@ -4,14 +4,22 @@
 #include "main.h"
 #include "model.h"
 
+/**
+ * @brief Collects a map of all vertices in a model to all objects that use the specified vertex.
+ */
 class VertexMap : public QObject
 {
 	Q_OBJECT
 public:
+	using ApplyFunction = std::function<void(const glm::vec3&, const std::set<ldraw::id_t>&)>;
 	VertexMap(const Model *model);
 	Q_SLOT void build();
+	void apply(ApplyFunction fn) const;
+Q_SIGNALS:
+	Q_SIGNAL void verticesChanged();
 private:
 	const Model* const model;
+	std::map<unsigned int, glm::vec3> vertices;
 	std::map<unsigned int, std::set<ldraw::id_t>> map;
 };
 

mercurial