Skip to content

Commit

Permalink
fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Apr 11, 2021
1 parent 9f06bfc commit 7379d58
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ namespace internal {
template<typename PM,
typename EdgeConstraintMap,
typename VertexPointMap,
typename FacePatchMap>
typename FacePatchMap,
typename SizingFunction>
bool constraints_are_short_enough(const PM& pmesh,
EdgeConstraintMap ecmap,
VertexPointMap vpmap,
const FacePatchMap& fpm,
const double& high)
const SizingFunction& sizing)
{
double sqh = high*high;
typedef typename boost::graph_traits<PM>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<PM>::edge_descriptor edge_descriptor;
for(edge_descriptor e : edges(pmesh))
Expand All @@ -248,8 +248,7 @@ namespace internal {
get(ecmap, e) ||
get(fpm, face(h,pmesh))!=get(fpm, face(opposite(h,pmesh),pmesh)) )
{
if (sqh < CGAL::squared_distance(get(vpmap, source(h, pmesh)),
get(vpmap, target(h, pmesh))))
if (sizing.is_too_long(source(h, pmesh), target(h, pmesh)))
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ namespace CGAL {

namespace Polygon_mesh_processing {

/*! \todo document me or merge the doc with the original overload*/
template<typename PolygonMesh
, typename FaceRange
, typename SizingFunction
, typename NamedParameters>
void isotropic_remeshing(const FaceRange& faces
, const SizingFunction& sizing
, PolygonMesh& pmesh
, const NamedParameters& np);

/*!
* \ingroup PMP_meshing_grp
* @brief remeshes a triangulated region of a polygon mesh.
Expand Down Expand Up @@ -181,8 +191,10 @@ void isotropic_remeshing(const FaceRange& faces
, PolygonMesh& pmesh
, const NamedParameters& np)
{
isotropic_remeshing(faces,
CGAL::Uniform_sizing_field<PolygonMesh>(target_edge_length, pmesh),
typedef Uniform_sizing_field<PolygonMesh> Default_sizing;
isotropic_remeshing<PolygonMesh, FaceRange, Default_sizing, NamedParameters>(
faces,
Default_sizing(target_edge_length, pmesh),
pmesh,
np);
}
Expand Down Expand Up @@ -261,12 +273,11 @@ void isotropic_remeshing(const FaceRange& faces
#if !defined(CGAL_NO_PRECONDITIONS)
if(protect)
{
double high = 4. / 3. * target_edge_length;
std::string msg("Isotropic remeshing : protect_constraints cannot be set to");
msg.append(" true with constraints larger than 4/3 * target_edge_length.");
msg.append(" Remeshing aborted.");
CGAL_precondition_msg(
internal::constraints_are_short_enough(pmesh, ecmap, vpmap, fpmap, high),
internal::constraints_are_short_enough(pmesh, ecmap, vpmap, fpmap, sizing),
msg.c_str());
}
#endif
Expand Down

0 comments on commit 7379d58

Please sign in to comment.