18 #ifndef QGSMAPCANVAS_H 19 #define QGSMAPCANVAS_H 21 #include "qgsconfig.h" 30 #include <QDomDocument> 31 #include <QGraphicsView> 38 #include <QGestureEvent> 81 , mInOverview( isInOverview )
126 double magnificationFactor()
const;
133 void updateOverview();
144 void setCrsTransformEnabled(
bool enabled );
156 void setCachingEnabled(
bool enabled );
160 bool isCachingEnabled()
const;
168 void refreshAllLayers();
172 void setParallelRenderingEnabled(
bool enabled );
176 bool isParallelRenderingEnabled()
const;
180 void setMapUpdateInterval(
int timeMilliseconds );
184 int mapUpdateInterval()
const;
205 Q_DECL_DEPRECATED
void clear();
208 double mapUnitsPerPixel()
const;
216 void setExtent(
const QgsRectangle &r,
bool magnified =
false );
220 double rotation()
const;
224 void setRotation(
double degrees );
228 void setCenter(
const QgsPoint& center );
235 void zoomToFullExtent();
238 void zoomToPreviousExtent();
241 void zoomToNextExtent();
244 void clearExtentHistory();
274 virtual void setCanvasColor(
const QColor & _newVal );
276 virtual QColor canvasColor()
const;
279 void setSelectionColor(
const QColor& color );
286 Q_DECL_DEPRECATED
void updateFullExtent() {}
293 int layerCount()
const;
306 void freeze(
bool frz =
true );
317 Q_DECL_DEPRECATED
void setDirty(
bool _dirty );
321 Q_DECL_DEPRECATED
bool isDirty()
const;
348 Q_DECL_DEPRECATED
void setWheelAction(
WheelAction action,
double factor = 2 );
351 void setWheelFactor(
double factor );
354 void zoomScale(
double scale );
358 void zoomByFactor(
double scaleFactor,
const QgsPoint *center =
nullptr );
361 void zoomWithCenter(
int x,
int y,
bool zoomIn );
369 void enableAntiAliasing(
bool theFlag );
375 void enableMapTileRendering(
bool theFlag );
379 Q_DECL_DEPRECATED
void useImageToRender(
bool theFlag );
384 void panActionEnd(
QPoint releasePoint );
396 void setPreviewModeEnabled(
bool previewEnabled );
403 bool previewModeEnabled()
const;
466 void setSegmentationTolerance(
double tolerance );
477 void selectionChangedSlot();
483 void layerStateChange();
486 void layerCrsChange();
489 void setRenderFlag(
bool theFlag );
494 bool hasCrsTransformEnabled();
497 Q_DECL_DEPRECATED
void updateMap();
501 void stopRendering();
504 Q_DECL_DEPRECATED
void showError(
QgsMapLayer * mapLayer );
517 static bool rotationEnabled();
521 static void enableRotation(
bool enabled );
527 void setMagnificationFactor(
double factor );
532 void setScaleLocked(
bool isLocked );
542 void mapToolDestroyed();
545 void rendererJobFinished();
547 void mapUpdateTimeout();
553 Q_DECL_DEPRECATED
void setProgress(
int,
int );
558 void xyCoordinates(
const QgsPoint &p );
561 void scaleChanged(
double );
564 void extentsChanged();
568 void rotationChanged(
double );
572 void magnificationChanged(
double );
588 void mapCanvasRefreshed();
592 void renderStarting();
595 void layersChanged();
616 void zoomLastStatusChanged(
bool );
619 void zoomNextStatusChanged(
bool );
623 void hasCrsTransformEnabledChanged(
bool flag );
627 void destinationCrsChanged();
631 void mapUnitsChanged();
639 void layerStyleOverridesChanged();
681 void moveCanvasContents(
bool reset =
false );
688 void updateCanvasItemPositions();
702 void updateDatumTransformEntries();
731 bool mRefreshScheduled;
750 int mLastExtentIndex;
753 double mWheelZoomFactor;
768 bool mUseParallelRendering;
771 bool mDrawRenderingStats;
802 void updateMapSize();
808 void beginZoomRect(
QPoint pos );
814 void endZoomRect(
QPoint pos );
816 friend class TestQgsMapCanvas;
843 void onMapUnitsC2R();
844 void onMapUnitsR2C();
847 void onMapRotationC2R();
849 void onMapRotationR2C();
851 void onCrsTransformC2R();
852 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)
SegmentationToleranceType
Segmentation tolerance as maximum angle or maximum difference between approximation and circle...
#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.
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.
virtual bool event(QEvent *event)
A class for drawing transient features (e.g.
Enable anti-aliasing for map rendering.
A class for highlight features on the map.
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
bool isInOverview() const
QgsExpressionContextScope & expressionContextScope()
Returns a reference to the expression context scope for the map canvas.
bool antiAliasingEnabled() const
true if antialising is enabled
bool scaleLocked() const
Returns whether the scale is locked, so zooming can be performed using magnication.
const QgsExpressionContextScope & expressionContextScope() const
Returns a const reference to the expression context scope for the map canvas.
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)
const QgsMapLayer * layer() const
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)