29 , mMessageBar( messageBar )
30 , mLastMessage( nullptr )
31 , mActionEnableTracing( nullptr )
33 tracers().insert( mCanvas,
this );
39 connect( canvas, SIGNAL( currentLayerChanged(
QgsMapLayer* ) ),
this, SLOT( onCurrentLayerChanged() ) );
49 tracers().remove( mCanvas );
54 return tracers().value( canvas );
59 Q_UNUSED( addingVertex );
66 mLastMessage =
nullptr;
72 message =
tr(
"Disabled - there are too many features displayed. Try zooming in or disable some layers." );
81 message =
tr(
"Tracing may not work correctly. Please check topology of the input layers." );
88 QSettings().value(
"/qgis/messageTimeout", 5 ).toInt() );
89 mMessageBar->
pushItem( mLastMessage );
107 if ( vl && visibleLayerIds.
contains( vl->
id() ) )
112 Q_FOREACH (
const QString& layerId, visibleLayerIds )
131 void QgsMapCanvasTracer::onCurrentLayerChanged()
virtual void configure()
Sets configuration from current snapping settings and canvas settings.
SnapToMapMode snapToMapMode() const
Find out how the snapping to map is done.
Base class for all map layer types.
snap to all rendered layers (tolerance and type from defaultSettings())
QList< LayerConfig > layers() const
Query layers used for snapping.
QgsMapLayer * mapLayer(const QString &theLayerId) const
Retrieve a pointer to a registered layer by layer ID.
void setExtent(const QgsRectangle &extent)
Set extent to which graph's features will be limited (empty extent means no limit) ...
bool contains(const QString &str, Qt::CaseSensitivity cs) const
bool hasCrsTransformEnabled() const
returns true if projections are enabled for this layer set
A bar for displaying non-blocking messages to the user.
QList< QgsVectorLayer * > layers() const
Get layers used for tracing.
QString tr(const char *sourceText, const char *disambiguation, int n)
Map canvas is a class for displaying all GIS data types on a canvas.
bool hasTopologyProblem() const
Whether there was an error during graph creation due to noding exception, indicating some input data ...
Extension of QgsTracer that provides extra functionality:
QString id() const
Get this layer's unique ID, this ID is used to access this layer from map layer registry.
static QgsMapCanvasTracer * tracerForCanvas(QgsMapCanvas *canvas)
Retrieve instance of this class associated with given canvas (if any).
bool popWidget(QgsMessageBarItem *item)
Remove the passed widget from the bar (if previously added), then display the next one in the stack i...
Max feature count threshold was reached while reading features.
QgsRectangle extent() const
Returns the current zoom exent of the map canvas.
PathError
Possible errors that may happen when calling findShortestPath()
snap according to the configuration set in setLayers()
QgsMapLayer * currentLayer()
returns current layer (set by legend widget)
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
void reportError(PathError err, bool addingVertex)
Report a path finding error to the user.
void setCrsTransformEnabled(bool enabled)
Set whether to do reprojection to destination CRS.
void pushItem(QgsMessageBarItem *item)
Display a message item on the bar after hiding the currently visible one and putting it in a stack...
void setMaxFeatureCount(int count)
Get maximum possible number of features in graph. If the number is exceeded, graph is not created...
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
QgsVectorLayer * layer
The layer to configure.
Configures how a certain layer should be handled in a snapping operation.
void invalidateGraph()
Destroy the existing graph structure if any (de-initialize)
QgsMapCanvasTracer(QgsMapCanvas *canvas, QgsMessageBar *messageBar=0)
Create tracer associated with a particular map canvas, optionally message bar for reporting...
QStringList layers() const
Get list of layer IDs for map rendering The layers are stored in the reverse order of how they are re...
QgsSnappingUtils * snappingUtils() const
Return snapping utility class that is associated with map canvas.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
snap just to current layer (tolerance and type from defaultSettings())
Represents a vector layer which manages a vector based data sets.
void setLayers(const QList< QgsVectorLayer *> &layers)
Set layers used for tracing.
const QgsCoordinateReferenceSystem & destinationCrs() const
returns CRS of destination coordinate reference system
void setDestinationCrs(const QgsCoordinateReferenceSystem &crs)
Set CRS used for tracing.