Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2019-03-13 18:06:21 +0300
committerbubnikv <bubnikv@gmail.com>2019-03-13 18:06:21 +0300
commit8d8df8b6700d9f98b8aed1dbe77af488b4fe40ef (patch)
treef30760291336ad8f3bf5ddefd8b6de71a5735544
parent2ba661cb7640a1393eb82889ab3e9906314d5237 (diff)
added missing slic3r.hpp
removed slic3r-noconsole.exe from the windows builds
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/slic3r.hpp48
2 files changed, 50 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b38ae3665..945328a00 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -88,9 +88,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/slic3r.rc.in ${CMAKE_CUR
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/slic3r.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.manifest @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY)
if (MSVC)
- add_library(slic3r SHARED slic3r.cpp)
+ add_library(slic3r SHARED slic3r.cpp slic3r.hpp)
else ()
- add_executable(slic3r slic3r.cpp)
+ add_executable(slic3r slic3r.cpp slic3r.hpp)
endif ()
if (NOT MSVC)
if(SLIC3R_GUI)
@@ -161,11 +161,6 @@ if (MSVC)
target_compile_definitions(slic3r_app_console PRIVATE -DSLIC3R_WRAPPER_CONSOLE -DSLIC3R_WRAPPER_NOGUI)
add_dependencies(slic3r_app_console slic3r)
set_target_properties(slic3r_app_console PROPERTIES OUTPUT_NAME "slic3r-console")
-
- add_executable(slic3r_app_noconsole WIN32 slic3r_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc)
- target_compile_definitions(slic3r_app_noconsole PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE -DSLIC3R_WRAPPER_NOGUI)
- add_dependencies(slic3r_app_noconsole slic3r)
- set_target_properties(slic3r_app_noconsole PROPERTIES OUTPUT_NAME "slic3r-noconsole")
endif ()
# Link the resources dir to where Slic3r GUI expects it
@@ -213,7 +208,6 @@ if (WIN32)
if (MSVC)
install(TARGETS slic3r_app_gui RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}")
install(TARGETS slic3r_app_console RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}")
- install(TARGETS slic3r_app_noconsole RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif ()
else ()
install(TARGETS slic3r RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
diff --git a/src/slic3r.hpp b/src/slic3r.hpp
new file mode 100644
index 000000000..f977dc9eb
--- /dev/null
+++ b/src/slic3r.hpp
@@ -0,0 +1,48 @@
+#ifndef SLIC3R_HPP
+#define SLIC3R_HPP
+
+#include "libslic3r/Config.hpp"
+#include "libslic3r/Model.hpp"
+
+namespace Slic3r {
+
+namespace IO {
+ enum ExportFormat : int {
+ AMF,
+ OBJ,
+ STL,
+ // SVG,
+ TMF,
+ Gcode
+ };
+}
+
+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<Model> m_models;
+
+ bool setup(int argc, char **argv);
+
+ /// 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.
+ bool export_models(IO::ExportFormat format);
+
+ bool has_print_action() const { return m_config.opt_bool("export_gcode") || m_config.opt_bool("export_sla"); }
+
+ std::string output_filepath(const Model &model, IO::ExportFormat format) const;
+};
+
+}
+
+#endif