File tree 3 files changed +11
-0
lines changed
3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ class QgsRectangle
61
61
QgsRectangle intersect(QgsRectangle *rect);
62
62
//! returns true when rectangle intersects with other rectangle
63
63
bool intersects(const QgsRectangle& rect) const;
64
+ //! return true when rectangle contains other rectangle
65
+ //! @note added in version 1.1
66
+ bool contains( const QgsRectangle& rect ) const;
64
67
//! expand the rectangle so that covers both the original rectangle and the given rectangle
65
68
void combineExtentWith(QgsRectangle *rect);
66
69
//! expand the rectangle so that covers both the original rectangle and the given point
Original file line number Diff line number Diff line change @@ -156,6 +156,11 @@ bool QgsRectangle::intersects( const QgsRectangle& rect ) const
156
156
return TRUE ;
157
157
}
158
158
159
+ bool QgsRectangle::contains ( const QgsRectangle& rect ) const
160
+ {
161
+ return (rect.xmin >= xmin && rect.xmax <= xmax && rect.ymin >= ymin && rect.ymax <= ymax);
162
+ }
163
+
159
164
160
165
void QgsRectangle::combineExtentWith ( QgsRectangle * rect )
161
166
{
Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ class CORE_EXPORT QgsRectangle
84
84
QgsRectangle intersect ( QgsRectangle *rect ) const ;
85
85
// ! returns true when rectangle intersects with other rectangle
86
86
bool intersects ( const QgsRectangle& rect ) const ;
87
+ // ! return true when rectangle contains other rectangle
88
+ // ! @note added in version 1.1
89
+ bool contains ( const QgsRectangle& rect ) const ;
87
90
// ! expand the rectangle so that covers both the original rectangle and the given rectangle
88
91
void combineExtentWith ( QgsRectangle *rect );
89
92
// ! expand the rectangle so that covers both the original rectangle and the given point
You can’t perform that action at this time.
0 commit comments