Skip to content

Commit

Permalink
fixes for advanced digitizing tools
Browse files Browse the repository at this point in the history
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 a1e0f01
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/qgsadvanceddigitizingdockwidget.cpp
Expand Up @@ -235,7 +235,7 @@ void QgsAdvancedDigitizingDockWidget::mapToolChanged( QgsMapTool* tool )
mErrorLabel->setText( lblText );
mErrorLabel->show();
mCadWidget->hide();
setMaximumSize( 5000, 70 );
setMaximumSize( 5000, 80 );

setCadEnabled( false );
}
Expand Down Expand Up @@ -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();
}
Expand Down

5 comments on commit a1e0f01

@3nids
Copy link
Member Author

@3nids 3nids commented on a1e0f01 Sep 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@m-kuhn m-kuhn commented on a1e0f01 Sep 1, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@3nids
Copy link
Member Author

@3nids 3nids commented on a1e0f01 Sep 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@m-kuhn m-kuhn commented on a1e0f01 Sep 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@3nids
Copy link
Member Author

@3nids 3nids commented on a1e0f01 Sep 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.