Skip to content
Permalink
Browse files

Python bindings. part2

  • Loading branch information
Sergey Yakushevs
Sergey Yakushevs committed Jun 2, 2011
1 parent 776d7df commit 59a8a8deb8b41f0d919f3fa7cd9868dda4b10113
@@ -8,3 +8,5 @@
%Include qgsdistancearcproperter.sip
%Include qgsgraphbuilderintr.sip
%Include qgsgraphbuilder.sip
%Include qgsgraphdirector.sip
%Include qgslinevectorlayerdirector.sip
@@ -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;
};

@@ -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;
};

@@ -57,7 +57,8 @@ class ANALYSIS_EXPORT QgsGraphDirector : public QObject
*/
virtual void makeGraph( QgsGraphBuilderInterface* builder,
const QVector< QgsPoint >& additionalPoints,
QVector< QgsPoint>& tiedPoints ) const = 0;
QVector< QgsPoint>& tiedPoints ) const
{}

void addProperter( QgsArcProperter* prop )
{

0 comments on commit 59a8a8d

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