From edceb80b1805487c7d8e0fd59687ded7ad4f42c0 Mon Sep 17 00:00:00 2001
From: Lukas Matena <lukasmatena@seznam.cz>
Date: Sat, 3 Nov 2018 08:46:51 +0100
Subject: [PATCH] Updated function names in GLCanvas3D.cpp (mismatch caused by
 two conflicting commits yesterday)

---
 src/slic3r/GUI/GLCanvas3D.cpp | 12 +++++-------
 src/slic3r/GUI/GLCanvas3D.hpp |  3 ++-
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp
index a09e33b68..0009f9e7a 100644
--- a/src/slic3r/GUI/GLCanvas3D.cpp
+++ b/src/slic3r/GUI/GLCanvas3D.cpp
@@ -1396,9 +1396,7 @@ int GLCanvas3D::Selection::get_instance_idx() const
 
 const GLCanvas3D::Selection::InstanceIdxsList& GLCanvas3D::Selection::get_instance_idxs() const
 {
-    if (m_cache.content.size() != 1)
-        throw std::runtime_error("get_instance_idxs() called for multiple object selection.");
-
+    assert(m_cache.content.size() == 1);
     return m_cache.content.begin()->second;
 }
 
@@ -1502,10 +1500,10 @@ void GLCanvas3D::Selection::flattening_rotate(const Vec3d& normal)
 
     for (unsigned int i : m_list)
     {
-        Vec3d scaling_factor = m_cache.volumes_data[i].get_scaling_factor();
+        Vec3d scaling_factor = m_cache.volumes_data[i].get_volume_scaling_factor();
         scaling_factor = Vec3d(1./scaling_factor(0), 1./scaling_factor(1), 1./scaling_factor(2));
 
-        Vec3d transformed_normal = Geometry::assemble_transform(Vec3d::Zero(), m_cache.volumes_data[i].get_rotation(), scaling_factor) * normal;
+        Vec3d transformed_normal = Geometry::assemble_transform(Vec3d::Zero(), m_cache.volumes_data[i].get_volume_rotation(), scaling_factor) * normal;
         transformed_normal.normalize();
 
         Vec3d axis = transformed_normal(2) > 0.999f ? Vec3d(1., 0., 0.) : Vec3d(transformed_normal.cross(Vec3d(0., 0., -1.)));
@@ -1514,8 +1512,8 @@ void GLCanvas3D::Selection::flattening_rotate(const Vec3d& normal)
         Transform3d extra_rotation = Transform3d::Identity();
         extra_rotation.rotate(Eigen::AngleAxisd(acos(-transformed_normal(2)), axis));
 
-        Vec3d new_rotation = Geometry::extract_euler_angles(extra_rotation * m_cache.volumes_data[i].get_rotation_matrix() );
-        (*m_volumes)[i]->set_rotation(new_rotation);
+        Vec3d new_rotation = Geometry::extract_euler_angles(extra_rotation * m_cache.volumes_data[i].get_volume_rotation_matrix() );
+        (*m_volumes)[i]->set_volume_rotation(new_rotation);
     }
     m_bounding_box_dirty = true;
 }
diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp
index fdbb67011..7318d00c9 100644
--- a/src/slic3r/GUI/GLCanvas3D.hpp
+++ b/src/slic3r/GUI/GLCanvas3D.hpp
@@ -496,7 +496,8 @@ public:
         int get_object_idx() const;
         // Returns the instance id if the selection is from a single object and from a single instance, otherwise is -1
         int get_instance_idx() const;
-        // Returns the indices of selected instances if the selection is from a single object, throws otherwise!
+        // Returns the indices of selected instances.
+        // Can only be called if selection is from a single object.
         const InstanceIdxsList& get_instance_idxs() const;
 
         const IndicesList& get_volume_idxs() const { return m_list; }