@@ -41,34 +41,34 @@ class ANALYSIS_EXPORT QgsGraphAnalyzer
41
41
static SIP_PYLIST void dijkstra ( const QgsGraph *source, int startVertexIdx, int criterionNum, QVector<int > *resultTree = nullptr , QVector<double > *resultCost = nullptr );
42
42
43
43
#ifdef SIP_RUN
44
- % MethodCode
45
- QVector< int > treeResult;
46
- QVector< double > costResult;
47
- QgsGraphAnalyzer::dijkstra ( a0, a1, a2, &treeResult, &costResult );
44
+ % MethodCode
45
+ QVector< int > treeResult;
46
+ QVector< double > costResult;
47
+ QgsGraphAnalyzer::dijkstra ( a0, a1, a2, &treeResult, &costResult );
48
48
49
- PyObject *l1 = PyList_New( treeResult.size() );
50
- if ( l1 == NULL )
51
- {
52
- return NULL ;
53
- }
54
- PyObject *l2 = PyList_New( costResult.size() );
55
- if ( l2 == NULL )
56
- {
57
- return NULL ;
58
- }
59
- int i;
60
- for ( i = 0 ; i < costResult.size(); ++i )
61
- {
62
- PyObject *Int = PyLong_FromLong ( treeResult[i] );
63
- PyList_SET_ITEM ( l1, i, Int );
64
- PyObject *Float = PyFloat_FromDouble ( costResult[i] );
65
- PyList_SET_ITEM ( l2, i, Float );
66
- }
49
+ PyObject *l1 = PyList_New( treeResult.size() );
50
+ if ( l1 == NULL )
51
+ {
52
+ return NULL ;
53
+ }
54
+ PyObject *l2 = PyList_New( costResult.size() );
55
+ if ( l2 == NULL )
56
+ {
57
+ return NULL ;
58
+ }
59
+ int i;
60
+ for ( i = 0 ; i < costResult.size(); ++i )
61
+ {
62
+ PyObject *Int = PyLong_FromLong ( treeResult[i] );
63
+ PyList_SET_ITEM ( l1, i, Int );
64
+ PyObject *Float = PyFloat_FromDouble ( costResult[i] );
65
+ PyList_SET_ITEM ( l2, i, Float );
66
+ }
67
67
68
- sipRes = PyTuple_New( 2 );
69
- PyTuple_SET_ITEM ( sipRes, 0 , l1 );
70
- PyTuple_SET_ITEM ( sipRes, 1 , l2 );
71
- % End
68
+ sipRes = PyTuple_New( 2 );
69
+ PyTuple_SET_ITEM ( sipRes, 0 , l1 );
70
+ PyTuple_SET_ITEM ( sipRes, 1 , l2 );
71
+ % End
72
72
#endif
73
73
74
74
/* *
0 commit comments