예제 #1
0
bool QgsRectangle::operator==( const QgsRectangle & r1 ) const
{
  return ( r1.xMaximum() == xMaximum() &&
           r1.xMinimum() == xMinimum() &&
           r1.yMaximum() == yMaximum() &&
           r1.yMinimum() == yMinimum() );
}
예제 #2
0
void QgsRectangle::unionRect( const QgsRectangle& r )
{
  if ( r.xMinimum() < xMinimum() ) setXMinimum( r.xMinimum() );
  if ( r.xMaximum() > xMaximum() ) setXMaximum( r.xMaximum() );
  if ( r.yMinimum() < yMinimum() ) setYMinimum( r.yMinimum() );
  if ( r.yMaximum() > yMaximum() ) setYMaximum( r.yMaximum() );
}
예제 #3
0
void QgsRectangle::include( const QgsPoint &p )
{
  if ( p.x() < xMinimum() )
    setXMinimum( p.x() );
  else if ( p.x() > xMaximum() )
    setXMaximum( p.x() );
  if ( p.y() < yMinimum() )
    setYMinimum( p.y() );
  if ( p.y() > yMaximum() )
    setYMaximum( p.y() );
}