Skip to content

Commit

Permalink
Merge pull request #3352 from 3nids/rubberband_ispolygon
Browse files Browse the repository at this point in the history
QgsRubberBand: remove constructor and method with bool isPolygon
  • Loading branch information
3nids committed Aug 2, 2016
2 parents 2482a6b + b7f4fe3 commit f5b11d9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 54 deletions.
1 change: 1 addition & 0 deletions doc/api_break.dox
Expand Up @@ -446,6 +446,7 @@ be returned instead of a null pointer if no transformation is required.</li>

<ul>
<li>setToGeometry() and addGeometry() now take geometry references, not pointers.</li>
<li>QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon ) constructor and reset( bool isPolygon) have been removed, use constructor and function with Qgis::GeometryType as argument instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsPalLayerSettings QgsPalLayerSettings
Expand Down
16 changes: 1 addition & 15 deletions python/gui/qgsrubberband.sip
Expand Up @@ -41,13 +41,7 @@ class QgsRubberBand: QgsMapCanvasItem
* @param geometryType Defines how the data should be drawn onto the screen. (Use Qgis::Line, Qgis::Polygon or Qgis::Point)
*/
QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, Qgis::GeometryType geometryType = Qgis::Line );
/**
* Creates a new RubberBand.
* @deprecated Use the constructor which takes Qgis::GeometryType as second argument instead
* @param mapCanvas The map canvas to draw onto. It's CRS will be used map points onto screen coordinates.
* @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring
*/
QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, bool isPolygon ) /Deprecated/;

~QgsRubberBand();

/**
Expand Down Expand Up @@ -104,14 +98,6 @@ class QgsRubberBand: QgsMapCanvasItem
*/
void reset( Qgis::GeometryType geometryType = Qgis::Line );

/**
* @deprecated Use the reset method which takes Qgis::GeometryType as second argument instead
* Clears all the geometries in this rubberband.
* Sets the representation type according to isPolygon.
* @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring
*/
void reset( bool isPolygon ) /Deprecated/;

/**
* Add a vertex to the rubberband and update canvas.
* The rendering of the vertex depends on the current GeometryType and icon.
Expand Down
24 changes: 0 additions & 24 deletions src/gui/qgsrubberband.cpp
Expand Up @@ -43,22 +43,6 @@ QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, Qgis::GeometryType geomet
setBrushStyle( Qt::SolidPattern );
}

QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon )
: QgsMapCanvasItem( mapCanvas )
, mIconSize( 5 )
, mIconType( ICON_CIRCLE )
, mTranslationOffsetX( 0.0 )
, mTranslationOffsetY( 0.0 )
{
reset( isPolygon ? Qgis::Polygon : Qgis::Line );
QColor color( Qt::lightGray );
color.setAlpha( 63 );
setColor( color );
setWidth( 1 );
setLineStyle( Qt::SolidLine );
setBrushStyle( Qt::SolidPattern );
}

QgsRubberBand::QgsRubberBand()
: QgsMapCanvasItem( nullptr )
, mIconSize( 5 )
Expand Down Expand Up @@ -140,14 +124,6 @@ void QgsRubberBand::reset( Qgis::GeometryType geometryType )
update();
}

void QgsRubberBand::reset( bool isPolygon )
{
mPoints.clear();
mGeometryType = isPolygon ? Qgis::Polygon : Qgis::Line;
updateRect();
update();
}

/*!
Add a point to the shape being created.
*/
Expand Down
16 changes: 1 addition & 15 deletions src/gui/qgsrubberband.h
Expand Up @@ -68,13 +68,7 @@ class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem
* @param geometryType Defines how the data should be drawn onto the screen. (Use Qgis::Line, Qgis::Polygon or Qgis::Point)
*/
QgsRubberBand( QgsMapCanvas* mapCanvas, Qgis::GeometryType geometryType = Qgis::Line );
/**
* Creates a new RubberBand.
* @deprecated Use the constructor which takes Qgis::GeometryType as second argument instead
* @param mapCanvas The map canvas to draw onto. It's CRS will be used map points onto screen coordinates.
* @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring
*/
Q_DECL_DEPRECATED QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon );

~QgsRubberBand();

/**
Expand Down Expand Up @@ -131,14 +125,6 @@ class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem
*/
void reset( Qgis::GeometryType geometryType = Qgis::Line );

/**
* @deprecated Use the reset method which takes Qgis::GeometryType as second argument instead
* Clears all the geometries in this rubberband.
* Sets the representation type according to isPolygon.
* @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring
*/
Q_DECL_DEPRECATED void reset( bool isPolygon );

/**
* Add a vertex to the rubberband and update canvas.
* The rendering of the vertex depends on the current GeometryType and icon.
Expand Down

0 comments on commit f5b11d9

Please sign in to comment.