16 #ifndef QGSABSTRACTGEOMETRYV2
17 #define QGSABSTRACTGEOMETRYV2
47 QgsVertexId(): part( - 1 ), ring( -1 ), vertex( -1 ), type( SegmentVertex ) {}
49 : part( _part ), ring( _ring ), vertex( _vertex ), type( _type ) {}
53 bool isValid()
const {
return part >= 0 && ring >= 0 && vertex >= 0; }
57 return part == other.
part && ring == other.
ring && vertex == other.
vertex;
61 return part != other.
part || ring != other.
ring || vertex != other.
vertex;
89 virtual void clear() = 0;
104 virtual int dimension()
const = 0;
111 virtual QString geometryType()
const = 0;
133 bool isMeasure()
const;
137 virtual bool isEmpty()
const = 0;
138 virtual bool isSimple()
const = 0;
139 virtual bool isValid()
const = 0;
151 virtual bool fromWkb(
const unsigned char * wkb ) = 0;
156 virtual bool fromWkt(
const QString& wkt ) = 0;
163 virtual int wkbSize()
const = 0;
173 virtual unsigned char* asWkb(
int& binarySize )
const = 0;
182 virtual QString asWkt(
int precision = 17 )
const = 0;
213 virtual QString asJSON(
int precision = 17 )
const = 0;
225 virtual void transform(
const QTransform& t ) = 0;
234 virtual void draw(
QPainter& p )
const = 0;
251 int nCoordinates()
const;
293 virtual bool deleteVertex(
const QgsVertexId& position ) = 0;
298 virtual double length()
const {
return 0.0; }
303 virtual double area()
const {
return 0.0; }
307 bool isEmpty()
const;
337 #endif //QGSABSTRACTGEOMETRYV2
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
A rectangle specified with double values.
static QgsRectangle calculateBoundingBox(QGis::WkbType wkbType, const unsigned char *wkb, size_t numPoints)
Returns the BBOX of the specified WKB-point stream.
QgsVertexId(int _part, int _ring, int _vertex, VertexType _type=SegmentVertex)
virtual double length() const
Returns the length (or perimeter for area geometries) of the geometry.
Multi curve geometry collection.
Abstract base class for all geometries.
Multi point geometry collection.
bool operator!=(const QgsVertexId &other)
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 operator==(const QgsVertexId &other)
virtual QgsAbstractGeometryV2 * segmentize() const
Returns a version of the geometry without curves.
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'.
Abstract base class for curved geometry type.