Skip to content
Permalink
Browse files

fixes for advanced digitizing tools

do not clear intermediate points when digitizing points in construction mode
increase maximum height of dock widget when tools are disabled
  • Loading branch information
3nids committed Dec 10, 2014
1 parent a56ec98 commit a1e0f017093f5311243da18a0b4d2dbd9381b62c
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/app/qgsadvanceddigitizingdockwidget.cpp
@@ -235,7 +235,7 @@ void QgsAdvancedDigitizingDockWidget::mapToolChanged( QgsMapTool* tool )
mErrorLabel->setText( lblText );
mErrorLabel->show();
mCadWidget->hide();
setMaximumSize( 5000, 70 );
setMaximumSize( 5000, 80 );

setCadEnabled( false );
}
@@ -870,8 +870,10 @@ bool QgsAdvancedDigitizingDockWidget::canvasReleaseEventFilter( QgsMapMouseEvent

if ( e->button() == Qt::LeftButton )
{
// continue digitizing if line or polygon
if ( e->mapTool()->mode() == QgsMapToolCapture::CaptureNone || e->mapTool()->mode() == QgsMapToolCapture::CapturePoint )
// stop digitizing if not intermediate point and if line or polygon
if ( !mConstructionMode &&
( e->mapTool()->mode() == QgsMapToolCapture::CaptureNone ||

This comment has been minimized.

Copy link
@m-kuhn

m-kuhn Aug 31, 2015

Member

@3nids currently refactoring this into the gui library. I wonder if we want a dependency of this on QgsMapToolCapture.
An alternative would be to move the mode enum into this class here (or at least into the cad map tool).
Ideas, opinions?

This comment has been minimized.

Copy link
@3nids

3nids Aug 31, 2015

Author Member

it seems I already moved them to the header
d39a854#diff-3fd48fcb74cda565cab6e24a5dc3c146R40

I probably forgot to rephrase the calls....

This comment has been minimized.

Copy link
@m-kuhn

m-kuhn Aug 31, 2015

Member

I don't yet understand completely what it is for.
The mode is

  • Saved in QgsMapToolAdvancedDigitizing
  • Only changed in QgsMapToolCapture
  • Only evaluated in QgsAdvancedDigitizingDockWidget

Do other tools not need to change it? Maybe we can have a short call to explain the scope of this :)

e->mapTool()->mode() == QgsMapToolCapture::CapturePoint ) )
{
clearPoints();
}

5 comments on commit a1e0f01

@3nids

This comment has been minimized.

Copy link
Member Author

@3nids 3nids replied Sep 1, 2015

The point is that it depends on the map tool. Since it's called from the dock, I set him at the top class (QgsAdvancedDigitizingMapTool). QgsMapToolCapture is the only class using it because, right now, only QgsMapToolCapture classes are doing something else than capturing points. But this could change ass move feature for instance would be a CaptureLine for instance.

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Sep 1, 2015

@3nids

This comment has been minimized.

Copy link
Member Author

@3nids 3nids replied Sep 1, 2015

IIRC the mode is not only used for the snapping but also for the behavior on the left click: for Line/polygon digitizing goes on while it stops for Point.
What would be the advantage of moving the enum to the dock?

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Sep 1, 2015

The dock could live entirely without knowing anything about the maptool and theoretically used with something different than a maptool.

@3nids

This comment has been minimized.

Copy link
Member Author

@3nids 3nids replied Sep 1, 2015

Good point, but does it really make sense to use this out of a map tool?

Please sign in to comment.
You can’t perform that action at this time.