16 #ifndef QGSABSTRACTGEOMETRYV2
17 #define QGSABSTRACTGEOMETRYV2
55 virtual void clear() = 0;
70 virtual int dimension()
const = 0;
77 virtual QString geometryType()
const = 0;
99 bool isMeasure()
const;
103 virtual bool isEmpty()
const = 0;
104 virtual bool isSimple()
const = 0;
105 virtual bool isValid()
const = 0;
117 virtual bool fromWkb(
const unsigned char * wkb ) = 0;
122 virtual bool fromWkt(
const QString& wkt ) = 0;
129 virtual int wkbSize()
const = 0;
139 virtual unsigned char* asWkb(
int& binarySize )
const = 0;
148 virtual QString asWkt(
int precision = 17 )
const = 0;
179 virtual QString asJSON(
int precision = 17 )
const = 0;
192 virtual void transform(
const QTransform& t ) = 0;
201 virtual void draw(
QPainter& p )
const = 0;
218 int nCoordinates()
const;
260 virtual bool deleteVertex(
const QgsVertexId& position ) = 0;
266 virtual double length()
const {
return 0.0; }
278 virtual double area()
const {
return 0.0; }
285 bool isEmpty()
const;
299 virtual double vertexAngle(
const QgsVertexId& vertex )
const = 0;
301 virtual int vertexCount(
int part = 0,
int ring = 0 )
const = 0;
302 virtual int ringCount(
int part = 0 )
const = 0;
303 virtual int partCount()
const = 0;
311 virtual bool addZValue(
double zValue = 0 ) = 0;
319 virtual bool addMValue(
double mValue = 0 ) = 0;
355 : part( _part ), ring( _ring ), vertex( _vertex ), type( _type ) {}
359 bool isValid()
const {
return part >= 0 && ring >= 0 && vertex >= 0; }
363 return part == other.
part && ring == other.
ring && vertex == other.
vertex;
367 return part != other.
part || ring != other.
ring || vertex != other.
vertex;
371 return part >= 0 && o.
part == part;
375 return partEqual( o ) && ( ring >= 0 && o.
ring == ring );
379 return ringEqual( o ) && ( vertex >= 0 && o.
ring == ring );
383 return ( part >= 0 && part < geom->partCount() ) &&
385 ( vertex < 0 || vertex < geom->vertexCount( part, ring ) );
394 #endif //QGSABSTRACTGEOMETRYV2
bool operator==(const QgsVertexId &other) const
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
A rectangle specified with double values.
QgsVertexId(int _part=-1, int _ring=-1, int _vertex=-1, VertexType _type=SegmentVertex)
static QgsRectangle calculateBoundingBox(QGis::WkbType wkbType, const unsigned char *wkb, size_t numPoints)
Returns the BBOX of the specified WKB-point stream.
virtual double length() const
Returns the length of the geometry.
Multi curve geometry collection.
Abstract base class for all geometries.
TransformDirection
Enum used to indicate the direction (forward or inverse) of the transform.
Multi point geometry collection.
Perform transforms between map coordinates and device coordinates.
Utility class for identifying a unique vertex within a geometry.
QgsWKBTypes::Type mWkbType
virtual bool hasCurvedSegments() const
Returns true if the geometry contains curved segments.
bool vertexEqual(const QgsVertexId &o) const
virtual QgsAbstractGeometryV2 * segmentize() const
Returns a version of the geometry without curves.
virtual int ringCount(int part=0) const =0
bool ringEqual(const QgsVertexId &o) const
virtual double area() const
Returns the area of the geometry.
QgsRectangle mBoundingBox
bool isValid() const
Returns true if the vertex id is valid.
double ANALYSIS_EXPORT leftOf(Point3D *thepoint, Point3D *p1, Point3D *p2)
Returns whether 'thepoint' is left or right of the line from 'p1' to 'p2'.
virtual double perimeter() const
Returns the perimeter of the geometry.
Abstract base class for curved geometry type.
bool isValid(const QgsAbstractGeometryV2 *geom) const
bool operator!=(const QgsVertexId &other) const
bool partEqual(const QgsVertexId &o) const