New selection set as default

This commit is contained in:
Enrico Turri 2018-11-01 10:06:55 +01:00
parent 0d282896d0
commit a15bf7cc25
16 changed files with 20 additions and 2149 deletions

View file

@ -290,12 +290,6 @@ public:
float render_color[4];
// An ID containing the object ID, volume ID and instance ID.
int composite_id;
#if !ENABLE_EXTENDED_SELECTION
// An ID for group selection. It may be the same for all meshes of all object instances, or for just a single object instance.
int select_group_id;
// An ID for group dragging. It may be the same for all meshes of all object instances, or for just a single object instance.
int drag_group_id;
#endif // !ENABLE_EXTENDED_SELECTION
// An ID containing the extruder ID (used to select color).
int extruder_id;
// Is this object selected?
@ -365,9 +359,7 @@ public:
const Vec3d& get_rotation() const;
void set_rotation(const Vec3d& rotation);
#if ENABLE_EXTENDED_SELECTION
const Vec3d& get_scaling_factor() const;
#endif // ENABLE_EXTENDED_SELECTION
void set_scaling_factor(const Vec3d& scaling_factor);
const Vec3d& get_mirror() const;
@ -381,11 +373,6 @@ public:
void set_convex_hull(const TriangleMesh& convex_hull);
#if !ENABLE_EXTENDED_SELECTION
void set_select_group_id(const std::string& select_by);
void set_drag_group_id(const std::string& drag_by);
#endif // !ENABLE_EXTENDED_SELECTION
int object_idx() const { return this->composite_id / 1000000; }
int volume_idx() const { return (this->composite_id / 1000) % 1000; }
int instance_idx() const { return this->composite_id % 1000; }
@ -450,9 +437,7 @@ public:
#endif // ENABLE_MODELVOLUME_TRANSFORM
};
#if ENABLE_EXTENDED_SELECTION
typedef std::vector<GLVolume*> GLVolumePtrs;
#endif // ENABLE_EXTENDED_SELECTION
class GLVolumeCollection
{
@ -461,32 +446,17 @@ class GLVolumeCollection
float print_box_max[3];
public:
#if ENABLE_EXTENDED_SELECTION
GLVolumePtrs volumes;
#else
std::vector<GLVolume*> volumes;
#endif // ENABLE_EXTENDED_SELECTION
GLVolumeCollection() {};
~GLVolumeCollection() { clear(); };
#if ENABLE_EXTENDED_SELECTION
std::vector<int> load_object(
const ModelObject *model_object,
int obj_idx,
const std::vector<int> &instance_idxs,
const std::string &color_by,
bool use_VBOs);
#else
std::vector<int> load_object(
const ModelObject *model_object,
int obj_idx,
const std::vector<int> &instance_idxs,
const std::string &color_by,
const std::string &select_by,
const std::string &drag_by,
bool use_VBOs);
#endif // ENABLE_EXTENDED_SELECTION
int load_wipe_tower_preview(
int obj_idx, float pos_x, float pos_y, float width, float depth, float height, float rotation_angle, bool use_VBOs, bool size_unknown, float brim_width);
@ -520,11 +490,6 @@ public:
void update_colors_by_extruder(const DynamicPrintConfig* config);
#if !ENABLE_EXTENDED_SELECTION
void set_select_by(const std::string& select_by);
void set_drag_by(const std::string& drag_by);
#endif // !ENABLE_EXTENDED_SELECTION
// Returns a vector containing the sorted list of all the print_zs of the volumes contained in this collection
std::vector<double> get_current_print_zs(bool active_only) const;
@ -552,20 +517,11 @@ public:
static unsigned int get_volumes_count(wxGLCanvas* canvas);
static void reset_volumes(wxGLCanvas* canvas);
#if !ENABLE_EXTENDED_SELECTION
static void deselect_volumes(wxGLCanvas* canvas);
static void select_volume(wxGLCanvas* canvas, unsigned int id);
static void update_volumes_selection(wxGLCanvas* canvas, const std::vector<int>& selections);
#endif // !ENABLE_EXTENDED_SELECTION
static int check_volumes_outside_state(wxGLCanvas* canvas, const DynamicPrintConfig* config);
static bool move_volume_up(wxGLCanvas* canvas, unsigned int id);
static bool move_volume_down(wxGLCanvas* canvas, unsigned int id);
#if ENABLE_EXTENDED_SELECTION
static GUI::GLCanvas3D* get_canvas(wxGLCanvas* canvas);
#else
static void set_objects_selections(wxGLCanvas* canvas, const std::vector<int>& selections);
#endif // ENABLE_EXTENDED_SELECTION
static void set_config(wxGLCanvas* canvas, DynamicPrintConfig* config);
static void set_print(wxGLCanvas* canvas, Print* print);
@ -581,12 +537,6 @@ public:
static void set_cutting_plane(wxGLCanvas* canvas, float z, const ExPolygons& polygons);
static void set_color_by(wxGLCanvas* canvas, const std::string& value);
#if !ENABLE_EXTENDED_SELECTION
static void set_select_by(wxGLCanvas* canvas, const std::string& value);
static void set_drag_by(wxGLCanvas* canvas, const std::string& value);
static std::string get_select_by(wxGLCanvas* canvas);
#endif // !ENABLE_EXTENDED_SELECTION
static bool is_layers_editing_enabled(wxGLCanvas* canvas);
static bool is_layers_editing_allowed(wxGLCanvas* canvas);
@ -628,9 +578,7 @@ public:
static int get_first_volume_id(wxGLCanvas* canvas, int obj_idx);
static int get_in_object_volume_id(wxGLCanvas* canvas, int scene_vol_idx);
#if ENABLE_EXTENDED_SELECTION
static void mirror_selection(wxGLCanvas* canvas, Axis axis);
#endif // ENABLE_EXTENDED_SELECTION
static void reload_scene(wxGLCanvas* canvas, bool force);