Merge remote-tracking branch 'origin/master' into ys_new_features
This commit is contained in:
commit
7da9d2f66d
@ -240,17 +240,34 @@ if(NOT WIN32)
|
|||||||
set(MINIMUM_BOOST_VERSION "1.64.0")
|
set(MINIMUM_BOOST_VERSION "1.64.0")
|
||||||
endif()
|
endif()
|
||||||
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS system filesystem thread log locale regex)
|
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS system filesystem thread log locale regex)
|
||||||
if(Boost_FOUND)
|
|
||||||
# message("Boost include dir: ${Boost_INCLUDE_DIRS}")
|
add_library(boost_libs INTERFACE)
|
||||||
# message("Boost library dirs: ${Boost_LIBRARY_DIRS}")
|
add_library(boost_headeronly INTERFACE)
|
||||||
# message("Boost libraries: ${Boost_LIBRARIES}")
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
|
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
|
||||||
add_definitions(-DBOOST_ASIO_DISABLE_KQUEUE)
|
target_compile_definitions(boost_headeronly INTERFACE BOOST_ASIO_DISABLE_KQUEUE)
|
||||||
endif()
|
endif()
|
||||||
if(NOT SLIC3R_STATIC)
|
|
||||||
add_definitions(-DBOOST_LOG_DYN_LINK)
|
if(NOT SLIC3R_STATIC)
|
||||||
endif()
|
target_compile_definitions(boost_headeronly INTERFACE BOOST_LOG_DYN_LINK)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(TARGET Boost::system)
|
||||||
|
message(STATUS "Boost::boost exists")
|
||||||
|
target_link_libraries(boost_headeronly INTERFACE Boost::boost)
|
||||||
|
target_link_libraries(boost_libs INTERFACE
|
||||||
|
boost_headeronly # includes the custom compile definitions as well
|
||||||
|
Boost::system
|
||||||
|
Boost::filesystem
|
||||||
|
Boost::thread
|
||||||
|
Boost::log
|
||||||
|
Boost::locale
|
||||||
|
Boost::regex
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_include_directories(boost_headeronly INTERFACE ${Boost_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(boost_libs INTERFACE boost_headeronly ${Boost_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Find and configure intel-tbb
|
# Find and configure intel-tbb
|
||||||
|
@ -139,7 +139,7 @@ if (MSVC)
|
|||||||
target_compile_definitions(PrusaSlicer_app_gui PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE)
|
target_compile_definitions(PrusaSlicer_app_gui PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE)
|
||||||
add_dependencies(PrusaSlicer_app_gui PrusaSlicer)
|
add_dependencies(PrusaSlicer_app_gui PrusaSlicer)
|
||||||
set_target_properties(PrusaSlicer_app_gui PROPERTIES OUTPUT_NAME "prusa-slicer")
|
set_target_properties(PrusaSlicer_app_gui PROPERTIES OUTPUT_NAME "prusa-slicer")
|
||||||
target_include_directories(PrusaSlicer_app_gui SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
|
target_link_libraries(PrusaSlicer_app_gui PRIVATE boost_headeronly)
|
||||||
|
|
||||||
add_executable(PrusaSlicer_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/PrusaSlicer.rc)
|
add_executable(PrusaSlicer_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/PrusaSlicer.rc)
|
||||||
# Generate debug symbols even in release mode.
|
# Generate debug symbols even in release mode.
|
||||||
@ -147,7 +147,7 @@ if (MSVC)
|
|||||||
target_compile_definitions(PrusaSlicer_app_console PRIVATE -DSLIC3R_WRAPPER_CONSOLE)
|
target_compile_definitions(PrusaSlicer_app_console PRIVATE -DSLIC3R_WRAPPER_CONSOLE)
|
||||||
add_dependencies(PrusaSlicer_app_console PrusaSlicer)
|
add_dependencies(PrusaSlicer_app_console PrusaSlicer)
|
||||||
set_target_properties(PrusaSlicer_app_console PROPERTIES OUTPUT_NAME "prusa-slicer-console")
|
set_target_properties(PrusaSlicer_app_console PROPERTIES OUTPUT_NAME "prusa-slicer-console")
|
||||||
target_include_directories(PrusaSlicer_app_console SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
|
target_link_libraries(PrusaSlicer_app_console PRIVATE boost_headeronly)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Link the resources dir to where Slic3r GUI expects it
|
# Link the resources dir to where Slic3r GUI expects it
|
||||||
|
@ -11,4 +11,4 @@ add_library(admesh STATIC
|
|||||||
util.cpp
|
util.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(admesh SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})
|
target_link_libraries(admesh PRIVATE boost_headeronly)
|
||||||
|
@ -19,6 +19,6 @@ add_library(nowide STATIC
|
|||||||
nowide/windows.hpp
|
nowide/windows.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(nowide SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
|
target_link_libraries(nowide PUBLIC boost_headeronly)
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,12 +56,12 @@ endif()
|
|||||||
|
|
||||||
# Clipper backend is not enough on its own, it still needs some functions
|
# Clipper backend is not enough on its own, it still needs some functions
|
||||||
# from Boost geometry
|
# from Boost geometry
|
||||||
if(NOT Boost_INCLUDE_DIRS_FOUND)
|
if(NOT Boost_FOUND)
|
||||||
find_package(Boost 1.58 REQUIRED)
|
find_package(Boost 1.58 REQUIRED)
|
||||||
# TODO automatic download of boost geometry headers
|
# TODO automatic download of boost geometry headers
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(clipperBackend SYSTEM INTERFACE ${Boost_INCLUDE_DIRS} )
|
target_link_libraries(clipperBackend INTERFACE Boost::boost )
|
||||||
#target_sources(ClipperBackend INTERFACE
|
#target_sources(ClipperBackend INTERFACE
|
||||||
# ${CMAKE_CURRENT_SOURCE_DIR}/geometries.hpp
|
# ${CMAKE_CURRENT_SOURCE_DIR}/geometries.hpp
|
||||||
# ${CMAKE_CURRENT_SOURCE_DIR}/clipper_polygon.hpp
|
# ${CMAKE_CURRENT_SOURCE_DIR}/clipper_polygon.hpp
|
||||||
|
@ -182,13 +182,12 @@ if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY)
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_compile_definitions(libslic3r PUBLIC -DUSE_TBB)
|
target_compile_definitions(libslic3r PUBLIC -DUSE_TBB)
|
||||||
target_include_directories(libslic3r SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
|
|
||||||
target_include_directories(libslic3r PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${LIBNEST2D_INCLUDES} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(libslic3r PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${LIBNEST2D_INCLUDES} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_link_libraries(libslic3r
|
target_link_libraries(libslic3r
|
||||||
libnest2d
|
libnest2d
|
||||||
admesh
|
admesh
|
||||||
miniz
|
miniz
|
||||||
${Boost_LIBRARIES}
|
boost_libs
|
||||||
clipper
|
clipper
|
||||||
nowide
|
nowide
|
||||||
${EXPAT_LIBRARIES}
|
${EXPAT_LIBRARIES}
|
||||||
|
@ -19,8 +19,6 @@ wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(25 * wxGetApp().em_unit(), -
|
|||||||
m_user_drawn_background = false;
|
m_user_drawn_background = false;
|
||||||
#endif /*__APPLE__*/
|
#endif /*__APPLE__*/
|
||||||
Bind(wxEVT_PAINT, ([this](wxPaintEvent &/* e */) { repaint(); }));
|
Bind(wxEVT_PAINT, ([this](wxPaintEvent &/* e */) { repaint(); }));
|
||||||
Bind(wxEVT_LEFT_DOWN, ([this](wxMouseEvent &event) { mouse_event(event); }));
|
|
||||||
Bind(wxEVT_MOTION, ([this](wxMouseEvent &event) { mouse_event(event); }));
|
|
||||||
Bind(wxEVT_SIZE, ([this](wxSizeEvent & /* e */) { Refresh(); }));
|
Bind(wxEVT_SIZE, ([this](wxSizeEvent & /* e */) { Refresh(); }));
|
||||||
}
|
}
|
||||||
void Bed_2D::repaint()
|
void Bed_2D::repaint()
|
||||||
@ -43,22 +41,14 @@ void Bed_2D::repaint()
|
|||||||
dc.DrawRectangle(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight());
|
dc.DrawRectangle(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn cw and ch from sizes to max coordinates
|
if (m_bed_shape.empty())
|
||||||
cw--;
|
return;
|
||||||
ch--;
|
|
||||||
|
// reduce size to have some space around the drawn shape
|
||||||
|
cw -= (2 * Border);
|
||||||
|
ch -= (2 * Border);
|
||||||
|
|
||||||
auto cbb = BoundingBoxf(Vec2d(0, 0),Vec2d(cw, ch));
|
auto cbb = BoundingBoxf(Vec2d(0, 0),Vec2d(cw, ch));
|
||||||
// leave space for origin point
|
|
||||||
cbb.min(0) += 4;
|
|
||||||
cbb.max -= Vec2d(4., 4.);
|
|
||||||
|
|
||||||
// leave space for origin label
|
|
||||||
cbb.max(1) -= 13;
|
|
||||||
|
|
||||||
// read new size
|
|
||||||
cw = cbb.size()(0);
|
|
||||||
ch = cbb.size()(1);
|
|
||||||
|
|
||||||
auto ccenter = cbb.center();
|
auto ccenter = cbb.center();
|
||||||
|
|
||||||
// get bounding box of bed shape in G - code coordinates
|
// get bounding box of bed shape in G - code coordinates
|
||||||
@ -76,17 +66,17 @@ void Bed_2D::repaint()
|
|||||||
ccenter(0) - bcenter(0) * sfactor,
|
ccenter(0) - bcenter(0) * sfactor,
|
||||||
ccenter(1) - bcenter(1) * sfactor
|
ccenter(1) - bcenter(1) * sfactor
|
||||||
);
|
);
|
||||||
|
|
||||||
m_scale_factor = sfactor;
|
m_scale_factor = sfactor;
|
||||||
m_shift = Vec2d(shift(0) + cbb.min(0),
|
m_shift = Vec2d(shift(0) + cbb.min(0), shift(1) - (cbb.max(1) - ch));
|
||||||
shift(1) - (cbb.max(1) - GetSize().GetHeight()));
|
|
||||||
|
|
||||||
// draw bed fill
|
// draw bed fill
|
||||||
dc.SetBrush(wxBrush(wxColour(255, 255, 255), wxBRUSHSTYLE_SOLID));
|
dc.SetBrush(wxBrush(wxColour(255, 255, 255), wxBRUSHSTYLE_SOLID));
|
||||||
wxPointList pt_list;
|
wxPointList pt_list;
|
||||||
for (auto pt: m_bed_shape)
|
for (auto pt: m_bed_shape)
|
||||||
{
|
{
|
||||||
Point pt_pix = to_pixels(pt);
|
Point pt_pix = to_pixels(pt, ch);
|
||||||
pt_list.push_back(new wxPoint(pt_pix(0), pt_pix(1)));
|
pt_list.push_back(new wxPoint(pt_pix(0), pt_pix(1)));
|
||||||
}
|
}
|
||||||
dc.DrawPolygon(&pt_list, 0, 0);
|
dc.DrawPolygon(&pt_list, 0, 0);
|
||||||
|
|
||||||
@ -105,9 +95,9 @@ void Bed_2D::repaint()
|
|||||||
for (auto pl : polylines)
|
for (auto pl : polylines)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < pl.points.size()-1; i++) {
|
for (size_t i = 0; i < pl.points.size()-1; i++) {
|
||||||
Point pt1 = to_pixels(unscale(pl.points[i]));
|
Point pt1 = to_pixels(unscale(pl.points[i]), ch);
|
||||||
Point pt2 = to_pixels(unscale(pl.points[i+1]));
|
Point pt2 = to_pixels(unscale(pl.points[i + 1]), ch);
|
||||||
dc.DrawLine(pt1(0), pt1(1), pt2(0), pt2(1));
|
dc.DrawLine(pt1(0), pt1(1), pt2(0), pt2(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +106,7 @@ void Bed_2D::repaint()
|
|||||||
dc.SetBrush(wxBrush(wxColour(0, 0, 0), wxBRUSHSTYLE_TRANSPARENT));
|
dc.SetBrush(wxBrush(wxColour(0, 0, 0), wxBRUSHSTYLE_TRANSPARENT));
|
||||||
dc.DrawPolygon(&pt_list, 0, 0);
|
dc.DrawPolygon(&pt_list, 0, 0);
|
||||||
|
|
||||||
auto origin_px = to_pixels(Vec2d(0, 0));
|
auto origin_px = to_pixels(Vec2d(0, 0), ch);
|
||||||
|
|
||||||
// draw axes
|
// draw axes
|
||||||
auto axes_len = 50;
|
auto axes_len = 50;
|
||||||
@ -153,7 +143,7 @@ void Bed_2D::repaint()
|
|||||||
|
|
||||||
// draw current position
|
// draw current position
|
||||||
if (m_pos!= Vec2d(0, 0)) {
|
if (m_pos!= Vec2d(0, 0)) {
|
||||||
auto pos_px = to_pixels(m_pos);
|
auto pos_px = to_pixels(m_pos, ch);
|
||||||
dc.SetPen(wxPen(wxColour(200, 0, 0), 2, wxPENSTYLE_SOLID));
|
dc.SetPen(wxPen(wxColour(200, 0, 0), 2, wxPENSTYLE_SOLID));
|
||||||
dc.SetBrush(wxBrush(wxColour(200, 0, 0), wxBRUSHSTYLE_TRANSPARENT));
|
dc.SetBrush(wxBrush(wxColour(200, 0, 0), wxBRUSHSTYLE_TRANSPARENT));
|
||||||
dc.DrawCircle(pos_px(0), pos_px(1), 5);
|
dc.DrawCircle(pos_px(0), pos_px(1), 5);
|
||||||
@ -161,35 +151,14 @@ void Bed_2D::repaint()
|
|||||||
dc.DrawLine(pos_px(0) - 15, pos_px(1), pos_px(0) + 15, pos_px(1));
|
dc.DrawLine(pos_px(0) - 15, pos_px(1), pos_px(0) + 15, pos_px(1));
|
||||||
dc.DrawLine(pos_px(0), pos_px(1) - 15, pos_px(0), pos_px(1) + 15);
|
dc.DrawLine(pos_px(0), pos_px(1) - 15, pos_px(0), pos_px(1) + 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_painted = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// convert G - code coordinates into pixels
|
// convert G - code coordinates into pixels
|
||||||
Point Bed_2D::to_pixels(Vec2d point)
|
Point Bed_2D::to_pixels(Vec2d point, int height)
|
||||||
{
|
{
|
||||||
auto p = point * m_scale_factor + m_shift;
|
auto p = point * m_scale_factor + m_shift;
|
||||||
return Point(p(0), GetSize().GetHeight() - p(1));
|
return Point(p(0) + Border, height - p(1) + Border);
|
||||||
}
|
|
||||||
|
|
||||||
void Bed_2D::mouse_event(wxMouseEvent event)
|
|
||||||
{
|
|
||||||
if (!m_interactive) return;
|
|
||||||
if (!m_painted) return;
|
|
||||||
|
|
||||||
auto pos = event.GetPosition();
|
|
||||||
auto point = to_units(Point(pos.x, pos.y));
|
|
||||||
if (event.LeftDown() || event.Dragging()) {
|
|
||||||
if (m_on_move)
|
|
||||||
m_on_move(point) ;
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// convert pixels into G - code coordinates
|
|
||||||
Vec2d Bed_2D::to_units(Point point)
|
|
||||||
{
|
|
||||||
return (Vec2d(point(0), GetSize().GetHeight() - point(1)) - m_shift) * (1. / m_scale_factor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bed_2D::set_pos(Vec2d pos)
|
void Bed_2D::set_pos(Vec2d pos)
|
||||||
|
@ -9,20 +9,17 @@ namespace GUI {
|
|||||||
|
|
||||||
class Bed_2D : public wxPanel
|
class Bed_2D : public wxPanel
|
||||||
{
|
{
|
||||||
|
static const int Border = 10;
|
||||||
|
|
||||||
bool m_user_drawn_background = true;
|
bool m_user_drawn_background = true;
|
||||||
|
|
||||||
bool m_painted = false;
|
double m_scale_factor;
|
||||||
bool m_interactive = false;
|
|
||||||
double m_scale_factor;
|
|
||||||
Vec2d m_shift = Vec2d::Zero();
|
Vec2d m_shift = Vec2d::Zero();
|
||||||
Vec2d m_pos = Vec2d::Zero();
|
Vec2d m_pos = Vec2d::Zero();
|
||||||
std::function<void(Vec2d)> m_on_move = nullptr;
|
|
||||||
|
|
||||||
Point to_pixels(Vec2d point);
|
Point to_pixels(Vec2d point, int height);
|
||||||
Vec2d to_units(Point point);
|
void repaint();
|
||||||
void repaint();
|
void set_pos(Vec2d pos);
|
||||||
void mouse_event(wxMouseEvent event);
|
|
||||||
void set_pos(Vec2d pos);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Bed_2D(wxWindow* parent);
|
Bed_2D(wxWindow* parent);
|
||||||
|
@ -30,11 +30,9 @@ void BedShapeDialog::build_dialog(ConfigOptionPoints* default_pt)
|
|||||||
SetMinSize(GetSize());
|
SetMinSize(GetSize());
|
||||||
main_sizer->SetSizeHints(this);
|
main_sizer->SetSizeHints(this);
|
||||||
|
|
||||||
// needed to actually free memory
|
this->Bind(wxEVT_CLOSE_WINDOW, ([this](wxCloseEvent& evt) {
|
||||||
this->Bind(wxEVT_CLOSE_WINDOW, ([this](wxCloseEvent e) {
|
EndModal(wxID_CANCEL);
|
||||||
EndModal(wxID_OK);
|
}));
|
||||||
Destroy();
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BedShapeDialog::on_dpi_changed(const wxRect &suggested_rect)
|
void BedShapeDialog::on_dpi_changed(const wxRect &suggested_rect)
|
||||||
@ -135,7 +133,7 @@ void BedShapePanel::build_panel(ConfigOptionPoints* default_pt)
|
|||||||
|
|
||||||
// Called from the constructor.
|
// Called from the constructor.
|
||||||
// Create a panel for a rectangular / circular / custom bed shape.
|
// Create a panel for a rectangular / circular / custom bed shape.
|
||||||
ConfigOptionsGroupShp BedShapePanel::init_shape_options_page(wxString title)
|
ConfigOptionsGroupShp BedShapePanel::init_shape_options_page(const wxString& title)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto panel = new wxPanel(m_shape_options_book);
|
auto panel = new wxPanel(m_shape_options_book);
|
||||||
@ -305,8 +303,9 @@ void BedShapePanel::update_shape()
|
|||||||
}
|
}
|
||||||
m_canvas->m_bed_shape = points;
|
m_canvas->m_bed_shape = points;
|
||||||
}
|
}
|
||||||
|
else if (page_idx == SHAPE_CUSTOM)
|
||||||
|
m_canvas->m_bed_shape = m_loaded_bed_shape;
|
||||||
|
|
||||||
// $self->{on_change}->();
|
|
||||||
update_preview();
|
update_preview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,8 +350,9 @@ void BedShapePanel::load_stl()
|
|||||||
std::vector<Vec2d> points;
|
std::vector<Vec2d> points;
|
||||||
for (auto pt : polygon.points)
|
for (auto pt : polygon.points)
|
||||||
points.push_back(unscale(pt));
|
points.push_back(unscale(pt));
|
||||||
m_canvas->m_bed_shape = points;
|
|
||||||
update_preview();
|
m_loaded_bed_shape = points;
|
||||||
|
update_shape();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // GUI
|
} // GUI
|
||||||
|
@ -16,7 +16,8 @@ namespace GUI {
|
|||||||
using ConfigOptionsGroupShp = std::shared_ptr<ConfigOptionsGroup>;
|
using ConfigOptionsGroupShp = std::shared_ptr<ConfigOptionsGroup>;
|
||||||
class BedShapePanel : public wxPanel
|
class BedShapePanel : public wxPanel
|
||||||
{
|
{
|
||||||
Bed_2D* m_canvas;
|
Bed_2D* m_canvas;
|
||||||
|
std::vector<Vec2d> m_loaded_bed_shape;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BedShapePanel(wxWindow* parent) : wxPanel(parent, wxID_ANY) {}
|
BedShapePanel(wxWindow* parent) : wxPanel(parent, wxID_ANY) {}
|
||||||
@ -24,8 +25,8 @@ public:
|
|||||||
|
|
||||||
void build_panel(ConfigOptionPoints* default_pt);
|
void build_panel(ConfigOptionPoints* default_pt);
|
||||||
|
|
||||||
ConfigOptionsGroupShp init_shape_options_page(wxString title);
|
ConfigOptionsGroupShp init_shape_options_page(const wxString& title);
|
||||||
void set_shape(ConfigOptionPoints* points);
|
void set_shape(ConfigOptionPoints* points);
|
||||||
void update_preview();
|
void update_preview();
|
||||||
void update_shape();
|
void update_shape();
|
||||||
void load_stl();
|
void load_stl();
|
||||||
|
@ -56,9 +56,9 @@ public:
|
|||||||
|
|
||||||
Vec3d get_dir_right() const { return m_view_matrix.matrix().block(0, 0, 3, 3).row(0); }
|
Vec3d get_dir_right() const { return m_view_matrix.matrix().block(0, 0, 3, 3).row(0); }
|
||||||
Vec3d get_dir_up() const { return m_view_matrix.matrix().block(0, 0, 3, 3).row(1); }
|
Vec3d get_dir_up() const { return m_view_matrix.matrix().block(0, 0, 3, 3).row(1); }
|
||||||
Vec3d get_dir_forward() const { return m_view_matrix.matrix().block(0, 0, 3, 3).row(2); }
|
Vec3d get_dir_forward() const { return -m_view_matrix.matrix().block(0, 0, 3, 3).row(2); }
|
||||||
|
|
||||||
Vec3d get_position() const { return m_view_matrix.matrix().block(0, 3, 3, 1); }
|
Vec3d get_position() const { return m_view_matrix.matrix().inverse().block(0, 3, 3, 1); }
|
||||||
|
|
||||||
void apply_viewport(int x, int y, unsigned int w, unsigned int h) const;
|
void apply_viewport(int x, int y, unsigned int w, unsigned int h) const;
|
||||||
void apply_view_matrix() const;
|
void apply_view_matrix() const;
|
||||||
|
@ -550,7 +550,7 @@ bool GLGizmoSlaSupports::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
|
|||||||
const Selection& selection = m_parent.get_selection();
|
const Selection& selection = m_parent.get_selection();
|
||||||
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
||||||
const Transform3d& instance_matrix_no_translation_no_scaling = volume->get_instance_transformation().get_matrix(true,false,true);
|
const Transform3d& instance_matrix_no_translation_no_scaling = volume->get_instance_transformation().get_matrix(true,false,true);
|
||||||
Vec3f direction_to_camera = camera.get_dir_forward().cast<float>();
|
Vec3f direction_to_camera = -camera.get_dir_forward().cast<float>();
|
||||||
Vec3f direction_to_camera_mesh = (instance_matrix_no_translation_no_scaling.inverse().cast<float>() * direction_to_camera).normalized().eval();
|
Vec3f direction_to_camera_mesh = (instance_matrix_no_translation_no_scaling.inverse().cast<float>() * direction_to_camera).normalized().eval();
|
||||||
Vec3f scaling = volume->get_instance_scaling_factor().cast<float>();
|
Vec3f scaling = volume->get_instance_scaling_factor().cast<float>();
|
||||||
direction_to_camera_mesh = Vec3f(direction_to_camera_mesh(0)*scaling(0), direction_to_camera_mesh(1)*scaling(1), direction_to_camera_mesh(2)*scaling(2));
|
direction_to_camera_mesh = Vec3f(direction_to_camera_mesh(0)*scaling(0), direction_to_camera_mesh(1)*scaling(1), direction_to_camera_mesh(2)*scaling(2));
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class wxTimer;
|
class wxTimer;
|
||||||
class wxGauge;
|
class wxGauge;
|
||||||
|
@ -296,6 +296,9 @@ void Selection::clear()
|
|||||||
if (!m_valid)
|
if (!m_valid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (m_list.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
for (unsigned int i : m_list)
|
for (unsigned int i : m_list)
|
||||||
{
|
{
|
||||||
(*m_volumes)[i]->selected = false;
|
(*m_volumes)[i]->selected = false;
|
||||||
|
@ -1854,13 +1854,17 @@ void TabPrinter::build_fff()
|
|||||||
|
|
||||||
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e)
|
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e)
|
||||||
{
|
{
|
||||||
auto dlg = new BedShapeDialog(this);
|
BedShapeDialog dlg(this);
|
||||||
dlg->build_dialog(m_config->option<ConfigOptionPoints>("bed_shape"));
|
dlg.build_dialog(m_config->option<ConfigOptionPoints>("bed_shape"));
|
||||||
if (dlg->ShowModal() == wxID_OK) {
|
if (dlg.ShowModal() == wxID_OK) {
|
||||||
load_key_value("bed_shape", dlg->GetValue());
|
std::vector<Vec2d> shape = dlg.GetValue();
|
||||||
update_changed_ui();
|
if (!shape.empty())
|
||||||
}
|
{
|
||||||
}));
|
load_key_value("bed_shape", shape);
|
||||||
|
update_changed_ui();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
return sizer;
|
return sizer;
|
||||||
};
|
};
|
||||||
@ -2056,11 +2060,15 @@ void TabPrinter::build_sla()
|
|||||||
|
|
||||||
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e)
|
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e)
|
||||||
{
|
{
|
||||||
auto dlg = new BedShapeDialog(this);
|
BedShapeDialog dlg(this);
|
||||||
dlg->build_dialog(m_config->option<ConfigOptionPoints>("bed_shape"));
|
dlg.build_dialog(m_config->option<ConfigOptionPoints>("bed_shape"));
|
||||||
if (dlg->ShowModal() == wxID_OK) {
|
if (dlg.ShowModal() == wxID_OK) {
|
||||||
load_key_value("bed_shape", dlg->GetValue());
|
std::vector<Vec2d> shape = dlg.GetValue();
|
||||||
update_changed_ui();
|
if (!shape.empty())
|
||||||
|
{
|
||||||
|
load_key_value("bed_shape", shape);
|
||||||
|
update_changed_ui();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -119,8 +119,6 @@ target_include_directories(XS PRIVATE src ${LIBDIR}/libslic3r)
|
|||||||
target_compile_definitions(XS PRIVATE -DSLIC3RXS)
|
target_compile_definitions(XS PRIVATE -DSLIC3RXS)
|
||||||
set_target_properties(XS PROPERTIES PREFIX "") # Prevent cmake from generating libXS.so instead of XS.so
|
set_target_properties(XS PROPERTIES PREFIX "") # Prevent cmake from generating libXS.so instead of XS.so
|
||||||
|
|
||||||
target_link_libraries(XS ${Boost_LIBRARIES})
|
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# -liconv: boost links to libiconv by default
|
# -liconv: boost links to libiconv by default
|
||||||
target_link_libraries(XS "-liconv -framework IOKit" "-framework CoreFoundation" -lc++)
|
target_link_libraries(XS "-liconv -framework IOKit" "-framework CoreFoundation" -lc++)
|
||||||
@ -156,12 +154,6 @@ if (WIN32)
|
|||||||
target_link_libraries(XS ${PERL_LIBRARY})
|
target_link_libraries(XS ${PERL_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(XS ${Boost_LIBRARIES})
|
|
||||||
target_link_libraries(XS ${TBB_LIBRARIES})
|
|
||||||
# target_link_libraries(XS ${wxWidgets_LIBRARIES})
|
|
||||||
target_link_libraries(XS ${EXPAT_LIBRARIES})
|
|
||||||
# target_link_libraries(XS ${GLEW_LIBRARIES})
|
|
||||||
|
|
||||||
# Install the XS.pm and XS.{so,dll,bundle} into the local-lib directory.
|
# Install the XS.pm and XS.{so,dll,bundle} into the local-lib directory.
|
||||||
set(PERL_LOCAL_LIB_DIR "../../local-lib/lib/perl5/${PerlEmbed_ARCHNAME}")
|
set(PERL_LOCAL_LIB_DIR "../../local-lib/lib/perl5/${PerlEmbed_ARCHNAME}")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
@ -181,10 +173,6 @@ if(APPLE)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SLIC3R_PROFILE)
|
|
||||||
target_link_libraries(Shiny)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
# Here we associate some additional properties with the MSVC project to enable compilation and debugging out of the box.
|
# Here we associate some additional properties with the MSVC project to enable compilation and debugging out of the box.
|
||||||
get_filename_component(PROPS_PERL_BIN_PATH "${PERL_EXECUTABLE}" DIRECTORY)
|
get_filename_component(PROPS_PERL_BIN_PATH "${PERL_EXECUTABLE}" DIRECTORY)
|
||||||
|
Loading…
Reference in New Issue
Block a user