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:
authorLukas Matena <lukasmatena@seznam.cz>2019-09-17 10:17:53 +0300
committerLukas Matena <lukasmatena@seznam.cz>2019-09-17 15:57:45 +0300
commitb6292247e88c7ace1a7c406c0d560e954a448373 (patch)
tree543c389fc5b5b085dfcc635008ef4047a0f5ed7b /src/slic3r/GUI/MeshUtils.hpp
parent284355d3786d80687a37067d1083d6f70963aa5f (diff)
Unproject on mesh in the SLA gizmo is now performed by the MeshRaycaster class
Diffstat (limited to 'src/slic3r/GUI/MeshUtils.hpp')
-rw-r--r--src/slic3r/GUI/MeshUtils.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/slic3r/GUI/MeshUtils.hpp b/src/slic3r/GUI/MeshUtils.hpp
index f97003a91..cadc821dd 100644
--- a/src/slic3r/GUI/MeshUtils.hpp
+++ b/src/slic3r/GUI/MeshUtils.hpp
@@ -14,6 +14,8 @@ class TriangleMeshSlicer;
namespace GUI {
+class Camera;
+
class ClippingPlane
@@ -86,6 +88,28 @@ private:
};
+
+
+class MeshRaycaster {
+public:
+ MeshRaycaster(const TriangleMesh& mesh);
+ ~MeshRaycaster();
+ void set_transformation(const Geometry::Transformation& trafo);
+ void set_camera(const Camera& camera);
+
+ bool unproject_on_mesh(const Vec2d& mouse_pos, const Transform3d& trafo, const Camera& camera,
+ std::vector<Vec3f>* positions = nullptr, std::vector<Vec3f>* normals = nullptr) const;
+
+private:
+ // PIMPL wrapper around igl::AABB so I don't have to include the header-only IGL here
+ class AABBWrapper;
+ AABBWrapper* m_AABB_wrapper;
+
+ const TriangleMesh* m_mesh = nullptr;
+
+
+};
+
} // namespace GUI
} // namespace Slic3r