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 committed Nov 14, 2011
1 parent 1fa8386 commit f0839fb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/app/qgsmaptoolnodetool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,11 +1178,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 @@ -1205,12 +1206,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 f0839fb

Please sign in to comment.