-
an instance of
PointMapthat maps an item frominput_rangetoGeomTraits::Point_2 -
Default:
PointMap()
|
CGAL 6.0 - Shape Regularization
|
#include <CGAL/Shape_regularization/Contours/Longest_direction_2.h>
Estimates the longest principal direction of the contour.
This algorithm finds the longest contour edge and sets its direction as the principal direction of the contour.
| 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>. |
ContourDirections Initialization | |
| template<typename NamedParameters = parameters::Default_named_parameters> | |
| Longest_direction_2 (const InputRange &input_range, const bool is_closed, 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 longest principal direction. | |
Miscellaneous | |
| std::size_t | number_of_directions () const |
| returns the number of principal directions of the contour. | |
| CGAL::Shape_regularization::Contours::Longest_direction_2< GeomTraits, InputRange, PointMap >::Longest_direction_2 | ( | const InputRange & | input_range, |
| const bool | is_closed, | ||
| const NamedParameters & | np = parameters::default_values() |
||
| ) |
initializes all internal data structures.
| NamedParameters | a sequence of Named Parameters |
| input_range | a const range of ordered 2D points, which form a contour |
| is_closed | indicates whether the contour is closed or open |
| np | an optional sequence of Named Parameters among the ones listed below; this parameter can be omitted, the default values are then used |
|
| std::size_t CGAL::Shape_regularization::Contours::Longest_direction_2< GeomTraits, InputRange, PointMap >::number_of_directions | ( | ) | const |
returns the number of principal directions of the contour.
The returned number is always one.
| void CGAL::Shape_regularization::Contours::Longest_direction_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 longest principal direction.
| query_index | an index of the contour vertex that emits the contour edge being segment |
| segment | a segment to be rotated |