From 4b464dfa58d2a1c2dd94e2d215974860ee6bac7e Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 4 Jul 2019 16:55:03 +0200 Subject: [PATCH] Store color information per segment --- src/Mod/Mesh/App/Mesh.cpp | 1 + src/Mod/Mesh/App/Segment.cpp | 1 + src/Mod/Mesh/App/Segment.h | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/src/Mod/Mesh/App/Mesh.cpp b/src/Mod/Mesh/App/Mesh.cpp index 4c38b968ed..ad52ae220e 100644 --- a/src/Mod/Mesh/App/Mesh.cpp +++ b/src/Mod/Mesh/App/Mesh.cpp @@ -1699,6 +1699,7 @@ void MeshObject::addSegment(const Segment& s) { addSegment(s.getIndices()); this->_segments.back().setName(s.getName()); + this->_segments.back().setColor(s.getColor()); this->_segments.back().save(s.isSaved()); this->_segments.back()._modifykernel = s._modifykernel; } diff --git a/src/Mod/Mesh/App/Segment.cpp b/src/Mod/Mesh/App/Segment.cpp index ccc2f2d31b..726100f80c 100644 --- a/src/Mod/Mesh/App/Segment.cpp +++ b/src/Mod/Mesh/App/Segment.cpp @@ -85,6 +85,7 @@ Segment::Segment(const Segment& s) : _mesh(s._mesh) , _indices(s._indices) , _name(s._name) + , _color(s._color) , _save(s._save) , _modifykernel(s._modifykernel) { diff --git a/src/Mod/Mesh/App/Segment.h b/src/Mod/Mesh/App/Segment.h index 459ef93ee2..c0233ce982 100644 --- a/src/Mod/Mesh/App/Segment.h +++ b/src/Mod/Mesh/App/Segment.h @@ -51,6 +51,9 @@ public: void setName(const std::string& n) { _name = n; } const std::string& getName() const { return _name; } + void setColor(const std::string& c) { _color = c; } + const std::string& getColor() const { return _color; } + void save(bool on) { _save = on; } bool isSaved() const { return _save; } @@ -61,6 +64,7 @@ private: MeshObject* _mesh; std::vector _indices; std::string _name; + std::string _color; bool _save; bool _modifykernel;