CGAL 6.1.1 - Shape Regularization

Loading...
Searching...
No Matches
List of all members | Classes
CGAL::Shape_regularization::QP_regularization< GeomTraits, InputRange, NeighQuery, RegType, QPSolver > Class Template Reference
Reference Manual

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

## Definition

template<typename GeomTraits, typename InputRange, typename NeighQuery, typename RegType, typename QPSolver>
class CGAL::Shape_regularization::QP_regularization< GeomTraits, InputRange, NeighQuery, RegType, QPSolver >

Shape regularization algorithm based on the quadratic programming global optimization.

Given a quadratic programming solver via the class `QuadraticProgramTraits`, this version of the shape regularization algorithm enables to regularize a set of user-specified geometric objects provided a way

- to access neighbors of each object via the `NeighborQuery` class;
- to obtain a maximum bound on a regularization characteristic (angle-orientation/ distance-offset/etc.) with respect to which an object is being regularized via the `RegularizationType` class;
- to obtain a target value for each pair of neighbor objects via the `RegularizationType` class.

This class is generic and forms a framework for different types of user-specified regularizations. Please refer to the user manual in order to learn how to use it. In particular, section Regularizing 2D Segments shows an example.

Template Parameters

  GeomTraits | a model of `Kernel`
  InputRange | a model of `ConstRange`
  NeighQuery | a model of `NeighborQuery`
  RegType | a model of `RegularizationType`
  QPSolver | a model of `QuadraticProgramTraits`

Examples
  Shape_regularization/regularize_15_segments.cpp, and Shape_regularization/regularize_framework.cpp.

## Initialization
template<typename NamedParameters = parameters::Default_named_parameters>
| QP_regularization (const InputRange &input_range, NeighQuery &neighbor_query, RegType &regularization_type, QPSolver &quadratic_program, const NamedParameters &np=parameters::default_values())
| initializes all internal data structures.

## Regularization
void | regularize ()
| runs the shape regularization algorithm.

## Memory Management
void | clear ()
| clears all internal data structures.
void | release_memory ()
| releases all memory that is used internally.

## Constructor & Destructor Documentation

## ◆ QP_regularization()

template<typename GeomTraits , typename InputRange , typename NeighQuery , typename RegType , typename QPSolver >
template<typename NamedParameters = parameters::Default_named_parameters>

CGAL::Shape_regularization::QP_regularization< GeomTraits, InputRange, NeighQuery, RegType, QPSolver >::QP_regularization | ( | const InputRange & | input_range,
|  | NeighQuery & | neighbor_query,
|  | RegType & | regularization_type,
|  | QPSolver & | quadratic_program,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

initializes all internal data structures.

Template Parameters

  NamedParameters | a sequence of Named Parameters

Parameters

  input_range | a const range of input objects for shape regularization
  neighbor_query | an instance of `NeighQuery` that is used internally to access object neighbors
  regularization_type | an instance of `RegType` that is used internally to obtain object bounds and target values
  quadratic_program | an instance of `QPSolver` to solve the quadratic programming problem
  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

  an instance of geometric traits class Type: a model of `Kernel` Default: `GeomTraits()` |

Precondition
  input_range.size() >= 2

## Member Function Documentation

## ◆ clear()

template<typename GeomTraits , typename InputRange , typename NeighQuery , typename RegType , typename QPSolver >

void CGAL::Shape_regularization::QP_regularization< GeomTraits, InputRange, NeighQuery, RegType, QPSolver >::clear | ( |  | ) |

clears all internal data structures.

This method does not release the allocated memory but only removes the class internal data.

## ◆ release_memory()

template<typename GeomTraits , typename InputRange , typename NeighQuery , typename RegType , typename QPSolver >

void CGAL::Shape_regularization::QP_regularization< GeomTraits, InputRange, NeighQuery, RegType, QPSolver >::release_memory | ( |  | ) |

releases all memory that is used internally.

This method first calls the `clear()` method and then releases the allocated memory.