16 #ifndef QGSABSTRACTGEOMETRYV2 17 #define QGSABSTRACTGEOMETRYV2 58 virtual void clear() = 0;
68 virtual int dimension()
const = 0;
75 virtual QString geometryType()
const = 0;
97 bool isMeasure()
const;
101 virtual bool isEmpty()
const = 0;
102 virtual bool isSimple()
const = 0;
103 virtual bool isValid()
const = 0;
120 virtual bool fromWkt(
const QString& wkt ) = 0;
127 virtual int wkbSize()
const = 0;
137 virtual unsigned char* asWkb(
int& binarySize )
const = 0;
146 virtual QString asWkt(
int precision = 17 )
const = 0;
177 virtual QString asJSON(
int precision = 17 )
const = 0;
190 virtual void transform(
const QTransform& t ) = 0;
199 virtual void draw(
QPainter& p )
const = 0;
216 virtual int nCoordinates()
const;
259 virtual bool deleteVertex(
QgsVertexId position ) = 0;
265 virtual double length()
const {
return 0.0; }
277 virtual double area()
const {
return 0.0; }
284 bool isEmpty()
const;
307 virtual double vertexAngle(
QgsVertexId vertex )
const = 0;
309 virtual int vertexCount(
int part = 0,
int ring = 0 )
const = 0;
310 virtual int ringCount(
int part = 0 )
const = 0;
316 virtual int partCount()
const = 0;
325 virtual bool addZValue(
double zValue = 0 ) = 0;
334 virtual bool addMValue(
double mValue = 0 ) = 0;
342 virtual bool dropZValue() = 0;
350 virtual bool dropMValue() = 0;
391 : part( _part ), ring( _ring ), vertex( _vertex ), type( _type ) {}
395 bool isValid()
const {
return part >= 0 && ring >= 0 && vertex >= 0; }
399 return part == other.
part && ring == other.
ring && vertex == other.
vertex;
403 return part != other.
part || ring != other.
ring || vertex != other.
vertex;
407 return part >= 0 && o.
part == part;
411 return partEqual( o ) && ( ring >= 0 && o.
ring == ring );
415 return ringEqual( o ) && ( vertex >= 0 && o.
ring == ring );
419 return ( part >= 0 && part < geom->partCount() ) &&
421 ( vertex < 0 || vertex < geom->vertexCount( part, ring ) );
430 #endif //QGSABSTRACTGEOMETRYV2
QList< QgsPointV2 > QgsPointSequenceV2
A rectangle specified with double values.
QgsVertexId(int _part=-1, int _ring=-1, int _vertex=-1, VertexType _type=SegmentVertex)
bool isValid() const
Returns true if the vertex id is valid.
Multi curve geometry collection.
virtual bool hasCurvedSegments() const
Returns true if the geometry contains curved segments.
Abstract base class for all geometries.
Multi point geometry collection.
double closestSegment(const QgsPolyline &pl, const QgsPoint &pt, int &vertexAfter, double epsilon)
virtual void clearCache() const
Clears any cached parameters associated with the geometry, eg bounding boxes.
bool vertexEqual(QgsVertexId o) const
virtual QgsAbstractGeometryV2 * toCurveType() const
Returns the geometry converted to the more generic curve type.
bool operator!=(QgsVertexId other) const
Perform transforms between map coordinates and device coordinates.
Utility class for identifying a unique vertex within a geometry.
static QgsRectangle calculateBoundingBox(QGis::WkbType wkbType, QgsConstWkbPtr wkbPtr, int numPoints)
Returns the BBOX of the specified WKB-point stream.
Point geometry type, with support for z-dimension and m-values.
QList< QgsRingSequenceV2 > QgsCoordinateSequenceV2
QgsWKBTypes::Type mWkbType
bool isValid(const QgsAbstractGeometryV2 *geom) const
QList< QgsPointSequenceV2 > QgsRingSequenceV2
virtual double perimeter() const
Returns the perimeter of the geometry.
bool operator==(QgsVertexId other) const
bool partEqual(QgsVertexId o) const
bool ringEqual(QgsVertexId o) const
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
virtual int ringCount(int part=0) const =0
virtual double length() const
Returns the length of the geometry.
virtual QgsAbstractGeometryV2 * segmentize() const
Returns a version of the geometry without curves.
double ANALYSIS_EXPORT leftOf(Point3D *thepoint, Point3D *p1, Point3D *p2)
Returns whether 'thepoint' is left or right of the line from 'p1' to 'p2'.
Abstract base class for curved geometry type.
virtual double area() const
Returns the area of the geometry.