Fixed a bug, where std::string and wxString were mixed up.

This commit is contained in:
bubnikv 2019-04-29 18:10:08 +02:00
parent ebb7981d16
commit 5084d544a2
2 changed files with 11 additions and 8 deletions

View file

@ -301,8 +301,8 @@ void ObjectManipulation::update_if_dirty()
if (!m_dirty) if (!m_dirty)
return; return;
auto update_label = [](std::string &label_cache, const std::string &new_label, wxStaticText *widget) { auto update_label = [](wxString &label_cache, const std::string &new_label, wxStaticText *widget) {
std::string new_label_localized = _(new_label) + ":"; wxString new_label_localized = _(new_label) + ":";
if (label_cache != new_label_localized) { if (label_cache != new_label_localized) {
label_cache = new_label_localized; label_cache = new_label_localized;
widget->SetLabel(new_label_localized); widget->SetLabel(new_label_localized);
@ -420,6 +420,8 @@ void ObjectManipulation::change_rotation_value(int axis, double value)
transformation_type.set_local(); transformation_type.set_local();
} }
//FIXME if anisotropic scaling is required, and is_single_full_instance && m_world_coordinates, apply 90 degrees rotation of the rotation vector.
selection.start_dragging(); selection.start_dragging();
selection.rotate( selection.rotate(
(M_PI / 180.0) * (transformation_type.absolute() ? rotation : rotation - m_cache.rotation), (M_PI / 180.0) * (transformation_type.absolute() ? rotation : rotation - m_cache.rotation),
@ -490,6 +492,7 @@ void ObjectManipulation::do_scale(const Vec3d &scale) const
TransformationType transformation_type(TransformationType::World_Relative_Joint); TransformationType transformation_type(TransformationType::World_Relative_Joint);
if (selection.is_single_full_instance() && ! m_world_coordinates) if (selection.is_single_full_instance() && ! m_world_coordinates)
transformation_type.set_local(); transformation_type.set_local();
//FIXME if anisotropic scaling is required, and is_single_full_instance && m_world_coordinates, apply 90 degrees rotation of the scaling vector.
selection.start_dragging(); selection.start_dragging();
selection.scale(scaling_factor * 0.01, transformation_type); selection.scale(scaling_factor * 0.01, transformation_type);
wxGetApp().plater()->canvas3D()->do_scale(); wxGetApp().plater()->canvas3D()->do_scale();

View file

@ -28,9 +28,9 @@ class ObjectManipulation : public OG_Settings
Vec3d size; Vec3d size;
Vec3d size_rounded; Vec3d size_rounded;
std::string move_label_string; wxString move_label_string;
std::string rotate_label_string; wxString rotate_label_string;
std::string scale_label_string; wxString scale_label_string;
struct Instance struct Instance
{ {
@ -55,9 +55,9 @@ class ObjectManipulation : public OG_Settings
rotation = rotation_rounded = Vec3d(DBL_MAX, DBL_MAX, DBL_MAX); rotation = rotation_rounded = Vec3d(DBL_MAX, DBL_MAX, DBL_MAX);
scale = scale_rounded = Vec3d(DBL_MAX, DBL_MAX, DBL_MAX); scale = scale_rounded = Vec3d(DBL_MAX, DBL_MAX, DBL_MAX);
size = size_rounded = Vec3d(DBL_MAX, DBL_MAX, DBL_MAX); size = size_rounded = Vec3d(DBL_MAX, DBL_MAX, DBL_MAX);
move_label_string = ""; move_label_string = wxString();
rotate_label_string = ""; rotate_label_string = wxString();
scale_label_string = ""; scale_label_string = wxString();
instance.reset(); instance.reset();
} }
bool is_valid() const { return position != Vec3d(DBL_MAX, DBL_MAX, DBL_MAX); } bool is_valid() const { return position != Vec3d(DBL_MAX, DBL_MAX, DBL_MAX); }