mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 15:05:57 +08:00
Minor improvements to code quality
This commit is contained in:
parent
f0f36cb935
commit
a20adee38c
@ -18,6 +18,12 @@ namespace Slic3r { namespace GUI {
|
|||||||
class App: public wxApp
|
class App: public wxApp
|
||||||
{
|
{
|
||||||
public:
|
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;
|
virtual bool OnInit() override;
|
||||||
App() : wxApp() {}
|
App() : wxApp() {}
|
||||||
|
|
||||||
@ -42,8 +48,6 @@ private:
|
|||||||
|
|
||||||
void load_presets();
|
void load_presets();
|
||||||
|
|
||||||
wxString autosave {""};
|
|
||||||
wxString datadir {""};
|
|
||||||
const std::string LogChannel {"APP"}; //< Which log these messages should go to.
|
const std::string LogChannel {"APP"}; //< Which log these messages should go to.
|
||||||
|
|
||||||
/// Lock to guard the callback stack
|
/// Lock to guard the callback stack
|
||||||
|
@ -19,8 +19,12 @@ class CLI {
|
|||||||
t_config_option_keys input_files, actions, transforms;
|
t_config_option_keys input_files, actions, transforms;
|
||||||
std::vector<Model> models;
|
std::vector<Model> models;
|
||||||
|
|
||||||
|
/// Prints usage of the CLI.
|
||||||
void print_help(bool include_print_options = false) const;
|
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);
|
void export_models(IO::ExportFormat format);
|
||||||
|
|
||||||
std::string output_filepath(const Model &model, IO::ExportFormat format) const;
|
std::string output_filepath(const Model &model, IO::ExportFormat format) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -657,8 +657,13 @@ class CLIMiscConfigDef : public ConfigDef
|
|||||||
CLIMiscConfigDef();
|
CLIMiscConfigDef();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// This class defines the command line options representing actions.
|
||||||
extern const CLIActionsConfigDef cli_actions_config_def;
|
extern const CLIActionsConfigDef cli_actions_config_def;
|
||||||
|
|
||||||
|
// This class defines the command line options representing transforms.
|
||||||
extern const CLITransformConfigDef cli_transform_config_def;
|
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;
|
extern const CLIMiscConfigDef cli_misc_config_def;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@ class SimplePrint {
|
|||||||
double total_extruded_volume() const { return this->_print.total_extruded_volume; }
|
double total_extruded_volume() const { return this->_print.total_extruded_volume; }
|
||||||
void set_model(const Model &model);
|
void set_model(const Model &model);
|
||||||
void export_gcode(std::string outfile);
|
void export_gcode(std::string outfile);
|
||||||
|
const Model& model() const { return this->_model; };
|
||||||
|
const Print& print() const { return this->_print; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Model _model;
|
Model _model;
|
||||||
|
@ -404,7 +404,7 @@ Pointf3s TriangleMesh::vertices()
|
|||||||
if (this->stl.v_shared == nullptr)
|
if (this->stl.v_shared == nullptr)
|
||||||
stl_generate_shared_vertices(&stl); // build the list of vertices
|
stl_generate_shared_vertices(&stl); // build the list of vertices
|
||||||
for (auto i = 0; i < this->stl.stats.shared_vertices; i++) {
|
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));
|
tmp.emplace_back(Pointf3(v.x, v.y, v.z));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -420,7 +420,7 @@ Point3s TriangleMesh::facets()
|
|||||||
if (this->stl.v_shared == nullptr)
|
if (this->stl.v_shared == nullptr)
|
||||||
stl_generate_shared_vertices(&stl); // build the list of vertices
|
stl_generate_shared_vertices(&stl); // build the list of vertices
|
||||||
for (auto i = 0; i < stl.stats.number_of_facets; i++) {
|
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]));
|
tmp.emplace_back(Point3(v.vertex[0], v.vertex[1], v.vertex[2]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user