18 #ifndef QGSMAPCANVAS_H 19 #define QGSMAPCANVAS_H 21 #include "qgsconfig.h" 30 #include <QDomDocument> 31 #include <QGraphicsView> 38 #include <QGestureEvent> 78 : 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 timeMilliseconds );
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();
265 virtual void setCanvasColor(
const QColor & _newVal );
267 virtual QColor canvasColor()
const;
270 void setSelectionColor(
const QColor& color );
277 Q_DECL_DEPRECATED
void updateFullExtent() {}
284 int layerCount()
const;
297 void freeze(
bool frz =
true );
308 Q_DECL_DEPRECATED
void setDirty(
bool _dirty );
312 Q_DECL_DEPRECATED
bool isDirty()
const;
338 void setWheelAction(
WheelAction action,
double factor = 2 );
347 void zoomScale(
double scale );
351 void zoomByFactor(
double scaleFactor,
const QgsPoint *center =
nullptr );
354 void zoomWithCenter(
int x,
int y,
bool zoomIn );
357 void enableAntiAliasing(
bool theFlag );
363 void enableMapTileRendering(
bool theFlag );
367 Q_DECL_DEPRECATED
void useImageToRender(
bool theFlag );
372 void panActionEnd(
QPoint releasePoint );
384 void setPreviewModeEnabled(
bool previewEnabled );
391 bool previewModeEnabled()
const;
458 void selectionChangedSlot();
464 void layerStateChange();
467 void layerCrsChange();
470 void setRenderFlag(
bool theFlag );
475 bool hasCrsTransformEnabled();
478 Q_DECL_DEPRECATED
void updateMap();
482 void stopRendering();
485 Q_DECL_DEPRECATED
void showError(
QgsMapLayer * mapLayer );
498 static bool rotationEnabled();
502 static void enableRotation(
bool enabled );
506 void mapToolDestroyed();
509 void rendererJobFinished();
511 void mapUpdateTimeout();
517 Q_DECL_DEPRECATED
void setProgress(
int,
int );
522 void xyCoordinates(
const QgsPoint &p );
525 void scaleChanged(
double );
528 void extentsChanged();
532 void rotationChanged(
double );
548 void mapCanvasRefreshed();
552 void renderStarting();
555 void layersChanged();
576 void zoomLastStatusChanged(
bool );
579 void zoomNextStatusChanged(
bool );
583 void hasCrsTransformEnabledChanged(
bool flag );
587 void destinationCrsChanged();
591 void mapUnitsChanged();
599 void layerStyleOverridesChanged();
641 void moveCanvasContents(
bool reset =
false );
648 void updateCanvasItemPositions();
662 void updateDatumTransformEntries();
691 bool mRefreshScheduled;
710 int mLastExtentIndex;
713 double mWheelZoomFactor;
731 bool mUseParallelRendering;
734 bool mDrawRenderingStats;
773 void onMapUnitsC2R();
774 void onMapUnitsR2C();
777 void onMapRotationC2R();
779 void onMapRotationR2C();
781 void onCrsTransformC2R();
782 void onCrsTransformR2C();
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)
#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.
Deprecated to be deleted, stuff from here should be moved elsewhere.
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...
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)