mirror of https://github.com/CGAL/cgal
avoid constructing the Border_constraint_pmap when it's not needed
i.e. when it's given in the named parameters
This commit is contained in:
parent
a8a8a669b8
commit
e7c9bab5ae
|
|
@ -102,6 +102,7 @@ void isotropic_remeshing(const FaceRange& faces
|
|||
{
|
||||
typedef PolygonMesh PM;
|
||||
typedef typename boost::graph_traits<PM>::vertex_descriptor vertex_descriptor;
|
||||
typedef typename boost::graph_traits<PM>::edge_descriptor edge_descriptor;
|
||||
using boost::choose_pmap;
|
||||
using boost::get_param;
|
||||
using boost::choose_param;
|
||||
|
|
@ -125,9 +126,12 @@ void isotropic_remeshing(const FaceRange& faces
|
|||
NamedParameters,
|
||||
internal::Border_constraint_pmap<PM, FaceRange>//default
|
||||
> ::type ECMap;
|
||||
ECMap ecmap
|
||||
= choose_param(get_param(np, edge_is_constrained),
|
||||
internal::Border_constraint_pmap<PM, FaceRange>(pmesh, faces));
|
||||
ECMap ecmap = (boost::is_same<ECMap, internal::Border_constraint_pmap<PM, FaceRange> >::value)
|
||||
//avoid constructing the Border_constraint_pmap if it's not used
|
||||
? choose_param(get_param(np, edge_is_constrained)
|
||||
, internal::Border_constraint_pmap<PM, FaceRange>(pmesh, faces))
|
||||
: choose_param(get_param(np, edge_is_constrained)
|
||||
, internal::Border_constraint_pmap<PM, FaceRange>());
|
||||
|
||||
typedef typename boost::lookup_named_param_def <
|
||||
CGAL::vertex_is_constrained_t,
|
||||
|
|
|
|||
Loading…
Reference in New Issue