internal static int PolygonText(com.epl.geometry.AttributeStreamOfDbl zs, com.epl.geometry.AttributeStreamOfDbl ms, com.epl.geometry.AttributeStreamOfDbl position, com.epl.geometry.AttributeStreamOfInt32 paths, com.epl.geometry.AttributeStreamOfInt8 path_flags, int total_point_count , com.epl.geometry.WktParser wkt_parser) { // At start of PolygonText int current_token = wkt_parser.CurrentToken(); if (current_token == com.epl.geometry.WktParser.WktToken.empty) { return(total_point_count); } bool b_first_line_string = true; current_token = wkt_parser.NextToken(); while (current_token != com.epl.geometry.WktParser.WktToken.right_paren) { // At start of LineStringText int point_count = LineStringText(true, zs, ms, position, paths, path_flags, wkt_parser); if (point_count != 0) { if (b_first_line_string) { b_first_line_string = false; path_flags.SetBits(path_flags.Size() - 2, unchecked ((byte)com.epl.geometry.PathFlags.enumOGCStartPolygon)); } path_flags.SetBits(path_flags.Size() - 2, unchecked ((byte)com.epl.geometry.PathFlags.enumClosed)); total_point_count += point_count; } current_token = wkt_parser.NextToken(); } return(total_point_count); }
/// <exception cref="java.io.ObjectStreamException"/> internal object ReadResolve() { com.epl.geometry.Geometry geometry = null; try { geometry = com.epl.geometry.GeometryEngine.GeometryFromEsriShape(geometryData.esriShape, geometryData.geometryType); if (com.epl.geometry.Geometry.IsMultiVertex(geometry.GetType().Value())) { com.epl.geometry.GeometrySerializer.MultiVertexData mvd = (com.epl.geometry.GeometrySerializer.MultiVertexData)geometryData; com.epl.geometry.MultiVertexGeometryImpl mvImpl = (com.epl.geometry.MultiVertexGeometryImpl)geometry._getImpl(); if (!geometry.IsEmpty() && com.epl.geometry.Geometry.IsMultiPath(geometry.GetType().Value())) { com.epl.geometry.GeometrySerializer.MultiPathData mpd = (com.epl.geometry.GeometrySerializer.MultiPathData)geometryData; com.epl.geometry.MultiPathImpl mpImpl = (com.epl.geometry.MultiPathImpl)geometry._getImpl(); com.epl.geometry.AttributeStreamOfInt8 pathFlags = mpImpl.GetPathFlagsStreamRef(); for (int i = 0, n = mpImpl.GetPathCount(); i < n; i++) { if (mpd.ogcFlags[i]) { pathFlags.SetBits(i, unchecked ((byte)com.epl.geometry.PathFlags.enumOGCStartPolygon)); } } } mvImpl.SetIsSimple(mvd.simpleFlag, mvd.tolerance, false); } } catch (System.Exception) { throw new System.IO.InvalidDataException("Cannot read geometry from stream"); } return(geometry); }