Unified igl calls in MeshRaycaster and EigenMesh3D

MeshRaycaster is still aware of the clipping plane but it now uses EigenMesh3D internally
Public interface of both classes is unchanged
This commit is contained in:
Lukas Matena 2019-11-08 20:18:14 +01:00
parent 645f13a0ae
commit b4795e1292
4 changed files with 51 additions and 92 deletions

View file

@ -3,6 +3,7 @@
#include "libslic3r/Point.hpp"
#include "libslic3r/Geometry.hpp"
#include "libslic3r/SLA/SLACommon.hpp"
#include <cfloat>
@ -93,8 +94,9 @@ private:
class MeshRaycaster {
public:
MeshRaycaster(const TriangleMesh& mesh);
~MeshRaycaster();
MeshRaycaster(const TriangleMesh& mesh)
: m_mesh(&mesh), m_emesh(mesh)
{}
void set_transformation(const Geometry::Transformation& trafo);
void set_camera(const Camera& camera);
@ -107,9 +109,7 @@ public:
Vec3f get_closest_point(const Vec3f& point, Vec3f* normal = 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;
sla::EigenMesh3D m_emesh;
const TriangleMesh* m_mesh = nullptr;
};