QGIS/python/core/geometry/qgscompoundcurve.sip

105 lines
3.7 KiB
Plaintext
Raw Normal View History

2016-08-06 11:01:42 +02:00
class QgsCompoundCurve: public QgsCurve
2015-05-15 15:41:56 +02:00
{
%TypeHeaderCode
#include <qgscompoundcurve.h>
2015-05-15 15:41:56 +02:00
%End
public:
2016-08-06 11:01:42 +02:00
QgsCompoundCurve();
QgsCompoundCurve( const QgsCompoundCurve& curve );
//QgsCompoundCurve &operator=( const QgsCompoundCurve & curve );
~QgsCompoundCurve();
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 QgsCompoundCurve* 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;
//curve interface
virtual double length() const;
virtual QgsPointV2 startPoint() const;
virtual QgsPointV2 endPoint() const;
virtual void points( QList<QgsPointV2>& pts ) const;
virtual int numPoints() 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/;
2016-01-28 10:30:06 +01:00
/** Returns the number of curves in the geometry.
*/
2015-05-15 15:41:56 +02:00
int nCurves() const;
2016-01-28 10:30:06 +01:00
/** Returns the curve at the specified index.
*/
2016-08-06 11:01:42 +02:00
const QgsCurve* curveAt( int i ) const;
2015-05-15 15:41:56 +02:00
2016-01-28 10:30:06 +01:00
/** Adds a curve to the geometr (takes ownership)
*/
2016-08-06 11:01:42 +02:00
void addCurve( QgsCurve* c /Transfer/ );
2016-01-28 10:30:06 +01:00
/** Removes a curve from the geometry.
* @param i index of curve to remove
*/
2015-05-15 15:41:56 +02:00
void removeCurve( int i );
2016-01-28 10:30:06 +01:00
/** Adds a vertex to the end of the geometry.
*/
2015-05-15 15:41:56 +02:00
void addVertex( const QgsPointV2& pt );
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;
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
virtual double closestSegment( const QgsPointV2& pt, QgsPointV2& segmentPt, QgsVertexId& vertexAfter, bool* leftOf, double epsilon ) const;
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
void sumUpArea( double& sum ) const;
2015-05-29 17:59:52 +02:00
2016-01-28 10:30:06 +01:00
/** Appends first point if not already closed.*/
void close();
2015-05-29 17:59:52 +02:00
bool hasCurvedSegments() const;
/** 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 QgsCompoundCurve* 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-15 15:41:56 +02:00
};