QGIS/python/core/geometry/qgscircularstring.sip

117 lines
3.8 KiB
Plaintext
Raw Normal View History

2016-08-06 11:01:42 +02:00
class QgsCircularString: public QgsCurve
2015-05-15 15:41:56 +02:00
{
%TypeHeaderCode
#include <qgscircularstring.h>
2015-05-15 15:41:56 +02:00
%End
public:
2016-08-06 11:01:42 +02:00
QgsCircularString();
~QgsCircularString();
2015-05-15 15:41:56 +02:00
2016-08-06 11:01:42 +02:00
virtual bool operator==( const QgsCurve& other ) const;
virtual bool operator!=( const QgsCurve& other ) const;
2015-05-15 15:41:56 +02:00
virtual QString geometryType() const;
virtual int dimension() const;
virtual QgsCircularString* clone() const /Factory/;
2015-05-15 15:41:56 +02:00
virtual void clear();
virtual bool fromWkb( QgsConstWkbPtr& wkb );
2015-05-15 15:41:56 +02:00
virtual bool fromWkt( const QString& wkt );
QByteArray asWkb() const;
2015-05-15 15:41:56 +02:00
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
/**
2016-08-06 11:01:42 +02:00
* @copydoc QgsCurve::points()
2016-01-28 10:30:06 +01:00
*/
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
/**
2016-08-06 11:01:42 +02:00
* @copydoc QgsAbstractGeometry::length()
2016-01-28 10:30:06 +01:00
*/
2015-05-15 15:41:56 +02:00
virtual double length() const;
2016-01-28 10:30:06 +01:00
/**
2016-08-06 11:01:42 +02:00
* @copydoc QgsCurve::startPoint()
2016-01-28 10:30:06 +01:00
*/
2015-05-15 15:41:56 +02:00
virtual QgsPointV2 startPoint() const;
2016-01-28 10:30:06 +01:00
/**
2016-08-06 11:01:42 +02:00
* @copydoc QgsCurve::endPoint()
2016-01-28 10:30:06 +01:00
*/
2015-05-15 15:41:56 +02:00
virtual QgsPointV2 endPoint() const;
/** 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 QgsLineString* curveToLine( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;
2015-05-15 15:41:56 +02:00
void draw( QPainter& p ) const;
void transform( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform,
bool transformZ = false );
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
/**
2016-08-06 11:01:42 +02:00
* @copydoc QgsCurve::drawAsPolygon()
2016-01-28 10:30:06 +01:00
*/
2015-05-15 15:41:56 +02:00
void drawAsPolygon( QPainter& p ) const;
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
/**
2016-08-06 11:01:42 +02:00
* @copydoc QgsCurve::pointAt()
2016-01-28 10:30:06 +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
/**
2016-08-06 11:01:42 +02:00
* @copydoc QgsCurve::sumUpArea()
2016-01-28 10:30:06 +01:00
*/
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
/**
2016-08-06 11:01:42 +02:00
* @copydoc QgsAbstractGeometry::hasCurvedSegments()
2016-01-28 10:30:06 +01:00
*/
2015-05-29 17:59:52 +02:00
bool hasCurvedSegments() const;
2015-05-29 20:35:42 +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
@return rotation in radians, clockwise from north*/
double vertexAngle( QgsVertexId vertex ) const;
2016-08-06 11:01:42 +02:00
virtual QgsCircularString* reversed() const /Factory/;
virtual bool addZValue( double zValue = 0 );
virtual bool addMValue( double mValue = 0 );
virtual bool dropZValue();
virtual bool dropMValue();
virtual double xAt( int index ) const;
virtual double yAt( int index ) const;
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
};