File tree 4 files changed +99
-1
lines changed
4 files changed +99
-1
lines changed Original file line number Diff line number Diff line change 8
8
%Include qgsdistancearcproperter.sip
9
9
%Include qgsgraphbuilderintr.sip
10
10
%Include qgsgraphbuilder.sip
11
+ %Include qgsgraphdirector.sip
12
+ %Include qgslinevectorlayerdirector.sip
Original file line number Diff line number Diff line change
1
+ %ModuleHeaderCode
2
+ #include <qgslinevectorlayerdirector.h>
3
+ %End
4
+
5
+ /**
6
+ * \ingroup networkanalysis
7
+ * \class QgsGraphDirector
8
+ * \brief Determine making the graph. QgsGraphBuilder and QgsGraphDirector is a builder patter.
9
+ */
10
+ class QgsGraphDirector : QObject
11
+ {
12
+ %TypeHeaderCode
13
+ #include <qgsgraphbuilder.h>
14
+ %End
15
+
16
+ %ConvertToSubClassCode
17
+ if ( dynamic_cast< QgsLineVectorLayerDirector* > ( sipCpp ) != NULL )
18
+ sipClass = sipClass_QgsLineVectorLayerDirector;
19
+ else
20
+ sipClass = NULL;
21
+ %End
22
+
23
+
24
+ signals:
25
+ void buildProgress( int, int ) const;
26
+ void buildMessage( QString ) const;
27
+
28
+ public:
29
+ //! Destructor
30
+ virtual ~QgsGraphDirector();
31
+
32
+ /**
33
+ * Make a graph using RgGraphBuilder
34
+ *
35
+ * @param builder The graph builder
36
+ *
37
+ * @param additionalPoints Vector of points that must be tied to the graph
38
+ *
39
+ * @param tiedPoints Vector of tied points
40
+ *
41
+ * @note if tiedPoints[i]==QgsPoint(0.0,0.0) then tied failed.
42
+ */
43
+ virtual void makeGraph( QgsGraphBuilderInterface* builder,
44
+ const QVector< QgsPoint >& additionalPoints,
45
+ QVector< QgsPoint>& tiedPoints /Out/ );
46
+
47
+ void addProperter( QgsArcProperter* prop ) ;
48
+
49
+ /**
50
+ * return Director name
51
+ */
52
+ virtual QString name() const = 0;
53
+ };
54
+
Original file line number Diff line number Diff line change
1
+ /**
2
+ * \ingroup networkanalysis
3
+ * \class QgsLineVectorLayerDirector
4
+ * \brief Determine making the graph from vector line layer
5
+ */
6
+ class QgsLineVectorLayerDirector : QgsGraphDirector
7
+ {
8
+ %TypeHeaderCode
9
+ #include <qgslinevectorlayerdirector.h>
10
+ %End
11
+
12
+ public:
13
+ /**
14
+ * @param layerId
15
+ * @param directionFieldId feield contain road direction value
16
+ * @param directDirectionValue value for one-way road
17
+ * @param reverseDirectionValue value for reverse one-way road
18
+ * @param bothDirectionValue value for road
19
+ * @param defaultDirection 1 - direct direction, 2 - reverse direction, 3 - both direction
20
+ */
21
+ QgsLineVectorLayerDirector( const QString& layerId,
22
+ int directionFieldId,
23
+ const QString& directDirectionValue,
24
+ const QString& reverseDirectionValue,
25
+ const QString& bothDirectionValue,
26
+ int defaultDirection
27
+ );
28
+
29
+ //! Destructor
30
+ virtual ~QgsLineVectorLayerDirector();
31
+
32
+ /*
33
+ * MANDATORY DIRECTOR PROPERTY DECLARATION
34
+ */
35
+ void makeGraph( QgsGraphBuilderInterface *builder,
36
+ const QVector< QgsPoint >& additionalPoints,
37
+ QVector< QgsPoint>& tiedPoints /Out/ ) const;
38
+
39
+ QString name() const;
40
+ };
41
+
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ class ANALYSIS_EXPORT QgsGraphDirector : public QObject
57
57
*/
58
58
virtual void makeGraph ( QgsGraphBuilderInterface* builder,
59
59
const QVector< QgsPoint >& additionalPoints,
60
- QVector< QgsPoint>& tiedPoints ) const = 0;
60
+ QVector< QgsPoint>& tiedPoints ) const
61
+ {}
61
62
62
63
void addProperter ( QgsArcProperter* prop )
63
64
{
You can’t perform that action at this time.
0 commit comments