use do_not_triangulate_faces

a NP that already existed before this PR
This commit is contained in:
Jane Tournois 2024-02-12 17:08:46 +01:00
parent 801d7822c6
commit b48760af26
3 changed files with 9 additions and 7 deletions

View File

@ -278,9 +278,11 @@ namespace CGAL {
* axis-aligned bounding box.}
* \cgalParamDefault{1.}
* \cgalParamNEnd
* \cgalParamNBegin{triangulate_bbox}
* \cgalParamDescription{a boolean used to specify if the bounding box should be triangulated or not.}
* \cgalParamDefault{true}
* \cgalParamNBegin{do_not_triangulate_faces}
* \cgalParamDescription{a boolean used to specify if the bounding box faces
* should be triangulated or not.
* The default value is `false`, and faces are triangulated.}
* \cgalParamDefault{false}
* \cgalParamNEnd
* \cgalParamNBegin{geom_traits}
* \cgalParamDescription{an instance of a geometric traits class providing the functor `Construct_bbox_3`,
@ -306,7 +308,8 @@ namespace CGAL {
using Vector_3 = typename GT::Vector_3;
double factor = choose_parameter(get_parameter(np, internal_np::bbox_scaling), 1.);
bool triangulate = choose_parameter(get_parameter(np, internal_np::triangulate_bbox), true);
bool dont_triangulate = choose_parameter(
get_parameter(np, internal_np::do_not_triangulate_faces), false);
Iso_cuboid_3 bb(CGAL::Polygon_mesh_processing::bbox(pmesh));
Point_3 bb_center(0.5 * (bb.xmax() + bb.xmin()),
@ -321,7 +324,7 @@ namespace CGAL {
bbext[4], bbext[5], bbext[6], bbext[7],
bbox_mesh);
if(triangulate)
if(!dont_triangulate)
CGAL::Polygon_mesh_processing::triangulate_faces(bbox_mesh);
CGAL::copy_face_graph(bbox_mesh, pmesh,

View File

@ -395,7 +395,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionAddBbox_triggered(Scene_
const double scaling = ui.bbox_scaling->value();
CGAL::Polygon_mesh_processing::add_bbox(*poly_item->face_graph(),
CGAL::parameters::bbox_scaling(scaling).
triangulate_bbox(ui.triangulate_bbox->isChecked()));
do_not_triangulate_faces(!ui.triangulate_bbox->isChecked()));
poly_item->invalidateOpenGLBuffers();
Q_EMIT poly_item->itemChanged();

View File

@ -164,7 +164,6 @@ CGAL_add_named_parameter(region_primitive_map_t, region_primitive_map, region_pr
CGAL_add_named_parameter(postprocess_regions_t, postprocess_regions, postprocess_regions)
CGAL_add_named_parameter(sizing_function_t, sizing_function, sizing_function)
CGAL_add_named_parameter(bbox_scaling_t, bbox_scaling, bbox_scaling)
CGAL_add_named_parameter(triangulate_bbox_t, triangulate_bbox, triangulate_bbox)
// List of named parameters that we use in the package 'Surface Mesh Simplification'
CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost)