mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Added a set(const QgsRect&) function
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@3222 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
a0fde81dce
commit
458f33b56f
@ -34,11 +34,7 @@ QgsRect::QgsRect(double newxmin, double newymin, double newxmax, double newymax)
|
||||
|
||||
QgsRect::QgsRect(QgsPoint const & p1, QgsPoint const & p2)
|
||||
{
|
||||
xmin = p1.x();
|
||||
xmax = p2.x();
|
||||
ymin = p1.y();
|
||||
ymax = p2.y();
|
||||
normalize();
|
||||
set(p1, p2);
|
||||
}
|
||||
|
||||
QgsRect::QgsRect(const QgsRect &r)
|
||||
@ -49,6 +45,15 @@ QgsRect::QgsRect(const QgsRect &r)
|
||||
ymax = r.yMax();
|
||||
}
|
||||
|
||||
void QgsRect::set(const QgsPoint& p1, const QgsPoint& p2)
|
||||
{
|
||||
xmin = p1.x();
|
||||
xmax = p2.x();
|
||||
ymin = p1.y();
|
||||
ymax = p2.y();
|
||||
normalize();
|
||||
}
|
||||
|
||||
void QgsRect::normalize()
|
||||
{
|
||||
double temp;
|
||||
|
@ -45,6 +45,9 @@ class QgsRect
|
||||
QgsRect(const QgsRect &other);
|
||||
//! Destructor
|
||||
~QgsRect();
|
||||
//! Set the rectangle from two QgsPoints. The rectangle is
|
||||
//normalised after construction.
|
||||
void set(const QgsPoint& p1, const QgsPoint& p2);
|
||||
//! Set the minimum x value
|
||||
void setXmin(double x);
|
||||
//! Set the maximum x value
|
||||
|
Loading…
x
Reference in New Issue
Block a user