Skip to content
Permalink
Browse files

Add missing docs, SIP bindings, some const correctness

  • Loading branch information
nyalldawson committed May 29, 2016
1 parent 36ff0ba commit 421ab4fee73536ac2c534ac5974452b0004d2ff3
Showing with 74 additions and 16 deletions.
  1. +23 −3 python/core/qgsmaprenderer.sip
  2. +20 −6 python/gui/qgsmapcanvas.sip
  3. +2 −2 src/core/qgsmaprenderer.cpp
  4. +23 −3 src/core/qgsmaprenderer.h
  5. +6 −2 src/gui/qgsmapcanvas.h
@@ -184,14 +184,34 @@ class QgsMapRenderer : QObject
//! sets whether map image will be for overview
void enableOverviewMode( bool isOverview = true );

/** Sets the desired size of the rendered map image.
* @param size size in pixels
* @param dpi resolution to render map using
* @see outputSize()
*/
void setOutputSize( QSize size, double dpi );

/** Sets the desired size of the rendered map image.
* @param size size in pixels
* @param dpi resolution to render map using
* @see outputSizeF()
*/
void setOutputSize( QSizeF size, double dpi );

//!accessor for output dpi
double outputDpi();
//!accessor for output size
QSize outputSize();
QSizeF outputSizeF();

/** Returns the size which the map will be rendered at.
* @see setOutputSize()
* @see outputSizeF()
*/
QSize outputSize() const;

/** Returns the size which the map will be rendered at.
* @see setOutputSize()
* @see outputSize()
*/
QSizeF outputSizeF() const;

/**
* @brief transform bounding box from layer's CRS to output CRS
@@ -50,12 +50,6 @@ class QgsMapCanvas : QGraphicsView
//! Destructor
~QgsMapCanvas();

//! Sets the factor of magnification to apply to the map canvas. Indeed, we
//! increase/decrease the DPI of the map settings according to this factor
//! in order to render marker point, labels, ... bigger.
//! @note added in 2.16
void setMagnificationFactor( double level );

//! Returns the magnification factor
//! @note added in 2.16
double magnificationFactor() const;
@@ -301,6 +295,11 @@ class QgsMapCanvas : QGraphicsView
//! Zooms in/out with a given center
void zoomWithCenter( int x, int y, bool zoomIn );

//! Returns whether the scale is locked, so zooming can be performed using magnication.
//! @note added in 2.16
//! @see setScaleLocked()
bool scaleLocked() const;

//! used to determine if anti-aliasing is enabled or not
void enableAntiAliasing( bool theFlag );

@@ -456,6 +455,17 @@ class QgsMapCanvas : QGraphicsView
//! @note added in 2.8
static void enableRotation( bool enabled );

//! Sets the factor of magnification to apply to the map canvas. Indeed, we
//! increase/decrease the DPI of the map settings according to this factor
//! in order to render marker point, labels, ... bigger.
//! @note added in 2.16
void setMagnificationFactor( double factor );

//! Lock the scale, so zooming can be performed using magnication
//! @note added in 2.16
//! @see scaleLocked()
void setScaleLocked( bool isLocked );

signals:
/** Let the owner know how far we are with render operations */
//! @deprecated since 2.4 - already unused in 2.0 anyway
@@ -475,6 +485,10 @@ class QgsMapCanvas : QGraphicsView
//! @note added in 2.8
void rotationChanged( double );

//! Emitted when the scale of the map changes
//! @note added in 2.16
void magnificationChanged( double );

/** Emitted when the canvas has rendered.
* Passes a pointer to the painter on which the map was drawn. This is
* useful for plugins that wish to draw on the map after it has been
@@ -157,12 +157,12 @@ double QgsMapRenderer::outputDpi()
return mScaleCalculator->dpi();
}

QSize QgsMapRenderer::outputSize()
QSize QgsMapRenderer::outputSize() const
{
return mSize.toSize();
}

QSizeF QgsMapRenderer::outputSizeF()
QSizeF QgsMapRenderer::outputSizeF() const
{
return mSize;
}
@@ -247,14 +247,34 @@ class CORE_EXPORT QgsMapRenderer : public QObject
//! sets whether map image will be for overview
void enableOverviewMode( bool isOverview = true ) { mOverview = isOverview; }

/** Sets the desired size of the rendered map image.
* @param size size in pixels
* @param dpi resolution to render map using
* @see outputSize()
*/
void setOutputSize( QSize size, double dpi );

/** Sets the desired size of the rendered map image.
* @param size size in pixels
* @param dpi resolution to render map using
* @see outputSizeF()
*/
void setOutputSize( QSizeF size, double dpi );

//!accessor for output dpi
double outputDpi();
//!accessor for output size
QSize outputSize();
QSizeF outputSizeF();

/** Returns the size which the map will be rendered at.
* @see setOutputSize()
* @see outputSizeF()
*/
QSize outputSize() const;

/** Returns the size which the map will be rendered at.
* @see setOutputSize()
* @see outputSize()
*/
QSizeF outputSizeF() const;

/**
* @brief transform bounding box from layer's CRS to output CRS
@@ -365,7 +365,10 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! Zooms in/out with a given center
void zoomWithCenter( int x, int y, bool zoomIn );

bool scaleLocked() { return mScaleLocked;}
//! Returns whether the scale is locked, so zooming can be performed using magnication.
//! @note added in 2.16
//! @see setScaleLocked()
bool scaleLocked() const { return mScaleLocked;}

//! used to determine if anti-aliasing is enabled or not
void enableAntiAliasing( bool theFlag );
@@ -528,8 +531,9 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! @note added in 2.16
void setMagnificationFactor( double factor );

//! lock the scale, so zooming can be performed using magnication
//! Lock the scale, so zooming can be performed using magnication
//! @note added in 2.16
//! @see scaleLocked()
void setScaleLocked( bool isLocked );

private slots:

0 comments on commit 421ab4f

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