2015-05-15 15:41:56 +02:00
|
|
|
class QgsCompoundCurveV2: public QgsCurveV2
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgscompoundcurvev2.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
QgsCompoundCurveV2();
|
|
|
|
QgsCompoundCurveV2( const QgsCompoundCurveV2& curve );
|
|
|
|
//QgsCompoundCurveV2 &operator=( const QgsCompoundCurveV2 & curve );
|
|
|
|
~QgsCompoundCurveV2();
|
|
|
|
|
|
|
|
virtual QString geometryType() const;
|
|
|
|
virtual int dimension() const;
|
|
|
|
virtual QgsAbstractGeometryV2* 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;
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Adds curve (takes ownership)*/
|
2015-05-15 15:41:56 +02:00
|
|
|
void addCurve( QgsCurveV2* c /Transfer/ );
|
|
|
|
void removeCurve( int i );
|
|
|
|
void addVertex( const QgsPointV2& pt );
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns closed ring based on curve (connects to start point if not already done)*/
|
2015-05-15 15:41:56 +02:00
|
|
|
void close();
|
|
|
|
|
|
|
|
void draw( QPainter& p ) const;
|
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;
|
|
|
|
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;
|
2015-05-29 17:59:52 +02:00
|
|
|
|
|
|
|
bool hasCurvedSegments() const;
|
2015-09-04 14:53:06 +02:00
|
|
|
|
|
|
|
/** Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
|
|
|
|
@return rotation in radians, clockwise from north*/
|
|
|
|
double vertexAngle( const QgsVertexId& vertex ) const;
|
2015-05-15 15:41:56 +02:00
|
|
|
};
|