Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Applied patch from Stefanie Tellex for simpler retreival of coords fr…
…om QgsPoint

Thanks!


git-svn-id: http://svn.osgeo.org/qgis/trunk@8582 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jun 3, 2008
1 parent 35f10e1 commit 97f3618
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions python/core/qgspoint.sip
Expand Up @@ -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

0 comments on commit 97f3618

Please sign in to comment.