ENH: preview: refine the logic to switch camera view

when switch between preview and view3D,
if the screen center is on the plate
don't change to the plate view

Change-Id: I16b8815ad9b10a7cea174faa6a16bb9e582a77c3
This commit is contained in:
lane.wei 2022-07-28 19:58:06 +08:00 committed by Lane.Wei
parent 92ad7ff1d0
commit 6a08c2d509
4 changed files with 16 additions and 16 deletions

View file

@ -1840,7 +1840,7 @@ bool PartPlate::set_shape(const Pointfs& shape, const Pointfs& exclude_areas, Ve
ExPolygon logo_poly;
generate_logo_polygon(logo_poly);
if (!m_logo_triangles.set_from_triangles(triangulate_expolygon_2f(logo_poly, NORMALS_UP), GROUND_Z+0.02f))
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ":Unable to create plate triangles\n";
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ":Unable to create logo triangles\n";
ExPolygon poly;
/*for (const Vec2d& p : m_shape) {
@ -1883,9 +1883,9 @@ const BoundingBox PartPlate::get_bounding_box_crd()
return plate_shape.bounding_box();
}
bool PartPlate::contains(const Point& point) const
bool PartPlate::contains(const Vec3d& point) const
{
return m_polygon.contains(point);
return m_bounding_box.contains(point);
}
bool PartPlate::contains(const GLVolume& v) const
@ -1917,11 +1917,6 @@ bool PartPlate::intersects(const BoundingBoxf3& bb) const
return print_volume.intersects(bb);
}
Point PartPlate::point_projection(const Point& point) const
{
return m_polygon.point_projection(point);
}
void PartPlate::render(bool bottom, bool only_body, bool force_background_color, HeightLimitMode mode, int hover_id)
{
glsafe(::glEnable(GL_DEPTH_TEST));