33 , mIconType( ICON_CIRCLE )
34 , mGeometryType( geometryType )
35 , mTranslationOffsetX( 0.0 )
36 , mTranslationOffsetY( 0.0 )
38 reset( geometryType );
39 QColor color( Qt::lightGray );
50 , mIconType( ICON_CIRCLE )
51 , mTranslationOffsetX( 0.0 )
52 , mTranslationOffsetY( 0.0 )
55 QColor color( Qt::lightGray );
76 mPen.setColor( color );
77 QColor fillColor( color.red(), color.green(), color.blue(), color.alpha() );
78 mBrush.setColor( fillColor );
86 mPen.setWidth( width );
101 mPen.setStyle( penStyle );
106 mBrush.setStyle( brushStyle );
133 if ( geometryIndex < 0 )
135 geometryIndex =
mPoints.size() - 1;
138 if ( geometryIndex < 0 || geometryIndex >
mPoints.size() )
143 if ( geometryIndex ==
mPoints.size() )
145 mPoints.push_back( QList<QgsPoint>() << p );
151 mPoints[geometryIndex].last() = p;
170 if (
mPoints.size() < geometryIndex + 1 )
181 index =
mPoints[geometryIndex].size() + index;
183 mPoints[geometryIndex].removeAt( index );
203 if (
mPoints.size() < geometryIndex + 1 )
208 if (
mPoints.at( geometryIndex ).size() < 1 )
213 mPoints[geometryIndex].last() = p;
221 if (
mPoints.size() < geometryIndex + 1 )
226 if (
mPoints.at( geometryIndex ).size() < index )
231 mPoints[geometryIndex][index] = p;
283 for (
int i = 0; i < mpt.size(); ++i, ++idx )
304 for (
int i = 0; i < line.count(); i++ )
323 for (
int i = 0; i < mline.size(); ++i, ++idx )
327 if ( line.size() == 0 )
332 for (
int j = 0; j < line.size(); ++j )
352 for (
int i = 0; i < line.count(); i++ )
371 for (
int i = 0; i < multipoly.size(); ++i, ++idx )
375 for (
int j = 0; j < line.count(); ++j )
427 Q_FOREACH(
const QList<QgsPoint>& line,
mPoints )
429 QVector<QPointF> pts;
430 Q_FOREACH(
const QgsPoint& pt, line )
433 if ( pts.empty() || std::abs( pts.back().x() - cur.x() ) > 1 || std::abs( pts.back().y() - cur.y() ) > 1 )
441 p->drawPolygon( pts );
447 Q_FOREACH(
const QPointF& pt, pts )
460 p->drawLine( QLineF( x - s, y, x + s, y ) );
461 p->drawLine( QLineF( x, y - s, x, y + s ) );
465 p->drawLine( QLineF( x - s, y - s, x + s, y + s ) );
466 p->drawLine( QLineF( x - s, y + s, x + s, y - s ) );
470 p->drawLine( QLineF( x - s, y - s, x + s, y - s ) );
471 p->drawLine( QLineF( x + s, y - s, x + s, y + s ) );
472 p->drawLine( QLineF( x + s, y + s, x - s, y + s ) );
473 p->drawLine( QLineF( x - s, y + s, x - s, y - s ) );
487 p->drawPolyline( pts );
500 QList<QgsPoint>::const_iterator it =
mPoints.at( 0 ).constBegin();
501 if ( it ==
mPoints.at( 0 ).constEnd() )
508 qreal p =
mPen.width() * scale;
513 for (
int i = 0; i <
mPoints.size(); ++i )
515 QList<QgsPoint>::const_iterator it =
mPoints.at( i ).constBegin();
516 for ( ; it !=
mPoints.at( i ).constEnd(); ++it )
529 setVisible(
mPoints.size() > 0 );
546 if ( geometryIndex < 0 || geometryIndex >=
mPoints.size() )
return 0;
547 return mPoints[geometryIndex].size();
553 QList<QList<QgsPoint> >::const_iterator it =
mPoints.constBegin();
554 for ( ; it !=
mPoints.constEnd(); ++it )
556 QList<QgsPoint>::const_iterator iter = it->constBegin();
557 for ( ; iter != it->constEnd(); ++iter )
582 QList< QList<QgsPoint> >::const_iterator it =
mPoints.constBegin();
583 for ( ; it !=
mPoints.constEnd(); ++it )
595 QList< QList<QgsPoint> >::const_iterator it =
mPoints.constBegin();
596 for ( ; it !=
mPoints.constEnd(); ++it )
612 QList< QList<QgsPoint> >::const_iterator it =
mPoints.constBegin();
613 for ( ; it !=
mPoints.constEnd(); ++it )
633 QList<QgsPoint>::const_iterator iter = points.constBegin();
634 for ( ; iter != points.constEnd(); ++iter )
636 polyline.append( *iter );