Revision: 5876
          http://sourceforge.net/p/jump-pilot/code/5876
Author:   michaudm
Date:     2018-06-12 06:25:45 +0000 (Tue, 12 Jun 2018)
Log Message:
-----------
GraphToolBox : release 0.6.0 (improvement of SkeletonPlugIn + refactoring to 
use parameters)

Modified Paths:
--------------
    plug-ins/GraphToolboxPlugin/trunk/build.xml
    
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/GraphExtension.java
    
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/SkeletonPlugIn.java
    
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph.properties
    
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_cz.properties
    
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_fi.properties
    
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_fr.properties
    
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_it.properties

Modified: plug-ins/GraphToolboxPlugin/trunk/build.xml
===================================================================
--- plug-ins/GraphToolboxPlugin/trunk/build.xml 2018-06-11 20:04:16 UTC (rev 
5875)
+++ plug-ins/GraphToolboxPlugin/trunk/build.xml 2018-06-12 06:25:45 UTC (rev 
5876)
@@ -17,7 +17,7 @@
     <property name="dist"    value="dist" />
     <property name="javadoc" value="javadoc" />
 
-    <property name="version" value="0.5.9" />
+    <property name="version" value="0.6.0" />
     
     <!-- =================================================================== 
-->
     <!-- Defines the classpath used for compilation and test.                
-->

Modified: 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/GraphExtension.java
===================================================================
--- 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/GraphExtension.java
     2018-06-11 20:04:16 UTC (rev 5875)
+++ 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/GraphExtension.java
     2018-06-12 06:25:45 UTC (rev 5876)
@@ -35,8 +35,9 @@
  * <li>CycleFinderPlugIn : computes a graph from a linear network and find 
base cycles</li>
  * </ul>
  * @author Micha&euml;l Michaud
- * @version 0.5.9 (2018-06-06)
+ * @version 0.6.0 (2018-06-12)
  */
+//version 0.6.0 (2018-06-12) refactor to use AbstractPlugIn parameters in 
SkeletonPlugIn
 //version 0.5.9 (2018-06-06) fix a new robustess problem
 //version 0.5.8 (2018-05-27) improve SkeletonPlugIn (and add a parameter)
 //version 0.5.6 (2018-01-27) add some translations in finnish
@@ -59,7 +60,7 @@
     }
 
     public String getVersion() {
-        return "0.5.9 (2018-06-06)";
+        return "0.6.0 (2018-06-12)";
     }
 
     public void configure(PlugInContext context) throws Exception {

Modified: 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/SkeletonPlugIn.java
===================================================================
--- 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/SkeletonPlugIn.java
     2018-06-11 20:04:16 UTC (rev 5875)
+++ 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/SkeletonPlugIn.java
     2018-06-12 06:25:45 UTC (rev 5876)
@@ -9,11 +9,9 @@
 import com.vividsolutions.jts.operation.linemerge.LineMerger;
 import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
 import com.vividsolutions.jts.triangulate.VoronoiDiagramBuilder;
-import com.vividsolutions.jump.I18N;
 import com.vividsolutions.jump.feature.*;
 import com.vividsolutions.jump.geom.Angle;
 import com.vividsolutions.jump.task.TaskMonitor;
-import com.vividsolutions.jump.workbench.Logger;
 import com.vividsolutions.jump.workbench.WorkbenchContext;
 import com.vividsolutions.jump.workbench.model.LayerManager;
 import com.vividsolutions.jump.workbench.model.StandardCategoryNames;
@@ -43,6 +41,13 @@
  */
 public class SkeletonPlugIn extends AbstractThreadedUiPlugIn {
 
+    private static String P_LAYER_NAME               = "LayerName";
+    private static String P_AUTO_WIDTH               = "AutoWidth";
+    private static String P_MIN_WIDTH                = "MinWidth";
+    private static String P_MIN_FORK_LENGTH          = "MinForkLength";
+    private static String P_RELATIVE_MIN_FORK_LENGTH = "MinForkLengthRelative";
+    private static String P_SNAP_TO_BOUNDARY         = "SnapToBoundary";
+
     private static String GRAPH                   = I18NPlug.getI18N("Graph");
     private static String CENTRAL_SKELETON        = 
I18NPlug.getI18N("SkeletonPlugIn");
     private static String SKELETONIZE             = 
I18NPlug.getI18N("SkeletonPlugIn.skeletonize");
@@ -51,12 +56,8 @@
     private static String AUTO_WIDTH_PARAMETER_TT = 
I18NPlug.getI18N("SkeletonPlugIn.auto-width-parameter-tooltip");
     private static String MIN_WIDTH               = 
I18NPlug.getI18N("SkeletonPlugIn.min-width");
     private static String MIN_WIDTH_TT            = 
I18NPlug.getI18N("SkeletonPlugIn.min-width-tooltip");
-    private static String BUFFER_THINER_THAN      = 
I18NPlug.getI18N("SkeletonPlugIn.buffer-thiner-than");
-    private static String BUFFER_THINER_THAN_TT   = 
I18NPlug.getI18N("SkeletonPlugIn.buffer-thiner-than-tooltip");
     private static String MIN_FORK_LENGTH_FROM_MEAN_WIDTH    = 
I18NPlug.getI18N("SkeletonPlugIn.min-fork-length-from-mean-width");
     private static String MIN_FORK_LENGTH_FROM_MEAN_WIDTH_TT = 
I18NPlug.getI18N("SkeletonPlugIn.min-fork-length-from-mean-width-tooltip");
-    private static String MIN_FORK_LENGTH_IN_MAP_UNITS       = 
I18NPlug.getI18N("SkeletonPlugIn.min-fork-length-in-map-units");
-    private static String MIN_FORK_LENGTH_IN_MAP_UNITS_TT    = 
I18NPlug.getI18N("SkeletonPlugIn.min-fork-length-in-map-units-tooltip");
     private static String MIN_FORK_LENGTH         = 
I18NPlug.getI18N("SkeletonPlugIn.min-fork-length");
     private static String MIN_FORK_LENGTH_TT      = 
I18NPlug.getI18N("SkeletonPlugIn.min-fork-length-tooltip");
     private static String SNAP_TO_BOUNDARY        = 
I18NPlug.getI18N("SkeletonPlugIn.snap-to_boundary");
@@ -64,24 +65,23 @@
     private static String DISPLAY_VORONOI_EDGES   = 
I18NPlug.getI18N("SkeletonPlugIn.display-voronoi-edges");
     private static String DESCRIPTION             = 
I18NPlug.getI18N("SkeletonPlugIn.description");
 
-    private String  layerName;
-    private boolean autoWidth        = true;
-    private double  minWidth         = 1.0;   // minimum width of the polygon
-    private double  bufferThinerThan = 0.1;   // buffer polygon thiner than a 
value
-    private double  simplification   = 0.2;   // by default, simplification 
factor is minWidth/5
-    private double  densification    = 0.5;   // by default, densification 
factor is minWidth/2
-    private double  meanWidth        = 2.0;   // mean width of the polygon
-    private int     maxIterations    = 8192;  // maximum iteration to 
eliminate forks
-    private double  forkLengthMul    = 2.5;   // minimum length of a fork
-    private double  minForkLength    = 10.0;  // minimum length of a fork
-    private boolean fromMeanWidth    = true;  // minimum fork length from mean 
width
-    private boolean fromMapUnits     = false; // minimum fork length in map 
units
-    private boolean snapEnds         = false; // wheter the skeletton must 
snap the polygon boundary
+    // default external parameters
+    {
+      addParameter(P_LAYER_NAME, null);
+      addParameter(P_AUTO_WIDTH,       true);
+      addParameter(P_MIN_WIDTH,        1.0);
+      addParameter(P_MIN_FORK_LENGTH,  10.0);
+      addParameter(P_SNAP_TO_BOUNDARY, true);
+      addParameter(P_RELATIVE_MIN_FORK_LENGTH, false);
+    }
 
-    private boolean displayVoronoiEdges = false;
+    // internal parameters
+    private double  simplification        = 0.2;   // default simplification 
factor is minWidth/5
+    private double  densification         = 0.5;   // default densification 
factor is minWidth/2
+    private double  meanWidth             = 2.0;   // mean width of the polygon
+    private int     maxIterations         = 8192;  // maximum iteration to 
eliminate forks
+    private boolean displayVoronoiEdges   = false;
 
-    //private static Collection debugGeometries = new ArrayList<Geometry>();
-
     public void initialize(PlugInContext context) {
 
         workbenchContext = context.getWorkbenchContext();
@@ -122,51 +122,51 @@
 
     private void setDialogValues(MultiInputDialog dialog, PlugInContext 
context) {
         dialog.setSideBarDescription(DESCRIPTION);
-        layerName = context.getCandidateLayer(0).getName();
-        dialog.addLayerComboBox(SOURCE_LAYER, 
context.getLayerManager().getLayer(layerName),
+        if (getStringParam(P_LAYER_NAME) == null ||
+                
context.getLayerManager().getLayer(getStringParam(P_LAYER_NAME)) == null) {
+            addParameter(P_LAYER_NAME, context.getCandidateLayer(0).getName());
+        }
+        dialog.addLayerComboBox(SOURCE_LAYER,
+                
context.getLayerManager().getLayer(getStringParam(P_LAYER_NAME)),
                 null, context.getLayerManager());
 
-        final JCheckBox autoWidthJcb = 
dialog.addCheckBox(AUTO_WIDTH_PARAMETER, autoWidth, AUTO_WIDTH_PARAMETER_TT);
-        final JTextField minWidthTF = dialog.addDoubleField(MIN_WIDTH, 
minWidth, 12, MIN_WIDTH_TT);
-        minWidthTF.setEnabled(!autoWidth);
-        final JTextField bufferThinerThanTF = 
dialog.addDoubleField(BUFFER_THINER_THAN, bufferThinerThan, 12, 
BUFFER_THINER_THAN_TT);
-        bufferThinerThanTF.setEnabled(autoWidth);
+        final JCheckBox autoWidthJcb = dialog.addCheckBox(AUTO_WIDTH_PARAMETER,
+                getBooleanParam(P_AUTO_WIDTH), AUTO_WIDTH_PARAMETER_TT);
+        final JTextField minWidthTF = dialog.addDoubleField(MIN_WIDTH,
+                getDoubleParam(P_MIN_WIDTH), 12, MIN_WIDTH_TT);
+        minWidthTF.setEnabled(!getBooleanParam(P_AUTO_WIDTH));
 
-        final JTextField minForkLengthTF = 
dialog.addDoubleField(MIN_FORK_LENGTH, forkLengthMul, 12, MIN_FORK_LENGTH_TT);
-        final JRadioButton mflFromMinWidthJRB = 
dialog.addRadioButton(MIN_FORK_LENGTH_FROM_MEAN_WIDTH,
-                "fork-length-units", fromMeanWidth, 
MIN_FORK_LENGTH_FROM_MEAN_WIDTH_TT);
-        final JRadioButton mflInMapUnitsJRB = 
dialog.addRadioButton(MIN_FORK_LENGTH_IN_MAP_UNITS,
-                "fork-length-units", fromMapUnits, 
MIN_FORK_LENGTH_IN_MAP_UNITS_TT);
+        final JTextField minForkLengthTF = 
dialog.addDoubleField(MIN_FORK_LENGTH,
+                getDoubleParam(P_MIN_FORK_LENGTH), 12, MIN_FORK_LENGTH_TT);
+        final JCheckBox mflFromMeanWidthJCB = 
dialog.addCheckBox(MIN_FORK_LENGTH_FROM_MEAN_WIDTH,
+                getBooleanParam(P_RELATIVE_MIN_FORK_LENGTH), 
MIN_FORK_LENGTH_FROM_MEAN_WIDTH_TT);
 
-        dialog.addCheckBox(SNAP_TO_BOUNDARY, snapEnds, SNAP_TO_BOUNDARY_TT);
+        dialog.addCheckBox(SNAP_TO_BOUNDARY,
+                getBooleanParam(P_SNAP_TO_BOUNDARY), SNAP_TO_BOUNDARY_TT);
         dialog.addCheckBox(DISPLAY_VORONOI_EDGES, displayVoronoiEdges);
 
-        //minWidthTF.setEnabled(!autoWidthJcb.isSelected());
         autoWidthJcb.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
                 minWidthTF.setEnabled(!autoWidthJcb.isSelected());
-                bufferThinerThanTF.setEnabled(autoWidthJcb.isSelected());
             }
         });
     }
 
     private void getDialogValues(MultiInputDialog dialog) {
-        layerName = dialog.getLayer(SOURCE_LAYER).getName();
-        autoWidth = dialog.getBoolean(AUTO_WIDTH_PARAMETER);
-        minWidth = dialog.getDouble(MIN_WIDTH);
-        bufferThinerThan = dialog.getDouble(BUFFER_THINER_THAN);
-        forkLengthMul = dialog.getDouble(MIN_FORK_LENGTH);
-        fromMeanWidth = dialog.getBoolean(MIN_FORK_LENGTH_FROM_MEAN_WIDTH);
-        fromMapUnits = dialog.getBoolean(MIN_FORK_LENGTH_IN_MAP_UNITS);
-        snapEnds = dialog.getBoolean(SNAP_TO_BOUNDARY);
+        addParameter(P_LAYER_NAME, dialog.getLayer(SOURCE_LAYER).getName());
+        addParameter(P_AUTO_WIDTH, dialog.getBoolean(AUTO_WIDTH_PARAMETER));
+        addParameter(P_MIN_WIDTH, dialog.getDouble(MIN_WIDTH));
+        addParameter(P_RELATIVE_MIN_FORK_LENGTH, 
dialog.getBoolean(MIN_FORK_LENGTH_FROM_MEAN_WIDTH));
+        addParameter(P_MIN_FORK_LENGTH, dialog.getDouble(MIN_FORK_LENGTH));
+        addParameter(P_SNAP_TO_BOUNDARY, dialog.getBoolean(SNAP_TO_BOUNDARY));
         displayVoronoiEdges = dialog.getBoolean(DISPLAY_VORONOI_EDGES);
     }
 
-    public void run(TaskMonitor monitor, PlugInContext context) throws 
Exception {
+    public void run(TaskMonitor monitor, PlugInContext context) {
         monitor.report(SKELETONIZE);
         LayerManager layerManager = context.getLayerManager();
-        FeatureCollection inputFC = 
layerManager.getLayer(layerName).getFeatureCollectionWrapper();
+        FeatureCollection inputFC = 
layerManager.getLayer(getStringParam(P_LAYER_NAME)).getFeatureCollectionWrapper();
         FeatureSchema schema = inputFC.getFeatureSchema().clone();
         schema.addAttribute("mean_width", AttributeType.DOUBLE);
         schema.addAttribute("min_width", AttributeType.DOUBLE);
@@ -193,13 +193,13 @@
                     newFeature.setAttributes(objects);
                     Geometry g = geom.getGeometryN(i);
                     try {
-                        computeParams(g);
+                        g = computeParams(g);
                     } catch (Exception e) {
                         context.getWorkbenchFrame().warnUser(e.getMessage());
                     }
                     newFeature.setAttribute("mean_width", meanWidth);
-                    newFeature.setAttribute("min_width",  minWidth);
-                    newFeature.setAttribute("min_fork_length", minForkLength);
+                    newFeature.setAttribute("min_width",  
getDoubleParam(P_MIN_WIDTH));
+                    newFeature.setAttribute("min_fork_length", 
getDoubleParam(P_MIN_FORK_LENGTH));
                     g = skeletonize(g, edges);
                     newFeature.setGeometry(g);
                     newFeature.setAttribute("iteration_number", 
((Object[])g.getUserData())[0]);
@@ -214,23 +214,22 @@
                 outputFC.add(newFeature);
             }
         }
-        layerManager.addLayer(StandardCategoryNames.RESULT, layerName + " - 
skeletonized", outputFC);
+        layerManager.addLayer(StandardCategoryNames.RESULT, 
getStringParam(P_LAYER_NAME) + " - skeletonized", outputFC);
         if (edges.size() > 0) {
-            layerManager.addLayer(StandardCategoryNames.RESULT, layerName + " 
- voronoi-edges",
+            layerManager.addLayer(StandardCategoryNames.RESULT, 
getStringParam(P_LAYER_NAME) + " - voronoi-edges",
                     FeatureDatasetFactory.createFromGeometry(edges));
-            //if (debugGeometries.size() > 0) {
-            //    layerManager.addLayer(StandardCategoryNames.RESULT, 
layerName + " - debug",
-            //            
FeatureDatasetFactory.createFromGeometry(debugGeometries));
-            //}
         }
     }
 
-    // Get minWidth and meanWidth from the geometry
-    private void computeParams(Geometry geometry) {
+    // Compute meanWidth from the geometry
+    // Compute minWidth from meanWidth if autoWidth = true
+    // Compute minForkLength if fromMeanWidth = true
+    // This method must be called only once per object
+    private Geometry computeParams(Geometry geometry) {
         meanWidth = getMeanWidth(geometry);
         double SQRT2 = Math.sqrt(2.0);
         if (meanWidth==0) meanWidth = 
geometry.getLength()/geometry.getNumPoints()/5;
-        if (autoWidth) {
+        if (getBooleanParam(P_AUTO_WIDTH)) {
             // Iterative function to find the minimal width of the polygon
             // A buffer < -minWidth/2 will split the polygon into two polygons
             // (except in polygons with holes where)
@@ -238,23 +237,30 @@
             double semiMinWidth = meanWidth*0.5/64;
             double originalLength = geometry.getLength();
             Geometry buffer = geometry.buffer(-semiMinWidth);
-            // Use buffParam as the minimalWidth if
-            // - buffParam split the geometry into several parts
-            // - buffParam reduces boundary length by more than 10%
-            while (buffer.getNumGeometries() == numGeometries && 
buffer.getLength()/originalLength > 0.9) {
-                semiMinWidth = semiMinWidth*SQRT2;
-                buffer = geometry.buffer(-semiMinWidth);
-                //if (buffParam < meanWidth/64) break;
+            // Use semiMinWidth as the minimalWidth if
+            // - semiMinWidth split the geometry into several parts or
+            // - semiMinWidth reduces boundary length by more than 10%
+            if (buffer.getNumGeometries() > numGeometries || 
buffer.getLength()/originalLength <= 0.9) {
+                // polygon is very thin : it has been split or reduced by more 
than 10%
+                // after a negative buffer of only meanWidth*0.5/64
+                // ==> we create a buffer around the polygon to be able to 
calculate the
+                // skeleton with a reasonable point densification
+                geometry = geometry.buffer(meanWidth/32);
+                semiMinWidth = meanWidth/32;
+            } else {
+                while (buffer.getNumGeometries() == numGeometries && 
buffer.getLength() / originalLength > 0.9) {
+                    semiMinWidth = semiMinWidth * SQRT2;
+                    buffer = geometry.buffer(-semiMinWidth);
+                }
             }
-            minWidth = semiMinWidth;
+            addParameter(P_MIN_WIDTH, semiMinWidth);
         }
-        if (fromMeanWidth) {
-            minForkLength = forkLengthMul*meanWidth;
-        } else if (fromMapUnits) {
-            minForkLength = forkLengthMul;
+        if (getBooleanParam(P_RELATIVE_MIN_FORK_LENGTH)) {
+            addParameter(P_MIN_FORK_LENGTH, 
getDoubleParam(P_MIN_FORK_LENGTH)*meanWidth);
         }
-        simplification = minWidth/5.0;
-        densification = minWidth/2.0;
+        simplification = getDoubleParam(P_MIN_WIDTH)/5.0;
+        densification = getDoubleParam(P_MIN_WIDTH)/2.0;
+        return geometry;
     }
 
     // Computes the mean width of a polygon
@@ -275,15 +281,13 @@
 
     // Simplification/densification of input geometry
     private Geometry preprocess(Geometry geometry, int iteration) {
-        // 0.5.8 : create a buffer if the min width is very small compared to 
mean width
-        // to avoid very heavy calculation du to high densification of the 
outline
-        if (minWidth < bufferThinerThan || iteration > 0) {
-            geometry = geometry.buffer(bufferThinerThan/2);
-            simplification = bufferThinerThan/5.0;
-            densification = bufferThinerThan/2.0;
+        if (iteration > 0) {
+            geometry = geometry.buffer(getDoubleParam(P_MIN_WIDTH)/2);
+            simplification = getDoubleParam(P_MIN_WIDTH)/5.0;
+            densification = getDoubleParam(P_MIN_WIDTH)/2.0;
         }
         geometry = TopologyPreservingSimplifier.simplify(geometry, 
simplification);
-        if (geometry.isEmpty() || Double.isNaN(minWidth)) {
+        if (geometry.isEmpty() || Double.isNaN(getDoubleParam(P_MIN_WIDTH))) {
             return geometry;
         } else {
             geometry = Densifier.densify(geometry, densification);
@@ -293,7 +297,7 @@
 
     // Build a voronoi diagram based on geometry vertices
     // (geometry must have been densified before)
-    private Geometry getVoronoiDiagram(Geometry geometry, int iteration) 
throws Exception {
+    private Geometry getVoronoiDiagram(Geometry geometry, int iteration) {
         if (geometry.isEmpty()) return geometry;
         if (iteration > 32) return 
geometry.getFactory().createMultiPolygon(new Polygon[0]);
         VoronoiDiagramBuilder voronoiBuilder = new VoronoiDiagramBuilder();
@@ -379,27 +383,23 @@
     }
 
 
-    private Geometry skeletonize(Geometry geometry, List<Geometry> list) 
throws Exception {
+    private Geometry skeletonize(Geometry geometry, List<Geometry> list) {
 
         Object userData[] = new Object[2];
 
         // 1 - Build voronoi diagram and extract the edges
-        long t0 = System.currentTimeMillis();
         Set<LineString> edges = new HashSet<LineString>();
         Geometry voronoi = getVoronoiDiagram(preprocess(geometry, 0), 0);
         userData[1] = voronoi.getUserData();
         getEdges(voronoi, edges);
-        //System.out.println("voronoi : " + 
(System.currentTimeMillis()-t0)/1000);
 
         // 2 - Filter voronoi edges strictly included in the geometry
         edges = filter(geometry, edges);
-        //System.out.println("filter : " + 
(System.currentTimeMillis()-t0)/1000);
 
         // 3 - Merge filtered edges
         LineMerger merger = new LineMerger();
         merger.add(edges);
         edges = new HashSet<LineString>(merger.getMergedLineStrings());
-        //System.out.println("merge : " + 
(System.currentTimeMillis()-t0)/1000);
 
         if (displayVoronoiEdges) list.addAll(edges);
 
@@ -406,7 +406,6 @@
         // 4 - Compute the graph and iterate to eliminate edges
         UndirectedGraph<INode,FeatureAsEdge> graph =
                 (UndirectedGraph<INode,FeatureAsEdge>)getGraph(edges);
-        //System.out.println("build graph : " + 
(System.currentTimeMillis()-t0)/1000);
 
         // 5 - Simplify the graph iteratively
         // In each loop, the method eliminates the shortest branch of each fork
@@ -424,12 +423,12 @@
         // 6 - Beautify ends
         List<FeatureAsEdge> finalEdges = new 
ArrayList<FeatureAsEdge>(graph.edgeSet());
         for (FeatureAsEdge f : finalEdges) {
-            
f.setGeometry(TopologyPreservingSimplifier.simplify(f.getGeometry(), 
minWidth/5));
+            
f.setGeometry(TopologyPreservingSimplifier.simplify(f.getGeometry(), 
getDoubleParam(P_MIN_WIDTH)/5));
             EdgeNodes nodes = new EdgeNodes(graph, f);
-            String snapError;
             if (nodes.srcDegree == 1) {
                 try {
-                    f.setGeometry(snapStart(f.getGeometry(), 
geometry.getBoundary(), snapEnds));
+                    f.setGeometry(snapStart(f.getGeometry(), 
geometry.getBoundary(),
+                            getBooleanParam(P_SNAP_TO_BOUNDARY)));
                 } catch(Exception e) {
                     userData[1] = "Snapping error";
                 }
@@ -436,7 +435,8 @@
             }
             if (nodes.tgtDegree == 1) {
                 try {
-                    f.setGeometry(snapEnd(f.getGeometry(), 
geometry.getBoundary(), snapEnds));
+                    f.setGeometry(snapEnd(f.getGeometry(), 
geometry.getBoundary(),
+                            getBooleanParam(P_SNAP_TO_BOUNDARY)));
                 } catch(Exception e) {
                     userData[1] = "Snapping error";
                 }
@@ -447,7 +447,7 @@
 
         // 7 - Retourner une geometrie
         Geometry geom = graph2geometry(graph);
-        geom = TopologyPreservingSimplifier.simplify(geom, minWidth/5);
+        geom = TopologyPreservingSimplifier.simplify(geom, 
getDoubleParam(P_MIN_WIDTH)/5);
         userData[0] = i;
         if (geom.isEmpty()) userData[1] = "Empty";
         geom.setUserData(userData); // set the number of iteration used
@@ -598,7 +598,7 @@
                     if (nodes.nbOfDegreeN()==2) nonTerminalSegmentNumber++;
                     if (nonTerminalSegmentNumber>1 && iterative) break;
                     if (nodes.nbOfDegree1() != 1) continue;
-                    if (e.getGeometry().getLength() > minForkLength) continue;
+                    if (e.getGeometry().getLength() > 
getDoubleParam(P_MIN_FORK_LENGTH)) continue;
                     PointPairDistance ppd = new PointPairDistance();
                     DistanceToPoint.computeDistance(boundary, 
nodes.getDegree1().getCoordinate(), ppd);
                     double coeff = ppd.getDistance() / 
e.getGeometry().getLength();

Modified: 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph.properties
===================================================================
--- 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph.properties
        2018-06-11 20:04:16 UTC (rev 5875)
+++ 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph.properties
        2018-06-12 06:25:45 UTC (rev 5876)
@@ -130,16 +130,10 @@
 SkeletonPlugIn.auto-width-parameter-tooltip = Computes automatically a minimum 
width for each feature
 SkeletonPlugIn.min-width = Minimum width
 SkeletonPlugIn.min-width-tooltip = Boundary is densified according to this 
parameter
-SkeletonPlugIn.buffer-thiner-than = Buffer polygons thiner than
-SkeletonPlugIn.buffer-thiner-than-tooltip = Buffer the polygon to avoid 
over-densification
-
 SkeletonPlugIn.min-fork-length = Minimum length of forks
 SkeletonPlugIn.min-fork-length-tooltip = Minimum length of forks
 SkeletonPlugIn.min-fork-length-from-mean-width = ...relative to mean width
 SkeletonPlugIn.min-fork-length-from-mean-width-tooltip = Minimum length of 
forks is a multiplicative factor relative to mean feature width
-SkeletonPlugIn.min-fork-length-in-map-units = ...in map units
-SkeletonPlugIn.min-fork-length-in-map-units-tooltip = Minimum length of forks 
is in map units
-
 SkeletonPlugIn.snap-to_boundary = Snap edge ends to polygon boundary
 SkeletonPlugIn.snap-to_boundary-tooltip = Snap edge ends to polygon boundary
 SkeletonPlugIn.display-voronoi-edges = Display a layer with initial voronoi 
edges

Modified: 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_cz.properties
===================================================================
--- 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_cz.properties
     2018-06-11 20:04:16 UTC (rev 5875)
+++ 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_cz.properties
     2018-06-12 06:25:45 UTC (rev 5876)
@@ -124,16 +124,10 @@
 SkeletonPlugIn.auto-width-parameter-tooltip = #T: Computes automatically a 
minimum width for each feature
 SkeletonPlugIn.min-width = #T: Minimum width
 SkeletonPlugIn.min-width-tooltip = #T: Boundary is densified according to this 
parameter
-SkeletonPlugIn.buffer-thiner-than = Buffer polygons thiner than
-SkeletonPlugIn.buffer-thiner-than-tooltip = Buffer the polygon to avoid 
over-densification
-
 SkeletonPlugIn.min-fork-length = #T: Minimum length of forks
 SkeletonPlugIn.min-fork-length-tooltip = #T: Minimum length of forks
 SkeletonPlugIn.min-fork-length-from-mean-width = #T: ...relative to mean width
 SkeletonPlugIn.min-fork-length-from-mean-width-tooltip = #T: Minimum length of 
forks is a multiplicative factor relative to mean feature width
-SkeletonPlugIn.min-fork-length-in-map-units = #T: ...in map units
-SkeletonPlugIn.min-fork-length-in-map-units-tooltip = #T: Minimum length of 
forks is in map units
-
 SkeletonPlugIn.snap-to_boundary = #T: Snap edge ends to polygon boundary
 SkeletonPlugIn.snap-to_boundary-tooltip = #T: Snap edge ends to polygon 
boundary
 SkeletonPlugIn.display-voronoi-edges = #T: Display a layer with initial 
voronoi edges

Modified: 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_fi.properties
===================================================================
--- 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_fi.properties
     2018-06-11 20:04:16 UTC (rev 5875)
+++ 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_fi.properties
     2018-06-12 06:25:45 UTC (rev 5876)
@@ -118,16 +118,10 @@
 SkeletonPlugIn.auto-width-parameter-tooltip = Laskee automaattisesti 
minimileveyden jokaiselle kohteelle
 SkeletonPlugIn.min-width = Minimileveys
 SkeletonPlugIn.min-width-tooltip = Reunaviiva tihennet\u00E4\u00E4n 
t\u00E4m\u00E4n parametrin perusteella
-SkeletonPlugIn.buffer-thiner-than = Buffer polygons thiner than
-SkeletonPlugIn.buffer-thiner-than-tooltip = Buffer the polygon to avoid 
over-densification
-
 SkeletonPlugIn.min-fork-length = Haarojen minimipituus
 SkeletonPlugIn.min-fork-length-tooltip = Haarojen minimipituus
 SkeletonPlugIn.min-fork-length-from-mean-width = ...suhteessa keskileveyteen
 SkeletonPlugIn.min-fork-length-from-mean-width-tooltip = Haaran minimipituus 
on arvo, jolla kerrotaan kohteen keskileveys
-SkeletonPlugIn.min-fork-length-in-map-units = ..kartan 
mittayksik\u00F6iss\u00E4
-SkeletonPlugIn.min-fork-length-in-map-units-tooltip = Haarojen minimipituus 
kartan mittayksik\u00F6iss\u00E4
-
 SkeletonPlugIn.snap-to_boundary = Kiinnit\u00E4 loppupisteet polygonin 
reunaviivaan
 SkeletonPlugIn.snap-to_boundary-tooltip = Kiinnit\u00E4 loppupisteet polygonin 
reunaviivaan
 SkeletonPlugIn.display-voronoi-edges = N\u00E4yt\u00E4 taso, jolla on 
l\u00E4ht\u00F6tilanteen Voronoi-s\u00E4rm\u00E4t

Modified: 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_fr.properties
===================================================================
--- 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_fr.properties
     2018-06-11 20:04:16 UTC (rev 5875)
+++ 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_fr.properties
     2018-06-12 06:25:45 UTC (rev 5876)
@@ -130,17 +130,11 @@
 SkeletonPlugIn.auto-width-parameter = Largeur minimale automatique
 SkeletonPlugIn.auto-width-parameter-tooltip = Calcul automatiquement une 
largeur minimale adapt\xE9e \xE0 chaque objet
 SkeletonPlugIn.min-width = Largeur minimale
-SkeletonPlugIn.min-width-tooltip = La fronti\xE8re est densifi\xE9e en 
fonction de se param\xE8tre
-SkeletonPlugIn.buffer-thiner-than = Elargir les polygones trop fins
-SkeletonPlugIn.buffer-thiner-than-tooltip = Elargir le polygone pour \xE9viter 
une densification trop importante
-
+SkeletonPlugIn.min-width-tooltip = La fronti\xE8re est densifi\xE9e en 
fonction de ce param\xE8tre
 SkeletonPlugIn.min-fork-length = Longueur minimale des embranchements
 SkeletonPlugIn.min-fork-length-tooltip = Longueur minimale des embranchements
 SkeletonPlugIn.min-fork-length-from-mean-width = ...relativement \xE0 la 
largeur moyenne
 SkeletonPlugIn.min-fork-length-from-mean-width-tooltip = La longueur minimale 
des embranchements est relative au param\xE8tre de largeur moyenne
-SkeletonPlugIn.min-fork-length-in-map-units = ...en unit\xE9s de la carte
-SkeletonPlugIn.min-fork-length-in-map-units-tooltip = La longueur minimale des 
embranchements est relative \xE0 l'unit\xE9 de la carte
-
 SkeletonPlugIn.snap-to_boundary = Prolonger les extr\xE9mit\xE9s jusqu'au bord
 SkeletonPlugIn.snap-to_boundary-tooltip = Prolonge les extr\xE9mit\xE9s 
jusqu'au bord de la surface
 SkeletonPlugIn.display-voronoi-edges = Cr\xE9er une couche avec les ar\xEAtes 
de Voronoi initiale

Modified: 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_it.properties
===================================================================
--- 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_it.properties
     2018-06-11 20:04:16 UTC (rev 5875)
+++ 
plug-ins/GraphToolboxPlugin/trunk/src/fr/michaelm/jump/plugin/graph/graph_it.properties
     2018-06-12 06:25:45 UTC (rev 5876)
@@ -116,16 +116,10 @@
 SkeletonPlugIn.auto-width-parameter-tooltip = #T: Computes automatically a 
minimum width for each feature
 SkeletonPlugIn.min-width = #T: Minimum width
 SkeletonPlugIn.min-width-tooltip = #T: Boundary is densified according to this 
parameter
-SkeletonPlugIn.buffer-thiner-than = Buffer polygons thiner than
-SkeletonPlugIn.buffer-thiner-than-tooltip = Buffer the polygon to avoid 
over-densification
-
 SkeletonPlugIn.min-fork-length = #T: Minimum length of forks
 SkeletonPlugIn.min-fork-length-tooltip = #T: Minimum length of forks
 SkeletonPlugIn.min-fork-length-from-mean-width = #T: ...relative to mean width
 SkeletonPlugIn.min-fork-length-from-mean-width-tooltip = #T: Minimum length of 
forks is a multiplicative factor relative to mean feature width
-SkeletonPlugIn.min-fork-length-in-map-units = #T: ...in map units
-SkeletonPlugIn.min-fork-length-in-map-units-tooltip = #T: Minimum length of 
forks is in map units
-
 SkeletonPlugIn.snap-to_boundary = #T: Snap edge ends to polygon boundary
 SkeletonPlugIn.snap-to_boundary-tooltip = #T: Snap edge ends to polygon 
boundary
 SkeletonPlugIn.display-voronoi-edges = #T: Display a layer with initial 
voronoi edges


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to