17 #ifndef QGSPROFILEPOINT_H
18 #define QGSPROFILEPOINT_H
20 #include "qgis_core.h"
43 : mDistance( distance )
44 , mElevation( elevation )
66 mElevation = elevation;
95 bool isEmpty() const
SIP_HOLDGIL {
return mIsEmpty; }
99 if ( isEmpty() && other.isEmpty() )
101 if ( isEmpty() && !other.isEmpty() )
103 if ( ! isEmpty() && other.isEmpty() )
115 if ( isEmpty() && other.isEmpty() )
117 if ( isEmpty() && !other.isEmpty() )
119 if ( ! isEmpty() && other.isEmpty() )
124 equal &=
qgsDoubleNear( other.mElevation, mElevation, 1E-8 );
130 SIP_PYOBJECT __repr__();
132 const QString
str = sipCpp->isEmpty()
133 ? QStringLiteral(
"<QgsProfilePoint: EMPTY>" )
134 : QStringLiteral(
"<QgsProfilePoint: %1, %2>" ).arg( sipCpp->distance() ).arg( sipCpp->elevation() );
135 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
143 SIP_PYOBJECT __getitem__(
int );
147 sipRes = Py_BuildValue(
"d", sipCpp->distance() );
151 sipRes = Py_BuildValue(
"d", sipCpp->elevation() );
155 QString msg = QString(
"Bad index: %1" ).arg( a0 );
156 PyErr_SetString( PyExc_IndexError, msg.toLatin1().constData() );
164 double mDistance = 0;
165 double mElevation = 0;
166 bool mIsEmpty =
true;
169 #endif // QGSPROFILEPOINT_H