如何解决:error C2039: 'make_normal_of_point_with_normal_pmap': is not member of 'CGAL'
How to solve: error C2039: 'make_normal_of_point_with_normal_pmap': is not a member of 'CGAL'
我正在使用 CGAL 4.12 和 eigen 3.3.4 并尝试通过 Matlab mex 函数编译 Poisson_surface_reconstruction_3 示例,但出现以下错误:
C:\Users\u0116401\Documents\PRosPeRoS\Matlab_Code\mexTest\CGAL_poisson_reconstruction.cpp(70): error C2039: 'make_normal_of_point_with_normal_pmap': is not a member of 'CGAL'
C:\dev\CGAL-4.12\include\CGAL/IO/read_xyz_points.h(40): note: see declaration of 'CGAL'
C:\Users\u0116401\Documents\PRosPeRoS\Matlab_Code\mexTest\CGAL_poisson_reconstruction.cpp(70): error C3861: 'make_normal_of_point_with_normal_pmap': identifier not found
好像'make_normal_of_point_with_normal_pmap'找不到了。有谁知道是什么导致了这个问题?
产生此错误的代码是:
/* mex headers */
#include <mex.h>
/* C++ headers */
#include <vector>
#include <fstream>
/* CGAL headers */
#include <CGAL/trace.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/Surface_mesh_default_triangulation_3.h>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Implicit_surface_3.h>
#include <CGAL/IO/output_surface_facets_to_polyhedron.h>
#include <CGAL/Poisson_reconstruction_function.h>
#include <CGAL/Point_with_normal_3.h>
#include <CGAL/property_map.h>
#include <CGAL/IO/read_xyz_points.h>
#include <CGAL/compute_average_spacing.h>
// Types
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef CGAL::Point_with_normal_3<Kernel> Point_with_normal;
typedef Kernel::Sphere_3 Sphere;
typedef std::vector<Point_with_normal> PointList;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Poisson_reconstruction_function<Kernel>Poisson_reconstruction_function;
typedef CGAL::Surface_mesh_default_triangulation_3 STr;
typedef CGAL::Surface_mesh_complex_2_in_triangulation_3<STr> C2t3;
typedef CGAL::Implicit_surface_3<Kernel, Poisson_reconstruction_function> Surface_3;
void mexFunction(int nlhs, mxArray *plhs[], /*Output variables */
int nrhs, const mxArray *prhs[]) /*Input variables */
{
PointList points;
std::ifstream stream("kitten.xyz");
if (!stream ||
!CGAL::read_xyz_points_and_normals(
stream,
std::back_inserter(points),
CGAL::make_normal_of_point_with_normal_pmap(std::back_inserter(points))))
}
该函数名为 make_normal_of_point_with_normal_map()
(map
而不是 pmap
),它使用 Point_with_normal 作为参数。调用应该是:
CGAL::make_normal_of_point_with_normal_map(Point_with_normal())
我正在使用 CGAL 4.12 和 eigen 3.3.4 并尝试通过 Matlab mex 函数编译 Poisson_surface_reconstruction_3 示例,但出现以下错误:
C:\Users\u0116401\Documents\PRosPeRoS\Matlab_Code\mexTest\CGAL_poisson_reconstruction.cpp(70): error C2039: 'make_normal_of_point_with_normal_pmap': is not a member of 'CGAL'
C:\dev\CGAL-4.12\include\CGAL/IO/read_xyz_points.h(40): note: see declaration of 'CGAL'
C:\Users\u0116401\Documents\PRosPeRoS\Matlab_Code\mexTest\CGAL_poisson_reconstruction.cpp(70): error C3861: 'make_normal_of_point_with_normal_pmap': identifier not found
好像'make_normal_of_point_with_normal_pmap'找不到了。有谁知道是什么导致了这个问题?
产生此错误的代码是:
/* mex headers */
#include <mex.h>
/* C++ headers */
#include <vector>
#include <fstream>
/* CGAL headers */
#include <CGAL/trace.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/Surface_mesh_default_triangulation_3.h>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Implicit_surface_3.h>
#include <CGAL/IO/output_surface_facets_to_polyhedron.h>
#include <CGAL/Poisson_reconstruction_function.h>
#include <CGAL/Point_with_normal_3.h>
#include <CGAL/property_map.h>
#include <CGAL/IO/read_xyz_points.h>
#include <CGAL/compute_average_spacing.h>
// Types
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef CGAL::Point_with_normal_3<Kernel> Point_with_normal;
typedef Kernel::Sphere_3 Sphere;
typedef std::vector<Point_with_normal> PointList;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Poisson_reconstruction_function<Kernel>Poisson_reconstruction_function;
typedef CGAL::Surface_mesh_default_triangulation_3 STr;
typedef CGAL::Surface_mesh_complex_2_in_triangulation_3<STr> C2t3;
typedef CGAL::Implicit_surface_3<Kernel, Poisson_reconstruction_function> Surface_3;
void mexFunction(int nlhs, mxArray *plhs[], /*Output variables */
int nrhs, const mxArray *prhs[]) /*Input variables */
{
PointList points;
std::ifstream stream("kitten.xyz");
if (!stream ||
!CGAL::read_xyz_points_and_normals(
stream,
std::back_inserter(points),
CGAL::make_normal_of_point_with_normal_pmap(std::back_inserter(points))))
}
该函数名为 make_normal_of_point_with_normal_map()
(map
而不是 pmap
),它使用 Point_with_normal 作为参数。调用应该是:
CGAL::make_normal_of_point_with_normal_map(Point_with_normal())