public static IList MergeRoad(IList roads, GORoadFeature r) { if (r.convertedGeometry == null || r.convertedGeometry.Count == 0) { return(roads); } r.startingPoint = r.convertedGeometry [0]; r.endingPoint = r.convertedGeometry [r.convertedGeometry.Count - 1]; List <GORoadFeature> m = r.FindRoadsMatching(roads); if (m.Count == 0) { r.preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(r); roads.Add(r); return(roads); } List <GORoadFeature> toRemove = r.Merge(m); // roadsCasted = roadsCasted.Except (toRemove).ToList(); // // r.preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData (r); // roads.Add (r); return(roads); }
private void AddFatureToList(GOFeature f, IList list) { f.preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(f); if (f.goFeatureType == GOFeatureType.Point || f.goFeatureType == GOFeatureType.Label || f.preloadedMeshData != null) { list.Add(f); } }
private void AddFatureToList(GOFeature f, IList list) { // if (f.GetType () == typeof(GORoadFeature)) { // // GORoadFeature rf = (GORoadFeature)f; // GORoadFeature.MergeRoad (list, rf); // // } else { f.preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(f); if (f.goFeatureType == GOFeatureType.Point || f.preloadedMeshData != null) { list.Add(f); } // } }
public List <GORoadFeature> Merge(IList roads) { List <GORoadFeature> merged = new List <GORoadFeature>(); for (int i = 0; i < roads.Count; i++) { GORoadFeature r = (GORoadFeature)roads [i]; if (r.startingPoint.Equals(endingPoint)) { endingPoint = r.endingPoint; r.convertedGeometry.RemoveAt(0); convertedGeometry.AddRange(r.convertedGeometry); r.preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(r); preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(this); merged.Add(r); } else if (r.endingPoint.Equals(startingPoint)) { startingPoint = r.startingPoint; convertedGeometry.RemoveAt(0); r.convertedGeometry.AddRange(convertedGeometry); convertedGeometry = r.convertedGeometry; r.preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(r); preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(this); merged.Add(r); } else if (r.startingPoint.Equals(startingPoint)) { startingPoint = r.endingPoint; r.convertedGeometry.Reverse(); convertedGeometry.RemoveAt(0); r.convertedGeometry.AddRange(convertedGeometry); convertedGeometry = r.convertedGeometry; r.preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(r); preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(this); merged.Add(r); } else if (r.endingPoint.Equals(endingPoint)) { endingPoint = r.startingPoint; r.convertedGeometry.Reverse(); r.convertedGeometry.RemoveAt(0); convertedGeometry.AddRange(r.convertedGeometry); r.preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(r); preloadedMeshData = GOFeatureMeshBuilder.PreloadFeatureData(this); merged.Add(r); } if (name == "" && r.name != "") { name = r.name; } } return(merged); }