Skip to content

Commit

Permalink
Save some time in node tool for geometry export and avoid detachs
Browse files Browse the repository at this point in the history
  • Loading branch information
marco authored and alexbruy committed Dec 2, 2011
1 parent 3a58d8c commit cd6ca37
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/app/qgsmaptoolnodetool.cpp
Expand Up @@ -1164,11 +1164,12 @@ QgsFeature* SelectionFeature::feature()
void SelectionFeature::createVertexMapPolygon()
{
int y = 0;
if ( !mFeature->geometry()->asPolygon().empty() )
QgsPolygon polygon = mFeature->geometry()->asPolygon();
if ( !polygon.empty() )
{ //polygon
for ( int i2 = 0; i2 < mFeature->geometry()->asPolygon().size(); i2++ )
for ( int i2 = 0; i2 < polygon.size(); i2++ )
{
QgsPolyline poly = mFeature->geometry()->asPolygon()[i2];
const QgsPolyline& poly = polygon[i2];
int i;
for ( i = 0; i < poly.size(); i++ )
{
Expand All @@ -1191,12 +1192,13 @@ void SelectionFeature::createVertexMapPolygon()
}
else //multipolygon
{
for ( int i2 = 0; i2 < mFeature->geometry()->asMultiPolygon().size(); i2++ )
QgsMultiPolygon multiPolygon = mFeature->geometry()->asMultiPolygon();
for ( int i2 = 0; i2 < multiPolygon.size(); i2++ )
{ //iterating through polygons
QgsPolygon poly2 = mFeature->geometry()->asMultiPolygon()[i2];
const QgsPolygon& poly2 = multiPolygon[i2];
for ( int i3 = 0; i3 < poly2.size(); i3++ )
{ //iterating through polygon rings
QgsPolyline poly = poly2[i3];
const QgsPolyline& poly = poly2[i3];
int i;
for ( i = 0; i < poly.size(); i++ )
{
Expand Down

0 comments on commit cd6ca37

Please sign in to comment.