16 #ifndef QGSABSTRACTGEOMETRYV2 17 #define QGSABSTRACTGEOMETRYV2 65 virtual void clear() = 0;
75 virtual int dimension()
const = 0;
82 virtual QString geometryType()
const = 0;
104 bool isMeasure()
const;
108 virtual bool isEmpty()
const = 0;
109 virtual bool isSimple()
const = 0;
110 virtual bool isValid()
const = 0;
133 virtual bool fromWkt(
const QString& wkt ) = 0;
140 virtual int wkbSize()
const = 0;
150 virtual unsigned char* asWkb(
int& binarySize )
const = 0;
159 virtual QString asWkt(
int precision = 17 )
const = 0;
190 virtual QString asJSON(
int precision = 17 )
const = 0;
204 bool transformZ =
false ) = 0;
209 virtual void transform(
const QTransform& t ) = 0;
218 virtual void draw(
QPainter& p )
const = 0;
235 virtual int nCoordinates()
const;
278 virtual bool deleteVertex(
QgsVertexId position ) = 0;
284 virtual double length()
const {
return 0.0; }
296 virtual double area()
const {
return 0.0; }
303 bool isEmpty()
const;
328 virtual double vertexAngle(
QgsVertexId vertex )
const = 0;
330 virtual int vertexCount(
int part = 0,
int ring = 0 )
const = 0;
331 virtual int ringCount(
int part = 0 )
const = 0;
337 virtual int partCount()
const = 0;
346 virtual bool addZValue(
double zValue = 0 ) = 0;
355 virtual bool addMValue(
double mValue = 0 ) = 0;
363 virtual bool dropZValue() = 0;
371 virtual bool dropMValue() = 0;
420 bool isValid()
const {
return part >= 0 && ring >= 0 && vertex >= 0; }
424 return part == other.
part && ring == other.
ring && vertex == other.
vertex;
428 return part != other.
part || ring != other.
ring || vertex != other.
vertex;
432 return part >= 0 && o.
part == part;
436 return partEqual( o ) && ( ring >= 0 && o.
ring == ring );
440 return ringEqual( o ) && ( vertex >= 0 && o.
ring == ring );
444 return ( part >= 0 && part < geom->partCount() ) &&
446 ( vertex < 0 || vertex < geom->vertexCount( part, ring ) );
455 #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.
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
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.
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.