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 )
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 )
289 for (
int i = 0; i < mpt.size(); ++i, ++idx )
310 for (
int i = 0; i < line.count(); i++ )
329 for (
int i = 0; i < mline.size(); ++i, ++idx )
333 if ( line.size() == 0 )
338 for (
int j = 0; j < line.size(); ++j )
358 for (
int i = 0; i < line.count(); i++ )
377 for (
int i = 0; i < multipoly.size(); ++i, ++idx )
381 for (
int j = 0; j < line.count(); ++j )
433 Q_FOREACH(
const QList<QgsPoint>& line,
mPoints )
435 QVector<QPointF> pts;
436 Q_FOREACH(
const QgsPoint& pt, line )
439 if ( pts.empty() || std::abs( pts.back().x() - cur.x() ) > 1 || std::abs( pts.back().y() - cur.y() ) > 1 )
447 p->drawPolygon( pts );
453 Q_FOREACH(
const QPointF& pt, pts )
466 p->drawLine( QLineF( x - s, y, x + s, y ) );
467 p->drawLine( QLineF( x, y - s, x, 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 ) );
476 p->drawLine( QLineF( x - s, y - s, x + s, y - s ) );
477 p->drawLine( QLineF( x + s, y - s, x + s, y + s ) );
478 p->drawLine( QLineF( x + s, y + s, x - s, y + s ) );
479 p->drawLine( QLineF( x - s, y + s, x - s, y - s ) );
497 p->drawPolyline( pts );
510 QList<QgsPoint>::const_iterator it =
mPoints.at( 0 ).constBegin();
511 if ( it ==
mPoints.at( 0 ).constEnd() )
518 qreal p =
mPen.width() * scale;
523 for (
int i = 0; i <
mPoints.size(); ++i )
525 QList<QgsPoint>::const_iterator it =
mPoints.at( i ).constBegin();
526 for ( ; it !=
mPoints.at( i ).constEnd(); ++it )
539 setVisible(
mPoints.size() > 0 );
556 if ( geometryIndex < 0 || geometryIndex >=
mPoints.size() )
return 0;
557 return mPoints[geometryIndex].size();
563 QList<QList<QgsPoint> >::const_iterator it =
mPoints.constBegin();
564 for ( ; it !=
mPoints.constEnd(); ++it )
566 QList<QgsPoint>::const_iterator iter = it->constBegin();
567 for ( ; iter != it->constEnd(); ++iter )
592 QList< QList<QgsPoint> >::const_iterator it =
mPoints.constBegin();
593 for ( ; it !=
mPoints.constEnd(); ++it )
605 QList< QList<QgsPoint> >::const_iterator it =
mPoints.constBegin();
606 for ( ; it !=
mPoints.constEnd(); ++it )
622 QList< QList<QgsPoint> >::const_iterator it =
mPoints.constBegin();
623 for ( ; it !=
mPoints.constEnd(); ++it )
643 QList<QgsPoint>::const_iterator iter = points.constBegin();
644 for ( ; iter != points.constEnd(); ++iter )
646 polyline.append( *iter );