Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #4353 from nyalldawson/range
New QgsRange template based class for storing interval ranges
- Loading branch information
Showing
8 changed files
with
703 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.