FIX:not need deal SINKING logic in assembly view

jira: STUDIO-6730
Change-Id: Idca375293377ec219f79873d29e963b50cafa8df
This commit is contained in:
zhou.xu 2024-04-03 14:41:56 +08:00 committed by Lane.Wei
parent c211a9c53a
commit d02f9561a8
2 changed files with 15 additions and 22 deletions

View File

@ -1306,14 +1306,6 @@ bool can_set_xyz_distance(const SurfaceFeature &a, const SurfaceFeature &b) {
if (f2.get_type() == SurfaceFeatureType::Circle) {
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;
}

View File

@ -4709,23 +4709,24 @@ void GLCanvas3D::do_rotate(const std::string& snapshot_type)
//BBS: notify instance updates to part plater list
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
for (const std::pair<int, int>& i : done) {
ModelObject* m = m_model->objects[i.first];
// BBS: don't call translate if the z is zero
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);
}
//BBS: don't call translate if the z is zero
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));
}
wxGetApp().obj_list()->update_info_items(static_cast<size_t>(i.first));
}
//BBS: nofity object list to update
wxGetApp().plater()->sidebar().obj_list()->update_plate_values_for_items();