18 #ifndef QGSRECTANGLE_H 19 #define QGSRECTANGLE_H 22 #include <QDomDocument> 39 QgsRectangle(
double xmin = 0,
double ymin = 0,
double xmax = 0,
double ymax = 0 );
53 void set(
double xmin,
double ymin,
double xmax,
double ymax );
55 void setXMinimum(
double x );
57 void setXMaximum(
double x );
59 void setYMinimum(
double y );
61 void setYMaximum(
double y );
66 double xMaximum()
const;
68 double xMinimum()
const;
70 double yMaximum()
const;
72 double yMinimum()
const;
78 double height()
const;
82 void scale(
double scaleFactor,
const QgsPoint *c =
nullptr );
83 void scale(
double scaleFactor,
double centerX,
double centerY );
85 void grow(
double delta );
98 bool contains(
const QgsPoint &p )
const;
102 void combineExtentWith(
double x,
double y );
105 bool isEmpty()
const;
111 QString asWktCoordinates()
const;
117 QString toString(
bool automaticPrecision =
false )
const;
119 QString toString(
int thePrecision )
const;
141 bool isFinite()
const;
219 return QgsPoint( xmin + width() / 2, ymin + height() / 2 );
226 #endif // QGSRECTANGLE_H A rectangle specified with double values.
QgsPoint center() const
Center point of the rectangle.
void setXMaximum(double x)
Set the maximum x value.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
~QgsRectangle()
Destructor.
CORE_EXPORT QDataStream & operator<<(QDataStream &out, const QgsRectangle &rectangle)
Writes the list rectangle to stream out.
QString toString(bool automaticPrecision=false) const
returns string representation of form xmin,ymin xmax,ymax
double width() const
Width of the rectangle.
void setYMinimum(double y)
Set the minimum y value.
A class to represent a point.
QByteArray toLocal8Bit() const
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
double xMaximum() const
Get the x maximum value (right side of rectangle)
CORE_EXPORT QDataStream & operator>>(QDataStream &in, QgsRectangle &rectangle)
Reads a rectangle from stream in into rectangle.
void setYMaximum(double y)
Set the maximum y value.
double xMinimum() const
Get the x minimum value (left side of rectangle)
double yMaximum() const
Get the y maximum value (top side of rectangle)
bool isNull(const QVariant &v)
void setXMinimum(double x)
Set the minimum x value.
double height() const
Height of the rectangle.