本文整理汇总了C++中Point_set::has_normal_map方法的典型用法代码示例。如果您正苦于以下问题:C++ Point_set::has_normal_map方法的具体用法?C++ Point_set::has_normal_map怎么用?C++ Point_set::has_normal_map使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point_set
的用法示例。
在下文中一共展示了Point_set::has_normal_map方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: poisson_reconstruct
bool poisson_reconstruct(FaceGraph* graph,
Point_set& points,
typename Traits::FT sm_angle, // Min triangle angle (degrees).
typename Traits::FT sm_radius, // Max triangle size w.r.t. point set average spacing.
typename Traits::FT sm_distance, // Approximation error w.r.t. point set average spacing.
const QString& solver_name, // solver name
bool use_two_passes,
bool do_not_fill_holes)
{
// Poisson implicit function
typedef CGAL::Poisson_reconstruction_function<Traits> Poisson_reconstruction_function;
// Surface mesher
typedef CGAL::Surface_mesh_default_triangulation_3 STr;
typedef CGAL::Surface_mesh_complex_2_in_triangulation_3<STr> C2t3;
typedef CGAL::Implicit_surface_3<Traits, Poisson_reconstruction_function> Surface_3;
// AABB tree
typedef CGAL::AABB_face_graph_triangle_primitive<FaceGraph> Primitive;
typedef CGAL::AABB_traits<Traits, Primitive> AABB_traits;
typedef CGAL::AABB_tree<AABB_traits> AABB_tree;
CGAL::Timer task_timer; task_timer.start();
//***************************************
// Checks requirements
//***************************************
if (points.size() == 0)
{
std::cerr << "Error: empty point set" << std::endl;
return false;
}
bool points_have_normals = points.has_normal_map();
if ( ! points_have_normals )
{
std::cerr << "Input point set not supported: this reconstruction method requires oriented normals" << std::endl;
return false;
}
CGAL::Timer reconstruction_timer; reconstruction_timer.start();
//***************************************
// Computes implicit function
//***************************************
std::cerr << "Computes Poisson implicit function "
<< "using " << solver_name.toLatin1().data() << " solver...\n";
// Creates implicit function from the point set.
// Note: this method requires an iterator over points
// + property maps to access each point's position and normal.
Poisson_reconstruction_function function(points.begin_or_selection_begin(), points.end(),
points.point_map(), points.normal_map());
bool ok = false;
#ifdef CGAL_EIGEN3_ENABLED
if(solver_name=="Eigen - built-in simplicial LDLt")
{
CGAL::Eigen_solver_traits<Eigen::SimplicialCholesky<CGAL::Eigen_sparse_matrix<double>::EigenType> > solver;
ok = function.compute_implicit_function(solver, use_two_passes);
}
if(solver_name=="Eigen - built-in CG")
{
CGAL::Eigen_solver_traits<Eigen::ConjugateGradient<CGAL::Eigen_sparse_matrix<double>::EigenType> > solver;
solver.solver().setTolerance(1e-6);
solver.solver().setMaxIterations(1000);
ok = function.compute_implicit_function(solver, use_two_passes);
}
#endif
// Computes the Poisson indicator function f()
// at each vertex of the triangulation.
if ( ! ok )
{
std::cerr << "Error: cannot compute implicit function" << std::endl;
return false;
}
// Prints status
std::cerr << "Total implicit function (triangulation+refinement+solver): " << task_timer.time() << " seconds\n";
task_timer.reset();
//***************************************
// Surface mesh generation
//***************************************
std::cerr << "Surface meshing...\n";
// Computes average spacing
Kernel::FT average_spacing = CGAL::compute_average_spacing<Concurrency_tag>(points.all_or_selection_if_not_empty(),
6 /* knn = 1 ring */,
points.parameters());
// Gets one point inside the implicit surface
Kernel::Point_3 inner_point = function.get_inner_point();
Kernel::FT inner_point_value = function(inner_point);
if(inner_point_value >= 0.0)
//.........这里部分代码省略.........