Code: Select all
struct Point3VPM {
using key_type = Mesh::Vertex_index;
using value_type = VNCS::Sim2D::Kernel::K::Point_3;
using reference = value_type;
using category = boost::readable_property_map_tag;
Point3VPM(const Mesh &m)
: mesh(std::cref(m))
{
}
friend Point3VPM::value_type get(const Point3VPM &map, Mesh::Vertex_index idx)
{
Point p = map.mesh.get().point(idx);
return {p[0], p[1], 0};
}
std::reference_wrapper mesh;
};
< /code>
Hier startet mein erstes Problem. Mein Aabbtree -Typ ist Folgendes: < /p>
using AABBTreeTraits =
CGAL::AABB_traits;
using AABBTree = CGAL::AABB_tree;
Code: Select all
#include
#include
#include
#include
#include
#include
namespace
{
using K = CGAL::Simple_cartesian;
using Point2 = K::Point_2;
using Point3 = K::Point_3;
using Mesh = CGAL::Surface_mesh;
namespace PMP = CGAL::Polygon_mesh_processing;
struct Point3VPM {
using key_type = Mesh::Vertex_index;
using value_type = Point3;
using reference = value_type;
using category = boost::readable_property_map_tag;
Point3VPM(const Mesh &m)
: mesh(std::cref(m))
{
}
friend Point3VPM::value_type get(const Point3VPM &map, Mesh::Vertex_index idx)
{
Point2 p = map.mesh.get().point(idx);
return {p[0], p[1], 0};
}
std::reference_wrapper mesh;
};
using AABBTreeTraits = CGAL::AABB_traits;
using AABBTree = CGAL::AABB_tree;
} // namespace
int main()
{
Mesh mesh;
AABBTree tree;
PMP::build_AABB_tree(mesh, tree);
auto location = PMP::locate_with_AABB_tree({0, 0}, tree, mesh);
}