18 #ifndef QGSMAPCANVAS_H
19 #define QGSMAPCANVAS_H
21 #include "qgsconfig.h"
31 #include <QDomDocument>
32 #include <QGraphicsView>
39 #include <QGestureEvent>
79 : mLayer( layer ), mVisible( visible ), mInOverview( isInOverview ) {}
124 void updateOverview();
135 void setCrsTransformEnabled(
bool enabled );
147 void setCachingEnabled(
bool enabled );
151 bool isCachingEnabled()
const;
159 void refreshAllLayers();
163 void setParallelRenderingEnabled(
bool enabled );
167 bool isParallelRenderingEnabled()
const;
171 void setMapUpdateInterval(
int timeMiliseconds );
175 int mapUpdateInterval()
const;
196 Q_DECL_DEPRECATED
void clear();
199 double mapUnitsPerPixel()
const;
211 double rotation()
const;
215 void setRotation(
double degrees );
219 void setCenter(
const QgsPoint& center );
226 void zoomToFullExtent();
229 void zoomToPreviousExtent();
232 void zoomToNextExtent();
235 void clearExtentHistory();
259 virtual void setCanvasColor(
const QColor & _newVal );
261 virtual QColor canvasColor()
const;
264 void setSelectionColor(
const QColor& color );
271 Q_DECL_DEPRECATED
void updateFullExtent() {}
278 int layerCount()
const;
288 void freeze(
bool frz =
true );
295 Q_DECL_DEPRECATED
void setDirty(
bool _dirty );
299 Q_DECL_DEPRECATED
bool isDirty()
const;
317 void setWheelAction( WheelAction action,
double factor = 2 );
326 void zoomScale(
double scale );
330 void zoomByFactor(
double scaleFactor,
const QgsPoint *center = 0 );
333 void zoomWithCenter(
int x,
int y,
bool zoomIn );
336 void enableAntiAliasing(
bool theFlag );
343 Q_DECL_DEPRECATED
void useImageToRender(
bool theFlag );
348 void panActionEnd(
QPoint releasePoint );
360 void setPreviewModeEnabled(
bool previewEnabled );
367 bool previewModeEnabled()
const;
409 void selectionChangedSlot();
415 void layerStateChange();
418 void layerCrsChange();
421 void setRenderFlag(
bool theFlag );
426 bool hasCrsTransformEnabled();
429 Q_DECL_DEPRECATED
void updateMap();
433 void stopRendering();
436 Q_DECL_DEPRECATED
void showError(
QgsMapLayer * mapLayer );
449 static bool rotationEnabled();
453 static void enableRotation(
bool enabled );
457 void mapToolDestroyed();
460 void rendererJobFinished();
462 void mapUpdateTimeout();
468 Q_DECL_DEPRECATED
void setProgress(
int,
int );
473 void xyCoordinates(
const QgsPoint &p );
476 void scaleChanged(
double );
479 void extentsChanged();
483 void rotationChanged(
double );
500 void mapCanvasRefreshed();
504 void renderStarting();
507 void layersChanged();
528 void zoomLastStatusChanged(
bool );
531 void zoomNextStatusChanged(
bool );
535 void hasCrsTransformEnabledChanged(
bool flag );
539 void destinationCrsChanged();
543 void mapUnitsChanged();
586 void moveCanvasContents(
bool reset =
false );
589 void updateCanvasItemPositions();
603 void updateDatumTransformEntries();
632 bool mRefreshScheduled;
651 int mLastExtentIndex;
654 double mWheelZoomFactor;
672 bool mUseParallelRendering;
675 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)
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.
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)
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)
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)
UnitType
Map units that qgis supports.
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)