Merge branch 'master' of https://github.com/prusa3d/Slic3r into et_copy_and_paste

This commit is contained in:
Enrico Turri
2019-04-24 08:17:33 +02:00
5 changed files with 26 additions and 31 deletions

View File

@@ -12,7 +12,6 @@ add_subdirectory(poly2tri)
add_subdirectory(qhull)
add_subdirectory(Shiny)
add_subdirectory(semver)
add_subdirectory(imgui)
# Adding libnest2d project for bin packing...
set(LIBNEST2D_UNITTESTS ON CACHE BOOL "Force generating unittests for libnest2d")
@@ -24,6 +23,8 @@ include_directories(${LIBDIR}/qhull/src)
add_subdirectory(libslic3r)
if (SLIC3R_GUI)
add_subdirectory(imgui)
if(WIN32)
message(STATUS "WXWIN environment set to: $ENV{WXWIN}")
elseif(UNIX)
@@ -56,9 +57,10 @@ if (SLIC3R_GUI)
endif()
include(${wxWidgets_USE_FILE})
add_subdirectory(slic3r)
endif()
add_subdirectory(slic3r)
# Create a slic3r executable
# Process mainfests for various platforms.
@@ -88,7 +90,8 @@ elseif (MSVC)
# Manifest is provided through slic3r.rc, don't generate your own.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
else ()
target_link_libraries(slic3r ${CMAKE_DL_LIBS} -lstdc++)
# Boost on Raspberry-Pi does not link to pthreads explicitely.
target_link_libraries(slic3r ${CMAKE_DL_LIBS} -lstdc++ Threads::Threads)
endif ()
# Add the Slic3r GUI library, libcurl, OpenGL and GLU libraries.

View File

@@ -508,31 +508,15 @@ void ObjectManipulation::on_fill_empty_value(const std::string& opt_key)
std::copy(opt_key.begin(), opt_key.end() - 2, std::back_inserter(param));
double value = 0.0;
if (param == "position") {
int axis = opt_key.back() == 'x' ? 0 :
opt_key.back() == 'y' ? 1 : 2;
value = m_cache.position(axis);
}
else if (param == "rotation") {
int axis = opt_key.back() == 'x' ? 0 :
opt_key.back() == 'y' ? 1 : 2;
value = m_cache.rotation(axis);
}
else if (param == "scale") {
int axis = opt_key.back() == 'x' ? 0 :
opt_key.back() == 'y' ? 1 : 2;
value = m_cache.scale(axis);
}
else if (param == "size") {
int axis = opt_key.back() == 'x' ? 0 :
opt_key.back() == 'y' ? 1 : 2;
value = m_cache.size(axis);
}
auto opt_key_to_axis = [&opt_key]() { return opt_key.back() == 'x' ? 0 : opt_key.back() == 'y' ? 1 : 2; };
if (param == "position")
value = m_cache.position(opt_key_to_axis());
else if (param == "rotation")
value = m_cache.rotation(opt_key_to_axis());
else if (param == "scale")
value = m_cache.scale(opt_key_to_axis());
else if (param == "size")
value = m_cache.size(opt_key_to_axis());
m_og->set_value(opt_key, double_to_string(value));
}

View File

@@ -86,6 +86,8 @@ public:
wxSizer* sizer {nullptr};
column_t extra_column {nullptr};
t_change m_on_change { nullptr };
// To be called when the field loses focus, to assign a new initial value to the field.
// Used by the relative position / rotation / scale manipulation fields of the Object Manipulation UI.
t_kill_focus m_fill_empty_value { nullptr };
t_kill_focus m_set_focus { nullptr };
std::function<DynamicPrintConfig()> m_get_initial_config{ nullptr };