mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Copy and paste -> Disabled paste of volumes when nothing is selected and fixed enabling/disabling of paste item in toolbar and edit menu
This commit is contained in:
parent
4718c839f6
commit
4046d517c9
4 changed files with 36 additions and 27 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue