CGAL 5.6.3 - 2D Polyline Simplification

Loading...
Searching...
No Matches
Functions
Global Functions
2D Polyline Simplification Reference

##

## Functions
template<class Traits , class Container , class CostFunction , class StopFunction >
CGAL::Polygon_2< Traits, Container > | CGAL::Polyline_simplification_2::simplify (const CGAL::Polygon_2< Traits, Container > &polygon, CostFunction cost, StopFunction stop)
| Simplifies a single polygon.
template<class Traits , class Container , class CostFunction , class StopFunction >
CGAL::Polygon_with_holes_2< Traits, Container > | CGAL::Polyline_simplification_2::simplify (const CGAL::Polygon_with_holes_2< Traits, Container > &polygon, CostFunction cost, StopFunction stop)
| Simplifies a single polygon with holes.
template<class PointIterator , class CostFunction , class StopFunction , class PointOutputIterator >
PointOutputIterator | CGAL::Polyline_simplification_2::simplify (PointIterator b, PointIterator e, CostFunction cost, StopFunction stop, PointOutputIterator out, bool close=false)
| Simplifies an open or closed polyline given as an iterator range of 2D CGAL points.
template<class CDT , class CostFunction , class StopFunction >
std::size_t | CGAL::Polyline_simplification_2::simplify (CGAL::Constrained_triangulation_plus_2< CDT > &ct, typename CGAL::Constrained_triangulation_plus_2< CDT >::Constraint_id cid, CostFunction cost, StopFunction stop, bool remove_points=true)
| Simplifies a single polyline in a triangulation with polylines as constraints.
template<class CDT , class CostFunction , class StopFunction >
std::size_t | CGAL::Polyline_simplification_2::simplify (CGAL::Constrained_triangulation_plus_2< CDT > &ct, CostFunction cost, StopFunction stop, bool remove_points=true)
| Simplifies all polylines in a triangulation with polylines as constraints.

## Function Documentation

## ◆ simplify() [1/5]

template<class CDT , class CostFunction , class StopFunction >

std::size_t CGAL::Polyline_simplification_2::simplify | ( | CGAL::Constrained_triangulation_plus_2< CDT > & | ct,
|  | CostFunction | cost,
|  | StopFunction | stop,
|  | bool | remove_points = `true`
| ) |  |

`#include <CGAL/Polyline_simplification_2/simplify.h>`

Simplifies all polylines in a triangulation with polylines as constraints.

Parameters

  ct | The underlying constrained Delaunay triangulation which embeds the polyline constraints
  cost | The cost function
  stop | The stop function
  remove_points | If `true` the function `ct.remove_points_without_corresponding_vertex()` is called.

Returns
  the number of removed vertices

Template Parameters

  CDT | must be `CGAL::Constrained_triangulation_plus_2` with a vertex type that is model of `PolylineSimplificationVertexBase_2`.
  CostFunction | must be a model of `PolylineSimplificationCostFunction`
  StopFunction | must be a model of `PolylineSimplificationStopPredicate`

## ◆ simplify() [2/5]

template<class CDT , class CostFunction , class StopFunction >

std::size_t CGAL::Polyline_simplification_2::simplify | ( | CGAL::Constrained_triangulation_plus_2< CDT > & | ct,
|  | typename CGAL::Constrained_triangulation_plus_2< CDT >::Constraint_id | cid,
|  | CostFunction | cost,
|  | StopFunction | stop,
|  | bool | remove_points = `true`
| ) |  |

`#include <CGAL/Polyline_simplification_2/simplify.h>`

Simplifies a single polyline in a triangulation with polylines as constraints.

Parameters

  ct | The underlying constrained Delaunay triangulation which embeds the polyline constraints
  cid | The constraint identifier of the polyline constraint to simplify
  cost | The cost function
  stop | The stop function
  remove_points | If `true` the function `ct.remove_points_without_corresponding_vertex()` is called.

Returns
  the number of removed vertices

Template Parameters

  CDT | must be `CGAL::Constrained_triangulation_plus_2` with a vertex type that is model of `PolylineSimplificationVertexBase_2`.
  CostFunction | must be a model of `PolylineSimplificationCostFunction`
  StopFunction | must be a model of `PolylineSimplificationStopPredicate`

## ◆ simplify() [3/5]

template<class Traits , class Container , class CostFunction , class StopFunction >

CGAL::Polygon_2< Traits, Container > CGAL::Polyline_simplification_2::simplify | ( | const CGAL::Polygon_2< Traits, Container > & | polygon,
|  | CostFunction | cost,
|  | StopFunction | stop
| ) |  |

`#include <CGAL/Polyline_simplification_2/simplify.h>`

Simplifies a single polygon.

Template Parameters

  Traits | must be a model of `ConstrainedDelaunayTriangulationTraits_2`
  CostFunction | must be a model of `PolylineSimplificationCostFunction`.
  StopFunction | must be a model of `PolylineSimplificationStopPredicate`

Attention
  Any CGAL kernel can be used for `Traits`, but as the traits class is used for internally using a constrained Delaunay triangulation, it should be a kernel with at least exact predicates.

## ◆ simplify() [4/5]

template<class Traits , class Container , class CostFunction , class StopFunction >

CGAL::Polygon_with_holes_2< Traits, Container > CGAL::Polyline_simplification_2::simplify | ( | const CGAL::Polygon_with_holes_2< Traits, Container > & | polygon,
|  | CostFunction | cost,
|  | StopFunction | stop
| ) |  |

`#include <CGAL/Polyline_simplification_2/simplify.h>`

Simplifies a single polygon with holes.

Template Parameters

  Traits | must be a model of `ConstrainedDelaunayTriangulationTraits_2`
  CostFunction | must be a model of `PolylineSimplificationCostFunction`.
  StopFunction | must be a model of `PolylineSimplificationStopPredicate`

Attention
  Any CGAL kernel can be used for `Traits`, but as the traits class is used for internally using a constrained Delaunay triangulation, it should be a kernel with at least exact predicates.

## ◆ simplify() [5/5]

template<class PointIterator , class CostFunction , class StopFunction , class PointOutputIterator >

PointOutputIterator CGAL::Polyline_simplification_2::simplify | ( | PointIterator | b,
|  | PointIterator | e,
|  | CostFunction | cost,
|  | StopFunction | stop,
|  | PointOutputIterator | out,
|  | bool | close = `false`
| ) |  |

`#include <CGAL/Polyline_simplification_2/simplify.h>`

Simplifies an open or closed polyline given as an iterator range of 2D CGAL points.

Template Parameters

  PointIterator | must be an iterator with value type `Kernel::Point_2`.
  CostFunction | must be a model of `PolylineSimplificationCostFunction`
  StopFunction | must be a model of `PolylineSimplificationStopPredicate`
  PointOutputIterator | must be an output iterator to which `Kernel::Point_2` can be assigned.