mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-03 19:20:38 +08:00
PrusaSlicer reorganization: WIP
* Deleted old unused code. * Functions related to profiles sharing are removed from CLI and used as a free functions now. * Code blocks related to transformation and actions are extracted into separate free functions. * Added CLIParams struct to hold current parameters needed to process cli options
This commit is contained in:
parent
963f96b31f
commit
c8c85d3840
1467
src/PrusaSlicer.cpp
1467
src/PrusaSlicer.cpp
File diff suppressed because it is too large
Load Diff
@ -16,35 +16,32 @@ namespace IO {
|
||||
};
|
||||
}
|
||||
|
||||
struct CliInParams
|
||||
{
|
||||
DynamicPrintAndCLIConfig config;
|
||||
std::vector<std::string> input_files;
|
||||
std::vector<std::string> actions;
|
||||
std::vector<std::string> transforms;
|
||||
std::vector<std::string> profiles_sharing;
|
||||
};
|
||||
|
||||
struct CliOutParams
|
||||
{
|
||||
DynamicPrintConfig print_config;
|
||||
PrinterTechnology printer_technology;
|
||||
ForwardCompatibilitySubstitutionRule config_substitution_rule;
|
||||
std::vector<Model> models;
|
||||
bool user_center_specified { false };
|
||||
bool delete_after_load { false };
|
||||
};
|
||||
|
||||
class CLI {
|
||||
public:
|
||||
int run(int argc, char **argv);
|
||||
|
||||
private:
|
||||
DynamicPrintAndCLIConfig m_config;
|
||||
DynamicPrintConfig m_print_config;
|
||||
DynamicPrintConfig m_extra_config;
|
||||
std::vector<std::string> m_input_files;
|
||||
std::vector<std::string> m_actions;
|
||||
std::vector<std::string> m_transforms;
|
||||
std::vector<std::string> m_profiles_sharing;
|
||||
std::vector<Model> m_models;
|
||||
|
||||
bool setup(int argc, char **argv);
|
||||
|
||||
/// Prints usage of the CLI.
|
||||
void print_help(bool include_print_options = false, PrinterTechnology printer_technology = ptAny) const;
|
||||
|
||||
/// Exports loaded models to a file of the specified format, according to the options affecting output filename.
|
||||
bool export_models(IO::ExportFormat format);
|
||||
|
||||
bool has_print_action() const { return m_config.opt_bool("export_gcode") || m_config.opt_bool("export_sla"); }
|
||||
|
||||
bool processed_profiles_sharing();
|
||||
|
||||
bool check_and_load_input_profiles(PrinterTechnology& printer_technology);
|
||||
|
||||
std::string output_filepath(const Model &model, IO::ExportFormat format) const;
|
||||
bool setup(int argc, char **argv, CliInParams& in);
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user