CGAL 5.6.2 - Shape Regularization
CGAL::Shape_regularization::QP_regularization< GeomTraits, InputRange, NeighQuery, RegType, QPSolver > Class Template Reference

#include <CGAL/Shape_regularization/QP_regularization.h>

Definition

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
GeomTraitsa model of Kernel
InputRangea model of ConstRange
NeighQuerya model of NeighborQuery
RegTypea model of RegularizationType
QPSolvera 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. More...
 

Regularization

void regularize ()
 runs the shape regularization algorithm.
 

Memory Management

void clear ()
 clears all internal data structures. More...
 
void release_memory ()
 releases all memory that is used internally. More...
 

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
NamedParametersa sequence of Named Parameters
Parameters
input_rangea const range of input objects for shape regularization
neighbor_queryan instance of NeighQuery that is used internally to access object neighbors
regularization_typean instance of RegType that is used internally to obtain object bounds and target values
quadratic_programan instance of QPSolver to solve the quadratic programming problem
npan 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.