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

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2019-06-24 12:08:42 +0300
committerEnrico Turri <enricoturri@seznam.cz>2019-06-24 12:08:42 +0300
commit5766e9e91585af7114d67ddda612f219056d2494 (patch)
tree63f7b464a018447463bb7f0f70519a83fd6592a3 /src/slic3r/GUI/3DBed.cpp
parent00b9a3ad3250c79a58fc7ea3369932967aa80352 (diff)
parent8b3d88bc0a654fe8c488bcf4f30b6896587c116c (diff)
Fixed conflicts after merge with branch et_perpsective_camera
Diffstat (limited to 'src/slic3r/GUI/3DBed.cpp')
-rw-r--r--src/slic3r/GUI/3DBed.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp
index 6ffcdcbe8..d73e423e0 100644
--- a/src/slic3r/GUI/3DBed.cpp
+++ b/src/slic3r/GUI/3DBed.cpp
@@ -212,7 +212,7 @@ const double Bed3D::Axes::ArrowLength = 5.0;
Bed3D::Axes::Axes()
: origin(Vec3d::Zero())
-, length(Vec3d::Zero())
+, length(25.0 * Vec3d::Ones())
{
m_quadric = ::gluNewQuadric();
if (m_quadric != nullptr)
@@ -292,7 +292,7 @@ bool Bed3D::set_shape(const Pointfs& shape)
m_shape = shape;
m_type = new_type;
- calc_bounding_box();
+ calc_bounding_boxes();
ExPolygon poly;
for (const Vec2d& p : m_shape)
@@ -313,7 +313,7 @@ bool Bed3D::set_shape(const Pointfs& shape)
// Set the origin and size for painting of the coordinate system axes.
m_axes.origin = Vec3d(0.0, 0.0, (double)GROUND_Z);
- m_axes.length = 0.1 * get_bounding_box().max_size() * Vec3d::Ones();
+ m_axes.length = 0.1 * m_bounding_box.max_size() * Vec3d::Ones();
// Let the calee to update the UI.
return true;
@@ -401,13 +401,22 @@ void Bed3D::render_axes() const
m_axes.render();
}
-void Bed3D::calc_bounding_box()
+void Bed3D::calc_bounding_boxes() const
{
m_bounding_box = BoundingBoxf3();
for (const Vec2d& p : m_shape)
{
m_bounding_box.merge(Vec3d(p(0), p(1), 0.0));
}
+
+ m_extended_bounding_box = m_bounding_box;
+
+ // extend to contain axes
+ m_extended_bounding_box.merge(m_axes.length + Axes::ArrowLength * Vec3d::Ones());
+
+ // extend to contain model, if any
+ if (!m_model.get_filename().empty())
+ m_extended_bounding_box.merge(m_model.get_transformed_bounding_box());
}
void Bed3D::calc_triangles(const ExPolygon& poly)
@@ -550,6 +559,9 @@ void Bed3D::render_prusa(GLCanvas3D* canvas, const std::string &key, bool bottom
offset += Vec3d(0.0, 0.0, -0.03);
m_model.center_around(offset);
+
+ // update extended bounding box
+ calc_bounding_boxes();
}
if (!m_model.get_filename().empty())