18 #ifndef QGSMAPCANVAS_H
19 #define QGSMAPCANVAS_H
21 #include "qgsconfig.h"
32 #include <QDomDocument>
33 #include <QGraphicsView>
40 #include <QGestureEvent>
80 : mLayer( layer ), mVisible( visible ), mInOverview( isInOverview ) {}
126 void updateOverview();
137 void setCrsTransformEnabled(
bool enabled );
149 void setCachingEnabled(
bool enabled );
153 bool isCachingEnabled()
const;
161 void refreshAllLayers();
165 void setParallelRenderingEnabled(
bool enabled );
169 bool isParallelRenderingEnabled()
const;
173 void setMapUpdateInterval(
int timeMiliseconds );
177 int mapUpdateInterval()
const;
198 Q_DECL_DEPRECATED
void clear();
201 double mapUnitsPerPixel()
const;
213 double rotation()
const;
217 void setRotation(
double degrees );
221 void setCenter(
const QgsPoint& center );
228 void zoomToFullExtent();
231 void zoomToPreviousExtent();
234 void zoomToNextExtent();
237 void clearExtentHistory();
261 virtual void setCanvasColor(
const QColor & _newVal );
263 virtual QColor canvasColor()
const;
266 void setSelectionColor(
const QColor& color );
273 Q_DECL_DEPRECATED
void updateFullExtent() {}
280 int layerCount()
const;
290 void freeze(
bool frz =
true );
297 Q_DECL_DEPRECATED
void setDirty(
bool _dirty );
301 Q_DECL_DEPRECATED
bool isDirty()
const;
327 void setWheelAction( WheelAction action,
double factor = 2 );
336 void zoomScale(
double scale );
340 void zoomByFactor(
double scaleFactor,
const QgsPoint *center = 0 );
343 void zoomWithCenter(
int x,
int y,
bool zoomIn );
346 void enableAntiAliasing(
bool theFlag );
353 Q_DECL_DEPRECATED
void useImageToRender(
bool theFlag );
358 void panActionEnd(
QPoint releasePoint );
370 void setPreviewModeEnabled(
bool previewEnabled );
377 bool previewModeEnabled()
const;
443 void selectionChangedSlot();
449 void layerStateChange();
452 void layerCrsChange();
455 void setRenderFlag(
bool theFlag );
460 bool hasCrsTransformEnabled();
463 Q_DECL_DEPRECATED
void updateMap();
467 void stopRendering();
470 Q_DECL_DEPRECATED
void showError(
QgsMapLayer * mapLayer );
483 static bool rotationEnabled();
487 static void enableRotation(
bool enabled );
491 void mapToolDestroyed();
494 void rendererJobFinished();
496 void mapUpdateTimeout();
502 Q_DECL_DEPRECATED
void setProgress(
int,
int );
507 void xyCoordinates(
const QgsPoint &p );
510 void scaleChanged(
double );
513 void extentsChanged();
517 void rotationChanged(
double );
534 void mapCanvasRefreshed();
538 void renderStarting();
541 void layersChanged();
562 void zoomLastStatusChanged(
bool );
565 void zoomNextStatusChanged(
bool );
569 void hasCrsTransformEnabledChanged(
bool flag );
573 void destinationCrsChanged();
577 void mapUnitsChanged();
585 void layerStyleOverridesChanged();
624 void moveCanvasContents(
bool reset =
false );
627 void updateCanvasItemPositions();
641 void updateDatumTransformEntries();
670 bool mRefreshScheduled;
689 int mLastExtentIndex;
692 double mWheelZoomFactor;
710 bool mUseParallelRendering;
713 bool mDrawRenderingStats;
virtual void mouseMoveEvent(QMouseEvent *event)
A rectangle specified with double values.
Base class for all map layer types.
void setInOverview(bool isInOverview)
virtual void keyReleaseEvent(QKeyEvent *event)
A widget that displays an overview map.
virtual void dragEnterEvent(QDragEnterEvent *event)
UnitType
Map units that qgis supports.
#define Q_NOWARN_DEPRECATED_PUSH
A class that stores visibility and presence in overview flags together with pointer to the layer...
virtual void mouseReleaseEvent(QMouseEvent *event)
A non GUI class for rendering a map layer set onto a QPainter.
bool antiAliasingEnabled() const
true if antialising is enabled
Map canvas is a class for displaying all GIS data types on a canvas.
void setVisible(bool visible)
A graphics effect which can be applied to a widget to simulate various printing and color blindness m...
bool renderFlag()
State of render suppression flag.
The QgsMapSettings class contains configuration for rendering of the map.
QgsMapRenderer * mRenderer
void scale(qreal sx, qreal sy)
Perform transforms between map coordinates and device coordinates.
A rectangular graphics item representing the map on the canvas.
const QgsExpressionContextScope & expressionContextScope() const
Returns a const reference to the expression context scope for the map canvas.
virtual bool event(QEvent *event)
Enable anti-aliasin for map rendering.
A class for highlight features on the map.
const QgsMapLayer * layer() const
virtual void keyPressEvent(QKeyEvent *event)
Single scope for storing variables and functions for use within a QgsExpressionContext.
void setExpressionContextScope(const QgsExpressionContextScope &scope)
Sets an expression context scope for the map canvas.
A class to represent a point.
virtual void connectNotify(const char *signal)
QScopedPointer< CanvasProperties > mCanvasProperties
Handle pattern for implementation object.
virtual void mousePressEvent(QMouseEvent *event)
virtual void paintEvent(QPaintEvent *event)
#define Q_NOWARN_DEPRECATED_POP
QgsExpressionContextScope & expressionContextScope()
Returns a reference to the expression context scope for the map canvas.
bool isInOverview() const
Intermediate base class adding functionality that allows client to query the rendered image...
Class for storing a coordinate reference system (CRS)
This class has all the configuration of snapping and can return answers to snapping queries...
QgsMapCanvasRendererSync(QgsMapCanvas *canvas, QgsMapRenderer *renderer)
QgsMapCanvasLayer(QgsMapLayer *layer, bool visible=true, bool isInOverview=false)
Class that stores computed placement from labeling engine.
This class is responsible for keeping cache of rendered images of individual layers.
virtual void mouseDoubleClickEvent(QMouseEvent *event)
Class that does synchronization between QgsMapCanvas and its associated QgsMapRenderer: ...
Represents a vector layer which manages a vector based data sets.
virtual void wheelEvent(QWheelEvent *event)
virtual void resizeEvent(QResizeEvent *event)