This commit is contained in:
YuSanka 2019-01-24 15:40:54 +01:00
commit 54bd2e55c7
5 changed files with 12 additions and 22 deletions

View file

@ -918,12 +918,14 @@ bool store_amf(const char *path, Model *model, const DynamicPrintConfig *config)
auto &stl = volume->mesh.stl;
if (stl.v_shared == nullptr)
stl_generate_shared_vertices(&stl);
const Transform3d& matrix = volume->get_matrix();
for (size_t i = 0; i < stl.stats.shared_vertices; ++i) {
stream << " <vertex>\n";
stream << " <coordinates>\n";
stream << " <x>" << stl.v_shared[i](0) << "</x>\n";
stream << " <y>" << stl.v_shared[i](1) << "</y>\n";
stream << " <z>" << stl.v_shared[i](2) << "</z>\n";
Vec3d v = matrix * stl.v_shared[i].cast<double>();
stream << " <x>" << v(0) << "</x>\n";
stream << " <y>" << v(1) << "</y>\n";
stream << " <z>" << v(2) << "</z>\n";
stream << " </coordinates>\n";
stream << " </vertex>\n";
}

View file

@ -2172,7 +2172,7 @@ void GLCanvas3D::Selection::render_sidebar_hints(const std::string& sidebar_fiel
if (is_single_full_instance())
{
::glTranslated(center(0), center(1), center(2));
if (boost::starts_with(sidebar_field, "scale") || boost::starts_with(sidebar_field, "size"))
if (!boost::starts_with(sidebar_field, "position"))
{
Transform3d orient_matrix = (*m_volumes)[*m_list.begin()]->get_instance_transformation().get_matrix(true, false, true, true);
::glMultMatrixd(orient_matrix.data());
@ -2181,9 +2181,7 @@ void GLCanvas3D::Selection::render_sidebar_hints(const std::string& sidebar_fiel
else if (is_single_volume() || is_single_modifier())
{
Transform3d orient_matrix = (*m_volumes)[*m_list.begin()]->get_instance_transformation().get_matrix(true, false, true, true);
const Vec3d& offset = get_bounding_box().center();
::glTranslated(offset(0), offset(1), offset(2));
::glTranslated(center(0), center(1), center(2));
::glMultMatrixd(orient_matrix.data());
}
else

View file

@ -168,10 +168,8 @@ bool GUI_App::OnInit()
update_mode(); // update view mode after fix of the object_list size
}
#if !ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
if (this->plater() != nullptr)
this->obj_manipul()->update_if_dirty();
#endif // !ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
});
// On OS X the UI tends to freeze in weird ways if modal dialogs(config wizard, update notifications, ...)

View file

@ -327,15 +327,14 @@ void ObjectManipulation::update_settings_value(const GLCanvas3D::Selection& sele
else
reset_settings_value();
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
update_if_dirty();
#else
m_dirty = true;
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
}
void ObjectManipulation::update_if_dirty()
{
if (!m_dirty)
return;
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
if (m_cache.move_label_string != _(m_new_move_label_string)+ ":")
{
@ -414,9 +413,6 @@ void ObjectManipulation::update_if_dirty()
else
m_og->disable();
#else
if (! m_dirty)
return;
m_move_Label->SetLabel(_(m_new_move_label_string));
m_rotate_Label->SetLabel(_(m_new_rotate_label_string));
m_scale_Label->SetLabel(_(m_new_scale_label_string));
@ -446,9 +442,9 @@ void ObjectManipulation::update_if_dirty()
m_og->enable();
else
m_og->disable();
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
m_dirty = false;
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
}
void ObjectManipulation::reset_settings_value()
@ -461,9 +457,7 @@ void ObjectManipulation::reset_settings_value()
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
m_cache.instance.reset();
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
#if !ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
m_dirty = true;
#endif // !ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
}
void ObjectManipulation::change_position_value(const Vec3d& position)

View file

@ -62,10 +62,8 @@ class ObjectManipulation : public OG_Settings
wxStaticText* m_scale_Label = nullptr;
wxStaticText* m_rotate_Label = nullptr;
#if !ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
// Needs to be updated from OnIdle?
bool m_dirty = false;
#endif // !ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
// Cached labels for the delayed update, not localized!
std::string m_new_move_label_string;
std::string m_new_rotate_label_string;