CGAL 6.1.1 - Shape Regularization

Loading...
Searching...
No Matches
List of all members
CGAL::Shape_regularization::Contours::User_defined_directions_2< GeomTraits, InputRange, PointMap > Class Template Reference
Reference Manual » Contours

`#include <CGAL/Shape_regularization/Contours/User_defined_directions_2.h>`

## Definition

template<typename GeomTraits, typename InputRange, typename PointMap = CGAL::Identity_property_map<typename GeomTraits::Point_2>>
class CGAL::Shape_regularization::Contours::User_defined_directions_2< GeomTraits, InputRange, PointMap >

Sets multiple user-specified principal directions of the contour.

This algorithm finds the best-fit edges of the contour with respect to the user-specified principal directions and sets all other necessary data.

Template Parameters

  GeomTraits | a model of `Kernel`
  InputRange | a model of `ConstRange` whose iterator type is `RandomAccessIterator`
  PointMap | a model of `ReadablePropertyMap` whose key type is the value type of the input range and value type is `GeomTraits::Point_2`. The default is `CGAL::Identity_property_map<typename GeomTraits::Point_2>`.

Is model of
  `ContourDirections`

## Initialization
template<typename DirectionRange , typename NamedParameters = parameters::Default_named_parameters>
| User_defined_directions_2 (const InputRange &input_range, const bool is_closed, const DirectionRange &direction_range, const NamedParameters &np=parameters::default_values())
| initializes all internal data structures.

## Directions
void | orient (const std::size_t query_index, Segment_2 &segment) const
| orients a given `segment` with the index `query_index` towards the best-fit user-specified principal direction.

## Miscellaneous
std::size_t | number_of_directions () const
| returns the number of principal directions of the contour.

## Constructor & Destructor Documentation

## ◆ User_defined_directions_2()

template<typename GeomTraits , typename InputRange , typename PointMap = CGAL::Identity_property_map<typename GeomTraits::Point_2>>
template<typename DirectionRange , typename NamedParameters = parameters::Default_named_parameters>

CGAL::Shape_regularization::Contours::User_defined_directions_2< GeomTraits, InputRange, PointMap >::User_defined_directions_2 | ( | const InputRange & | input_range,
|  | const bool | is_closed,
|  | const DirectionRange & | direction_range,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

initializes all internal data structures.

Template Parameters

  DirectionRange | a model of `ConstRange` whose value type is `GeomTraits::Direction_2`
  NamedParameters | a sequence of Named Parameters

Parameters

  input_range | a const range of ordered 2D points, which form a contour
  is_closed | indicates whether the contour is closed or open
  direction_range | a const range with user-specified principal directions
  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 `PointMap` that maps an item from `input_range` to `GeomTraits::Point_2` Default: `PointMap()` |

Precondition
  direction_range.size() >= 1
  direction_range.size() == input_range.size() for closed contours
  direction_range.size() == input_range.size() - 1 for open contours
  input_range.size() >= 3 for closed contours
  input_range.size() >= 2 for open contours

## Member Function Documentation

## ◆ number_of_directions()

template<typename GeomTraits , typename InputRange , typename PointMap = CGAL::Identity_property_map<typename GeomTraits::Point_2>>

std::size_t CGAL::Shape_regularization::Contours::User_defined_directions_2< GeomTraits, InputRange, PointMap >::number_of_directions | ( |  | ) | const

returns the number of principal directions of the contour.

The returned number equals to the number of the user-specified directions.

## ◆ orient()

template<typename GeomTraits , typename InputRange , typename PointMap = CGAL::Identity_property_map<typename GeomTraits::Point_2>>

void CGAL::Shape_regularization::Contours::User_defined_directions_2< GeomTraits, InputRange, PointMap >::orient | ( | const std::size_t | query_index,
|  | Segment_2 & | segment
| ) |  | const

orients a given `segment` with the index `query_index` towards the best-fit user-specified principal direction.

Parameters

  query_index | an index of the contour vertex that emits the contour edge being `segment`
  segment | a segment to be rotated

Precondition
  query_index >= 0 && query_index < input_range.size() for closed contours
  query_index >= 0 && query_index < input_range.size() - 1 for open contours