xc
|
Base class for position lists. More...
#include <PolyPos.h>
Public Types | |
typedef deque_pos::iterator | iterator |
typedef deque_pos::const_iterator | const_iterator |
typedef pos::vector | vector |
Public Member Functions | |
PolyPos (const std::deque< pos > &dq_pos) | |
pos | getFromPoint (void) const |
pos | getToPoint (void) const |
bool | operator== (const PolyPos< pos > &other) const |
pos * | Agrega (const pos &p) |
void | Agrega (const PolyPos< pos > &p) |
void | AgregaSiNuevo (const PolyPos< pos > &p) |
template<class InputIterator > | |
void | extend (InputIterator first, InputIterator last) |
Append the vertices between [first,last) to thebefore end of the list. More... | |
void | AgregaSiNuevo (const pos &) |
Appends the point to the list (if not already there). | |
const_iterator | find (const pos &p) const |
iterator | find (const pos &p) |
bool | In (const pos &p) const |
Return true if the points is on en la lista. | |
void | close (void) |
Close the point list (insert the first point as its last one) | |
bool | isClosed (const GEOM_FT &tol=1e-6) const |
True if dist(lastPoint,firstPoint)< tol*length. | |
GEOM_FT | getLength (void) const |
Return the length of the PolyPos. | |
std::vector< GEOM_FT > | getLengths (void) const |
Return the lengths corresponding to each vertex. | |
boost::python::list | getLengthsPy (void) const |
Return the lengths corresponding to each vertex in a Python list. | |
GEOM_FT | getLengthUntilVertex (const_iterator) const |
Return the length of the PolyPos until the vertex pointed by the iterator. More... | |
const_iterator | getSegmentAtLength (const GEOM_FT &s) const |
Return an iterator pointing to the vertex that is just before the point at a distance "s" measured along the polyline from its origin. More... | |
int | getIndexOfSegmentAtLength (const GEOM_FT &s) const |
Return the index of the segment that lies at the point at a distance "s" measured along the polyline from its origin. More... | |
int | getIndexOfSegmentAtParam (const GEOM_FT &lambda) const |
Return the index of the segment that lies at the point at a distance "lambda*L" measured along the polyline from its origin. More... | |
boost::python::list | getIthCoordinates (unsigned short i) const |
Return the list of values for j-th coordinate. | |
GEOM_FT | GetMax (unsigned short i) const |
Return the maximum value of j-th coordinate. | |
GEOM_FT | GetMin (unsigned short i) const |
Return the minimum value of j-th coordinate. | |
PolyPos | GetMayores (unsigned short int i, const GEOM_FT &d) const |
PolyPos | GetMenores (unsigned short int i, const GEOM_FT &d) const |
pos | getCenterOfMass (void) const |
Return the center of mass del polígono. | |
pos | getWeightedCenterOfMass (const std::deque< GEOM_FT > &) const |
Return the center of mass del polígono. | |
PolyPos< pos > | getSwap (void) const |
Return a list with the elements in reverse order. | |
void | swap (void) |
std::deque< GEOM_FT > & | GetSeparaciones (void) const |
Compute the distance from each point to the nearest one. | |
GEOM_FT | GetSeparacionMedia (void) const |
Return the average distance between points. | |
iterator | getNearestPoint (const pos &) |
Returns the nearest point from those of the list. | |
const_iterator | getNearestPoint (const pos &) const |
Returns the nearest point from those of the list. | |
iterator | getFarthestPoint (const pos &) |
Returns the farthest point from those of the list. | |
const_iterator | getFarthestPoint (const pos &) const |
Returns the farthest point from those of the list. | |
virtual iterator | getFarthestPointFromSegment (iterator it1, iterator it2, GEOM_FT &pMaxDist) |
void | simplify (GEOM_FT epsilon, iterator it1, iterator it2) |
Douglas Peucker algorithm implementation. More... | |
void | simplify (GEOM_FT epsilon) |
Douglas Peucker algorithm implementation. More... | |
PolyPos< pos > | getSimplified (GEOM_FT epsilon) const |
! More... | |
void | removeRepeated (const GEOM_FT &tol=0.0) |
remove repeated vertexes. More... | |
void | removeBackwardSegments (const GEOM_FT &tol) |
remove backward segments. More... | |
void | Cat (const PolyPos< pos > &l) |
template<class inputIterator > | |
void | Cat (inputIterator begin, inputIterator end) |
Insert the objects between [first,last). | |
Protected Types | |
typedef std::deque< pos > | deque_pos |
Protected Member Functions | |
void | simplify_select (GEOM_FT epsilon, iterator it1, iterator it2, std::set< const_iterator > &selected) |
Douglas Peucker algorithm implementation. More... | |
void | remove_selected (std::set< const_iterator > &selected) |
Removes the selected items. More... | |
void | select_repeated (std::set< const_iterator > &selected, const GEOM_FT &tol=0.0) |
Select repeated vertexes. More... | |
void | select_backward_segments (std::set< const_iterator > &selected, const GEOM_FT &tol) |
Select backward segments. More... | |
Static Protected Member Functions | |
static GEOM_FT | g (GEOM_FT v1, GEOM_FT v2) |
Base class for position lists.
|
inline |
Append the vertices between [first,last) to thebefore end of the list.
|
virtual |
i1 | iterator to the first point. |
i2 | iterator to the second point. |
pMaxDist | pointer to the maximum distance of _line[return index]. |
Reimplemented in Polyline2d, and Polyline3d.
int PolyPos< pos >::getIndexOfSegmentAtLength | ( | const GEOM_FT & | s | ) | const |
Return the index of the segment that lies at the point at a distance "s" measured along the polyline from its origin.
s | distance measured along the polyline from its origin. |
int PolyPos< pos >::getIndexOfSegmentAtParam | ( | const GEOM_FT & | lambda | ) | const |
Return the index of the segment that lies at the point at a distance "lambda*L" measured along the polyline from its origin.
lambda | parameter (0.0->start of the pline, 1.0->end of the pline). |
GEOM_FT PolyPos< pos >::getLengthUntilVertex | ( | const_iterator | nth | ) | const |
Return the length of the PolyPos until the vertex pointed by the iterator.
nth | iterator pointing to the desired vertex. |
PolyPos< pos >::const_iterator PolyPos< pos >::getSegmentAtLength | ( | const GEOM_FT & | s | ) | const |
Return an iterator pointing to the vertex that is just before the point at a distance "s" measured along the polyline from its origin.
s | distance measured along the polyline from its origin. |
!
Return simplified point sequence using Douglas Peucker algorithm. Recursively delete points that are within epsilon.
epsilon | the higher the more aggressive. |
|
protected |
Removes the selected items.
selected | iterators pointing to the items to be removed. |
void PolyPos< pos >::removeBackwardSegments | ( | const GEOM_FT & | tol | ) |
remove backward segments.
tol | minimum accepted value for the dot product (<0) of consecutive direction vectors. |
void PolyPos< pos >::removeRepeated | ( | const GEOM_FT & | tol = 0.0 | ) |
remove repeated vertexes.
tol | minimum distance between vertices to be considered equal. |
|
protected |
Select backward segments.
selected | list containing the vertexes that generate backward segments. |
tol | minimum accepted value for the dot product (<0) of consecutive direction vectors. |
|
protected |
Select repeated vertexes.
selected | list containing the repeated vertexes. |
tol | minimum distance between vertices to be considered equal. |
void PolyPos< pos >::simplify | ( | GEOM_FT | epsilon, |
iterator | it1, | ||
iterator | it2 | ||
) |
Douglas Peucker algorithm implementation.
Recursively delete points that are within epsilon.
epsilon | the higher the more aggressive. |
iterator | of the first point in a segment. |
iterator | of the last point in a segment. |
void PolyPos< pos >::simplify | ( | GEOM_FT | epsilon | ) |
Douglas Peucker algorithm implementation.
Recursively delete points that are within epsilon.
epsilon | the higher the more aggressive. |
epsilon | The higher, the more points gotten rid of. |
|
protected |
Douglas Peucker algorithm implementation.
Recursively delete points that are within epsilon.
epsilon | the higher the more aggressive. |
iterator | of the first point in a segment. |
iterator | of the last point in a segment. |
selected | list containing the vertexes to be removed. |