Skip to content
Permalink
Browse files

changed requests

  • Loading branch information
signedav committed Dec 19, 2017
1 parent 0b05030 commit a7b5ffc5558c5361fee9b409ec17fdb2b1cb43c3
@@ -96,10 +96,6 @@ Clean a temporary rubberband
convenient method to clean members
%End

public slots:
void setCurrentLayer( QgsMapLayer *layer );


protected:

int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint );
@@ -55,10 +55,10 @@ bool QgsMapToolAddFeature::addFeature( QgsVectorLayer *vlayer, QgsFeature *f, bo
return res;
}

void QgsMapToolAddFeature::digitized( const QgsFeature *f )
void QgsMapToolAddFeature::digitized( QgsFeature &f )
{
QgsVectorLayer *vlayer = currentVectorLayer();
bool res = addFeature( vlayer, const_cast<QgsFeature *>( f ), false );
bool res = addFeature( vlayer, &f, false );

if ( res && ( mode() == CaptureLine || mode() == CapturePolygon ) )
{
@@ -76,13 +76,13 @@ void QgsMapToolAddFeature::digitized( const QgsFeature *f )
//can only add topological points if background layer is editable...
if ( vl->geometryType() == QgsWkbTypes::PolygonGeometry && vl->isEditable() )
{
vl->addTopologicalPoints( f->geometry() );
vl->addTopologicalPoints( f.geometry() );
}
}
}
else if ( topologicalEditing )
{
vlayer->addTopologicalPoints( f->geometry() );
vlayer->addTopologicalPoints( f.geometry() );
}
}
}
@@ -25,7 +25,7 @@ class APP_EXPORT QgsMapToolAddFeature : public QgsMapToolDigitizeFeature

bool addFeature( QgsVectorLayer *vlayer, QgsFeature *f, bool showModal = true );

void digitized( const QgsFeature *f ) override;
void digitized( QgsFeature &f ) override;

protected:

@@ -47,9 +47,9 @@ QgsMapToolDigitizeFeature::QgsMapToolDigitizeFeature( QgsMapCanvas *canvas, QgsM
connect( QgisApp::instance(), &QgisApp::projectRead, this, &QgsMapToolDigitizeFeature::stopCapturing );
}

void QgsMapToolDigitizeFeature::digitized( const QgsFeature *f )
void QgsMapToolDigitizeFeature::digitized( QgsFeature &f )
{
emit digitizingCompleted( static_cast< const QgsFeature & >( *f ) );
emit digitizingCompleted( f );
}

void QgsMapToolDigitizeFeature::activate()
@@ -61,7 +61,7 @@ void QgsMapToolDigitizeFeature::activate()
if ( vlayer && vlayer->geometryType() == QgsWkbTypes::NullGeometry )
{
QgsFeature f;
digitized( &f );
digitized( f );
return;
}

@@ -202,7 +202,7 @@ void QgsMapToolDigitizeFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
f.setGeometry( g );
f.setValid( true );

digitized( &f );
digitized( f );

// we are done with digitizing for now so instruct advanced digitizing dock to reset its CAD points
cadDockWidget()->clearPoints();
@@ -324,7 +324,7 @@ void QgsMapToolDigitizeFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
}
f->setValid( true );

digitized( f.get() );
digitized( *f );

stopCapturing();
}
@@ -29,7 +29,7 @@ class APP_EXPORT QgsMapToolDigitizeFeature : public QgsMapToolCapture

void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;

virtual void digitized( const QgsFeature *f );
virtual void digitized( QgsFeature &f );

virtual void activate() override;
virtual void deactivate() override;
@@ -273,7 +273,6 @@ QgsMapLayer *QgsMapCanvas::layer( int index )
return nullptr;
}


void QgsMapCanvas::setCurrentLayer( QgsMapLayer *layer )
{
mCurrentLayer = layer;
@@ -53,7 +53,7 @@ QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizin
setCursor( QgsApplication::getThemeCursor( QgsApplication::Cursor::CapturePoint ) );

connect( canvas, &QgsMapCanvas::currentLayerChanged,
this, &QgsMapToolCapture::setCurrentLayer );
this, &QgsMapToolCapture::currentLayerChanged );
}

QgsMapToolCapture::~QgsMapToolCapture()
@@ -95,7 +95,7 @@ void QgsMapToolCapture::validationFinished()
}
}

void QgsMapToolCapture::setCurrentLayer( QgsMapLayer *layer )
void QgsMapToolCapture::currentLayerChanged( QgsMapLayer *layer )
{
if ( !mCaptureModeFromLayer )
return;
@@ -112,9 +112,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
private slots:
void validationFinished();
void addError( QgsGeometry::Error );

public slots:
void setCurrentLayer( QgsMapLayer *layer );
void currentLayerChanged( QgsMapLayer *layer );


protected:

0 comments on commit a7b5ffc

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