mirror of https://github.com/CGAL/cgal
rename plc_face_id to plc_facet_id
This commit is contained in:
parent
08e0d6b839
commit
19f10ea890
|
|
@ -37,7 +37,7 @@ int main(int argc, char* argv[])
|
|||
std::cout << "Wrote segmented mesh to " << filename << "\n";
|
||||
|
||||
auto ccdt = CGAL::make_conforming_constrained_Delaunay_triangulation_3(mesh,
|
||||
CGAL::parameters::plc_face_id(face_patch_map));
|
||||
CGAL::parameters::plc_facet_id(face_patch_map));
|
||||
|
||||
std::cout << "Number of vertices in the CDT: "
|
||||
<< ccdt.triangulation().number_of_vertices() << '\n'
|
||||
|
|
@ -47,7 +47,7 @@ int main(int argc, char* argv[])
|
|||
filename = argc > 3 ? argv[3] : "out.mesh";
|
||||
std::ofstream out(filename);
|
||||
out.precision(17);
|
||||
CGAL::IO::write_MEDIT(out, ccdt, CGAL::parameters::with_plc_face_id(true));
|
||||
CGAL::IO::write_MEDIT(out, ccdt, CGAL::parameters::with_plc_facet_id(true));
|
||||
std::cout << "Wrote CDT to " << filename << "\n";
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -659,14 +659,14 @@ public:
|
|||
auto v_selected_map = get(CGAL::dynamic_vertex_property_t<bool>{}, mesh);
|
||||
|
||||
int number_of_patches = 0;
|
||||
constexpr bool has_plc_face_id = !parameters::is_default_parameter<CGAL_NP_CLASS, internal_np::plc_face_id_t>::value;
|
||||
constexpr bool has_plc_facet_id = !parameters::is_default_parameter<CGAL_NP_CLASS, internal_np::plc_facet_id_t>::value;
|
||||
|
||||
if constexpr (has_plc_face_id) {
|
||||
auto mesh_plc_face_id = parameters::get_parameter(np, internal_np::plc_face_id);
|
||||
using Patch_id_type = CGAL::cpp20::remove_cvref_t<decltype(get(mesh_plc_face_id, *faces(mesh).first))>;
|
||||
if constexpr (has_plc_facet_id) {
|
||||
auto mesh_plc_facet_id = parameters::get_parameter(np, internal_np::plc_facet_id);
|
||||
using Patch_id_type = CGAL::cpp20::remove_cvref_t<decltype(get(mesh_plc_facet_id, *faces(mesh).first))>;
|
||||
Patch_id_type max_patch_id{0};
|
||||
for(auto f : faces(mesh)) {
|
||||
max_patch_id = (std::max)(max_patch_id, get(mesh_plc_face_id, f));
|
||||
max_patch_id = (std::max)(max_patch_id, get(mesh_plc_facet_id, f));
|
||||
}
|
||||
number_of_patches = static_cast<int>(max_patch_id + 1);
|
||||
patch_edges.resize(number_of_patches);
|
||||
|
|
@ -674,9 +674,9 @@ public:
|
|||
if(is_border(h, mesh))
|
||||
continue;
|
||||
auto f = face(h, mesh);
|
||||
auto patch_id = get(mesh_plc_face_id, f);
|
||||
auto patch_id = get(mesh_plc_facet_id, f);
|
||||
auto opp = opposite(h, mesh);
|
||||
if(is_border(opp, mesh) || patch_id != get(mesh_plc_face_id, face(opp, mesh))) {
|
||||
if(is_border(opp, mesh) || patch_id != get(mesh_plc_facet_id, face(opp, mesh))) {
|
||||
auto va = source(h, mesh);
|
||||
auto vb = target(h, mesh);
|
||||
patch_edges[patch_id].emplace_back(va, vb);
|
||||
|
|
@ -693,7 +693,7 @@ public:
|
|||
auto tr_vertex_map = get(CGAL::dynamic_vertex_property_t<Vertex_handle>(), mesh);
|
||||
Cell_handle hint_ch{};
|
||||
for(auto v : vertices(mesh)) {
|
||||
if constexpr(has_plc_face_id) {
|
||||
if constexpr(has_plc_facet_id) {
|
||||
if(false == get(v_selected_map, v)) continue;
|
||||
}
|
||||
auto p = get(mesh_vp_map, v);
|
||||
|
|
@ -710,7 +710,7 @@ public:
|
|||
auto operator()(vertex_descriptor v) const { return get(*vertex_map, v); }
|
||||
} tr_vertex_fct{&tr_vertex_map};
|
||||
|
||||
if constexpr(has_plc_face_id) {
|
||||
if constexpr(has_plc_facet_id) {
|
||||
for(int i = 0; i < number_of_patches; ++i) {
|
||||
auto& edges = patch_edges[i];
|
||||
if(edges.empty())
|
||||
|
|
@ -793,12 +793,12 @@ public:
|
|||
auto point_map = choose_parameter(get_parameter(np, internal_np::point_map),
|
||||
CGAL::Identity_property_map<PointRange_value_type>{});
|
||||
|
||||
constexpr bool has_plc_face_id = !parameters::is_default_parameter<NamedParams, internal_np::plc_face_id_t>::value;
|
||||
constexpr bool has_plc_facet_id = !parameters::is_default_parameter<NamedParams, internal_np::plc_facet_id_t>::value;
|
||||
|
||||
using std::cbegin;
|
||||
using std::cend;
|
||||
|
||||
if constexpr (false == has_plc_face_id) {
|
||||
if constexpr (false == has_plc_facet_id) {
|
||||
using Vertex_handle = typename Triangulation::Vertex_handle;
|
||||
using Cell_handle = typename Triangulation::Cell_handle;
|
||||
using Vec_vertex_handle = std::vector<Vertex_handle>;
|
||||
|
|
@ -837,7 +837,7 @@ public:
|
|||
using PID = CGAL::cpp20::remove_cvref_t<decltype(get(polygon_patch_map, 0u))>;
|
||||
constexpr auto invalid_patch_id = (std::numeric_limits<PID>::max)();
|
||||
Surface_mesh surface_mesh;
|
||||
auto plc_face_id_pmap =
|
||||
auto plc_facet_id_pmap =
|
||||
surface_mesh.template add_property_map<face_descriptor, PID>("fpm", invalid_patch_id).first;
|
||||
|
||||
auto to_point = [point_map](const PointRange_value_type& v) { return get(point_map, v); };
|
||||
|
|
@ -850,14 +850,14 @@ public:
|
|||
PMP::orient_polygon_soup(rw_points, rw_polygons);
|
||||
|
||||
auto polygon_to_face_output_iterator = boost::make_function_output_iterator(
|
||||
[plc_face_id_pmap, polygon_patch_map](std::pair<std::size_t, face_descriptor> pid_f) {
|
||||
put(plc_face_id_pmap, pid_f.second, get(polygon_patch_map, pid_f.first));
|
||||
[plc_facet_id_pmap, polygon_patch_map](std::pair<std::size_t, face_descriptor> pid_f) {
|
||||
put(plc_facet_id_pmap, pid_f.second, get(polygon_patch_map, pid_f.first));
|
||||
});
|
||||
PMP::polygon_soup_to_polygon_mesh(std::move(rw_points), std::move(rw_polygons), surface_mesh,
|
||||
np.polygon_to_face_output_iterator(polygon_to_face_output_iterator));
|
||||
|
||||
Conforming_constrained_Delaunay_triangulation_3 ccdt{std::move(surface_mesh),
|
||||
CGAL::parameters::plc_face_id(plc_face_id_pmap)
|
||||
CGAL::parameters::plc_facet_id(plc_facet_id_pmap)
|
||||
.do_self_intersection_tests(false)
|
||||
.geom_traits(cdt_impl.geom_traits())};
|
||||
*this = std::move(ccdt);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace IO
|
|||
* \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamNBegin{with_plc_face_id}
|
||||
* \cgalParamNBegin{with_plc_facet_id}
|
||||
* \cgalParamDescription{a Boolean activating the numbering of PLC face identifiers in the output}
|
||||
* \cgalParamType{Boolean}
|
||||
* \cgalParamDefault{`false`}
|
||||
|
|
@ -80,11 +80,11 @@ void write_MEDIT(std::ostream& os,
|
|||
|
||||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter;
|
||||
const bool has_plc_face_id
|
||||
= choose_parameter(get_parameter(np, internal_np::with_plc_face_id), false);
|
||||
const bool has_plc_facet_id
|
||||
= choose_parameter(get_parameter(np, internal_np::with_plc_facet_id), false);
|
||||
|
||||
auto plc_patch_map = boost::make_function_property_map<Facet>([&](const Facet& f)
|
||||
{ return has_plc_face_id ? f.first->ccdt_3_data().face_constraint_index(f.second) + 1 : 1; });
|
||||
{ return has_plc_facet_id ? f.first->ccdt_3_data().face_constraint_index(f.second) + 1 : 1; });
|
||||
|
||||
return SMDS_3::output_to_medit(os,
|
||||
tr,
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@ namespace CGAL {
|
|||
during the triangulation process.
|
||||
|
||||
By default, each face of the input is considered a polygonal constraint for the triangulation. The
|
||||
named parameter `plc_face_id` can be used to describe larger polygonal constraints, possibly with holes. If
|
||||
named parameter `plc_facet_id` can be used to describe larger polygonal constraints, possibly with holes. If
|
||||
used, this parameter must be a property map that associates each face of the input with a patch
|
||||
identifier. Faces with the same patch identifier are considered part of the same surface patch. Each of these
|
||||
surface patches (defined as the union of the input faces with a given patch identifier) is expected to be a polygon or
|
||||
a polygon with holes, with coplanar vertices (or nearly coplanar up to the precision of the number type used).
|
||||
|
||||
The generated triangulation will conform to the faces of the input, or to the surface patches
|
||||
described by the `plc_face_id` property map if provided.
|
||||
described by the `plc_facet_id` property map if provided.
|
||||
|
||||
|
||||
\pre The input data must not be coplanar.
|
||||
|
|
@ -111,7 +111,7 @@ namespace CGAL {
|
|||
* must be available in `PolygonMesh`.}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalParamNBegin{plc_face_id}
|
||||
* \cgalParamNBegin{plc_facet_id}
|
||||
* \cgalParamDescription{a property map associating a patch identifier to each face of `mesh`.
|
||||
* Each identifier corresponds to a planar surface patch. Each surface
|
||||
* patch can be composed of several faces of `mesh`, forming a planar polygon.}
|
||||
|
|
@ -187,7 +187,7 @@ auto make_conforming_constrained_Delaunay_triangulation_3(const PolygonMesh &mes
|
|||
* \cgalParamDefault{`CGAL::Identity_property_map`}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalParamNBegin{plc_face_id}
|
||||
* \cgalParamNBegin{plc_facet_id}
|
||||
* \cgalParamDescription{a property map associating a patch identifier to each face of `soup`.
|
||||
* Each identifier corresponds to a planar surface patch. Each surface
|
||||
* patch can be composed of several faces of `soup`, forming a planar polygon.}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class CDT_3_plugin : public QObject, public CGAL_Lab_plugin_interface
|
|||
|
||||
if(patch_id_pmap_opt.has_value()) {
|
||||
cdt = CGAL::make_conforming_constrained_Delaunay_triangulation_3<CDT>(
|
||||
*mesh, CGAL::parameters::face_patch_map(*patch_id_pmap_opt));
|
||||
*mesh, CGAL::parameters::plc_facet_id(*patch_id_pmap_opt));
|
||||
} else {
|
||||
cdt = CGAL::make_conforming_constrained_Delaunay_triangulation_3<CDT>(*mesh);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -406,5 +406,5 @@ CGAL_add_named_parameter_with_compatibility_ref_only(angles_param_t, angles_para
|
|||
CGAL_add_named_parameter(maximum_height_t, maximum_height, maximum_height)
|
||||
|
||||
// List of named parameters used in the package 'Constrained_triangulation_3'
|
||||
CGAL_add_named_parameter(plc_face_id_t, plc_face_id, plc_face_id)
|
||||
CGAL_add_named_parameter(with_plc_face_id_t, with_plc_face_id, with_plc_face_id)
|
||||
CGAL_add_named_parameter(plc_facet_id_t, plc_facet_id, plc_facet_id)
|
||||
CGAL_add_named_parameter(with_plc_facet_id_t, with_plc_facet_id, with_plc_facet_id)
|
||||
|
|
|
|||
Loading…
Reference in New Issue