-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
776d7df
commit 59a8a8d
Showing
4 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
%ModuleHeaderCode | ||
#include <qgslinevectorlayerdirector.h> | ||
%End | ||
|
||
/** | ||
* \ingroup networkanalysis | ||
* \class QgsGraphDirector | ||
* \brief Determine making the graph. QgsGraphBuilder and QgsGraphDirector is a builder patter. | ||
*/ | ||
class QgsGraphDirector : QObject | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsgraphbuilder.h> | ||
%End | ||
|
||
%ConvertToSubClassCode | ||
if ( dynamic_cast< QgsLineVectorLayerDirector* > ( sipCpp ) != NULL ) | ||
sipClass = sipClass_QgsLineVectorLayerDirector; | ||
else | ||
sipClass = NULL; | ||
%End | ||
|
||
|
||
signals: | ||
void buildProgress( int, int ) const; | ||
void buildMessage( QString ) const; | ||
|
||
public: | ||
//! Destructor | ||
virtual ~QgsGraphDirector(); | ||
|
||
/** | ||
* Make a graph using RgGraphBuilder | ||
* | ||
* @param builder The graph builder | ||
* | ||
* @param additionalPoints Vector of points that must be tied to the graph | ||
* | ||
* @param tiedPoints Vector of tied points | ||
* | ||
* @note if tiedPoints[i]==QgsPoint(0.0,0.0) then tied failed. | ||
*/ | ||
virtual void makeGraph( QgsGraphBuilderInterface* builder, | ||
const QVector< QgsPoint >& additionalPoints, | ||
QVector< QgsPoint>& tiedPoints /Out/ ); | ||
|
||
void addProperter( QgsArcProperter* prop ) ; | ||
|
||
/** | ||
* return Director name | ||
*/ | ||
virtual QString name() const = 0; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* \ingroup networkanalysis | ||
* \class QgsLineVectorLayerDirector | ||
* \brief Determine making the graph from vector line layer | ||
*/ | ||
class QgsLineVectorLayerDirector : QgsGraphDirector | ||
{ | ||
%TypeHeaderCode | ||
#include <qgslinevectorlayerdirector.h> | ||
%End | ||
|
||
public: | ||
/** | ||
* @param layerId | ||
* @param directionFieldId feield contain road direction value | ||
* @param directDirectionValue value for one-way road | ||
* @param reverseDirectionValue value for reverse one-way road | ||
* @param bothDirectionValue value for road | ||
* @param defaultDirection 1 - direct direction, 2 - reverse direction, 3 - both direction | ||
*/ | ||
QgsLineVectorLayerDirector( const QString& layerId, | ||
int directionFieldId, | ||
const QString& directDirectionValue, | ||
const QString& reverseDirectionValue, | ||
const QString& bothDirectionValue, | ||
int defaultDirection | ||
); | ||
|
||
//! Destructor | ||
virtual ~QgsLineVectorLayerDirector(); | ||
|
||
/* | ||
* MANDATORY DIRECTOR PROPERTY DECLARATION | ||
*/ | ||
void makeGraph( QgsGraphBuilderInterface *builder, | ||
const QVector< QgsPoint >& additionalPoints, | ||
QVector< QgsPoint>& tiedPoints /Out/ ) const; | ||
|
||
QString name() const; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters