Skip to content
Permalink
Browse files

QgsRubberBand: remove constructor and method with bool isPolygon

use methods with Qgis::GeometryType instead
  • Loading branch information
3nids committed Aug 2, 2016
1 parent 9db9304 commit b7f4fe36e7d0f987802dbc2d5c14e7d2645234fa
Showing with 3 additions and 54 deletions.
  1. +1 −0 doc/api_break.dox
  2. +1 −15 python/gui/qgsrubberband.sip
  3. +0 −24 src/gui/qgsrubberband.cpp
  4. +1 −15 src/gui/qgsrubberband.h
@@ -441,6 +441,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
@@ -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();

/**
@@ -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.
@@ -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 )
@@ -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.
*/
@@ -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();

/**
@@ -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.

0 comments on commit b7f4fe3

Please sign in to comment.
You can’t perform that action at this time.