Minor improvements to code quality

This commit is contained in:
Alessandro Ranellucci 2018-11-24 13:08:33 +01:00 committed by Joseph Lenox
parent f0f36cb935
commit a20adee38c
5 changed files with 19 additions and 4 deletions

View File

@ -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

View File

@ -19,8 +19,12 @@ class CLI {
t_config_option_keys input_files, actions, transforms;
std::vector<Model> 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;
};

View File

@ -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;
}

View File

@ -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;

View File

@ -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 {