2011-06-02 19:02:20 +06:00
|
|
|
/**
|
2016-11-16 16:48:41 +02:00
|
|
|
* \ingroup analysis
|
2016-11-21 16:33:34 +02:00
|
|
|
* \class QgsVectorLayerDirector
|
2011-06-02 19:02:20 +06:00
|
|
|
* \brief Determine making the graph from vector line layer
|
|
|
|
*/
|
2016-11-21 16:33:34 +02:00
|
|
|
class QgsVectorLayerDirector : QgsGraphDirector
|
2011-06-02 19:02:20 +06:00
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
2016-11-21 16:33:34 +02:00
|
|
|
#include <qgsvectorlayerdirector.h>
|
2011-06-02 19:02:20 +06:00
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2016-11-21 16:44:44 +02:00
|
|
|
/** Edge direction
|
|
|
|
* Edge can be one-way with direct flow (one can move only from the start
|
2016-11-19 16:56:51 +02:00
|
|
|
* point to the end point), one-way with reversed flow (one can move only
|
|
|
|
* from the end point to the start point) and bidirectional or two-way
|
|
|
|
* (one can move in any direction)
|
|
|
|
*/
|
2016-11-21 11:29:02 +02:00
|
|
|
enum Direction
|
2016-11-19 16:56:51 +02:00
|
|
|
{
|
2016-11-21 11:29:02 +02:00
|
|
|
DirectionForward, //!< One-way direct
|
|
|
|
DirectionBackward, //!< One-way reversed
|
|
|
|
DirectionBoth, //!< Two-way
|
2016-11-19 16:56:51 +02:00
|
|
|
};
|
|
|
|
|
2011-06-02 19:02:20 +06:00
|
|
|
/**
|
2011-06-03 11:51:53 +06:00
|
|
|
* @param myLayer source vector layer
|
2011-06-02 19:02:20 +06:00
|
|
|
* @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
|
2016-11-21 16:44:44 +02:00
|
|
|
* @param defaultDirection default direction. Will be used if corresponding
|
2016-11-19 16:56:51 +02:00
|
|
|
* attribute value is not set or does not equal to the given values
|
2011-06-02 19:02:20 +06:00
|
|
|
*/
|
2016-11-21 16:33:34 +02:00
|
|
|
QgsVectorLayerDirector( QgsVectorLayer* myLayer,
|
|
|
|
int directionFieldId,
|
|
|
|
const QString& directDirectionValue,
|
|
|
|
const QString& reverseDirectionValue,
|
|
|
|
const QString& bothDirectionValue,
|
|
|
|
const Direction defaultDirection
|
|
|
|
);
|
2011-06-02 19:02:20 +06:00
|
|
|
|
|
|
|
//! Destructor
|
2016-11-21 16:33:34 +02:00
|
|
|
virtual ~QgsVectorLayerDirector();
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2011-06-02 19:02:20 +06:00
|
|
|
/*
|
|
|
|
* MANDATORY DIRECTOR PROPERTY DECLARATION
|
|
|
|
*/
|
|
|
|
void makeGraph( QgsGraphBuilderInterface *builder,
|
|
|
|
const QVector< QgsPoint >& additionalPoints,
|
2016-11-17 17:30:10 +02:00
|
|
|
QVector< QgsPoint>& snappedPoints /Out/ ) const;
|
2011-06-02 19:02:20 +06:00
|
|
|
|
|
|
|
QString name() const;
|
|
|
|
};
|
|
|
|
|