Skip to content
Permalink
Browse files

speed up QgsRubberBand::setToGeometry()

git-svn-id: http://svn.osgeo.org/qgis/trunk@9916 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jan 2, 2009
1 parent 0bbbe00 commit 80a8b8b616f95779abcd1bfdfb097b39ddddbbc5
Showing with 18 additions and 18 deletions.
  1. +18 −18 src/gui/qgsrubberband.cpp
@@ -186,10 +186,10 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
{
pt = geom->asPoint();
}
addPoint( QgsPoint( pt.x() - d, pt.y() - d ) );
addPoint( QgsPoint( pt.x() + d, pt.y() - d ) );
addPoint( QgsPoint( pt.x() + d, pt.y() + d ) );
addPoint( QgsPoint( pt.x() - d, pt.y() + d ) );
addPoint( QgsPoint( pt.x() - d, pt.y() - d ), false );
addPoint( QgsPoint( pt.x() + d, pt.y() - d ), false );
addPoint( QgsPoint( pt.x() + d, pt.y() + d ), false );
addPoint( QgsPoint( pt.x() - d, pt.y() + d ), false );
}
break;

@@ -204,17 +204,17 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
QgsPoint pt = mpt[i];
if ( layer )
{
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ) );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ) );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ) );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ) );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ), false );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ), false );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ), false );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ), false );
}
else
{
addPoint( QgsPoint( pt.x() - d, pt.y() - d ) );
addPoint( QgsPoint( pt.x() + d, pt.y() - d ) );
addPoint( QgsPoint( pt.x() + d, pt.y() + d ) );
addPoint( QgsPoint( pt.x() - d, pt.y() + d ) );
addPoint( QgsPoint( pt.x() - d, pt.y() - d ), false );
addPoint( QgsPoint( pt.x() + d, pt.y() - d ), false );
addPoint( QgsPoint( pt.x() + d, pt.y() + d ), false );
addPoint( QgsPoint( pt.x() - d, pt.y() + d ), false );
}
}
}
@@ -229,11 +229,11 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
{
if ( layer )
{
addPoint( mr->layerToMapCoordinates( layer, line[i] ) );
addPoint( mr->layerToMapCoordinates( layer, line[i] ), false );
}
else
{
addPoint( line[i] );
addPoint( line[i], false );
}
}
}
@@ -259,7 +259,7 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
}
else
{
addPoint( line[j] );
addPoint( line[j], false, i );
}
}
}
@@ -276,11 +276,11 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
{
if ( layer )
{
addPoint( mr->layerToMapCoordinates( layer, line[i] ) );
addPoint( mr->layerToMapCoordinates( layer, line[i] ), false );
}
else
{
addPoint( line[i] );
addPoint( line[i], false );
}
}
}
@@ -307,7 +307,7 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
}
else
{
addPoint( line[j] );
addPoint( line[j], false, i );
}
}
}

0 comments on commit 80a8b8b

Please sign in to comment.
You can’t perform that action at this time.