File tree 4 files changed +67
-2
lines changed
4 files changed +67
-2
lines changed Original file line number Diff line number Diff line change 6
6
SET (QGIS_NETWORK_ANALYSIS_SRCS
7
7
qgsgraph.cpp
8
8
qgsgraphbuilder.cpp
9
+ qgsdistanceedgeproperter.cpp
9
10
)
10
11
11
12
INCLUDE_DIRECTORIES (BEFORE raster)
@@ -54,7 +55,9 @@ INSTALL(TARGETS qgis_networkanalysis
54
55
SET (QGIS_NETWORK_ANALYSIS_HDRS
55
56
qgsgraph.h
56
57
qgsgraphbuilderinterface.h
57
- qgsgraphbuilder.h )
58
+ qgsgraphbuilder.h
59
+ qgsedgeproperter.h
60
+ qgsdistanceedgeproperter.h )
58
61
59
62
INSTALL (CODE "MESSAGE(\" Installing NETWORK ANALYSIS headers...\" )" )
60
63
INSTALL (FILES ${QGIS_NETWORK_ANALYSIS_HDRS} ${QGIS_NETWORK_ANALYSIS_MOC_HDRS} DESTINATION ${QGIS_INCLUDE_DIR} )
Original file line number Diff line number Diff line change
1
+ /* **************************************************************************
2
+ * Copyright (C) 2011 by Sergey Yakushev *
3
+ * yakushevs <at >list.ru *
4
+ * *
5
+ * *
6
+ * This program is free software; you can redistribute it and/or modify *
7
+ * it under the terms of the GNU General Public License as published by *
8
+ * the Free Software Foundation; either version 2 of the License, or *
9
+ * (at your option) any later version. *
10
+ ***************************************************************************/
11
+
12
+ // QGIS includes
13
+ #include < qgsdistanceedgeproperter.h>
14
+
15
+ QVariant QgsDistanceEdgeProperter::property ( double distance, const QgsFeature& f ) const
16
+ {
17
+ return QVariant ( distance );
18
+ }
Original file line number Diff line number Diff line change
1
+ /* **************************************************************************
2
+ qgsedgeproperter.h
3
+ --------------------------------------
4
+ Date : 2011-04-01
5
+ Copyright : (C) 2010 by Yakushev Sergey
6
+ Email : YakushevS <at> list.ru
7
+ ****************************************************************************
8
+ * *
9
+ * This program is free software; you can redistribute it and/or modify *
10
+ * it under the terms of the GNU General Public License as published by *
11
+ * the Free Software Foundation; either version 2 of the License, or *
12
+ * (at your option) any later version. *
13
+ * *
14
+ ***************************************************************************/
15
+
16
+ #ifndef QGSEDGEDISTANCEPROPERTERH
17
+ #define QGSEDGEDISTANCEPROPERTERH
18
+
19
+ // QT4 includes
20
+ #include < QVariant>
21
+
22
+ // QGIS includes
23
+ #include < qgsedgeproperter.h>
24
+
25
+ class ANALYSIS_EXPORT QgsDistanceEdgeProperter : public QgsEdgeProperter
26
+ {
27
+ public:
28
+ virtual QVariant property ( double distance, const QgsFeature& ) const ;
29
+ };
30
+ #endif // QGSEDGEDISTANCEPROPERTYH
Original file line number Diff line number Diff line change 23
23
#include < qgsfeature.h>
24
24
#include < qgslabel.h>
25
25
26
+ /* *
27
+ * \class QgsEdgeProperter
28
+ * \brief QgsEdgeProperter is a strategy pattern. You can use it for customize edge property.
29
+ */
26
30
class ANALYSIS_EXPORT QgsEdgeProperter
27
31
{
28
32
public:
33
+ /* *
34
+ * default constructor
35
+ */
29
36
QgsEdgeProperter ()
30
37
{ }
31
-
38
+
39
+ /* *
40
+ * QgsGraphDirector call this method for fetching attribute from source layer
41
+ * \return required attributes list
42
+ */
32
43
virtual QgsAttributeList requiredAttributes () const
33
44
{ return QgsAttributeList (); }
34
45
46
+ /* *
47
+ * calculate and return adge property
48
+ */
35
49
virtual QVariant property ( double distance, const QgsFeature& f ) const
36
50
{ return QVariant (); }
37
51
};
You can’t perform that action at this time.
0 commit comments