Skip to content

Commit

Permalink
Code layout fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Oct 10, 2017
1 parent 89b884a commit 863197f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 16 deletions.
8 changes: 8 additions & 0 deletions python/core/qgstracer.sip
Expand Up @@ -64,20 +64,28 @@ Set extent to which graph's features will be limited (empty extent means no limi

double offset() const;
%Docstring
Get offset in map units that should be applied to the traced paths returned from findShortestPath().
Positive offset for right side, negative offset for left side.
.. versionadded:: 3.0
:rtype: float
%End

void setOffset( double offset );
%Docstring
Set offset in map units that should be applied to the traced paths returned from findShortestPath().
Positive offset for right side, negative offset for left side.
.. versionadded:: 3.0
%End

void offsetParameters( int &quadSegments /Out/, int &joinStyle /Out/, double &miterLimit /Out/ );
%Docstring
Get extra parameters for offset curve algorithm (used when offset is non-zero)
.. versionadded:: 3.0
%End

void setOffsetParameters( int quadSegments, int joinStyle, double miterLimit );
%Docstring
Set extra parameters for offset curve algorithm (used when offset is non-zero)
.. versionadded:: 3.0
%End

Expand Down
31 changes: 21 additions & 10 deletions src/core/qgstracer.h
Expand Up @@ -63,20 +63,30 @@ class CORE_EXPORT QgsTracer : public QObject
//! Set extent to which graph's features will be limited (empty extent means no limit)
void setExtent( const QgsRectangle &extent );

//! Get offset in map units that should be applied to the traced paths returned from findShortestPath().
//! Positive offset for right side, negative offset for left side.
//! \since QGIS 3.0
/**
* Get offset in map units that should be applied to the traced paths returned from findShortestPath().
* Positive offset for right side, negative offset for left side.
* \since QGIS 3.0
*/
double offset() const { return mOffset; }
//! Set offset in map units that should be applied to the traced paths returned from findShortestPath().
//! Positive offset for right side, negative offset for left side.
//! \since QGIS 3.0

/**
* Set offset in map units that should be applied to the traced paths returned from findShortestPath().
* Positive offset for right side, negative offset for left side.
* \since QGIS 3.0
*/
void setOffset( double offset );

//! Get extra parameters for offset curve algorithm (used when offset is non-zero)
//! \since QGIS 3.0
/**
* Get extra parameters for offset curve algorithm (used when offset is non-zero)
* \since QGIS 3.0
*/
void offsetParameters( int &quadSegments SIP_OUT, int &joinStyle SIP_OUT, double &miterLimit SIP_OUT );
//! Set extra parameters for offset curve algorithm (used when offset is non-zero)
//! \since QGIS 3.0

/**
* Set extra parameters for offset curve algorithm (used when offset is non-zero)
* \since QGIS 3.0
*/
void setOffsetParameters( int quadSegments, int joinStyle, double miterLimit );

//! Get maximum possible number of features in graph. If the number is exceeded, graph is not created.
Expand Down Expand Up @@ -162,6 +172,7 @@ class CORE_EXPORT QgsTracer : public QObject
int mOffsetJoinStyle = 2;
//! Offset parameter: Limit for miter join style
double mOffsetMiterLimit = 5.;

/**
* Limit of how many features can be in the graph (0 means no limit).
* This is to avoid possibly long graph preparation for complicated layers
Expand Down
10 changes: 6 additions & 4 deletions src/gui/qgsmaptoolcapture.h
Expand Up @@ -240,10 +240,12 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing

QgsVertexMarker *mSnappingMarker = nullptr;

//! Keeps point (in map units) snapped to a segment where we most recently finished tracing,
//! so that we can use as the starting point for further tracing. This is useful mainly when
//! tracing with offset: without knowledge of this point user would need to click a segment
//! again after every time a new trace with offset is created (to get new "anchor" point)
/**
* Keeps point (in map units) snapped to a segment where we most recently finished tracing,
* so that we can use as the starting point for further tracing. This is useful mainly when
* tracing with offset: without knowledge of this point user would need to click a segment
* again after every time a new trace with offset is created (to get new "anchor" point)
*/
QgsPointXY mTracingStartPoint;

#ifdef Q_OS_WIN
Expand Down
5 changes: 3 additions & 2 deletions tests/src/app/testqgsmaptooladdfeature.cpp
Expand Up @@ -64,7 +64,8 @@ static QgsFeatureId _newFeatureId( QgsVectorLayer *layer, QSet<QgsFeatureId> old



/** \ingroup UnitTests
/**
* \ingroup UnitTests
* This is a unit test for the node tool
*/
class TestQgsMapToolAddFeature : public QObject
Expand Down Expand Up @@ -189,7 +190,7 @@ void TestQgsMapToolAddFeature::initTestCase()
mCanvas->setMapTool( mCaptureTool );
mCanvas->setCurrentLayer( mLayerLine );

mEnableTracingAction = new QAction();
mEnableTracingAction = new QAction( nullptr );
mEnableTracingAction->setCheckable( true );

mTracer = new QgsMapCanvasTracer( mCanvas, nullptr );
Expand Down

0 comments on commit 863197f

Please sign in to comment.