FIX:not need deal SINKING logic in assembly view
jira: STUDIO-6730 Change-Id: Idca375293377ec219f79873d29e963b50cafa8df
This commit is contained in:
parent
c211a9c53a
commit
d02f9561a8
|
@ -1306,14 +1306,6 @@ bool can_set_xyz_distance(const SurfaceFeature &a, const SurfaceFeature &b) {
|
||||||
if (f2.get_type() == SurfaceFeatureType::Circle) {
|
if (f2.get_type() == SurfaceFeatureType::Circle) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (f2.get_type() == SurfaceFeatureType::Plane) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (f1.get_type() == SurfaceFeatureType::Plane) {
|
|
||||||
if (f2.get_type() == SurfaceFeatureType::Plane) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4709,23 +4709,24 @@ void GLCanvas3D::do_rotate(const std::string& snapshot_type)
|
||||||
|
|
||||||
//BBS: notify instance updates to part plater list
|
//BBS: notify instance updates to part plater list
|
||||||
m_selection.notify_instance_update(-1, -1);
|
m_selection.notify_instance_update(-1, -1);
|
||||||
|
if (m_canvas_type != CanvasAssembleView) {
|
||||||
|
// Fixes sinking/flying instances
|
||||||
|
for (const std::pair<int, int> &i : done) {
|
||||||
|
ModelObject *m = m_model->objects[i.first];
|
||||||
|
|
||||||
// Fixes sinking/flying instances
|
// BBS: don't call translate if the z is zero
|
||||||
for (const std::pair<int, int>& i : done) {
|
const double shift_z = m->get_instance_min_z(i.second);
|
||||||
ModelObject* m = m_model->objects[i.first];
|
// leave sinking instances as sinking
|
||||||
|
if ((min_zs.find({i.first, i.second})->second >= SINKING_Z_THRESHOLD || shift_z > SINKING_Z_THRESHOLD) && (shift_z != 0.0f)) {
|
||||||
|
const Vec3d shift(0.0, 0.0, -shift_z);
|
||||||
|
m_selection.translate(i.first, i.second, shift);
|
||||||
|
m->translate_instance(i.second, shift);
|
||||||
|
// BBS: notify instance updates to part plater list
|
||||||
|
m_selection.notify_instance_update(i.first, i.second);
|
||||||
|
}
|
||||||
|
|
||||||
//BBS: don't call translate if the z is zero
|
wxGetApp().obj_list()->update_info_items(static_cast<size_t>(i.first));
|
||||||
const double shift_z = m->get_instance_min_z(i.second);
|
|
||||||
// leave sinking instances as sinking
|
|
||||||
if ((min_zs.find({ i.first, i.second })->second >= SINKING_Z_THRESHOLD || shift_z > SINKING_Z_THRESHOLD)&&(shift_z != 0.0f)) {
|
|
||||||
const Vec3d shift(0.0, 0.0, -shift_z);
|
|
||||||
m_selection.translate(i.first, i.second, shift);
|
|
||||||
m->translate_instance(i.second, shift);
|
|
||||||
//BBS: notify instance updates to part plater list
|
|
||||||
m_selection.notify_instance_update(i.first, i.second);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGetApp().obj_list()->update_info_items(static_cast<size_t>(i.first));
|
|
||||||
}
|
}
|
||||||
//BBS: nofity object list to update
|
//BBS: nofity object list to update
|
||||||
wxGetApp().plater()->sidebar().obj_list()->update_plate_values_for_items();
|
wxGetApp().plater()->sidebar().obj_list()->update_plate_values_for_items();
|
||||||
|
|
Loading…
Reference in New Issue