Skip to content

Commit

Permalink
start adding checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Oct 23, 2024
1 parent a896d30 commit 0f8e1fc
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Convex_hull_3/include/CGAL/convex_hull_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,8 @@ void convex_hull_3(const VertexListGraph& g,
PolygonMesh& pm,
const NamedParameters& np = parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, vertex_point_t);

using CGAL::parameters::choose_parameter;
using CGAL::parameters::get_parameter;

Expand Down
20 changes: 16 additions & 4 deletions Kinetic_space_partition/include/CGAL/Kinetic_space_partition_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ class Kinetic_space_partition_3 {
m_parameters(
parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::debug), false)), // use true here to export all steps
m_input2regularized() {}
m_input2regularized()
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, verbose_t, debug_t);
}

/*!
\brief constructs a kinetic space partition object and initializes it.
Expand Down Expand Up @@ -355,7 +358,11 @@ class Kinetic_space_partition_3 {
m_parameters(
parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::debug), false)), // use true here to export all steps
m_input2regularized() {
m_input2regularized()
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, point_t, debug_t, verbose_t, reorient_bbox_t,
bbox_dilation_ratio_t, max_octree_depth_t, max_octree_node_size_t);

insert(points, polygons, np);
initialize(np);
}
Expand Down Expand Up @@ -393,7 +400,9 @@ class Kinetic_space_partition_3 {
void insert(
const PointRange& points,
const PolygonRange& polygons,
const NamedParameters& np = CGAL::parameters::default_values()) {
const NamedParameters& np = CGAL::parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, point_t);

using NP_helper = Point_set_processing_3_np_helper<PointRange, NamedParameters>;
using PointMap = typename NP_helper::Point_map;
Expand Down Expand Up @@ -480,7 +489,10 @@ class Kinetic_space_partition_3 {
template<
typename NamedParameters = parameters::Default_named_parameters>
void initialize(
const NamedParameters& np = CGAL::parameters::default_values()) {
const NamedParameters& np = CGAL::parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, reorient_bbox_t, bbox_dilation_ratio_t, max_octree_depth_t, max_octree_node_size_t);

Timer timer;
m_parameters.bbox_dilation_ratio = parameters::choose_parameter(
parameters::get_parameter(np, internal_np::bbox_dilation_ratio), FT(11) / FT(10));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ class Kinetic_surface_reconstruction_3 {
*/
template<typename NamedParameters = parameters::Default_named_parameters>
Kinetic_surface_reconstruction_3(Point_range& points,
const NamedParameters& np = CGAL::parameters::default_values()) : m_points(points), m_ground_polygon_index(-1), m_kinetic_partition(np) {
const NamedParameters& np = CGAL::parameters::default_values()) : m_points(points), m_ground_polygon_index(-1), m_kinetic_partition(np)
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, point_t);

m_verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false);
m_debug = parameters::choose_parameter(parameters::get_parameter(np, internal_np::debug), false);

Expand Down Expand Up @@ -178,7 +181,14 @@ class Kinetic_surface_reconstruction_3 {
*/
template<typename CGAL_NP_TEMPLATE_PARAMETERS>
std::size_t detect_planar_shapes(const CGAL_NP_CLASS& np = parameters::default_values()) {
std::size_t detect_planar_shapes(const CGAL_NP_CLASS& np = parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, point_t, normal_t, k_neighbors_t, maximum_distance_t, maximum_angle_t,
minimum_region_size_t, angle_tolerance_t, maximum_offset_t,
regularize_parallelism_t, regularize_orthogonality_t, regularize_coplanarity_t,
regularize_axis_symmetry_t, symmetry_direction_t);


m_verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), m_verbose);
m_debug = parameters::choose_parameter(parameters::get_parameter(np, internal_np::debug), m_debug);

Expand Down Expand Up @@ -319,7 +329,13 @@ class Kinetic_surface_reconstruction_3 {
*/
template<typename CGAL_NP_TEMPLATE_PARAMETERS>
void detection_and_partition(std::size_t k, const CGAL_NP_CLASS& np = parameters::default_values()) {
void detection_and_partition(std::size_t k, const CGAL_NP_CLASS& np = parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, point_t, normal_t, k_neighbors_t, maximum_distance_t, maximum_angle_t,
minimum_region_size_t, angle_tolerance_t, maximum_offset_t, regularize_parallelism_t,
regularize_orthogonality_t, regularize_coplanarity_t, regularize_axis_symmetry_t,
symmetry_direction_t, reorient_bbox_t, bbox_dilation_ratio_t);

detect_planar_shapes(np);
initialize_partition(np);
partition(k);
Expand Down Expand Up @@ -373,7 +389,10 @@ class Kinetic_surface_reconstruction_3 {
\pre shape detection performed
*/
template<typename CGAL_NP_TEMPLATE_PARAMETERS>
void initialize_partition(const CGAL_NP_CLASS& np = parameters::default_values()) {
void initialize_partition(const CGAL_NP_CLASS& np = parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, reorient_bbox_t, bbox_dilation_ratio_t);

m_kinetic_partition.initialize(np);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ int edge_collapse(TM& tmesh,
const ShouldStop& should_stop,
const NamedParameters& np = parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, vertex_point_t, geom_traits_t, halfedge_index_t, get_cost_policy_t,
get_placement_policy_t, filter_t, edge_is_constrained_t,
visitor_t, vertex_index_t, use_relaxed_order_t);


using parameters::choose_parameter;
using parameters::get_parameter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ Adaptive_remeshing_sizing_field<Tr>
create_adaptive_remeshing_sizing_field(const Tr& tr,
const CGAL_NP_CLASS& np = parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, edge_is_constrained_t, facet_is_constrained_t, cell_selector_t);

using parameters::choose_parameter;
using parameters::get_parameter;

Expand Down
6 changes: 6 additions & 0 deletions Tetrahedral_remeshing/include/CGAL/tetrahedral_remeshing.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ void tetrahedral_isotropic_remeshing(
const SizingFunction& sizing,
const NamedParameters& np = parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, number_of_iterations_t, remesh_boundaries_t, facet_is_constrained_t,
edge_is_constrained_t, vertex_is_constrained_t, cell_selector_t,
smooth_constrained_edges_t);

CGAL_expensive_assertion(tr.is_valid());

using Tr = CGAL::Triangulation_3<Traits, TDS, SLDS>;
Expand Down Expand Up @@ -357,6 +361,8 @@ convert_to_triangulation_3(
CGAL::Mesh_complex_3_in_triangulation_3<Tr, CornerIndex, CurveIndex> c3t3,
const NamedParameters& np = parameters::default_values())
{
CGAL_CHECK_AUTHORIZED_NAMED_PARAMETERS(np, edge_is_constrained_t, vertex_is_constrained_t);

using parameters::get_parameter;
using parameters::choose_parameter;

Expand Down

0 comments on commit 0f8e1fc

Please sign in to comment.