mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 12:32:01 +08:00
Set typedef (via using directive) for object references (iterators) and object indices.
This commit is contained in:
parent
872fd61706
commit
1d4e5775ae
@ -328,7 +328,7 @@ std::vector<int> Plater::load_model_objects(ModelObjectPtrs model_objects) {
|
||||
|
||||
MainFrame* Plater::GetFrame() { return dynamic_cast<MainFrame*>(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<int>(i);
|
||||
}
|
||||
|
@ -28,7 +28,8 @@
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
using UndoOperation = int;
|
||||
using obj_index = unsigned int;
|
||||
using ObjIdx = unsigned int;
|
||||
using ObjRef = std::vector<PlaterObject>::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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user