Skip to content

Commit

Permalink
-Propogated updates for QgsRect setYMin/setYMax
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9177 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
ersts committed Aug 26, 2008
1 parent 6e8b4a2 commit dfcacb6
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions python/core/qgsrect.sip
Expand Up @@ -31,9 +31,9 @@ class QgsRect
//! Set the maximum x value
void setXMaximum(double x);
//! Set the maximum y value
void setYmin(double y);
void setYMinimum(double y);
//! Set the maximum y value
void setYmax(double y);
void setYMaximum(double y);
//! Set a rectangle so that min corner is at max
// and max corner is at min. It is NOT normalized.
void setMinimal();
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsmaptoolidentify.cpp
Expand Up @@ -244,8 +244,8 @@ void QgsMapToolIdentify::identifyVectorLayer( const QgsPoint& point )
QgsRect r;
r.setXMinimum( point.x() - searchRadius );
r.setXMaximum( point.x() + searchRadius );
r.setYmin( point.y() - searchRadius );
r.setYmax( point.y() + searchRadius );
r.setYMinimum( point.y() - searchRadius );
r.setYMaximum( point.y() + searchRadius );

r = toLayerCoords( layer, r );

Expand Down
4 changes: 2 additions & 2 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -263,8 +263,8 @@ void QgsComposerMap::moveContent( double dx, double dy )

mExtent.setXMinimum( mExtent.xMin() + xMoveMapCoord );
mExtent.setXMaximum( mExtent.xMax() + xMoveMapCoord );
mExtent.setYmin( mExtent.yMin() + yMoveMapCoord );
mExtent.setYmax( mExtent.yMax() + yMoveMapCoord );
mExtent.setYMinimum( mExtent.yMin() + yMoveMapCoord );
mExtent.setYMaximum( mExtent.yMax() + yMoveMapCoord );
emit extentChanged();
cache();
update();
Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsmaprenderer.cpp
Expand Up @@ -182,8 +182,8 @@ void QgsMapRenderer::adjustExtentToSize()
// update extent
mExtent.setXMinimum( dxmin );
mExtent.setXMaximum( dxmax );
mExtent.setYmin( dymin );
mExtent.setYmax( dymax );
mExtent.setYMinimum( dymin );
mExtent.setYMaximum( dymax );

// update the scale
updateScale();
Expand Down Expand Up @@ -326,7 +326,7 @@ void QgsMapRenderer::render( QPainter* painter )
bk_mapToPixel = mRenderContext.mapToPixel();
rasterMapToPixel = mRenderContext.mapToPixel();
rasterMapToPixel.setMapUnitsPerPixel( mRenderContext.mapToPixel().mapUnitsPerPixel() / rasterScaleFactor );
rasterMapToPixel.setYmax( mSize.height() * rasterScaleFactor );
rasterMapToPixel.setYMaximum( mSize.height() * rasterScaleFactor );
mRenderContext.setMapToPixel( rasterMapToPixel );
mRenderContext.painter()->save();
mRenderContext.painter()->scale( 1.0 / rasterScaleFactor, 1.0 / rasterScaleFactor );
Expand Down Expand Up @@ -754,15 +754,15 @@ bool QgsMapRenderer::readXML( QDomNode & theNode )

exElement = yminNode.toElement();
double ymin = exElement.text().toDouble();
aoi.setYmin( ymin );
aoi.setYMinimum( ymin );

exElement = xmaxNode.toElement();
double xmax = exElement.text().toDouble();
aoi.setXMaximum( xmax );

exElement = ymaxNode.toElement();
double ymax = exElement.text().toDouble();
aoi.setYmax( ymax );
aoi.setYMaximum( ymax );

setExtent( aoi );

Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaptopixel.cpp
Expand Up @@ -64,12 +64,12 @@ double QgsMapToPixel::mapUnitsPerPixel() const
return mMapUnitsPerPixel;
}

void QgsMapToPixel::setYmax( double ymax )
void QgsMapToPixel::setYMaximum( double ymax )
{
yMax = ymax;
}

void QgsMapToPixel::setYmin( double ymin )
void QgsMapToPixel::setYMinimum( double ymin )
{
yMin = ymin;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaptopixel.h
Expand Up @@ -91,9 +91,9 @@ class CORE_EXPORT QgsMapToPixel
double mapUnitsPerPixel() const;

//! Set maximum y value
void setYmax( double ymax );
void setYMaximum( double ymax );
//! Set minimum y value
void setYmin( double ymin );
void setYMinimum( double ymin );
//! set minimum x value
void setXMinimum( double xmin );
/*! Set parameters for use in tranfsorming coordinates
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsrect.h
Expand Up @@ -145,12 +145,12 @@ inline void QgsRect::setXMaximum( double x )
xmax = x;
}

inline void QgsRect::setYmin( double y )
inline void QgsRect::setYMinimum( double y )
{
ymin = y;
}

inline void QgsRect::setYmax( double y )
inline void QgsRect::setYMaximum( double y )
{
ymax = y;
}
Expand Down
16 changes: 8 additions & 8 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -1535,8 +1535,8 @@ int QgsVectorLayer::addRing( const QList<QgsPoint>& ring )

if ( boundingBoxFromPointList( ring, xMin, yMin, xMax, yMax ) == 0 )
{
bBox.setXMinimum( xMin ); bBox.setYmin( yMin );
bBox.setXMaximum( xMax ); bBox.setYmax( yMax );
bBox.setXMinimum( xMin ); bBox.setYMinimum( yMin );
bBox.setXMaximum( xMax ); bBox.setYMaximum( yMax );
}
else
{
Expand Down Expand Up @@ -1661,8 +1661,8 @@ int QgsVectorLayer::splitFeatures( const QList<QgsPoint>& splitLine, bool topolo
{
if ( boundingBoxFromPointList( splitLine, xMin, yMin, xMax, yMax ) == 0 )
{
bBox.setXMinimum( xMin ); bBox.setYmin( yMin );
bBox.setXMaximum( xMax ); bBox.setYmax( yMax );
bBox.setXMinimum( xMin ); bBox.setYMinimum( yMin );
bBox.setXMaximum( xMax ); bBox.setYMaximum( yMax );
}
else
{
Expand All @@ -1679,8 +1679,8 @@ int QgsVectorLayer::splitFeatures( const QList<QgsPoint>& splitLine, bool topolo
}
else if ( bBox.height() == 0.0 && bBox.width() > 0 )
{
bBox.setYmin( bBox.yMin() - bBox.width() / 2 );
bBox.setYmax( bBox.yMax() + bBox.width() / 2 );
bBox.setYMinimum( bBox.yMin() - bBox.width() / 2 );
bBox.setYMaximum( bBox.yMax() + bBox.width() / 2 );
}
else
{
Expand Down Expand Up @@ -2176,8 +2176,8 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
// store the extent
mLayerExtent.setXMaximum( mbr.xMax() );
mLayerExtent.setXMinimum( mbr.xMin() );
mLayerExtent.setYmax( mbr.yMax() );
mLayerExtent.setYmin( mbr.yMin() );
mLayerExtent.setYMaximum( mbr.yMax() );
mLayerExtent.setYMinimum( mbr.yMin() );

// get and store the feature type
mGeometryType = mDataProvider->geometryType();
Expand Down
8 changes: 4 additions & 4 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -483,8 +483,8 @@ bool QgsRasterLayer::readFile( QString const & fileName )
// The affine transform reduces to these values at the
// top-left corner of the raster
mLayerExtent.setXMinimum( mGeoTransform[0] );
mLayerExtent.setYmax( mGeoTransform[3] );
mLayerExtent.setYmin( myYMin );
mLayerExtent.setYMaximum( mGeoTransform[3] );
mLayerExtent.setYMinimum( myYMin );

//
// Set up the x and y dimensions of this raster layer
Expand Down Expand Up @@ -4864,8 +4864,8 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
// store the extent
mLayerExtent.setXMaximum( mbr.xMax() );
mLayerExtent.setXMinimum( mbr.xMin() );
mLayerExtent.setYmax( mbr.yMax() );
mLayerExtent.setYmin( mbr.yMin() );
mLayerExtent.setYMaximum( mbr.yMax() );
mLayerExtent.setYMinimum( mbr.yMin() );

// upper case the first letter of the layer name
QgsDebugMsg( "mLayerName: " + name() );
Expand Down
16 changes: 8 additions & 8 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -628,17 +628,17 @@ void QgsMapCanvas::keyPressEvent( QKeyEvent * e )
case Qt::Key_Up:
QgsDebugMsg( "Pan up" );

currentExtent.setYmax( currentExtent.yMax() + dy );
currentExtent.setYmin( currentExtent.yMin() + dy );
currentExtent.setYMaximum( currentExtent.yMax() + dy );
currentExtent.setYMinimum( currentExtent.yMin() + dy );
setExtent( currentExtent );
refresh();
break;

case Qt::Key_Down:
QgsDebugMsg( "Pan down" );

currentExtent.setYmax( currentExtent.yMax() - dy );
currentExtent.setYmin( currentExtent.yMin() - dy );
currentExtent.setYMaximum( currentExtent.yMax() - dy );
currentExtent.setYMinimum( currentExtent.yMin() - dy );
setExtent( currentExtent );
refresh();
break;
Expand Down Expand Up @@ -1134,14 +1134,14 @@ void QgsMapCanvas::panActionEnd( QPoint releasePoint )

if ( end.y() < start.y() )
{
r.setYmax( r.yMax() + dy );
r.setYmin( r.yMin() + dy );
r.setYMaximum( r.yMax() + dy );
r.setYMinimum( r.yMin() + dy );

}
else
{
r.setYmax( r.yMax() - dy );
r.setYmin( r.yMin() - dy );
r.setYMaximum( r.yMax() - dy );
r.setYMinimum( r.yMin() - dy );

}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmapoverviewcanvas.cpp
Expand Up @@ -188,8 +188,8 @@ void QgsMapOverviewCanvas::mouseReleaseEvent( QMouseEvent * e )
QgsRect ext;
ext.setXMinimum( center.x() - oldExtent.width() / 2 );
ext.setXMaximum( center.x() + oldExtent.width() / 2 );
ext.setYmin( center.y() - oldExtent.height() / 2 );
ext.setYmax( center.y() + oldExtent.height() / 2 );
ext.setYMinimum( center.y() - oldExtent.height() / 2 );
ext.setYMaximum( center.y() + oldExtent.height() / 2 );

QgsDebugMsg( QString( "panning: new position: [%1,%2] [%3x%4]" ).arg( rect.left() ).arg( rect.top() ).arg( rect.width() ).arg( rect.height() ) );

Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmaptip.cpp
Expand Up @@ -92,8 +92,8 @@ QString QgsMapTip::fetchFeature( QgsMapLayer *layer, QgsPoint & mapPosition, Qgs
QgsRect r;
r.setXMinimum( mapPosition.x() - searchRadius );
r.setXMaximum( mapPosition.x() + searchRadius );
r.setYmin( mapPosition.y() - searchRadius );
r.setYmax( mapPosition.y() + searchRadius );
r.setYMinimum( mapPosition.y() - searchRadius );
r.setYMaximum( mapPosition.y() + searchRadius );

// Get the data provider
QgsVectorDataProvider* dataProvider = dynamic_cast<QgsVectorLayer*>( layer )->dataProvider();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmaptoolzoom.cpp
Expand Up @@ -85,9 +85,9 @@ void QgsMapToolZoom::canvasReleaseEvent( QMouseEvent * e )

QgsRect r;
r.setXMinimum( ll.x() );
r.setYmin( ll.y() );
r.setYMinimum( ll.y() );
r.setXMaximum( ur.x() );
r.setYmax( ur.y() );
r.setYMaximum( ur.y() );
r.normalize();

// prevent zooming to an empty extent
Expand Down
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspostgresextentthread.cpp
Expand Up @@ -137,8 +137,8 @@ void QgsPostgresExtentThread::run()
/*
layerExtent.setXMaximum(maxx);
layerExtent.setXMinimum(minx);
layerExtent.setYmax(maxy);
layerExtent.setYmin(miny);
layerExtent.setYMaximum(maxy);
layerExtent.setYMinimum(miny);
*/


Expand Down
8 changes: 4 additions & 4 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -698,8 +698,8 @@ void QgsPostgresProvider::setExtent( QgsRect& newExtent )
{
layerExtent.setXMaximum( newExtent.xMax() );
layerExtent.setXMinimum( newExtent.xMin() );
layerExtent.setYmax( newExtent.yMax() );
layerExtent.setYmin( newExtent.yMin() );
layerExtent.setYMaximum( newExtent.yMax() );
layerExtent.setYMinimum( newExtent.yMin() );
}

// TODO - make this function return the real extent_
Expand Down Expand Up @@ -2388,8 +2388,8 @@ void QgsPostgresProvider::calculateExtents()

layerExtent.setXMaximum( maxx );
layerExtent.setXMinimum( minx );
layerExtent.setYmax( maxy );
layerExtent.setYmin( miny );
layerExtent.setYMaximum( maxy );
layerExtent.setYMinimum( miny );
}
}
else
Expand Down
8 changes: 4 additions & 4 deletions src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -620,10 +620,10 @@ int QgsWFSProvider::getExtentFromGML2( QgsRect* extent, const QDomElement& wfsCo

std::list<QgsPoint>::const_iterator it = boundingPoints.begin();
extent->setXMinimum( it->x() );
extent->setYmin( it->y() );
extent->setYMinimum( it->y() );
++it;
extent->setXMaximum( it->x() );
extent->setYmax( it->y() );
extent->setYMaximum( it->y() );
return 0;
}
else if ( coordinatesNode.localName() == "coord" )
Expand Down Expand Up @@ -659,9 +659,9 @@ int QgsWFSProvider::getExtentFromGML2( QgsRect* extent, const QDomElement& wfsCo
return 10;
}
extent->setXMinimum( x1 );
extent->setYmin( y1 );
extent->setYMinimum( y1 );
extent->setXMaximum( x2 );
extent->setYmax( y2 );
extent->setYMaximum( y2 );
return 0;
}
else
Expand Down

0 comments on commit dfcacb6

Please sign in to comment.