mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-22 00:01:09 -06:00
Implemented UI for ordering volumes
https://github.com/prusa3d/Slic3r/issues/277
This commit is contained in:
parent
7884fa3d7c
commit
ff9d565ba7
2 changed files with 78 additions and 9 deletions
|
@ -215,6 +215,22 @@ ModelMaterial::attributes()
|
|||
%code%{ RETVAL = THIS->volumes.size(); %};
|
||||
Ref<ModelVolume> get_volume(int idx)
|
||||
%code%{ RETVAL = THIS->volumes.at(idx); %};
|
||||
bool move_volume_up(int idx)
|
||||
%code%{
|
||||
if (idx > 0 && idx < int(THIS->volumes.size())) {
|
||||
std::swap(THIS->volumes[idx-1], THIS->volumes[idx]);
|
||||
RETVAL = true;
|
||||
} else
|
||||
RETVAL = false;
|
||||
%};
|
||||
bool move_volume_down(int idx)
|
||||
%code%{
|
||||
if (idx >= 0 && idx + 1 < int(THIS->volumes.size())) {
|
||||
std::swap(THIS->volumes[idx+1], THIS->volumes[idx]);
|
||||
RETVAL = true;
|
||||
} else
|
||||
RETVAL = false;
|
||||
%};
|
||||
|
||||
%name{_add_instance} Ref<ModelInstance> add_instance();
|
||||
Ref<ModelInstance> _add_instance_clone(ModelInstance* other)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue