mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Change QgsRectangle::combineExtentWith(const QgsRectangle*) into QgsRectangle::combineExtentWith(const QgsRectangle&)
This commit is contained in:
parent
d5f8255a0d
commit
d5512a931f
@ -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.
|
||||
|
@ -3706,7 +3706,7 @@ QgsRectangle QgsDxfExport::dxfExtent() const
|
||||
else
|
||||
{
|
||||
QgsRectangle layerExtent = layerIt->first->extent();
|
||||
extent.combineExtentWith( &layerExtent );
|
||||
extent.combineExtentWith( layerExtent );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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() );
|
||||
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
@ -731,7 +731,7 @@ QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
|
||||
if ( fet.constGeometry() )
|
||||
{
|
||||
r = fet.constGeometry()->boundingBox();
|
||||
retval.combineExtentWith( &r );
|
||||
retval.combineExtentWith( r );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -999,7 +999,7 @@ QgsRectangle QgsVectorLayer::extent()
|
||||
if ( mDataProvider->featureCount() != 0 )
|
||||
{
|
||||
QgsRectangle r = mDataProvider->extent();
|
||||
rect.combineExtentWith( &r );
|
||||
rect.combineExtentWith( r );
|
||||
}
|
||||
|
||||
if ( mEditBuffer )
|
||||
@ -1009,7 +1009,7 @@ QgsRectangle QgsVectorLayer::extent()
|
||||
if ( it->constGeometry() )
|
||||
{
|
||||
QgsRectangle r = it->constGeometry()->boundingBox();
|
||||
rect.combineExtentWith( &r );
|
||||
rect.combineExtentWith( r );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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() )
|
||||
|
@ -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++;
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,7 @@ void QgsRubberBand::updateRect()
|
||||
}
|
||||
else
|
||||
{
|
||||
r.combineExtentWith( &rect );
|
||||
r.combineExtentWith( rect );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
@ -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();
|
||||
|
||||
@ -958,7 +958,7 @@ void GlobePlugin::updateLayers()
|
||||
}
|
||||
else
|
||||
{
|
||||
fullExtent.combineExtentWith( &extent );
|
||||
fullExtent.combineExtentWith( extent );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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 );
|
||||
|
@ -458,7 +458,7 @@ QgsRectangle QgsInterpolationDialog::boundingBoxOfLayers()
|
||||
}
|
||||
else
|
||||
{
|
||||
combinedLayerExtent.combineExtentWith( ¤tLayerExtent );
|
||||
combinedLayerExtent.combineExtentWith( currentLayerExtent );
|
||||
}
|
||||
}
|
||||
return combinedLayerExtent;
|
||||
|
@ -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?
|
||||
|
@ -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 )
|
||||
{
|
||||
@ -797,7 +797,7 @@ void QgsDelimitedTextProvider::rescanFile()
|
||||
else
|
||||
{
|
||||
QgsRectangle bbox( f.constGeometry()->boundingBox() );
|
||||
mExtent.combineExtentWith( &bbox );
|
||||
mExtent.combineExtentWith( bbox );
|
||||
}
|
||||
if ( buildSpatialIndex ) mSpatialIndex->insertFeature( f );
|
||||
}
|
||||
|
@ -1256,7 +1256,7 @@ bool QgsWmsProvider::calculateExtent()
|
||||
}
|
||||
else
|
||||
{
|
||||
mLayerExtent.combineExtentWith( &extent );
|
||||
mLayerExtent.combineExtentWith( extent );
|
||||
}
|
||||
|
||||
firstLayer = false;
|
||||
|
@ -725,7 +725,7 @@ void QgsServerProjectParser::combineExtentAndCrsOfGroupChildren( QDomElement& gr
|
||||
}
|
||||
else
|
||||
{
|
||||
combinedBBox.combineExtentWith( &bbox );
|
||||
combinedBBox.combineExtentWith( bbox );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1707,7 +1707,7 @@ void QgsWMSProjectParser::addOWSLayers( QDomDocument &doc,
|
||||
}
|
||||
else
|
||||
{
|
||||
combinedBBox.combineExtentWith( &BBox );
|
||||
combinedBBox.combineExtentWith( BBox );
|
||||
}
|
||||
|
||||
addOWSLayerStyles( currentLayer, doc, layerElem );
|
||||
|
@ -2260,7 +2260,7 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
|
||||
}
|
||||
else
|
||||
{
|
||||
featureBBox->combineExtentWith( &box );
|
||||
featureBBox->combineExtentWith( box );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2600,7 +2600,7 @@ void QgsWMSServer::applyRequestedLayerFilters( const QStringList& layerList , QH
|
||||
}
|
||||
else
|
||||
{
|
||||
filterExtent.combineExtentWith( &layerExtent );
|
||||
filterExtent.combineExtentWith( layerExtent );
|
||||
}
|
||||
}
|
||||
mMapRenderer->setExtent( filterExtent );
|
||||
|
Loading…
x
Reference in New Issue
Block a user