2015-05-15 15:41:56 +02:00
|
|
|
class QgsCircularStringV2: public QgsCurveV2
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgscircularstringv2.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
QgsCircularStringV2();
|
|
|
|
~QgsCircularStringV2();
|
|
|
|
|
2015-12-15 22:36:41 +11:00
|
|
|
virtual bool operator==( const QgsCurveV2& other ) const;
|
|
|
|
virtual bool operator!=( const QgsCurveV2& other ) const;
|
|
|
|
|
2015-05-15 15:41:56 +02:00
|
|
|
virtual QString geometryType() const;
|
|
|
|
virtual int dimension() const;
|
2015-09-09 17:45:31 +02:00
|
|
|
virtual QgsCircularStringV2* clone() const;
|
2015-05-15 15:41:56 +02:00
|
|
|
virtual void clear();
|
|
|
|
|
2016-01-31 18:09:13 +01:00
|
|
|
virtual bool fromWkb( QgsConstWkbPtr wkb );
|
2015-05-15 15:41:56 +02:00
|
|
|
virtual bool fromWkt( const QString& wkt );
|
|
|
|
|
|
|
|
int wkbSize() const;
|
|
|
|
unsigned char* asWkb( int& binarySize ) const;
|
|
|
|
QString asWkt( int precision = 17 ) const;
|
|
|
|
QDomElement asGML2( QDomDocument& doc, int precision = 17, const QString& ns = "gml" ) const;
|
|
|
|
QDomElement asGML3( QDomDocument& doc, int precision = 17, const QString& ns = "gml" ) const;
|
|
|
|
QString asJSON( int precision = 17 ) const;
|
|
|
|
|
|
|
|
int numPoints() const;
|
2016-01-28 10:30:06 +01:00
|
|
|
|
|
|
|
/** Returns the point at index i within the circular string.
|
|
|
|
*/
|
2015-05-15 15:41:56 +02:00
|
|
|
QgsPointV2 pointN( int i ) const;
|
2016-01-28 10:30:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @copydoc QgsCurveV2::points()
|
|
|
|
*/
|
2015-05-15 15:41:56 +02:00
|
|
|
void points( QList<QgsPointV2>& pts ) const;
|
|
|
|
|
2016-01-28 10:30:06 +01:00
|
|
|
/** Sets the circular string's points
|
|
|
|
*/
|
|
|
|
void setPoints( const QList<QgsPointV2>& points );
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2016-01-28 10:30:06 +01:00
|
|
|
/**
|
|
|
|
* @copydoc QgsAbstractGeometryV2::length()
|
|
|
|
*/
|
2015-05-15 15:41:56 +02:00
|
|
|
virtual double length() const;
|
2016-01-28 10:30:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @copydoc QgsCurveV2::startPoint()
|
|
|
|
*/
|
2015-05-15 15:41:56 +02:00
|
|
|
virtual QgsPointV2 startPoint() const;
|
2016-01-28 10:30:06 +01:00
|
|
|
/**
|
|
|
|
* @copydoc QgsCurveV2::endPoint()
|
|
|
|
*/
|
2015-05-15 15:41:56 +02:00
|
|
|
virtual QgsPointV2 endPoint() const;
|
2016-05-17 18:09:16 +02:00
|
|
|
/** Returns a new line string geometry corresponding to a segmentized approximation
|
|
|
|
* of the curve.
|
|
|
|
* @param tolerance segmentation tolerance
|
|
|
|
* @param toleranceType maximum segmentation angle or maximum difference between approximation and curve*/
|
|
|
|
virtual QgsLineStringV2* curveToLine( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const;
|
2015-05-15 15:41:56 +02:00
|
|
|
|
|
|
|
void draw( QPainter& p ) const;
|
2016-01-28 10:30:06 +01:00
|
|
|
|
|
|
|
/** Transforms the geometry using a coordinate transform
|
|
|
|
* @param ct coordinate transform
|
|
|
|
* @param d transformation direction
|
|
|
|
*/
|
2015-08-17 17:14:05 +02:00
|
|
|
void transform( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform );
|
2015-05-15 15:41:56 +02:00
|
|
|
void transform( const QTransform& t );
|
|
|
|
void addToPainterPath( QPainterPath& path ) const;
|
2016-01-28 10:30:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @copydoc QgsCurveV2::drawAsPolygon()
|
|
|
|
*/
|
2015-05-15 15:41:56 +02:00
|
|
|
void drawAsPolygon( QPainter& p ) const;
|
|
|
|
|
2016-02-02 19:46:18 +11:00
|
|
|
virtual bool insertVertex( QgsVertexId position, const QgsPointV2& vertex );
|
|
|
|
virtual bool moveVertex( QgsVertexId position, const QgsPointV2& newPos );
|
|
|
|
virtual bool deleteVertex( QgsVertexId position );
|
2015-05-15 15:41:56 +02:00
|
|
|
|
|
|
|
double closestSegment( const QgsPointV2& pt, QgsPointV2& segmentPt, QgsVertexId& vertexAfter, bool* leftOf, double epsilon ) const;
|
2016-01-28 10:30:06 +01:00
|
|
|
/**
|
|
|
|
* @copydoc QgsCurveV2::pointAt()
|
|
|
|
*/
|
2016-02-21 21:49:51 +01:00
|
|
|
bool pointAt( int node, QgsPointV2& point, QgsVertexId::VertexType& type ) const;
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2016-01-28 10:30:06 +01:00
|
|
|
/**
|
|
|
|
* @copydoc QgsCurveV2::sumUpArea()
|
|
|
|
*/
|
2015-05-15 15:41:56 +02:00
|
|
|
void sumUpArea( double& sum ) const;
|
2015-05-29 20:35:42 +02:00
|
|
|
|
2016-01-28 10:30:06 +01:00
|
|
|
/**
|
|
|
|
* @copydoc QgsAbstractGeometryV2::hasCurvedSegments()
|
|
|
|
*/
|
2015-05-29 17:59:52 +02:00
|
|
|
bool hasCurvedSegments() const;
|
2015-05-29 20:35:42 +02:00
|
|
|
|
2015-09-04 14:53:06 +02:00
|
|
|
/** Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
|
2015-09-04 17:23:41 +02:00
|
|
|
@param vertex the vertex id
|
2015-09-04 14:53:06 +02:00
|
|
|
@return rotation in radians, clockwise from north*/
|
2016-02-02 19:46:18 +11:00
|
|
|
double vertexAngle( QgsVertexId vertex ) const;
|
2015-09-04 14:53:06 +02:00
|
|
|
|
2015-11-18 16:24:27 +11:00
|
|
|
virtual QgsCircularStringV2* reversed() const /Factory/;
|
|
|
|
|
2015-10-14 08:21:54 +11:00
|
|
|
virtual bool addZValue( double zValue = 0 );
|
|
|
|
virtual bool addMValue( double mValue = 0 );
|
|
|
|
|
2015-12-01 16:33:44 +11:00
|
|
|
virtual bool dropZValue();
|
|
|
|
virtual bool dropMValue();
|
|
|
|
|
2016-02-21 16:26:45 +11:00
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual QgsRectangle calculateBoundingBox() const;
|
|
|
|
|
2015-05-29 20:35:42 +02:00
|
|
|
private:
|
2016-02-14 03:50:23 +01:00
|
|
|
//helper methods for curveToLine
|
2015-05-29 20:35:42 +02:00
|
|
|
void segmentize( const QgsPointV2& p1, const QgsPointV2& p2, const QgsPointV2& p3, QList<QgsPointV2>& points ) const;
|
2015-05-15 15:41:56 +02:00
|
|
|
};
|