From ab7109568a42b9172d5a947e71e362d755329389 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Wed, 4 Mar 2020 12:48:04 +0100 Subject: [PATCH] WIP: Fixed some compilation issues on OSX, fixed some "override" vs. "virtual" warnings. --- src/libslic3r/ExtrusionEntityCollection.hpp | 12 ++++++------ src/libslic3r/Polygon.hpp | 2 +- src/libslic3r/Polyline.hpp | 2 +- src/slic3r/GUI/Field.hpp | 8 ++++---- src/slic3r/GUI/Mouse3DHandlerMac.mm | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/libslic3r/ExtrusionEntityCollection.hpp b/src/libslic3r/ExtrusionEntityCollection.hpp index 8aacb4d46..271ac71f3 100644 --- a/src/libslic3r/ExtrusionEntityCollection.hpp +++ b/src/libslic3r/ExtrusionEntityCollection.hpp @@ -40,7 +40,7 @@ public: ~ExtrusionEntityCollection() { clear(); } explicit operator ExtrusionPaths() const; - bool is_collection() const { return true; } + bool is_collection() const override { return true; } ExtrusionRole role() const override { ExtrusionRole out = erNone; for (const ExtrusionEntity *ee : entities) { @@ -49,7 +49,7 @@ public: } return out; } - bool can_reverse() const { return !this->no_sort; } + bool can_reverse() const override { return !this->no_sort; } bool empty() const { return this->entities.empty(); } void clear(); void swap (ExtrusionEntityCollection &c); @@ -83,9 +83,9 @@ public: static ExtrusionEntityCollection chained_path_from(const ExtrusionEntitiesPtr &extrusion_entities, const Point &start_near, ExtrusionRole role = erMixed); ExtrusionEntityCollection chained_path_from(const Point &start_near, ExtrusionRole role = erMixed) const { return this->no_sort ? *this : chained_path_from(this->entities, start_near, role); } - void reverse(); - const Point& first_point() const { return this->entities.front()->first_point(); } - const Point& last_point() const { return this->entities.back()->last_point(); } + void reverse() override; + const Point& first_point() const override { return this->entities.front()->first_point(); } + const Point& last_point() const override { return this->entities.back()->last_point(); } // Produce a list of 2D polygons covered by the extruded paths, offsetted by the extrusion width. // Increase the offset by scaled_epsilon to achieve an overlap, so a union will produce no gaps. void polygons_covered_by_width(Polygons &out, const float scaled_epsilon) const override; @@ -102,7 +102,7 @@ public: /// You should be iterating over flatten().entities if you are interested in the underlying ExtrusionEntities (and don't care about hierarchy). /// \param preserve_ordering Flag to method that will flatten if and only if the underlying collection is sortable when True (default: False). ExtrusionEntityCollection flatten(bool preserve_ordering = false) const; - double min_mm3_per_mm() const; + double min_mm3_per_mm() const override; double total_volume() const override { double volume=0.; for (const auto& ent : entities) volume+=ent->total_volume(); return volume; } // Following methods shall never be called on an ExtrusionEntityCollection. diff --git a/src/libslic3r/Polygon.hpp b/src/libslic3r/Polygon.hpp index 8230b49f8..0f8457ebd 100644 --- a/src/libslic3r/Polygon.hpp +++ b/src/libslic3r/Polygon.hpp @@ -39,7 +39,7 @@ public: // last point == first point for polygons const Point& last_point() const override { return this->points.front(); } - virtual Lines lines() const; + Lines lines() const override; Polyline split_at_vertex(const Point &point) const; // Split a closed polygon into an open polyline, with the split point duplicated at both ends. Polyline split_at_index(int index) const; diff --git a/src/libslic3r/Polyline.hpp b/src/libslic3r/Polyline.hpp index 7e3a1e506..2a53a13f9 100644 --- a/src/libslic3r/Polyline.hpp +++ b/src/libslic3r/Polyline.hpp @@ -65,7 +65,7 @@ public: const Point& last_point() const override { return this->points.back(); } const Point& leftmost_point() const; - virtual Lines lines() const; + Lines lines() const override; void clip_end(double distance); void clip_start(double distance); void extend_end(double distance); diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp index ca0c77d5c..1f8b642b1 100644 --- a/src/slic3r/GUI/Field.hpp +++ b/src/slic3r/GUI/Field.hpp @@ -284,7 +284,7 @@ public: TextCtrl(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : Field(parent, opt, id) {} ~TextCtrl() {} - void BUILD(); + void BUILD() override; bool value_was_changed(); // Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER void propagate_value(); @@ -303,9 +303,9 @@ public: void msw_rescale(bool rescale_sidetext = false) override; - virtual void enable(); - virtual void disable(); - virtual wxWindow* getWindow() { return window; } + void enable() override; + void disable() override; + wxWindow* getWindow() override { return window; } }; class CheckBox : public Field { diff --git a/src/slic3r/GUI/Mouse3DHandlerMac.mm b/src/slic3r/GUI/Mouse3DHandlerMac.mm index 129a097e2..d40948cd1 100644 --- a/src/slic3r/GUI/Mouse3DHandlerMac.mm +++ b/src/slic3r/GUI/Mouse3DHandlerMac.mm @@ -126,7 +126,7 @@ static bool load_driver_functions() BOOST_LOG_TRIVIAL(error) << "3dx drivers module loading error: "<< dlerror() ; } - BOOST_LOG_TRIVIAL(info) << "3dx drivers loaded: "<< driver_loaded ? (has_new_driver ? "YES, new" : "YES, old") : "NO" ; + BOOST_LOG_TRIVIAL(info) << "3dx drivers loaded: " << (driver_loaded ? (has_new_driver ? "YES, new" : "YES, old") : "NO"); return driver_loaded; } @@ -164,7 +164,7 @@ static void DeviceEvent(uint32_t unused, uint32_t msg_type, void *msg_arg) case kConnexionCmdHandleAxis: { // The axis field is an array of 6 signed 16-bit integers corresponding to the 6 device axes. Data is ordered as Tx, Tz, Ty, Rx, Rz, Ry. The values reported are scaled by the driver according to the speed slider settings on the 3Dconnexion preference panel. At maximum speed, the range is - 1024 to 1024. Typical range that you should optimize your application for should be -500 to 500. // Actually we are getting values way over 1024. Max is probably 2048 now. - Mouse3DController::DataPacketAxis packet; + Slic3r::GUI::Mouse3DController::DataPacketAxis packet; for (int i = 0; i < 6; ++ i) packet[i] = (double)s->axis[i]/350.0;//wanted to divide by 500 but 350 is used at raw input so i used same value. mouse_3d_controller->handle_input(packet);