1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrange.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
template <T>
class QgsRange
{
%Docstring(signature="appended")
A template based class for storing ranges (lower to upper values).
:py:class:`QgsRange` classes represent a range of values of some element
type. For instance, ranges of int might be used to represent integer
ranges.
Ranges can indicate whether the upper and lower values are inclusive or
exclusive. The inclusivity or exclusivity of bounds is considered when
determining things like whether ranges overlap or during calculation of
range intersections.
.. seealso:: :py:class:`QgsDoubleRange`
.. seealso:: :py:class:`QgsIntRange`
.. note::
not available in Python bindings (but class provided for template-based inheritance)
%End
%TypeHeaderCode
#include "qgsrange.h"
%End
public:
QgsRange( T lower, T upper, bool includeLower = true, bool includeUpper = true );
%Docstring
Constructor for QgsRange. The ``lower`` and ``upper`` bounds are
specified, and optionally whether or not these bounds are included in
the range.
%End
QgsRange( T lower, T upper, Qgis::RangeLimits limits );
%Docstring
Constructor for QgsRange. The ``lower`` and ``upper`` bounds are
specified, and whether or not these bounds are included in the range.
.. versionadded:: 3.38
%End
T lower() const;
%Docstring
Returns the lower bound of the range.
.. seealso:: :py:func:`upper`
.. seealso:: :py:func:`includeLower`
%End
T upper() const;
%Docstring
Returns the upper bound of the range.
.. seealso:: :py:func:`lower`
.. seealso:: :py:func:`includeUpper`
%End
bool includeLower() const;
%Docstring
Returns ``True`` if the lower bound is inclusive, or ``False`` if the
lower bound is exclusive.
.. seealso:: :py:func:`lower`
.. seealso:: :py:func:`includeUpper`
%End
bool includeUpper() const;
%Docstring
Returns ``True`` if the upper bound is inclusive, or ``False`` if the
upper bound is exclusive.
.. seealso:: :py:func:`upper`
.. seealso:: :py:func:`includeLower`
%End
Qgis::RangeLimits rangeLimits() const;
%Docstring
Returns the limit handling of the range.
.. versionadded:: 3.38
%End
bool isEmpty() const;
%Docstring
Returns ``True`` if the range is empty, ie the lower bound equals (or
exceeds) the upper bound and either the bounds are exclusive.
.. seealso:: :py:func:`isSingleton`
%End
bool isSingleton() const;
%Docstring
Returns ``True`` if the range consists only of a single value or
instant.
.. seealso:: :py:func:`isEmpty`
%End
bool contains( const QgsRange<T> &other ) const;
%Docstring
Returns ``True`` if this range contains another range.
.. seealso:: :py:func:`overlaps`
%End
bool contains( T element ) const;
%Docstring
Returns ``True`` if this range contains a specified ``element``.
%End
bool overlaps( const QgsRange<T> &other ) const;
%Docstring
Returns ``True`` if this range overlaps another range.
.. seealso:: :py:func:`contains`
%End
bool operator==( const QgsRange<T> &other ) const;
bool operator!=( const QgsRange<T> &other ) const;
protected:
};
typedef QgsRange<double> QgsRangedoubleBase;
class QgsDoubleRange : QgsRangedoubleBase
{
%Docstring(signature="appended")
:py:class:`QgsRange` which stores a range of double values.
.. seealso:: :py:class:`QgsIntRange`
.. seealso:: :py:class:`QgsDateRange`
.. seealso:: :py:class:`QgsDateTimeRange`
%End
%TypeHeaderCode
#include "qgsrange.h"
typedef QgsRange<double> QgsRangedoubleBase;
%End
public:
QgsDoubleRange( double lower, double upper, Qgis::RangeLimits limits );
%Docstring
Constructor for QgsDoubleRange. The ``lower`` and ``upper`` bounds are
specified, and whether or not these bounds are included in the range.
.. versionadded:: 3.38
%End
QgsDoubleRange( double lower,
double upper,
bool includeLower = true, bool includeUpper = true );
%Docstring
Constructor for QgsDoubleRange. The ``lower`` and ``upper`` bounds are
specified, and optionally whether or not these bounds are included in
the range.
%End
QgsDoubleRange();
%Docstring
Constructor for QgsDoubleRange containing an infinite range (see
:py:func:`~QgsDoubleRange.isInfinite`).
.. versionadded:: 3.18
%End
bool isInfinite() const;
%Docstring
Returns ``True`` if the range consists of all possible values.
.. versionadded:: 3.18
%End
SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsDoubleRange: %1%2, %3%4>" ).arg( sipCpp->includeLower() ? QStringLiteral( "[" ) : QStringLiteral( "(" ) )
.arg( sipCpp->lower() )
.arg( sipCpp->upper() )
.arg( sipCpp->includeUpper() ? QStringLiteral( "]" ) : QStringLiteral( ")" ) );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End
bool operator==( const QgsDoubleRange &other ) const;
bool operator!=( const QgsDoubleRange &other ) const;
};
typedef QgsRange<int> QgsRangeintBase;
class QgsIntRange : QgsRangeintBase
{
%Docstring(signature="appended")
:py:class:`QgsRange` which stores a range of integer values.
.. seealso:: :py:class:`QgsDoubleRange`
.. seealso:: :py:class:`QgsDateRange`
.. seealso:: :py:class:`QgsDateTimeRange`
%End
%TypeHeaderCode
#include "qgsrange.h"
typedef QgsRange<int> QgsRangeintBase;
%End
public:
QgsIntRange( int lower, int upper, Qgis::RangeLimits limits );
%Docstring
Constructor for QgsIntRange. The ``lower`` and ``upper`` bounds are
specified, and whether or not these bounds are included in the range.
.. versionadded:: 3.38
%End
QgsIntRange( int lower,
int upper,
bool includeLower = true, bool includeUpper = true );
%Docstring
Constructor for QgsIntRange. The ``lower`` and ``upper`` bounds are
specified, and optionally whether or not these bounds are included in
the range.
%End
QgsIntRange();
%Docstring
Constructor for QgsIntRange containing an infinite range (see
:py:func:`~QgsIntRange.isInfinite`).
.. versionadded:: 3.18
%End
bool isInfinite() const;
%Docstring
Returns ``True`` if the range consists of all possible values.
.. versionadded:: 3.18
%End
SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsIntRange: %1%2, %3%4>" ).arg( sipCpp->includeLower() ? QStringLiteral( "[" ) : QStringLiteral( "(" ) )
.arg( sipCpp->lower() )
.arg( sipCpp->upper() )
.arg( sipCpp->includeUpper() ? QStringLiteral( "]" ) : QStringLiteral( ")" ) );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End
};
template <T>
class QgsTemporalRange
{
%Docstring(signature="appended")
A template based class for storing temporal ranges (beginning to end
values).
:py:class:`QgsTemporalRange` classes represent a range of values of some
temporal type. For instance, ranges of QDateTime might be used to
represent datetime ranges.
Ranges can indicate whether the upper and lower values are inclusive or
exclusive. The inclusivity or exclusivity of bounds is considered when
determining things like whether ranges overlap or during calculation of
range intersections.
.. seealso:: :py:class:`QgsDateRange`
.. note::
not available in Python bindings (but class provided for template-based inheritance)
%End
%TypeHeaderCode
#include "qgsrange.h"
%End
public:
QgsTemporalRange( const T &begin, const T &end, bool includeBeginning = true, bool includeEnd = true );
%Docstring
Constructor for QgsTemporalRange. The ``begin`` and ``end`` are
specified, and optionally whether or not these bounds are included in
the range.
.. note::
in Python ``begin`` and ``end`` must be provided.
%End
// default constructor as default value for templates is not handled in SIP
T begin() const;
%Docstring
Returns the beginning of the range.
.. seealso:: :py:func:`end`
.. seealso:: :py:func:`includeBeginning`
%End
T end() const;
%Docstring
Returns the upper bound of the range.
.. seealso:: :py:func:`begin`
.. seealso:: :py:func:`includeEnd`
%End
bool includeBeginning() const;
%Docstring
Returns ``True`` if the beginning is inclusive, or ``False`` if the
beginning is exclusive.
.. seealso:: :py:func:`begin`
.. seealso:: :py:func:`includeEnd`
%End
bool includeEnd() const;
%Docstring
Returns ``True`` if the end is inclusive, or ``False`` if the end is
exclusive.
.. seealso:: :py:func:`end`
.. seealso:: :py:func:`includeBeginning`
%End
bool isInstant() const;
%Docstring
Returns ``True`` if the range consists only of a single instant.
.. seealso:: :py:func:`isEmpty`
.. seealso:: :py:func:`isInfinite`
%End
bool isInfinite() const;
%Docstring
Returns ``True`` if the range consists of all possible values.
.. seealso:: :py:func:`isEmpty`
.. seealso:: :py:func:`isInstant`
%End
bool isEmpty() const;
%Docstring
Returns ``True`` if the range is empty, ie the beginning equals (or
exceeds) the end and either of the bounds are exclusive. A range with
both invalid beginning and end is considered infinite and not empty.
%End
bool contains( const QgsTemporalRange<T> &other ) const;
%Docstring
Returns ``True`` if this range contains another range.
%End
bool contains( const T &element ) const;
%Docstring
Returns ``True`` if this range contains a specified ``element``.
%End
bool overlaps( const QgsTemporalRange<T> &other ) const;
%Docstring
Returns ``True`` if this range overlaps another range.
.. seealso:: :py:func:`contains`
%End
bool extend( const QgsTemporalRange<T> &other );
%Docstring
Extends the range in place by extending this range out to include an
``other`` range. If ``other`` is empty the range is not changed. If the
range is empty and ``other`` is not, the range is changed and set to
``other``.
.. seealso:: :py:func:`isEmpty`
:return: ``True`` if the range was extended
.. versionadded:: 3.12
%End
bool operator==( const QgsTemporalRange<T> &other ) const;
bool operator!=( const QgsTemporalRange<T> &other ) const;
};
typedef QgsTemporalRange< QDate > QgsDateRange;
@DOCSTRINGSTEMPLATE@%Docstring
@DOCSTRINGSTEMPLATE@:py:class:`QgsRange` which stores a range of dates.
@DOCSTRINGSTEMPLATE@ @DOCSTRINGSTEMPLATE@Invalid QDates as the beginning
or end are permitted. In this case, @DOCSTRINGSTEMPLATE@the bound is
considered to be infinite. E.g. QgsDateRange(QDate(),QDate(2017,1,1))
@DOCSTRINGSTEMPLATE@is treated as a range containing all dates before
2017-1-1. @DOCSTRINGSTEMPLATE@QgsDateRange(QDate(2017,1,1),QDate()) is
treated as a range containing all dates after 2017-1-1.
@DOCSTRINGSTEMPLATE@ @DOCSTRINGSTEMPLATE@.. seealso::
:py:class:`QgsDateTimeRange`
@DOCSTRINGSTEMPLATE@%End
typedef QgsTemporalRange< QDateTime > QgsDateTimeRange;
@DOCSTRINGSTEMPLATE@%Docstring
@DOCSTRINGSTEMPLATE@:py:class:`QgsRange` which stores a range of date
times. @DOCSTRINGSTEMPLATE@ @DOCSTRINGSTEMPLATE@Invalid QDateTimes as
the beginning or end are permitted. In this case,
@DOCSTRINGSTEMPLATE@the bound is considered to be infinite. E.g.
QgsDateTimeRange(QDateTime(),QDateTime(2017,1,1)) @DOCSTRINGSTEMPLATE@is
treated as a range containing all dates before 2017-1-1.
@DOCSTRINGSTEMPLATE@QgsDateTimeRange(QDateTime(2017,1,1),QDateTime()) is
treated as a range containing all dates after 2017-1-1.
@DOCSTRINGSTEMPLATE@ @DOCSTRINGSTEMPLATE@.. seealso::
:py:class:`QgsDateRange`
@DOCSTRINGSTEMPLATE@%End
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrange.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|