CGAL 6.1.1 - Shape Regularization

Loading...
Searching...
No Matches
Classes | Functions
Contours
Reference Manual

##

Models and functions that can be used when regularizing contours.

## Classes
class | CGAL::Shape_regularization::Contours::Longest_direction_2< GeomTraits, InputRange, PointMap >
| Estimates the longest principal direction of the contour. More...
class | CGAL::Shape_regularization::Contours::Multiple_directions_2< GeomTraits, InputRange, PointMap >
| Estimates possibly multiple principal directions of the contour based on the user-specified minimum length and maximum angle bounds. More...
class | CGAL::Shape_regularization::Contours::User_defined_directions_2< GeomTraits, InputRange, PointMap >
| Sets multiple user-specified principal directions of the contour. More...

## Functions
template<typename InputRange , typename ContDirections , typename OutIterator , typename NamedParameters = parameters::Default_named_parameters>
OutIterator | CGAL::Shape_regularization::Contours::regularize_closed_contour (const InputRange &input_range, const ContDirections &directions, OutIterator contour, const NamedParameters &np=parameters::default_values())
| regularizes closed contours.
template<typename InputRange , typename OutIterator >
OutIterator | CGAL::Shape_regularization::Contours::regularize_closed_contour (const InputRange &input_range, OutIterator contour)
| regularizes closed contours.
template<typename InputRange , typename ContDirections , typename OutIterator , typename NamedParameters = parameters::Default_named_parameters>
OutIterator | CGAL::Shape_regularization::Contours::regularize_open_contour (const InputRange &input_range, const ContDirections &directions, OutIterator contour, const NamedParameters &np=parameters::default_values())
| regularizes open contours.
template<typename InputRange , typename OutIterator >
OutIterator | CGAL::Shape_regularization::Contours::regularize_open_contour (const InputRange &input_range, OutIterator contour)
| regularizes open contours.

## Function Documentation

## ◆ regularize_closed_contour() [1/2]

template<typename InputRange , typename ContDirections , typename OutIterator , typename NamedParameters = parameters::Default_named_parameters>

OutIterator CGAL::Shape_regularization::Contours::regularize_closed_contour | ( | const InputRange & | input_range,
|  | const ContDirections & | directions,
|  | OutIterator | contour,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/Shape_regularization/regularize_contours.h>`

regularizes closed contours.

Given a set of ordered 2D points connected by segments, which form a closed contour, this function enables to reinforce three types of regularities among consecutive edges of this contour:

- Parallelism: contour edges, which are detected as near parallel, are made exactly parallel.
- Orthogonality: contour edges, which are detected as near orthogonal, are made exactly orthogonal.
- Collinearity: parallel contour edges, which are detected as near collinear, are made exactly collinear.

The principal directions of the contour are provided via the concept `ContourDirections`.

Template Parameters

  InputRange | a model of `ConstRange` whose iterator type is `RandomAccessIterator`
  ContDirections | a model of `ContourDirections`
  OutIterator | a model of `OutputIterator` that accepts points of type `GeomTraits::Point_2`
  NamedParameters | a sequence of Named Parameters

Parameters

  input_range | a const range of ordered points, which form a contour
  directions | estimated contour directions towards which the contour edges are oriented
  contour | an output iterator with points of the regularized contour
  np | an optional sequence of Named Parameters among the ones listed below; this parameter can be omitted, the default values are then used

Optional Named Parameters

  maximum allowed orthogonal distance between two parallel and consecutive contour edges such that they are considered to be collinear Type: `GeomTraits::FT` Default: 0.5 unit length |
  a property map that maps an item from `input_range` to `GeomTraits::Point_2` Type: a model of `ReadablePropertyMap` whose key type is the value type of the input range and value type is `GeomTraits::Point_2` Default: `CGAL::Identity_property_map` |
  an instance of geometric traits class Type: a model of `Kernel` Default: a CGAL `Kernel` deduced from the point type, using `CGAL::Kernel_traits` |

Returns
  an output iterator to the element in the destination range, one past the last contour vertex stored

Precondition
  input_range.size() >= 3

Examples
  Shape_regularization/regularize_closed_contour.cpp, and Shape_regularization/regularize_contour.cpp.

## ◆ regularize_closed_contour() [2/2]

template<typename InputRange , typename OutIterator >

OutIterator CGAL::Shape_regularization::Contours::regularize_closed_contour | ( | const InputRange & | input_range,
|  | OutIterator | contour
| ) |  |

`#include <CGAL/Shape_regularization/regularize_contours.h>`

regularizes closed contours.

This function regularizes a closed contour with respect to the longest edge of this contour.

## ◆ regularize_open_contour() [1/2]

template<typename InputRange , typename ContDirections , typename OutIterator , typename NamedParameters = parameters::Default_named_parameters>

OutIterator CGAL::Shape_regularization::Contours::regularize_open_contour | ( | const InputRange & | input_range,
|  | const ContDirections & | directions,
|  | OutIterator | contour,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/Shape_regularization/regularize_contours.h>`

regularizes open contours.

Given a set of ordered 2D points connected by segments, which form an open contour, this function enables to reinforce three types of regularities among consecutive edges of this contour:

- Parallelism: contour edges, which are detected as near parallel, are made exactly parallel.
- Orthogonality: contour edges, which are detected as near orthogonal, are made exactly orthogonal.
- Collinearity: parallel contour edges, which are detected as near collinear, are made exactly collinear.

The principal directions of the contour are provided via the concept `ContourDirections`.

Template Parameters

  InputRange | a model of `ConstRange` whose iterator type is `RandomAccessIterator`
  ContDirections | a model of `ContourDirections`
  OutIterator | a model of `OutputIterator` that accepts points of type `GeomTraits::Point_2`
  NamedParameters | a sequence of Named Parameters

Parameters

  input_range | a const range of ordered points, which form a contour
  directions | estimated contour directions towards which the contour edges are oriented
  contour | an output iterator with points of the regularized contour
  np | an optional sequence of Named Parameters among the ones listed below; this parameter can be omitted, the default values are then used

Optional Named Parameters

  maximum allowed orthogonal distance between two parallel and consecutive contour edges such that they are considered to be collinear Type: `GeomTraits::FT` Default: 0.5 unit length |
  a property map that maps an item from `input_range` to `GeomTraits::Point_2` Type: a model of `ReadablePropertyMap` whose key type is the value type of the input range and value type is `GeomTraits::Point_2` Default: `CGAL::Identity_property_map` |
  an instance of geometric traits class Type: a model of `Kernel` Default: a CGAL `Kernel` deduced from the point type, using `CGAL::Kernel_traits` |

Returns
  an output iterator to the element in the destination range, one past the last contour vertex stored

Precondition
  input_range.size() >= 2

Examples
  Shape_regularization/regularize_open_contour.cpp.

## ◆ regularize_open_contour() [2/2]

template<typename InputRange , typename OutIterator >

OutIterator CGAL::Shape_regularization::Contours::regularize_open_contour | ( | const InputRange & | input_range,
|  | OutIterator | contour
| ) |  |

`#include <CGAL/Shape_regularization/regularize_contours.h>`

regularizes open contours.

This function regularizes an open contour with respect to the longest edge of this contour.