![]() |
University of Murcia ![]() |
QVPolylineF Class ReferenceFloating point polyline representation. |
Public Member Functions | |
bool | surrounds (const QPointF &p) const |
Test if a point is contained inside the poligon. |
A polyline is a continuous line composed of one or more straight line segments. A QVPolylineF is a implementation of a polyline, specified by a list of the points located at the intersection of the segments. Thus, any QVPolylineF object inherits from the class QList<QPointF>.
When a polyline is closed, then it is considered to be a polygon. In that case it is supposed to have an implicit final straight line segment, that links the first and the last point in the polyline. The property QVPolylineF::closed will store the value TRUE if the polyline is a polygon, else storing FALSE.
A QVPolylineF has the property QVPolylineF::direction, that will indicate if it is a direct polyline, or a reverse polyline. It has only meaning for some algorithms, like getConnectedSetBorderContoursThreshold.
Definition at line 53 of file qvpolylinef.h.
bool QVPolylineF::surrounds | ( | const QPointF & | p | ) | const |
Test if a point is contained inside the poligon.
The poligon is supossed to be closed in any case. The following image shows the result of aplying this method with a polyline (drawn in red) over a set of points lying inside it (drawn in green) and outside it (drawn in red):
The source of the algorithm is the following:
Definition at line 120 of file qvpolylinef.cpp.