private static bool ReshapeSinglePolygonInUnion(ReshapeInfo reshapeInfo) { bool reshaped; if (reshapeInfo.CutReshapePath != null) { if (reshapeInfo.CutReshapePath.Path.Length > 0) { // reshape the known polygon part with the known cut reshape path reshaped = ReshapeUtils.ReshapePolygonOrMultipatch(reshapeInfo); } else { _msg.DebugFormat( "No need to reshape geometry with 0-length reshape path at {0} | {1}", reshapeInfo.CutReshapePath.Path.FromPoint.X, reshapeInfo.CutReshapePath.Path.FromPoint.Y); reshaped = false; } } else { Assert.NotNull(reshapeInfo.ReshapePath, "Reshape path and cut reshape path are undefined"); // try reshape if possible (typically for union-reshapes to the inside) var requiredPartIndexToReshape = (int)Assert.NotNull(reshapeInfo.PartIndexToReshape); IList <int> currentlyReshapableParts; reshapeInfo.IdentifyUniquePartIndexToReshape(out currentlyReshapableParts); if (currentlyReshapableParts.Contains(requiredPartIndexToReshape)) { // reset to make sure no other parts are reshaped here: reshapeInfo.PartIndexToReshape = requiredPartIndexToReshape; reshaped = ReshapeUtils.ReshapeGeometryPart(reshapeInfo.GeometryToReshape, reshapeInfo); } else { reshaped = false; } } return(reshaped); }