Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change QgsRectangle::combineExtentWith(const QgsRectangle*) into QgsR…
…ectangle::combineExtentWith(const QgsRectangle&)
  • Loading branch information
manisandro committed May 29, 2016
1 parent d5f8255 commit d5512a9
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsrectangle.sip
Expand Up @@ -74,7 +74,7 @@ class QgsRectangle
//! return true when rectangle contains a point
bool contains( const QgsPoint &p ) const;
//! expand the rectangle so that covers both the original rectangle and the given rectangle
void combineExtentWith( const QgsRectangle *rect );
void combineExtentWith( const QgsRectangle& rect );
//! expand the rectangle so that covers both the original rectangle and the given point
void combineExtentWith( double x, double y );
//! test if rectangle is empty.
Expand Down
2 changes: 1 addition & 1 deletion src/core/dxf/qgsdxfexport.cpp
Expand Up @@ -3706,7 +3706,7 @@ QgsRectangle QgsDxfExport::dxfExtent() const
else
{
QgsRectangle layerExtent = layerIt->first->extent();
extent.combineExtentWith( &layerExtent );
extent.combineExtentWith( layerExtent );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgscircularstringv2.cpp
Expand Up @@ -78,7 +78,7 @@ QgsRectangle QgsCircularStringV2::calculateBoundingBox() const
else
{
QgsRectangle segmentBox = segmentBoundingBox( QgsPointV2( mX[i], mY[i] ), QgsPointV2( mX[i + 1], mY[i + 1] ), QgsPointV2( mX[i + 2], mY[i + 2] ) );
bbox.combineExtentWith( &segmentBox );
bbox.combineExtentWith( segmentBox );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgscompoundcurvev2.cpp
Expand Up @@ -95,7 +95,7 @@ QgsRectangle QgsCompoundCurveV2::calculateBoundingBox() const
for ( int i = 1; i < mCurves.size(); ++i )
{
QgsRectangle curveBox = mCurves.at( i )->boundingBox();
bbox.combineExtentWith( &curveBox );
bbox.combineExtentWith( curveBox );
}
return bbox;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsgeometrycollectionv2.cpp
Expand Up @@ -336,7 +336,7 @@ QgsRectangle QgsGeometryCollectionV2::calculateBoundingBox() const
for ( int i = 1; i < mGeometries.size(); ++i )
{
QgsRectangle geomBox = mGeometries.at( i )->boundingBox();
bbox.combineExtentWith( &geomBox );
bbox.combineExtentWith( geomBox );
}
return bbox;
}
Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsrectangle.cpp
Expand Up @@ -194,14 +194,14 @@ bool QgsRectangle::contains( const QgsPoint &p ) const
ymin <= p.y() && p.y() <= ymax;
}

void QgsRectangle::combineExtentWith( const QgsRectangle * rect )
void QgsRectangle::combineExtentWith( const QgsRectangle &rect )
{

xmin = (( xmin < rect->xMinimum() ) ? xmin : rect->xMinimum() );
xmax = (( xmax > rect->xMaximum() ) ? xmax : rect->xMaximum() );
xmin = (( xmin < rect.xMinimum() ) ? xmin : rect.xMinimum() );
xmax = (( xmax > rect.xMaximum() ) ? xmax : rect.xMaximum() );

ymin = (( ymin < rect->yMinimum() ) ? ymin : rect->yMinimum() );
ymax = (( ymax > rect->yMaximum() ) ? ymax : rect->yMaximum() );
ymin = (( ymin < rect.yMinimum() ) ? ymin : rect.yMinimum() );
ymax = (( ymax > rect.yMaximum() ) ? ymax : rect.yMaximum() );

}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrectangle.h
Expand Up @@ -97,7 +97,7 @@ class CORE_EXPORT QgsRectangle
//! return true when rectangle contains a point
bool contains( const QgsPoint &p ) const;
//! expand the rectangle so that covers both the original rectangle and the given rectangle
void combineExtentWith( const QgsRectangle *rect );
void combineExtentWith( const QgsRectangle& rect );
//! expand the rectangle so that covers both the original rectangle and the given point
void combineExtentWith( double x, double y );
//! test if rectangle is empty.
Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -716,7 +716,7 @@ QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
if ( !fet.constGeometry() || fet.constGeometry()->isEmpty() )
continue;
r = fet.constGeometry()->boundingBox();
retval.combineExtentWith( &r );
retval.combineExtentWith( r );
}
}
else
Expand All @@ -731,7 +731,7 @@ QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
if ( fet.constGeometry() )
{
r = fet.constGeometry()->boundingBox();
retval.combineExtentWith( &r );
retval.combineExtentWith( r );
}
}
}
Expand Down Expand Up @@ -999,7 +999,7 @@ QgsRectangle QgsVectorLayer::extent()
if ( mDataProvider->featureCount() != 0 )
{
QgsRectangle r = mDataProvider->extent();
rect.combineExtentWith( &r );
rect.combineExtentWith( r );
}

if ( mEditBuffer )
Expand All @@ -1009,7 +1009,7 @@ QgsRectangle QgsVectorLayer::extent()
if ( it->constGeometry() )
{
QgsRectangle r = it->constGeometry()->boundingBox();
rect.combineExtentWith( &r );
rect.combineExtentWith( r );
}
}
}
Expand All @@ -1025,7 +1025,7 @@ QgsRectangle QgsVectorLayer::extent()
if ( fet.constGeometry() && fet.constGeometry()->type() != QGis::UnknownGeometry )
{
QgsRectangle bb = fet.constGeometry()->boundingBox();
rect.combineExtentWith( &bb );
rect.combineExtentWith( bb );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -617,7 +617,7 @@ void QgsRelationReferenceWidget::highlightFeature( QgsFeature f, CanvasExtent ca
QgsRectangle extent = mCanvas->extent();
if ( !extent.contains( featBBox ) )
{
extent.combineExtentWith( &featBBox );
extent.combineExtentWith( featBBox );
extent.scale( 1.1 );
mCanvas->setExtent( extent );
mCanvas->refresh();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/layertree/qgslayertreeviewdefaultactions.cpp
Expand Up @@ -242,7 +242,7 @@ void QgsLayerTreeViewDefaultActions::zoomToLayers( QgsMapCanvas* canvas, const Q
if ( canvas->hasCrsTransformEnabled() )
layerExtent = canvas->mapSettings().layerExtentToOutputExtent( layer, layerExtent );

extent.combineExtentWith( &layerExtent );
extent.combineExtentWith( layerExtent );
}

if ( extent.isNull() )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -1166,7 +1166,7 @@ void QgsMapCanvas::zoomToFeatureIds( QgsVectorLayer* layer, const QgsFeatureIds&
return;
}
QgsRectangle r = mapSettings().layerExtentToOutputExtent( layer, geom->boundingBox() );
rect.combineExtentWith( &r );
rect.combineExtentWith( r );
featureCount++;
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsrubberband.cpp
Expand Up @@ -558,7 +558,7 @@ void QgsRubberBand::updateRect()
}
else
{
r.combineExtentWith( &rect );
r.combineExtentWith( rect );
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/globe/globe_plugin.cpp
Expand Up @@ -772,7 +772,7 @@ void GlobePlugin::refreshQGISMapLayer( QgsRectangle rect )
rect = mLayerExtents.values().front();
foreach ( const QgsRectangle& extent, mLayerExtents.values() )
{
rect.combineExtentWith( &extent );
rect.combineExtentWith( extent );
}
}
mOsgViewer->getDatabasePager()->clear();
Expand Down Expand Up @@ -903,7 +903,7 @@ void GlobePlugin::updateLayers()
QgsRectangle fullExtent = mLayerExtents.isEmpty() ? QgsRectangle() : mLayerExtents.values().front();
foreach ( const QgsRectangle& rect, mLayerExtents.values() )
{
fullExtent.combineExtentWith( &rect );
fullExtent.combineExtentWith( rect );
}
mLayerExtents.clear();

Expand Down Expand Up @@ -958,7 +958,7 @@ void GlobePlugin::updateLayers()
}
else
{
fullExtent.combineExtentWith( &extent );
fullExtent.combineExtentWith( extent );
}
}
}
Expand Down Expand Up @@ -1034,7 +1034,7 @@ void GlobePlugin::layerChanged( QgsMapLayer* mapLayer )
QgsRectangle updateExtent = layerExtent;
if ( mLayerExtents.contains( mapLayer->id() ) )
{
updateExtent.combineExtentWith( &mLayerExtents[mapLayer->id()] );
updateExtent.combineExtentWith( mLayerExtents[mapLayer->id()] );
}
mLayerExtents[mapLayer->id()] = layerExtent;
refreshQGISMapLayer( updateExtent );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/interpolation/qgsinterpolationdialog.cpp
Expand Up @@ -458,7 +458,7 @@ QgsRectangle QgsInterpolationDialog::boundingBoxOfLayers()
}
else
{
combinedLayerExtent.combineExtentWith( &currentLayerExtent );
combinedLayerExtent.combineExtentWith( currentLayerExtent );
}
}
return combinedLayerExtent;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/topology/topolTest.cpp
Expand Up @@ -1171,7 +1171,7 @@ ErrorList topolTest::checkOverlapWithLayer( double tolerance, QgsVectorLayer* la
{
QgsRectangle r = bb;
QgsRectangle r2 = g2->boundingBox();
r.combineExtentWith( &r2 );
r.combineExtentWith( r2 );

QScopedPointer<QgsGeometry> conflictGeom( g1->intersection( g2 ) );
// could this for some reason return NULL?
Expand Down
4 changes: 2 additions & 2 deletions src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Expand Up @@ -474,7 +474,7 @@ void QgsDelimitedTextProvider::scanFile( bool buildIndexes )
mNumberFeatures++;
if ( geom->isMultipart() ) mWkbType = type;
QgsRectangle bbox( geom->boundingBox() );
mExtent.combineExtentWith( &bbox );
mExtent.combineExtentWith( bbox );
}
if ( buildSpatialIndex )
{
Expand Down Expand Up @@ -797,7 +797,7 @@ void QgsDelimitedTextProvider::rescanFile()
else
{
QgsRectangle bbox( f.constGeometry()->boundingBox() );
mExtent.combineExtentWith( &bbox );
mExtent.combineExtentWith( bbox );
}
if ( buildSpatialIndex ) mSpatialIndex->insertFeature( f );
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -1256,7 +1256,7 @@ bool QgsWmsProvider::calculateExtent()
}
else
{
mLayerExtent.combineExtentWith( &extent );
mLayerExtent.combineExtentWith( extent );
}

firstLayer = false;
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgsserverprojectparser.cpp
Expand Up @@ -725,7 +725,7 @@ void QgsServerProjectParser::combineExtentAndCrsOfGroupChildren( QDomElement& gr
}
else
{
combinedBBox.combineExtentWith( &bbox );
combinedBBox.combineExtentWith( bbox );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/qgswmsprojectparser.cpp
Expand Up @@ -1707,7 +1707,7 @@ void QgsWMSProjectParser::addOWSLayers( QDomDocument &doc,
}
else
{
combinedBBox.combineExtentWith( &BBox );
combinedBBox.combineExtentWith( BBox );
}

addOWSLayerStyles( currentLayer, doc, layerElem );
Expand Down
4 changes: 2 additions & 2 deletions src/server/qgswmsserver.cpp
Expand Up @@ -2260,7 +2260,7 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
}
else
{
featureBBox->combineExtentWith( &box );
featureBBox->combineExtentWith( box );
}
}
}
Expand Down Expand Up @@ -2600,7 +2600,7 @@ void QgsWMSServer::applyRequestedLayerFilters( const QStringList& layerList , QH
}
else
{
filterExtent.combineExtentWith( &layerExtent );
filterExtent.combineExtentWith( layerExtent );
}
}
mMapRenderer->setExtent( filterExtent );
Expand Down

0 comments on commit d5512a9

Please sign in to comment.