mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Applied patch from Stefanie Tellex for simpler retreival of coords from QgsPoint
Thanks! git-svn-id: http://svn.osgeo.org/qgis/trunk@8582 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
35f10e1cfc
commit
97f3618345
@ -82,6 +82,25 @@ public:
|
||||
sipRes = PyString_FromString(str.toLocal8Bit().data());
|
||||
%End
|
||||
|
||||
int __len__();
|
||||
%MethodCode
|
||||
sipRes = 2;
|
||||
%End
|
||||
|
||||
|
||||
SIP_PYOBJECT __getitem__(int);
|
||||
%MethodCode
|
||||
if (a0 == 0) {
|
||||
sipRes = Py_BuildValue("d",sipCpp->x());
|
||||
} else if (a0 == 1) {
|
||||
sipRes = Py_BuildValue("d",sipCpp->y());
|
||||
} else {
|
||||
QString msg = QString("Bad index: %1").arg(a0);
|
||||
PyErr_SetString(PyExc_IndexError, msg.toAscii().constData());
|
||||
}
|
||||
%End
|
||||
|
||||
|
||||
|
||||
}; // class QgsPOint
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user