GCodeViewer -> Do not show modifier shells
This commit is contained in:
parent
eb215fe994
commit
2a90cd2849
1 changed files with 27 additions and 12 deletions
|
@ -282,7 +282,10 @@ void GCodeViewer::load(const GCodeProcessor::Result& gcode_result, const Print&
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
load_toolpaths(gcode_result);
|
load_toolpaths(gcode_result);
|
||||||
load_shells(print, initialized);
|
#if ENABLE_GCODE_VIEWER_AS_STATE
|
||||||
|
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer)
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STATE
|
||||||
|
load_shells(print, initialized);
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_AS_STATE
|
#if ENABLE_GCODE_VIEWER_AS_STATE
|
||||||
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer) {
|
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer) {
|
||||||
|
@ -493,21 +496,21 @@ void GCodeViewer::load_toolpaths(const GCodeProcessor::Result& gcode_result)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// vertex data / bounding box -> extract from result
|
// vertex data / bounding box -> extract from result
|
||||||
std::vector<float> vertices_data(m_vertices.vertices_count * 3);
|
std::vector<float> vertices_data(m_vertices.vertices_count * 3);
|
||||||
for (size_t i = 0; i < m_vertices.vertices_count; ++i) {
|
for (size_t i = 0; i < m_vertices.vertices_count; ++i) {
|
||||||
const GCodeProcessor::MoveVertex& move = gcode_result.moves[i];
|
const GCodeProcessor::MoveVertex& move = gcode_result.moves[i];
|
||||||
#if ENABLE_GCODE_VIEWER_AS_STATE
|
#if ENABLE_GCODE_VIEWER_AS_STATE
|
||||||
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer)
|
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer)
|
||||||
|
m_bounding_box.merge(move.position.cast<double>());
|
||||||
|
else {
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STATE
|
||||||
|
if (move.type == GCodeProcessor::EMoveType::Extrude && move.width != 0.0f && move.height != 0.0f)
|
||||||
m_bounding_box.merge(move.position.cast<double>());
|
m_bounding_box.merge(move.position.cast<double>());
|
||||||
else {
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_AS_STATE
|
|
||||||
if (move.type == GCodeProcessor::EMoveType::Extrude && move.width != 0.0f && move.height != 0.0f)
|
|
||||||
m_bounding_box.merge(move.position.cast<double>());
|
|
||||||
#if ENABLE_GCODE_VIEWER_AS_STATE
|
#if ENABLE_GCODE_VIEWER_AS_STATE
|
||||||
}
|
|
||||||
#endif // ENABLE_GCODE_VIEWER_AS_STATE
|
|
||||||
::memcpy(static_cast<void*>(&vertices_data[i * 3]), static_cast<const void*>(move.position.data()), 3 * sizeof(float));
|
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STATE
|
||||||
|
::memcpy(static_cast<void*>(&vertices_data[i * 3]), static_cast<const void*>(move.position.data()), 3 * sizeof(float));
|
||||||
|
}
|
||||||
|
|
||||||
m_bounding_box.merge(m_bounding_box.max + m_sequential_view.marker.get_bounding_box().max[2] * Vec3d::UnitZ());
|
m_bounding_box.merge(m_bounding_box.max + m_sequential_view.marker.get_bounding_box().max[2] * Vec3d::UnitZ());
|
||||||
|
|
||||||
|
@ -684,6 +687,18 @@ void GCodeViewer::load_shells(const Print& print, bool initialized)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove modifiers
|
||||||
|
while (true) {
|
||||||
|
GLVolumePtrs::iterator it = std::find_if(m_shells.volumes.volumes.begin(), m_shells.volumes.volumes.end(), [](GLVolume* volume) { return volume->is_modifier; });
|
||||||
|
if (it != m_shells.volumes.volumes.end())
|
||||||
|
{
|
||||||
|
delete (*it);
|
||||||
|
m_shells.volumes.volumes.erase(it);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (GLVolume* volume : m_shells.volumes.volumes)
|
for (GLVolume* volume : m_shells.volumes.volumes)
|
||||||
{
|
{
|
||||||
volume->zoom_to_volumes = false;
|
volume->zoom_to_volumes = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue