QGIS/python/core/geometry/qgscompoundcurvev2.sip
Nyall Dawson 4e18d54555 Tests and fixes for QgsPolygonV2
- Setting exterior ring will force all interior rings to match
dimensionality of exterior ring
- add equality operator
- use correct WKB types for rings when creating polygon from WKB
- segmentize curves when setting exterior ring with curved segments
- fix export to GML2/3 (should use LinearRing, not LineString as
ring element tag)
2015-12-15 22:36:41 +11:00

81 lines
3.0 KiB
Plaintext

class QgsCompoundCurveV2: public QgsCurveV2
{
%TypeHeaderCode
#include <qgscompoundcurvev2.h>
%End
public:
QgsCompoundCurveV2();
QgsCompoundCurveV2( const QgsCompoundCurveV2& curve );
//QgsCompoundCurveV2 &operator=( const QgsCompoundCurveV2 & curve );
~QgsCompoundCurveV2();
virtual bool operator==( const QgsCurveV2& other ) const;
virtual bool operator!=( const QgsCurveV2& other ) const;
virtual QString geometryType() const;
virtual int dimension() const;
virtual QgsCompoundCurveV2* clone() const;
virtual void clear();
virtual QgsRectangle calculateBoundingBox() const;
virtual bool fromWkb( const unsigned char* wkb );
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;
//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;
virtual QgsLineStringV2* curveToLine() const;
int nCurves() const;
const QgsCurveV2* curveAt( int i ) const;
/** Adds curve (takes ownership)*/
void addCurve( QgsCurveV2* c /Transfer/ );
void removeCurve( int i );
void addVertex( const QgsPointV2& pt );
/** Returns closed ring based on curve (connects to start point if not already done)*/
void close();
void draw( QPainter& p ) const;
void transform( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform );
void transform( const QTransform& t );
void addToPainterPath( QPainterPath& path ) const;
void drawAsPolygon( QPainter& p ) const;
virtual bool insertVertex( const QgsVertexId& position, const QgsPointV2& vertex );
virtual bool moveVertex( const QgsVertexId& position, const QgsPointV2& newPos );
virtual bool deleteVertex( const QgsVertexId& position );
virtual double closestSegment( const QgsPointV2& pt, QgsPointV2& segmentPt, QgsVertexId& vertexAfter, bool* leftOf, double epsilon ) const;
bool pointAt( int i, QgsPointV2& vertex, QgsVertexId::VertexType& type ) const;
void sumUpArea( double& sum ) const;
bool hasCurvedSegments() const;
/** Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
@param vertex the vertex id
@return rotation in radians, clockwise from north*/
double vertexAngle( const QgsVertexId& vertex ) const;
virtual QgsCompoundCurveV2* reversed() const /Factory/;
virtual bool addZValue( double zValue = 0 );
virtual bool addMValue( double mValue = 0 );
virtual bool dropZValue();
virtual bool dropMValue();
};