diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-04-11 15:21:08 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-04-11 15:21:08 +0300 |
commit | 4046d517c9f9564e414a3309fbd5401c72a319b4 (patch) | |
tree | 3a3c8cd06d9d31101e067f53090694113f7c6ef6 /src/slic3r/GUI/Selection.hpp | |
parent | 4718c839f66dc6a0712e738390a08be3013143b7 (diff) |
Copy and paste -> Disabled paste of volumes when nothing is selected and fixed enabling/disabling of paste item in toolbar and edit menu
Diffstat (limited to 'src/slic3r/GUI/Selection.hpp')
-rw-r--r-- | src/slic3r/GUI/Selection.hpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/slic3r/GUI/Selection.hpp b/src/slic3r/GUI/Selection.hpp index 9fa9f1869..a8b0c06dc 100644 --- a/src/slic3r/GUI/Selection.hpp +++ b/src/slic3r/GUI/Selection.hpp @@ -138,19 +138,6 @@ public: typedef std::set<int> InstanceIdxsList; typedef std::map<int, InstanceIdxsList> ObjectIdxsToInstanceIdxsMap; -private: - struct Cache - { - // Cache of GLVolume derived transformation matrices, valid during mouse dragging. - VolumesCache volumes_data; - // Center of the dragged selection, valid during mouse dragging. - Vec3d dragging_center; - // Map from indices of ModelObject instances in Model::objects - // to a set of indices of ModelVolume instances in ModelObject::instances - // Here the index means a position inside the respective std::vector, not ModelID. - ObjectIdxsToInstanceIdxsMap content; - }; - class Clipboard { Model m_model; @@ -168,6 +155,19 @@ private: void set_mode(Selection::EMode mode) { m_mode = mode; } }; +private: + struct Cache + { + // Cache of GLVolume derived transformation matrices, valid during mouse dragging. + VolumesCache volumes_data; + // Center of the dragged selection, valid during mouse dragging. + Vec3d dragging_center; + // Map from indices of ModelObject instances in Model::objects + // to a set of indices of ModelVolume instances in ModelObject::instances + // Here the index means a position inside the respective std::vector, not ModelID. + ObjectIdxsToInstanceIdxsMap content; + }; + // Volumes owned by GLCanvas3D. GLVolumePtrs* m_volumes; // Model, not owned. @@ -287,7 +287,8 @@ public: void copy_to_clipboard(); void paste_from_clipboard(); - bool is_clipboard_empty(); + + const Clipboard& get_clipboard() const { return m_clipboard; } private: void update_valid(); |