Skip to content
Permalink
Browse files

Many tools support streaming mode

  • Loading branch information
nyalldawson committed Mar 11, 2021
1 parent 7234d89 commit c5f15aed1faa76af49cb9bda2869e15587f2dd93
@@ -40,6 +40,20 @@ QgsMapToolCapture::Capabilities QgsMapToolAddPart::capabilities() const
return QgsMapToolCapture::SupportsCurves;
}

bool QgsMapToolAddPart::supportsTechnique( QgsMapToolCapture::CaptureTechnique technique ) const
{
switch ( technique )
{
case QgsMapToolCapture::StraightSegments:
case QgsMapToolCapture::Streaming:
return true;

case QgsMapToolCapture::CircularString:
return false;
}
return false;
}

void QgsMapToolAddPart::canvasReleaseEvent( QgsMapMouseEvent *e )
{
if ( checkSelection() )
@@ -24,6 +24,7 @@ class APP_EXPORT QgsMapToolAddPart : public QgsMapToolCapture
QgsMapToolAddPart( QgsMapCanvas *canvas );

QgsMapToolCapture::Capabilities capabilities() const override;
bool supportsTechnique( CaptureTechnique technique ) const override;

void canvasReleaseEvent( QgsMapMouseEvent *e ) override;
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
@@ -33,6 +33,20 @@ QgsMapToolAddRing::QgsMapToolAddRing( QgsMapCanvas *canvas )
connect( QgisApp::instance(), &QgisApp::projectRead, this, &QgsMapToolAddRing::stopCapturing );
}

bool QgsMapToolAddRing::supportsTechnique( QgsMapToolCapture::CaptureTechnique technique ) const
{
switch ( technique )
{
case QgsMapToolCapture::StraightSegments:
case QgsMapToolCapture::Streaming:
return true;

case QgsMapToolCapture::CircularString:
return false;
}
return false;
}

void QgsMapToolAddRing::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{

@@ -22,5 +22,6 @@ class APP_EXPORT QgsMapToolAddRing: public QgsMapToolCapture
Q_OBJECT
public:
QgsMapToolAddRing( QgsMapCanvas *canvas );
bool supportsTechnique( CaptureTechnique technique ) const override;
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
};
@@ -33,6 +33,20 @@ QgsMapToolFillRing::QgsMapToolFillRing( QgsMapCanvas *canvas )
mToolName = tr( "Fill ring" );
}

bool QgsMapToolFillRing::supportsTechnique( QgsMapToolCapture::CaptureTechnique technique ) const
{
switch ( technique )
{
case QgsMapToolCapture::StraightSegments:
case QgsMapToolCapture::Streaming:
return true;

case QgsMapToolCapture::CircularString:
return false;
}
return false;
}

void QgsMapToolFillRing::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
//check if we operate on a vector layer
@@ -26,6 +26,7 @@ class APP_EXPORT QgsMapToolFillRing: public QgsMapToolCapture
Q_OBJECT
public:
QgsMapToolFillRing( QgsMapCanvas *canvas );
bool supportsTechnique( CaptureTechnique technique ) const override;
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;

private:
@@ -87,6 +87,7 @@ bool QgsMapToolReshape::supportsTechnique( QgsMapToolCapture::CaptureTechnique t
{
case QgsMapToolCapture::StraightSegments:
case QgsMapToolCapture::CircularString:
case QgsMapToolCapture::Streaming:
return true;
}
return false;
@@ -36,6 +36,7 @@ bool QgsMapToolSplitFeatures::supportsTechnique( QgsMapToolCapture::CaptureTechn
{
case QgsMapToolCapture::StraightSegments:
case QgsMapToolCapture::CircularString:
case QgsMapToolCapture::Streaming:
return true;
}
return false;
@@ -30,6 +30,20 @@ QgsMapToolSplitParts::QgsMapToolSplitParts( QgsMapCanvas *canvas )
setSnapToLayerGridEnabled( false );
}

bool QgsMapToolSplitParts::supportsTechnique( QgsMapToolCapture::CaptureTechnique technique ) const
{
switch ( technique )
{
case QgsMapToolCapture::StraightSegments:
case QgsMapToolCapture::Streaming:
return true;

case QgsMapToolCapture::CircularString:
return false;
}
return false;
}

void QgsMapToolSplitParts::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
//check if we operate on a vector layer
@@ -24,6 +24,7 @@ class APP_EXPORT QgsMapToolSplitParts: public QgsMapToolCapture
Q_OBJECT
public:
QgsMapToolSplitParts( QgsMapCanvas *canvas );
bool supportsTechnique( CaptureTechnique technique ) const override;
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
};

@@ -55,6 +55,7 @@ bool QgsMapToolDigitizeFeature::supportsTechnique( QgsMapToolCapture::CaptureTec
case QgsMapToolCapture::StraightSegments:
return true;
case QgsMapToolCapture::CircularString:
case QgsMapToolCapture::Streaming:
return mode() != QgsMapToolCapture::CapturePoint;
}
return false;

0 comments on commit c5f15ae

Please sign in to comment.