mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
ENH: label: refine some label logic
1. only show label of object in current partplate 2. disable label under gizmo 3. fix a issue of label not updated in time 4. add some logs Change-Id: If20196a566cc45a4a0c2bcc6bbe212aaa9f74dd3 (cherry picked from commit 3e92ed61e9687d5351a9bb2bc6d25b568cd1c973)
This commit is contained in:
parent
93ce494741
commit
eecc2a738c
3 changed files with 10 additions and 6 deletions
|
@ -673,7 +673,7 @@ GLCanvas3D::Mouse::Mouse()
|
|||
|
||||
void GLCanvas3D::Labels::render(const std::vector<const ModelInstance*>& sorted_instances) const
|
||||
{
|
||||
if (!m_enabled || !is_shown())
|
||||
if (!m_enabled || !is_shown() || m_canvas.get_gizmos_manager().is_running())
|
||||
return;
|
||||
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
|
@ -701,10 +701,14 @@ void GLCanvas3D::Labels::render(const std::vector<const ModelInstance*>& sorted_
|
|||
// collect owners world bounding boxes and data from volumes
|
||||
std::vector<Owner> owners;
|
||||
const GLVolumeCollection& volumes = m_canvas.get_volumes();
|
||||
PartPlate* cur_plate = wxGetApp().plater()->get_partplate_list().get_curr_plate();
|
||||
for (const GLVolume* volume : volumes.volumes) {
|
||||
int obj_idx = volume->object_idx();
|
||||
if (0 <= obj_idx && obj_idx < (int)model->objects.size()) {
|
||||
int inst_idx = volume->instance_idx();
|
||||
//only show current plate's label
|
||||
if (!cur_plate->contain_instance(obj_idx, inst_idx))
|
||||
continue;
|
||||
std::vector<Owner>::iterator it = std::find_if(owners.begin(), owners.end(), [obj_idx, inst_idx](const Owner& owner) {
|
||||
return (owner.obj_idx == obj_idx) && (owner.inst_idx == inst_idx);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue