diff --git a/src/GUI/Plater.cpp b/src/GUI/Plater.cpp index 68ad6b5ed..499267e98 100644 --- a/src/GUI/Plater.cpp +++ b/src/GUI/Plater.cpp @@ -328,7 +328,7 @@ std::vector Plater::load_model_objects(ModelObjectPtrs model_objects) { MainFrame* Plater::GetFrame() { return dynamic_cast(wxGetTopLevelParent(this)); } -int Plater::get_object_index(size_t object_id) { +int Plater::get_object_index(ObjIdx object_id) { for (size_t i = 0U; i < this->objects.size(); i++) { if (this->objects.at(i).identifier == object_id) return static_cast(i); } diff --git a/src/GUI/Plater.hpp b/src/GUI/Plater.hpp index a91053a8b..c73899b13 100644 --- a/src/GUI/Plater.hpp +++ b/src/GUI/Plater.hpp @@ -28,7 +28,8 @@ namespace Slic3r { namespace GUI { using UndoOperation = int; -using obj_index = unsigned int; +using ObjIdx = unsigned int; +using ObjRef = std::vector::iterator; class PlaterObject; class Plate2D; @@ -99,8 +100,13 @@ private: /// Method to get the top-level window and cast it as a MainFrame. MainFrame* GetFrame(); - void select_object(size_t& obj_idx) { }; - int get_object_index(size_t object_id); + void select_object(ObjRef obj_idx); + void select_object(ObjIdx obj_idx); + + /// Overload to unselect objects + void select_object(); + + int get_object_index(ObjIdx object_id); /// Get the center of the configured bed's bounding box. Slic3r::Pointf bed_centerf() {