mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Added QgsRectangle::contains predicate.
git-svn-id: http://svn.osgeo.org/qgis/trunk@9973 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
e35d41cd7b
commit
fde5e77bb0
@ -61,6 +61,9 @@ class QgsRectangle
|
||||
QgsRectangle intersect(QgsRectangle *rect);
|
||||
//! returns true when rectangle intersects with other rectangle
|
||||
bool intersects(const QgsRectangle& rect) const;
|
||||
//! return true when rectangle contains other rectangle
|
||||
//! @note added in version 1.1
|
||||
bool contains( const QgsRectangle& rect ) const;
|
||||
//! expand the rectangle so that covers both the original rectangle and the given rectangle
|
||||
void combineExtentWith(QgsRectangle *rect);
|
||||
//! expand the rectangle so that covers both the original rectangle and the given point
|
||||
|
@ -156,6 +156,11 @@ bool QgsRectangle::intersects( const QgsRectangle& rect ) const
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool QgsRectangle::contains( const QgsRectangle& rect ) const
|
||||
{
|
||||
return (rect.xmin >= xmin && rect.xmax <= xmax && rect.ymin >= ymin && rect.ymax <= ymax);
|
||||
}
|
||||
|
||||
|
||||
void QgsRectangle::combineExtentWith( QgsRectangle * rect )
|
||||
{
|
||||
|
@ -84,6 +84,9 @@ class CORE_EXPORT QgsRectangle
|
||||
QgsRectangle intersect( QgsRectangle *rect ) const;
|
||||
//! returns true when rectangle intersects with other rectangle
|
||||
bool intersects( const QgsRectangle& rect ) const;
|
||||
//! return true when rectangle contains other rectangle
|
||||
//! @note added in version 1.1
|
||||
bool contains( const QgsRectangle& rect ) const;
|
||||
//! expand the rectangle so that covers both the original rectangle and the given rectangle
|
||||
void combineExtentWith( QgsRectangle *rect );
|
||||
//! expand the rectangle so that covers both the original rectangle and the given point
|
||||
|
Loading…
x
Reference in New Issue
Block a user