Browse Source

fix linux debug build

supermerill 9 months ago
parent
commit
7bc92d156d

+ 5 - 4
src/libslic3r/AppConfig.cpp

@@ -1,10 +1,12 @@
-#include "libslic3r/libslic3r.h"
-#include "libslic3r/Utils.hpp"
 #include "AppConfig.hpp"
+
+#include "libslic3r.h"
+#include "format.hpp"
 #include "Exception.hpp"
+#include "I18N.hpp"
 #include "LocalesUtils.hpp"
 #include "Thread.hpp"
-#include "format.hpp"
+#include "Utils.hpp"
 
 #include <utility>
 #include <vector>
@@ -13,7 +15,6 @@
 #include <boost/algorithm/string/predicate.hpp>
 #include <boost/filesystem/directory.hpp>
 #include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
 #include <boost/format/format_fwd.hpp>
 #include <boost/locale.hpp>
 #include <boost/log/trivial.hpp>

+ 1 - 0
src/libslic3r/AppConfig.hpp

@@ -6,6 +6,7 @@
 #include <string>
 
 #include <boost/algorithm/string/trim_all.hpp>
+#include <boost/filesystem/path.hpp>
 
 #include "libslic3r/Config.hpp"
 #include "libslic3r/Semver.hpp"

+ 12 - 12
src/libslic3r/Config.hpp

@@ -820,9 +820,9 @@ public:
                     return false;
             return true;
         } else {
-            return idx < values.size() ? (std::isnan(this->values[idx]) || NIL_VALUE() == this->values[idx]) :
-                   values.empty()      ? (std::isnan(this->default_value) || NIL_VALUE() == this->default_value) :
-                                         (std::isnan(this->values.front()) || NIL_VALUE() == this->values.front());
+            return idx < int32_t(values.size()) ? (std::isnan(this->values[idx]) || NIL_VALUE() == this->values[idx]) :
+                   values.empty()               ? (std::isnan(this->default_value) || NIL_VALUE() == this->default_value) :
+                                                  (std::isnan(this->values.front()) || NIL_VALUE() == this->values.front());
         }
     }
     double                  get_float(size_t idx = 0) const override { return get_at(idx); }
@@ -1004,9 +1004,9 @@ public:
                     return false;
             return true;
         } else {
-            return idx < values.size() ? NIL_VALUE() == this->values[idx] :
-                   values.empty()      ? NIL_VALUE() == this->default_value :
-                                         NIL_VALUE() == this->values.front();
+            return idx < int32_t(values.size()) ? NIL_VALUE() == this->values[idx] :
+                   values.empty()               ? NIL_VALUE() == this->default_value :
+                                                  NIL_VALUE() == this->values.front();
         }
     }
     int32_t                 get_int(size_t idx = 0) const override { return get_at(idx); }
@@ -1349,9 +1349,9 @@ public:
                     return false;
             return true;
         } else {
-            return idx < values.size() ? (std::isnan(this->values[idx].value) || NIL_VALUE() == this->values[idx]) :
-                   values.empty()      ? (std::isnan(this->default_value.value) || NIL_VALUE() == this->default_value) :
-                                         (std::isnan(this->values.front().value) || NIL_VALUE() == this->values.front());
+            return idx < int32_t(values.size()) ? (std::isnan(this->values[idx].value) || NIL_VALUE() == this->values[idx]) :
+                   values.empty()               ? (std::isnan(this->default_value.value) || NIL_VALUE() == this->default_value) :
+                                                  (std::isnan(this->values.front().value) || NIL_VALUE() == this->values.front());
         }
     }
     double                  get_abs_value(size_t i, double ratio_over) const {
@@ -1718,9 +1718,9 @@ public:
                     return false;
             return true;
         } else {
-            return idx < values.size() ? NIL_VALUE() == this->values[idx] :
-                   values.empty()      ? NIL_VALUE() == this->default_value :
-                                         NIL_VALUE() == this->values.front();
+            return idx < int32_t(values.size()) ? NIL_VALUE() == this->values[idx] :
+                   values.empty()               ? NIL_VALUE() == this->default_value :
+                                                  NIL_VALUE() == this->values.front();
         }
     }
     bool                    get_bool(size_t idx = 0) const override { return ConfigOptionVector<unsigned char>::get_at(idx) != 0; }

+ 8 - 0
src/libslic3r/ExtrusionEntity.cpp

@@ -2,6 +2,7 @@
 #include "ExtrusionEntityCollection.hpp"
 #include "ExPolygonCollection.hpp"
 #include "ClipperUtils.hpp"
+#include "Config.hpp"
 #include "Extruder.hpp"
 #include "Flow.hpp"
 #include <cmath>
@@ -592,6 +593,13 @@ bool HasRoleVisitor::search(const ExtrusionEntitiesPtr &entities, HasRoleVisitor
     return visitor.found;
 }
 
+void SimplifyVisitor::use(ExtrusionPath& path) {
+    path.simplify(m_scaled_resolution, m_use_arc_fitting, scale_d(m_arc_fitting_tolearance->get_abs_value(path.width)));
+}
+void SimplifyVisitor::use(ExtrusionPath3D& path3D) {
+    path3D.simplify(m_scaled_resolution, m_use_arc_fitting, scale_d(m_arc_fitting_tolearance->get_abs_value(path3D.width)));
+}
+
 //class ExtrusionTreeVisitor : ExtrusionVisitor {
 //public:
 //    //virtual void use(ExtrusionEntity &entity) { assert(false); };

+ 3 - 6
src/libslic3r/ExtrusionEntity.hpp

@@ -637,18 +637,15 @@ struct HasThisRoleVisitor : public HasRoleVisitor{
 
 
 //call simplify for all paths.
+class ConfigOptionFloatOrPercent;
 class SimplifyVisitor : public ExtrusionVisitorRecursive {
     bool m_use_arc_fitting;
     coordf_t m_scaled_resolution;
     const ConfigOptionFloatOrPercent* m_arc_fitting_tolearance;
 public:
     SimplifyVisitor(coordf_t scaled_resolution, bool use_arc_fitting, const ConfigOptionFloatOrPercent* arc_fitting_tolearance) : m_scaled_resolution(scaled_resolution), m_use_arc_fitting(use_arc_fitting), m_arc_fitting_tolearance(arc_fitting_tolearance){}
-    virtual void use(ExtrusionPath& path) override {
-        path.simplify(m_scaled_resolution, m_use_arc_fitting, scale_d(m_arc_fitting_tolearance->get_abs_value(path.width)));
-    }
-    virtual void use(ExtrusionPath3D& path3D) override {
-        path3D.simplify(m_scaled_resolution, m_use_arc_fitting, scale_d(m_arc_fitting_tolearance->get_abs_value(path3D.width)));
-    }
+    virtual void use(ExtrusionPath& path) override;
+    virtual void use(ExtrusionPath3D& path3D) override;
 };
 class GetPathsVisitor : public ExtrusionVisitorRecursive {
 public:

+ 1 - 0
src/libslic3r/Flow.cpp

@@ -6,6 +6,7 @@
 #include <assert.h>
 
 #include <boost/algorithm/string/predicate.hpp>
+#include <boost/algorithm/string/replace.hpp>
 
 // Mark string for localization and translate.
 #define L(s) Slic3r::I18N::translate(s)

+ 5 - 0
src/libslic3r/Format/BBConfig.cpp

@@ -9,6 +9,11 @@
 #include <map>
 #include <string>
 
+#include <boost/algorithm/string/replace.hpp>
+#include <boost/log/trivial.hpp>
+#include <boost/property_tree/ini_parser.hpp>
+#include <boost/property_tree/ptree.hpp>
+
 namespace Slic3r {
     
 namespace BBConfiguration {

+ 6 - 0
src/libslic3r/Format/BBConfig.hpp

@@ -3,19 +3,25 @@
 
 #include "miniz_extension.hpp"
 
+
+#include <map>
+
 #ifdef __APPLE__
     #include <boost/filesystem.hpp>
+    #include <boost/nowide/fstream.hpp>
     typedef boost::filesystem::path std_path;
     typedef boost::nowide::ifstream std_ifstream;
     #define GET_STD_PATH_FOR_IFSTREAM(PARAM) PARAM.string()
 #else
     #include <filesystem>
+    #include <fstream>
     typedef std::filesystem::path std_path;
     typedef std::ifstream std_ifstream;
     #define GET_STD_PATH_FOR_IFSTREAM(PARAM) PARAM
 #endif
 
 namespace Slic3r {
+struct ConfigSubstitutionContext;
 class DynamicPrintConfig;
 class Model;
 class ModelConfigObject;

+ 7 - 6
src/libslic3r/Format/bbs_3mf.cpp

@@ -23,12 +23,12 @@
 
 
 #include <limits>
+#include <mutex>
 #include <stdexcept>
 #include <iomanip>
 
 #include <boost/assign.hpp>
 #include <boost/bimap.hpp>
-
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <boost/algorithm/string/predicate.hpp>
@@ -47,6 +47,7 @@
 
 namespace pt = boost::property_tree;
 
+#include <tbb/parallel_for.h>
 #include <tbb/parallel_reduce.h>
 
 #include <expat.h>
@@ -721,11 +722,11 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
     // Base class with error messages management
     class _BBS_3MF_Base
     {
-        mutable boost::mutex mutex;
+        mutable std::mutex mutex_error;
         mutable std::vector<std::string> m_errors;
 
     protected:
-        void add_error(const std::string& error) const { boost::unique_lock l(mutex); m_errors.push_back(error); }
+        void add_error(const std::string& error) const { std::lock_guard l(mutex_error); m_errors.push_back(error); }
         void clear_errors() { m_errors.clear(); }
 
     public:
@@ -1770,15 +1771,15 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
             }
 
             bool object_load_result = true;
-            boost::mutex mutex;
+            std::mutex mutex_load;
             tbb::parallel_for(
                 tbb::blocked_range<size_t>(0, m_object_importers.size()),
-                [this, &mutex, &object_load_result](const tbb::blocked_range<size_t>& importer_range) {
+                [this, &mutex_load, &object_load_result](const tbb::blocked_range<size_t>& importer_range) {
                     CNumericLocalesSetter locales_setter;
                     for (size_t object_index = importer_range.begin(); object_index < importer_range.end(); ++ object_index) {
                         bool result = m_object_importers[object_index]->extract_object_model();
                         {
-                            boost::unique_lock l(mutex);
+                            std::lock_guard l(mutex_load);
                             object_load_result &= result;
                         }
                     }

+ 3 - 2
src/libslic3r/GCode/FanMover.cpp

@@ -4,6 +4,9 @@
 #include "LocalesUtils.hpp"
 
 #include <iomanip>
+
+#include <boost/log/trivial.hpp>
+
 /*
 #include <memory.h>
 #include <string.h>
@@ -13,8 +16,6 @@
 #include "../PrintConfig.hpp"
 #include "../Utils.hpp"
 #include "Print.hpp"
-
-#include <boost/log/trivial.hpp>
 */
 
 

Some files were not shown because too many files changed in this diff