mirror of https://github.com/CGAL/cgal
Merge pull request #6635 from sloriot/PMP-split_long_edges_np
Add face_patch_map to split_long_edges
This commit is contained in:
commit
a9b4bf3ffb
|
|
@ -441,18 +441,24 @@ namespace internal {
|
|||
//insert new edges to keep triangular faces, and update long_edges
|
||||
if (!is_border(hnew, mesh_))
|
||||
{
|
||||
Patch_id patch_id = get_patch_id(face(hnew, mesh_));
|
||||
halfedge_descriptor hnew2 =
|
||||
CGAL::Euler::split_face(hnew, next(next(hnew, mesh_), mesh_), mesh_);
|
||||
put(ecmap_, edge(hnew2, mesh_), false);
|
||||
set_patch_id(face(hnew2, mesh_), patch_id);
|
||||
set_patch_id(face(opposite(hnew2, mesh_), mesh_), patch_id);
|
||||
}
|
||||
|
||||
//do it again on the other side if we're not on boundary
|
||||
halfedge_descriptor hnew_opp = opposite(hnew, mesh_);
|
||||
if (!is_border(hnew_opp, mesh_))
|
||||
{
|
||||
Patch_id patch_id = get_patch_id(face(hnew_opp, mesh_));
|
||||
halfedge_descriptor hnew2 =
|
||||
CGAL::Euler::split_face(prev(hnew_opp, mesh_), next(hnew_opp, mesh_), mesh_);
|
||||
put(ecmap_, edge(hnew2, mesh_), false);
|
||||
set_patch_id(face(hnew2, mesh_), patch_id);
|
||||
set_patch_id(face(opposite(hnew2, mesh_), mesh_), patch_id);
|
||||
}
|
||||
}
|
||||
#ifdef CGAL_PMP_REMESHING_VERBOSE
|
||||
|
|
|
|||
|
|
@ -377,6 +377,17 @@ void isotropic_remeshing(const FaceRange& faces
|
|||
* \cgalParamDefault{an automatically indexed internal map}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalParamNBegin{face_patch_map}
|
||||
* \cgalParamDescription{a property map with the patch id's associated to the faces of `faces`}
|
||||
* \cgalParamType{a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::%face_descriptor`
|
||||
* as key type and the desired property, model of `CopyConstructible` and `LessThanComparable` as value type.}
|
||||
* \cgalParamDefault{a default property map where each face is associated with the ID of
|
||||
* the connected component it belongs to. Connected components are
|
||||
* computed with respect to the constrained edges listed in the property map
|
||||
* `edge_is_constrained_map`}
|
||||
* \cgalParamExtra{The map is updated during the remeshing process while new faces are created.}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalParamNBegin{edge_is_constrained_map}
|
||||
* \cgalParamDescription{a property map containing the constrained-or-not status of each edge of `pmesh`}
|
||||
* \cgalParamType{a class model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::%edge_descriptor`
|
||||
|
|
@ -421,14 +432,22 @@ void split_long_edges(const EdgeRange& edges
|
|||
ECMap ecmap = choose_parameter(get_parameter(np, internal_np::edge_is_constrained),
|
||||
Static_boolean_property_map<edge_descriptor, false>());
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def <
|
||||
internal_np::face_patch_t,
|
||||
NamedParameters,
|
||||
internal::Connected_components_pmap<PM, FIMap>//default
|
||||
> ::type FPMap;
|
||||
FPMap fpmap = choose_parameter(
|
||||
get_parameter(np, internal_np::face_patch),
|
||||
internal::Connected_components_pmap<PM, FIMap>(faces(pmesh), pmesh, ecmap, fimap, false));
|
||||
|
||||
typename internal::Incremental_remesher<PM, VPMap, GT, ECMap,
|
||||
Static_boolean_property_map<vertex_descriptor, false>, // no constraint pmap
|
||||
internal::Connected_components_pmap<PM, FIMap>,
|
||||
FIMap
|
||||
FPMap,FIMap
|
||||
>
|
||||
remesher(pmesh, vpmap, gt, false/*protect constraints*/, ecmap,
|
||||
Static_boolean_property_map<vertex_descriptor, false>(),
|
||||
internal::Connected_components_pmap<PM, FIMap>(faces(pmesh), pmesh, ecmap, fimap, false),
|
||||
fpmap,
|
||||
fimap,
|
||||
false/*need aabb_tree*/);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue