Quantum GIS API Documentation
1.8
|
#include <qgsgeometryvalidator.h>
Public Slots | |
void | addError (QgsGeometry::Error) |
Signals | |
void | errorFound (QgsGeometry::Error) |
Public Member Functions | |
QgsGeometryValidator (QgsGeometry *g, QList< QgsGeometry::Error > *errors=0) | |
Constructor. | |
~QgsGeometryValidator () | |
void | run () |
void | stop () |
Static Public Member Functions | |
static void | validateGeometry (QgsGeometry *g, QList< QgsGeometry::Error > &errors) |
Validate geometry and produce a list of geometry errors. | |
Private Member Functions | |
void | validatePolyline (int i, QgsPolyline polyline, bool ring=false) |
void | validatePolygon (int i, const QgsPolygon &polygon) |
void | checkRingIntersections (int p0, int i0, const QgsPolyline &ring0, int p1, int i1, const QgsPolyline &ring1) |
double | distLine2Point (QgsPoint p, QgsVector v, QgsPoint q) |
bool | intersectLines (QgsPoint p, QgsVector v, QgsPoint q, QgsVector w, QgsPoint &s) |
bool | ringInRing (const QgsPolyline &inside, const QgsPolyline &outside) |
bool | pointInRing (const QgsPolyline &ring, const QgsPoint &p) |
Private Attributes | |
QgsGeometry | mG |
QList< QgsGeometry::Error > * | mErrors |
bool | mStop |
int | mErrorCount |
Definition at line 22 of file qgsgeometryvalidator.h.
QgsGeometryValidator::QgsGeometryValidator | ( | QgsGeometry * | g, |
QList< QgsGeometry::Error > * | errors = 0 |
||
) |
Constructor.
Definition at line 23 of file qgsgeometryvalidator.cpp.
References mG.
Referenced by validateGeometry().
Definition at line 34 of file qgsgeometryvalidator.cpp.
References stop().
void QgsGeometryValidator::addError | ( | QgsGeometry::Error | e | ) | [slot] |
Definition at line 332 of file qgsgeometryvalidator.cpp.
References mErrors.
Referenced by validateGeometry().
void QgsGeometryValidator::checkRingIntersections | ( | int | p0, |
int | i0, | ||
const QgsPolyline & | ring0, | ||
int | p1, | ||
int | i1, | ||
const QgsPolyline & | ring1 | ||
) | [private] |
Definition at line 45 of file qgsgeometryvalidator.cpp.
References distLine2Point(), errorFound(), intersectLines(), QgsVector::length(), mErrorCount, mStop, QgsVector::perpVector(), QgsDebugMsg, and QgsPoint::toString().
Referenced by run(), and validatePolygon().
double QgsGeometryValidator::distLine2Point | ( | QgsPoint | p, |
QgsVector | v, | ||
QgsPoint | q | ||
) | [private] |
Definition at line 351 of file qgsgeometryvalidator.cpp.
References QgsVector::length(), QgsVector::x(), QgsPoint::x(), QgsVector::y(), and QgsPoint::y().
Referenced by checkRingIntersections(), and validatePolyline().
void QgsGeometryValidator::errorFound | ( | QgsGeometry::Error | ) | [signal] |
Referenced by checkRingIntersections(), run(), validateGeometry(), validatePolygon(), and validatePolyline().
bool QgsGeometryValidator::intersectLines | ( | QgsPoint | p, |
QgsVector | v, | ||
QgsPoint | q, | ||
QgsVector | w, | ||
QgsPoint & | s | ||
) | [private] |
Definition at line 361 of file qgsgeometryvalidator.cpp.
References QgsVector::x(), QgsPoint::x(), QgsVector::y(), and QgsPoint::y().
Referenced by checkRingIntersections(), and validatePolyline().
bool QgsGeometryValidator::pointInRing | ( | const QgsPolyline & | ring, |
const QgsPoint & | p | ||
) | [private] |
Definition at line 377 of file qgsgeometryvalidator.cpp.
References mStop, QgsPoint::x(), and QgsPoint::y().
Referenced by ringInRing().
bool QgsGeometryValidator::ringInRing | ( | const QgsPolyline & | inside, |
const QgsPolyline & | outside | ||
) | [private] |
Definition at line 400 of file qgsgeometryvalidator.cpp.
References mStop, and pointInRing().
Referenced by run(), and validatePolygon().
void QgsGeometryValidator::run | ( | ) |
Definition at line 194 of file qgsgeometryvalidator.cpp.
References QgsGeometry::asGeos(), QgsGeometry::asMultiPolygon(), QgsGeometry::asMultiPolyline(), QgsGeometry::asPolygon(), QgsGeometry::asPolyline(), checkRingIntersections(), errorFound(), mErrorCount, mG, mStop, QgsDebugMsg, ringInRing(), validatePolygon(), validatePolyline(), QGis::WKBLineString, QGis::WKBLineString25D, QGis::WKBMultiLineString, QGis::WKBMultiLineString25D, QGis::WKBMultiPoint, QGis::WKBMultiPoint25D, QGis::WKBMultiPolygon, QGis::WKBMultiPolygon25D, QGis::WKBNoGeometry, QGis::WKBPoint, QGis::WKBPoint25D, QGis::WKBPolygon, QGis::WKBPolygon25D, QgsGeometry::wkbType(), and QGis::WKBUnknown.
Referenced by validateGeometry().
void QgsGeometryValidator::stop | ( | ) |
Definition at line 40 of file qgsgeometryvalidator.cpp.
References mStop.
Referenced by ~QgsGeometryValidator().
void QgsGeometryValidator::validateGeometry | ( | QgsGeometry * | g, |
QList< QgsGeometry::Error > & | errors | ||
) | [static] |
Validate geometry and produce a list of geometry errors.
Definition at line 338 of file qgsgeometryvalidator.cpp.
References addError(), errorFound(), QgsGeometryValidator(), and run().
void QgsGeometryValidator::validatePolygon | ( | int | i, |
const QgsPolygon & | polygon | ||
) | [private] |
Definition at line 164 of file qgsgeometryvalidator.cpp.
References checkRingIntersections(), errorFound(), mErrorCount, mStop, QgsDebugMsg, ringInRing(), and validatePolyline().
Referenced by run().
void QgsGeometryValidator::validatePolyline | ( | int | i, |
QgsPolyline | polyline, | ||
bool | ring = false |
||
) | [private] |
Definition at line 81 of file qgsgeometryvalidator.cpp.
References distLine2Point(), errorFound(), intersectLines(), QgsVector::length(), mErrorCount, mStop, QgsVector::perpVector(), QgsDebugMsg, and QgsPoint::toString().
Referenced by run(), and validatePolygon().
int QgsGeometryValidator::mErrorCount [private] |
Definition at line 57 of file qgsgeometryvalidator.h.
Referenced by checkRingIntersections(), run(), validatePolygon(), and validatePolyline().
QList<QgsGeometry::Error>* QgsGeometryValidator::mErrors [private] |
Definition at line 55 of file qgsgeometryvalidator.h.
Referenced by addError().
QgsGeometry QgsGeometryValidator::mG [private] |
Definition at line 54 of file qgsgeometryvalidator.h.
Referenced by QgsGeometryValidator(), and run().
bool QgsGeometryValidator::mStop [private] |
Definition at line 56 of file qgsgeometryvalidator.h.
Referenced by checkRingIntersections(), pointInRing(), ringInRing(), run(), stop(), validatePolygon(), and validatePolyline().