Skip to content
Permalink
Browse files

Rename QgsPointV2 to QgsPoint and QgsPoint to QgsPointXY

Because 3D coordinates should be the default.

References qgis/qgis4.0_api#36
  • Loading branch information
m-kuhn committed Jun 2, 2017
1 parent 164e464 commit a9d7630a69da6c333a67b582450401a068475fbb
Showing 498 changed files with 5,343 additions and 5,343 deletions.
@@ -71,7 +71,7 @@ class QgsGraphVertex
%End


QgsGraphVertex( const QgsPoint &point );
QgsGraphVertex( const QgsPointXY &point );
%Docstring
This constructor initializes QgsGraphVertex object and associates a vertex with a point
%End
@@ -88,10 +88,10 @@ class QgsGraphVertex
:rtype: QgsGraphEdgeIds
%End

QgsPoint point() const;
QgsPointXY point() const;
%Docstring
Returns point associated with graph vertex
:rtype: QgsPoint
:rtype: QgsPointXY
%End

};
@@ -110,7 +110,7 @@ class QgsGraph
QgsGraph();


int addVertex( const QgsPoint &pt );
int addVertex( const QgsPointXY &pt );
%Docstring
Add a vertex to the graph
:rtype: int
@@ -146,7 +146,7 @@ class QgsGraph
:rtype: QgsGraphEdge
%End

int findVertex( const QgsPoint &pt ) const;
int findVertex( const QgsPointXY &pt ) const;
%Docstring
Find vertex by associated point
:return: vertex index
@@ -29,12 +29,12 @@ class QgsGraphBuilder : QgsGraphBuilderInterface

~QgsGraphBuilder();

virtual void addVertex( int id, const QgsPoint &pt );
virtual void addVertex( int id, const QgsPointXY &pt );
%Docstring
MANDATORY BUILDER PROPERTY DECLARATION
%End

virtual void addEdge( int pt1id, const QgsPoint &pt1, int pt2id, const QgsPoint &pt2, const QVector< QVariant > &prop );
virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &prop );

QgsGraph *graph() /Factory/;
%Docstring
@@ -67,7 +67,7 @@ Returns measurement tool
:rtype: QgsDistanceArea
%End

virtual void addVertex( int id, const QgsPoint &pt );
virtual void addVertex( int id, const QgsPointXY &pt );
%Docstring
Add vertex to the graph
\param id vertex identifier
@@ -77,7 +77,7 @@ Returns measurement tool
id and pt are redundant. You can use pt or id to identify the vertex
%End

virtual void addEdge( int pt1id, const QgsPoint &pt1, int pt2id, const QgsPoint &pt2, const QVector< QVariant > &strategies );
virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &strategies );
%Docstring
Add edge to the graph
\param pt1id first vertex identificator
@@ -46,8 +46,8 @@ Emitted to report information about graph building
virtual ~QgsGraphDirector();

virtual void makeGraph( QgsGraphBuilderInterface *builder,
const QVector< QgsPoint > &additionalPoints,
QVector< QgsPoint > &snappedPoints /Out/ ) const;
const QVector< QgsPointXY > &additionalPoints,
QVector< QgsPointXY > &snappedPoints /Out/ ) const;
%Docstring
Make a graph using QgsGraphBuilder

@@ -56,7 +56,7 @@ Emitted to report information about graph building
\param snappedPoints list of snapped points
.. note::

if snappedPoints[i] == QgsPoint(0.0,0.0) then snapping failed.
if snappedPoints[i] == QgsPointXY(0.0,0.0) then snapping failed.
%End

void addStrategy( QgsNetworkStrategy *prop /Transfer/ );
@@ -50,8 +50,8 @@ class QgsVectorLayerDirector : QgsGraphDirector
virtual ~QgsVectorLayerDirector();

virtual void makeGraph( QgsGraphBuilderInterface *builder,
const QVector< QgsPoint > &additionalPoints,
QVector< QgsPoint> &snappedPoints /Out/ ) const;
const QVector< QgsPointXY > &additionalPoints,
QVector< QgsPointXY> &snappedPoints /Out/ ) const;
%Docstring
MANDATORY DIRECTOR PROPERTY DECLARATION
%End
@@ -69,11 +69,11 @@ point features or be used to define the path of a way.
%End
public:
QgsOSMNode();
QgsOSMNode( QgsOSMId id, const QgsPoint &point );
QgsOSMNode( QgsOSMId id, const QgsPointXY &point );

QgsPoint point() const;
QgsPointXY point() const;
%Docstring
:rtype: QgsPoint
:rtype: QgsPointXY
%End

};
@@ -86,17 +86,17 @@ class QgsAnnotation : QObject
.. seealso:: hasFixedMapPosition()
%End

QgsPoint mapPosition() const;
QgsPointXY mapPosition() const;
%Docstring
Returns the map position of the annotation, if it is attached to a fixed map
position.
.. seealso:: setMapPosition()
.. seealso:: hasFixedMapPosition()
.. seealso:: mapPositionCrs()
:rtype: QgsPoint
:rtype: QgsPointXY
%End

void setMapPosition( const QgsPoint &position );
void setMapPosition( const QgsPointXY &position );
%Docstring
Sets the map position of the annotation, if it is attached to a fixed map
position.
@@ -41,7 +41,7 @@ template <TYPE>
if ((l = PyList_New(sipCpp->size())) == NULL)
return NULL;

const sipMappedType *qvector_qgspoint = sipFindMappedType("QVector<QgsPoint>");
const sipMappedType *qvector_qgspoint = sipFindMappedType("QVector<QgsPointXY>");

// Set the list elements.
for (int i = 0; i < sipCpp->size(); ++i)
@@ -62,7 +62,7 @@ template <TYPE>
%End

%ConvertToTypeCode
const sipMappedType *qvector_qgspoint = sipFindMappedType("QVector<QgsPoint>");
const sipMappedType *qvector_qgspoint = sipFindMappedType("QVector<QgsPointXY>");

// Check the type if that is all that is required.
if (sipIsErr == NULL)
@@ -118,7 +118,7 @@ template <TYPE>
if ((l = PyList_New(sipCpp->size())) == NULL)
return NULL;

const sipMappedType *qvector_qgspoint = sipFindMappedType("QVector<QVector<QgsPoint> >");
const sipMappedType *qvector_qgspoint = sipFindMappedType("QVector<QVector<QgsPointXY> >");

// Set the list elements.
for (int i = 0; i < sipCpp->size(); ++i)
@@ -139,7 +139,7 @@ template <TYPE>

%ConvertToTypeCode

const sipMappedType *qvector_qgspoint = sipFindMappedType("QVector<QVector<QgsPoint> >");
const sipMappedType *qvector_qgspoint = sipFindMappedType("QVector<QVector<QgsPointXY> >");

// Check the type if that is all that is required.
if (sipIsErr == NULL)
@@ -255,7 +255,7 @@ template <TYPE>
};


%MappedType QList< QList<QgsPointV2> >
%MappedType QList< QList<QgsPoint> >
{
%TypeHeaderCode
#include <QList>
@@ -269,12 +269,12 @@ template <TYPE>
if ((l = PyList_New(sipCpp->size())) == NULL)
return NULL;

const sipMappedType *qlist_type = sipFindMappedType("QList<QgsPointV2>");
const sipMappedType *qlist_type = sipFindMappedType("QList<QgsPoint>");

// Set the list elements.
for (int i = 0; i < sipCpp->size(); ++i)
{
QList<QgsPointV2> *t = new QList<QgsPointV2>(sipCpp->at(i));
QList<QgsPoint> *t = new QList<QgsPoint>(sipCpp->at(i));
PyObject *tobj;

if ((tobj = sipConvertFromMappedType(t, qlist_type, sipTransferObj)) == NULL)
@@ -290,7 +290,7 @@ template <TYPE>
%End

%ConvertToTypeCode
const sipMappedType *qlist_type = sipFindMappedType("QList<QgsPointV2>");
const sipMappedType *qlist_type = sipFindMappedType("QList<QgsPoint>");

// Check the type if that is all that is required.
if (sipIsErr == NULL)
@@ -306,13 +306,13 @@ template <TYPE>
}


QList< QList<QgsPointV2> > *ql = new QList< QList<QgsPointV2> >;
QList< QList<QgsPoint> > *ql = new QList< QList<QgsPoint> >;

for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
{
int state;
//TYPE *t = reinterpret_cast<TYPE *>(sipConvertToType(PyList_GET_ITEM(sipPy, i), sipType_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
QList<QgsPointV2> *t = reinterpret_cast< QList<QgsPointV2> * >(sipConvertToMappedType(PyList_GET_ITEM(sipPy, i), qlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
QList<QgsPoint> *t = reinterpret_cast< QList<QgsPoint> * >(sipConvertToMappedType(PyList_GET_ITEM(sipPy, i), qlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));

if (*sipIsErr)
{
@@ -329,7 +329,7 @@ template <TYPE>
%End
};

%MappedType QList< QList< QList<QgsPointV2> > >
%MappedType QList< QList< QList<QgsPoint> > >
{
%TypeHeaderCode
#include <QList>
@@ -342,15 +342,15 @@ template <TYPE>
{
return NULL;
}
const sipMappedType *qlist_type = sipFindMappedType("QList<QList<QgsPointV2> >");
const sipMappedType *qlist_type = sipFindMappedType("QList<QList<QgsPoint> >");
if(!qlist_type )
{
Py_DECREF(l); return NULL;
}

for (int i = 0; i < sipCpp->size(); ++i)
{
QList< QList<QgsPointV2> > *t = new QList<QList<QgsPointV2> >(sipCpp->at(i));
QList< QList<QgsPoint> > *t = new QList<QList<QgsPoint> >(sipCpp->at(i));
PyObject *tobj;
if ((tobj = sipConvertFromMappedType(t, qlist_type, sipTransferObj)) == NULL)
{
@@ -363,16 +363,16 @@ template <TYPE>
return l;
%End
%ConvertToTypeCode
const sipMappedType *qlist_type = sipFindMappedType("QList<QList<QgsPointV2> >");
const sipMappedType *qlist_type = sipFindMappedType("QList<QList<QgsPoint> >");
if (sipIsErr == NULL)
{
return 0;
}
QList< QList< QList<QgsPointV2> > > *ql = new QList< QList< QList<QgsPointV2> > >();
QList< QList< QList<QgsPoint> > > *ql = new QList< QList< QList<QgsPoint> > >();
for( int i = 0;i < PyList_GET_SIZE(sipPy); ++i)
{
int state;
QList<QList<QgsPointV2> > *t = reinterpret_cast< QList< QList<QgsPointV2> > * >(sipConvertToMappedType(PyList_GET_ITEM(sipPy, i), qlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
QList<QList<QgsPoint> > *t = reinterpret_cast< QList< QList<QgsPoint> > * >(sipConvertToMappedType(PyList_GET_ITEM(sipPy, i), qlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
if( *sipIsErr )
{
sipReleaseMappedType(t, qlist_type, state);
@@ -174,7 +174,7 @@ class QgsDxfExport
* @note available in python bindings as writeGroupPointV2
* @note added in 2.15
*/
void writeGroup( int code, const QgsPointV2 &p ) /PyName=writeGroupPointV2/;
void writeGroup( int code, const QgsPoint &p ) /PyName=writeGroupPointV2/;

/**
* Write a group code with color value
@@ -243,32 +243,32 @@ class QgsDxfExport

//! Write line (as a polyline)
//! @note added in 2.15
void writeLine( const QgsPointV2 &pt1, const QgsPointV2 &pt2, const QString &layer, const QString &lineStyleName, const QColor &color, double width = -1 );
void writeLine( const QgsPoint &pt1, const QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor &color, double width = -1 );

//! Write point
//! @note available in Python bindings as writePointV2
//! @note added in 2.15
void writePoint( const QString &layer, const QColor &color, const QgsPointV2 &pt ) /PyName=writePointV2/;
void writePoint( const QString &layer, const QColor &color, const QgsPoint &pt ) /PyName=writePointV2/;

//! Write filled circle (as hatch)
//! @note available in Python bindings as writePointV2
//! @note added in 2.15
void writeFilledCircle( const QString &layer, const QColor &color, const QgsPointV2 &pt, double radius ) /PyName=writeFillCircleV2/;
void writeFilledCircle( const QString &layer, const QColor &color, const QgsPoint &pt, double radius ) /PyName=writeFillCircleV2/;

//! Write circle (as polyline)
//! @note available in Python bindings as writeCircleV2
//! @note added in 2.15
void writeCircle( const QString &layer, const QColor &color, const QgsPointV2 &pt, double radius, const QString &lineStyleName, double width ) /PyName=writeCircleV2/;
void writeCircle( const QString &layer, const QColor &color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width ) /PyName=writeCircleV2/;

//! Write text (TEXT)
//! @note available in Python bindings as writeTextV2
//! @note added in 2.15
void writeText( const QString &layer, const QString &text, const QgsPointV2 &pt, double size, double angle, const QColor &color ) /PyName=writeTextV2/;
void writeText( const QString &layer, const QString &text, const QgsPoint &pt, double size, double angle, const QColor &color ) /PyName=writeTextV2/;

//! Write mtext (MTEXT)
//! @note available in Python bindings as writeMTextV2
//! @note added in 2.15
void writeMText( const QString &layer, const QString &text, const QgsPointV2 &pt, double width, double angle, const QColor &color );
void writeMText( const QString &layer, const QString &text, const QgsPoint &pt, double width, double angle, const QColor &color );

//! Calculates a scaling factor to convert from map units to a specified symbol unit.
static double mapUnitScaleFactor( double scaleDenominator, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits );

0 comments on commit a9d7630

Please sign in to comment.
You can’t perform that action at this time.