Example #1
0
 /// <exception cref="java.io.ObjectStreamException"/>
 public virtual void SetGeometryByValue(com.epl.geometry.Geometry geometry)
 {
     try
     {
         esriShape    = com.epl.geometry.GeometryEngine.GeometryToEsriShape(geometry);
         geometryType = geometry.GetType().Value();
         if (com.epl.geometry.Geometry.IsMultiVertex(geometryType))
         {
             com.epl.geometry.MultiVertexGeometryImpl mvImpl = (com.epl.geometry.MultiVertexGeometryImpl)geometry._getImpl();
             tolerance  = mvImpl.m_simpleTolerance;
             simpleFlag = mvImpl.GetIsSimple(0);
             if (!geometry.IsEmpty() && com.epl.geometry.Geometry.IsMultiPath(geometryType))
             {
                 com.epl.geometry.MultiPathImpl mpImpl = (com.epl.geometry.MultiPathImpl)geometry._getImpl();
                 ogcFlags = new bool[mpImpl.GetPathCount()];
                 com.epl.geometry.AttributeStreamOfInt8 pathFlags = mpImpl.GetPathFlagsStreamRef();
                 for (int i = 0, n = mpImpl.GetPathCount(); i < n; i++)
                 {
                     ogcFlags[i] = (pathFlags.Read(i) & unchecked ((byte)com.epl.geometry.PathFlags.enumOGCStartPolygon)) != 0;
                 }
             }
         }
     }
     catch (System.Exception)
     {
         throw new System.IO.InvalidDataException("Cannot serialize this geometry");
     }
 }