[GRASS-SVN] r68023 - grass/branches/releasebranch_7_0/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 8 12:53:29 PST 2016


Author: mmetz
Date: 2016-03-08 12:53:29 -0800 (Tue, 08 Mar 2016)
New Revision: 68023

Modified:
   grass/branches/releasebranch_7_0/lib/vector/Vlib/net.c
Log:
Vlib: support different graph versions

Modified: grass/branches/releasebranch_7_0/lib/vector/Vlib/net.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/vector/Vlib/net.c	2016-03-08 17:02:53 UTC (rev 68022)
+++ grass/branches/releasebranch_7_0/lib/vector/Vlib/net.c	2016-03-08 20:53:29 UTC (rev 68023)
@@ -78,7 +78,7 @@
    \param abcol column with backward costs for arc (if NULL, back costs = forward costs), 
    \param ncol column with costs for nodes (if NULL, do not use node costs), 
    \param geo use geodesic calculation for length (LL), 
-   \param algorithm not used (in future code for algorithm)
+   \param version graph version to create (1, 2, 3)
 
    \return 0 on success, 1 on error
  */
@@ -89,7 +89,7 @@
 		     int nfield,
 		     const char *afcol,
 		     const char *abcol,
-		     const char *ncol, int geo, int algorithm)
+		     const char *ncol, int geo, int version)
 {
     int i, j, from, to, line, nlines, nnodes, ret, type, cat, skipped, cfound;
     int dofw, dobw;
@@ -148,11 +148,14 @@
 	Map->dgraph.node_costs[i] = 0;
     }
 
+    if (version < 1 || version > 3)
+	version = 1;
+
     if (ncol != NULL)
-	dglInitialize(gr, (dglByte_t) 1, sizeof(dglInt32_t), (dglInt32_t) 0,
+	dglInitialize(gr, (dglByte_t) version, sizeof(dglInt32_t), (dglInt32_t) 0,
 		      opaqueset);
     else
-	dglInitialize(gr, (dglByte_t) 1, (dglInt32_t) 0, (dglInt32_t) 0,
+	dglInitialize(gr, (dglByte_t) version, (dglInt32_t) 0, (dglInt32_t) 0,
 		      opaqueset);
 
     if (gr == NULL)



More information about the grass-commit mailing list