diff --git a/src/GUI/GUI.hpp b/src/GUI/GUI.hpp index b0bad5d48..2e88b8185 100644 --- a/src/GUI/GUI.hpp +++ b/src/GUI/GUI.hpp @@ -18,6 +18,12 @@ namespace Slic3r { namespace GUI { class App: public wxApp { public: + /// If set to a file path, Slic3r will automatically export to it the active configuration whenever an option is changed or a preset or selected. + wxString autosave {""}; + + /// The directory where presets and config are stored. If empty, Slic3r will default to the location provided by wxWidgets. + wxString datadir {""}; + virtual bool OnInit() override; App() : wxApp() {} @@ -42,8 +48,6 @@ private: void load_presets(); - wxString autosave {""}; - wxString datadir {""}; const std::string LogChannel {"APP"}; //< Which log these messages should go to. /// Lock to guard the callback stack diff --git a/src/slic3r.hpp b/src/slic3r.hpp index f22cc4794..c4bb43b40 100644 --- a/src/slic3r.hpp +++ b/src/slic3r.hpp @@ -19,8 +19,12 @@ class CLI { t_config_option_keys input_files, actions, transforms; std::vector models; + /// Prints usage of the CLI. void print_help(bool include_print_options = false) const; + + /// Exports loaded models to a file of the specified format, according to the options affecting output filename. void export_models(IO::ExportFormat format); + std::string output_filepath(const Model &model, IO::ExportFormat format) const; }; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index ad9839750..817644693 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -657,8 +657,13 @@ class CLIMiscConfigDef : public ConfigDef CLIMiscConfigDef(); }; +// This class defines the command line options representing actions. extern const CLIActionsConfigDef cli_actions_config_def; + +// This class defines the command line options representing transforms. extern const CLITransformConfigDef cli_transform_config_def; + +// This class defines all command line options that are not actions or transforms. extern const CLIMiscConfigDef cli_misc_config_def; } diff --git a/xs/src/libslic3r/SimplePrint.hpp b/xs/src/libslic3r/SimplePrint.hpp index 8691d69c1..b6e9ad2f6 100644 --- a/xs/src/libslic3r/SimplePrint.hpp +++ b/xs/src/libslic3r/SimplePrint.hpp @@ -17,6 +17,8 @@ class SimplePrint { double total_extruded_volume() const { return this->_print.total_extruded_volume; } void set_model(const Model &model); void export_gcode(std::string outfile); + const Model& model() const { return this->_model; }; + const Print& print() const { return this->_print; }; private: Model _model; diff --git a/xs/src/libslic3r/TriangleMesh.cpp b/xs/src/libslic3r/TriangleMesh.cpp index 874b01b3a..32b65ce86 100644 --- a/xs/src/libslic3r/TriangleMesh.cpp +++ b/xs/src/libslic3r/TriangleMesh.cpp @@ -404,7 +404,7 @@ Pointf3s TriangleMesh::vertices() if (this->stl.v_shared == nullptr) stl_generate_shared_vertices(&stl); // build the list of vertices for (auto i = 0; i < this->stl.stats.shared_vertices; i++) { - const stl_vertex& v { this->stl.v_shared[i] }; + const auto& v = this->stl.v_shared[i]; tmp.emplace_back(Pointf3(v.x, v.y, v.z)); } } else { @@ -420,7 +420,7 @@ Point3s TriangleMesh::facets() if (this->stl.v_shared == nullptr) stl_generate_shared_vertices(&stl); // build the list of vertices for (auto i = 0; i < stl.stats.number_of_facets; i++) { - const v_indices_struct& v { stl.v_indices[i] }; + const auto& v = stl.v_indices[i]; tmp.emplace_back(Point3(v.vertex[0], v.vertex[1], v.vertex[2])); } } else {