public static List <Entity> ToEntity(Geometry obj, Geometry denseObj, double defaultElevation, ObjectId blockDefId)
        {
            List <Entity> list = null;
            List <Entity> result;

            try
            {
                if (obj == null)
                {
                    result = null;
                }
                else
                {
                    PolygonN    polygonN    = obj as PolygonN;
                    PolylineN   polylineN   = obj as PolylineN;
                    PointN      pointN      = obj as PointN;
                    MultipointN multipointN = obj as MultipointN;
                    if (polygonN != null)
                    {
                        list = GIS2CAD.ToEntity(polygonN, denseObj as PolygonN, defaultElevation);
                    }
                    else if (polylineN != null)
                    {
                        list = GIS2CAD.ToEntity(polylineN, denseObj as PolylineN, defaultElevation);
                    }
                    else if (pointN != null)
                    {
                        list = GIS2CAD.ToEntity(pointN, defaultElevation, blockDefId);
                    }
                    else if (multipointN != null)
                    {
                        list = GIS2CAD.ToEntity(multipointN, defaultElevation);
                    }
                    else
                    {
                        DocUtil.ShowDebugMessage(AfaStrings.EncounteredUnknownObjectType);
                    }
                    if (list == null)
                    {
                        result = list;
                    }
                    else
                    {
                        result = list;
                    }
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
Exemple #2
0
 public AGSPolygon(PolygonN srcPoly)
 {
     if (srcPoly.RingArray != null)
     {
         this.Rings = new List <AGSRing>();
         Ring[] ringArray = srcPoly.RingArray;
         for (int i = 0; i < ringArray.Length; i++)
         {
             Ring srcRing = ringArray[i];
             this.Rings.Add(new AGSRing(srcRing));
         }
     }
 }
 static List<long> Prob061PolygonList(PolygonN algorithm)
 {
     List<long> rst = new List<long>();
     for (long n = 1; ; n++)
     {
         long pn = algorithm(n);
         if (1000 > pn) continue;
         if (9999 < pn) break;
         if ('0' == pn.ToString()[2]) continue;
         rst.Add(pn);
     }
     return rst;
 }
Exemple #4
0
        private static gView.Framework.Geometry.IPolygon ToPolygon(PolygonN polygon)
        {
            gView.Framework.Geometry.Polygon p = new gView.Framework.Geometry.Polygon();
            bool complex = false;

            if (polygon != null && polygon.RingArray != null)
            {
                foreach (Ring ring in polygon.RingArray)
                {
                    p.AddRing(ToRing(ring, ref complex));
                }
            }
            //p.IsComplex = complex;
            return(p);
        }
Exemple #5
0
        private static PolygonN ToPolygon(gView.Framework.Geometry.IPolygon polygon)
        {
            PolygonN poly = new PolygonN();

            if (polygon != null)
            {
                //polygon.VerifyHoles();
                List <Ring> rings = new List <Ring>();
                for (int i = 0; i < polygon.RingCount; i++)
                {
                    Ring ring = new Ring();
                    ring.PointArray = ToPointArray(polygon[i], true);
                    rings.Add(ring);
                }
                poly.RingArray = rings.ToArray();
            }
            return(poly);
        }
        private static List <Entity> ToEntity(PolygonN gisGeom, PolygonN densifiedGeometry, double defaultElevation)
        {
            List <Entity> list = new List <Entity>();
            int           num  = 0;

            Ring[] ringArray = gisGeom.RingArray;
            for (int i = 0; i < ringArray.Length; i++)
            {
                Ring    ring       = ringArray[i];
                Point[] pointArray = densifiedGeometry.RingArray[num].PointArray;
                num++;
                Entity entity = GIS2CAD.DrawPart(ring.SegmentArray, ring.PointArray, pointArray, true, gisGeom.HasZ, defaultElevation);
                if (entity != null)
                {
                    list.Add(entity);
                }
            }
            if (list.Count > 0)
            {
                return(list);
            }
            return(null);
        }