2008-05-15 08:13:05 +00:00
|
|
|
|
|
|
|
class QgsRenderContext
|
|
|
|
{
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsrendercontext.h>
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
public:
|
|
|
|
QgsRenderContext();
|
|
|
|
~QgsRenderContext();
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2013-12-05 18:27:45 +07:00
|
|
|
//! create initialized QgsRenderContext instance from given QgsMapSettings
|
2014-02-21 17:33:09 +07:00
|
|
|
//! @note added in 2.4
|
2013-12-05 18:27:45 +07:00
|
|
|
static QgsRenderContext fromMapSettings( const QgsMapSettings& mapSettings );
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
//getters
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QPainter* painter();
|
|
|
|
const QPainter* constPainter() const;
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
const QgsCoordinateTransform* coordinateTransform() const;
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
const QgsRectangle& extent() const;
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
const QgsMapToPixel& mapToPixel() const;
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
double scaleFactor() const;
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
double rasterScaleFactor() const;
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
bool renderingStopped() const;
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
bool forceVectorOutput() const;
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns true if advanced effects such as blend modes such be used */
|
2014-01-26 18:35:21 +01:00
|
|
|
bool useAdvancedEffects() const;
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Used to enable or disable advanced effects such as blend modes */
|
2014-01-26 18:35:21 +01:00
|
|
|
void setUseAdvancedEffects( bool enabled );
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
bool drawEditingInformation() const;
|
2008-11-17 16:04:30 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
double rendererScale() const;
|
2009-11-18 18:46:12 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QgsLabelingEngineInterface* labelingEngine();
|
2008-05-15 08:13:05 +00:00
|
|
|
|
2013-04-12 00:35:21 +02:00
|
|
|
QColor selectionColor() const;
|
2014-06-02 21:00:51 +02:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns true if vector selections should be shown in the rendered map
|
2014-06-02 16:37:06 +10:00
|
|
|
* @returns true if selections should be shown
|
|
|
|
* @see setShowSelection
|
|
|
|
* @see selectionColor
|
|
|
|
* @note Added in QGIS v2.4
|
|
|
|
*/
|
|
|
|
bool showSelection() const;
|
2013-04-12 00:35:21 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
//setters
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Sets coordinate transformation. QgsRenderContext does not take ownership*/
|
2012-12-17 08:55:31 +01:00
|
|
|
void setCoordinateTransform( const QgsCoordinateTransform* t );
|
2012-09-24 02:28:15 +02:00
|
|
|
void setMapToPixel( const QgsMapToPixel& mtp );
|
|
|
|
void setExtent( const QgsRectangle& extent );
|
|
|
|
void setDrawEditingInformation( bool b );
|
|
|
|
void setRenderingStopped( bool stopped );
|
|
|
|
void setScaleFactor( double factor );
|
|
|
|
void setRasterScaleFactor( double factor );
|
|
|
|
void setRendererScale( double scale );
|
|
|
|
void setPainter( QPainter* p );
|
|
|
|
void setForceVectorOutput( bool force );
|
2014-05-27 23:22:50 +02:00
|
|
|
void setLabelingEngine( QgsLabelingEngineInterface* iface );
|
2013-04-12 00:35:21 +02:00
|
|
|
void setSelectionColor( const QColor& color );
|
2014-06-02 21:00:51 +02:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Sets whether vector selections should be shown in the rendered map
|
2014-06-02 16:37:06 +10:00
|
|
|
* @param showSelection set to true if selections should be shown
|
|
|
|
* @see showSelection
|
|
|
|
* @see setSelectionColor
|
|
|
|
* @note Added in QGIS v2.4
|
|
|
|
*/
|
|
|
|
void setShowSelection( const bool showSelection );
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns true if the rendering optimization (geometry simplification) can be executed*/
|
2014-01-26 18:35:21 +01:00
|
|
|
bool useRenderingOptimization() const;
|
|
|
|
void setUseRenderingOptimization( bool enabled );
|
2014-05-26 17:30:41 +02:00
|
|
|
|
|
|
|
//! Added in QGIS v2.4
|
|
|
|
const QgsVectorSimplifyMethod& vectorSimplifyMethod() const;
|
|
|
|
void setVectorSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod );
|
2008-05-15 08:13:05 +00:00
|
|
|
};
|