Skip to content
Permalink
Browse files
Merge pull request #4353 from nyalldawson/range
New QgsRange template based class for storing interval ranges
  • Loading branch information
nyalldawson committed Apr 18, 2017
2 parents 405da59 + 7949c81 commit 6bb3fa61c5c8938180f5de5430cd8d2a30b24282
@@ -94,6 +94,7 @@ core/qgspropertycollection.sip
core/qgsprovidermetadata.sip
core/qgsproviderregistry.sip
core/qgspythonrunner.sip
core/qgsrange.sip
core/qgsrelation.sip
core/qgsrelationmanager.sip
core/qgsrenderchecker.sip
@@ -127,6 +127,7 @@
%Include qgsprovidermetadata.sip
%Include qgsproviderregistry.sip
%Include qgspythonrunner.sip
%Include qgsrange.sip
%Include qgsrelation.sip
%Include qgsrelationmanager.sip
%Include qgsrenderchecker.sip
@@ -0,0 +1,57 @@
class QgsDoubleRange
{
%TypeHeaderCode
#include <qgsrange.h>
%End

public:

QgsDoubleRange( double lower, double upper, bool includeLower = true, bool includeUpper = true );
double lower() const;
double upper() const;
bool includeLower() const;
bool includeUpper() const;
bool isEmpty() const;
bool contains( const QgsDoubleRange &other ) const;
bool contains( double element ) const;
bool overlaps( const QgsDoubleRange &other ) const;
};

class QgsIntRange
{
%TypeHeaderCode
#include <qgsrange.h>
%End

public:

QgsIntRange( int lower, int upper, bool includeLower = true, bool includeUpper = true );
int lower() const;
int upper() const;
bool includeLower() const;
bool includeUpper() const;
bool isEmpty() const;
bool contains( const QgsIntRange &other ) const;
bool contains( int element ) const;
bool overlaps( const QgsIntRange &other ) const;
};

class QgsDateRange
{
%TypeHeaderCode
#include <qgsrange.h>
%End

public:

QgsDateRange( QDate lower, QDate upper, bool includeLower = true, bool includeUpper = true );
QDate lower() const;
QDate upper() const;
bool includeLower() const;
bool includeUpper() const;
bool isEmpty() const;
bool contains( const QgsDateRange &other ) const;
bool contains( QDate element ) const;
bool overlaps( const QgsDateRange &other ) const;
};

@@ -762,6 +762,7 @@ SET(QGIS_CORE_HDRS
qgsprovidermetadata.h
qgsproviderregistry.h
qgspythonrunner.h
qgsrange.h
qgsrenderchecker.h
qgsrendercontext.h
qgsruntimeprofiler.h
Loading

0 comments on commit 6bb3fa6

Please sign in to comment.