Пример #1
0
        public void Draw(IDisplay display, IGeometry geometry)
        {
            var gp = DisplayOperations.Geometry2GraphicsPath(display, geometry);

            if (gp != null)
            {
                this.FillPath(display, gp);

                SimpleFillSymbol.DrawOutlineSymbol(display, _outlineSymbol, geometry, gp);
                gp.Dispose(); gp = null;
            }
        }
Пример #2
0
        public void Draw(IDisplay display, IGeometry geometry)
        {
            Polygon p = new Polygon();

            p.AddRing(display.Envelope.ToPolygon(0)[0]);

            if (geometry is IPolygon)
            {
                for (int i = 0; i < ((IPolygon)geometry).RingCount; i++)
                {
                    var ring = ((IPolygon)geometry)[i];
                    if (SpatialAlgorithms.Algorithm.Intersects(display.Envelope, new Polygon(ring)))
                    {
                        p.AddRing(ring);
                    }
                }
            }
            else if (geometry is IAggregateGeometry)
            {
                for (int g = 0; g < ((IAggregateGeometry)geometry).GeometryCount; g++)
                {
                    if (((IAggregateGeometry)geometry)[g] is IPolygon)
                    {
                        IPolygon poly = (IPolygon)((IAggregateGeometry)geometry)[g];
                        for (int i = 0; i < poly.RingCount; i++)
                        {
                            var ring = poly[i];
                            if (SpatialAlgorithms.Algorithm.Intersects(display.Envelope, new Polygon(ring)))
                            {
                                p.AddRing(ring);
                            }
                        }
                    }
                    else
                    {
                        return;
                    }
                }
            }

            var gp = DisplayOperations.Geometry2GraphicsPath(display, p);

            if (gp != null)
            {
                this.FillPath(display, gp);
                gp.Dispose(); gp = null;
            }
        }
Пример #3
0
        public void Draw(IDisplay display, IGeometry geometry)
        {
            // Wenn DashStyle nicht Solid (und Antialiasing) soll Geometry erst geclippt werden,
            // da es sonst zu extrem Zeitaufwendigen Graphikopertation kommt...

            if (this.DashStyle != LineDashStyle.Solid &&
                this.Smoothingmode != SymbolSmoothing.None)
            {
                IEnvelope dispEnvelope =
                    display.DisplayTransformation != null ?
                    new Envelope(display.DisplayTransformation.TransformedBounds(display)) :
                    new Envelope(display.Envelope);

                //dispEnvelope.Raise(75);
                geometry = gView.Framework.SpatialAlgorithms.Clip.PerformClip(dispEnvelope, geometry);
                if (geometry == null)
                {
                    return;
                }

                //GraphicsPath gp2 = DisplayOperations.Geometry2GraphicsPath(display, dispEnvelope);
                //if (gp2 != null)
                //{
                //    this.DrawPath(display, gp2);
                //    gp2.Dispose(); gp2 = null;
                //}
            }

            var gp = DisplayOperations.Geometry2GraphicsPath(display, geometry);

            if (gp != null)
            {
                //if (this.LineStartCap == LineCap.ArrowAnchor ||
                //    this.LineEndCap == LineCap.ArrowAnchor)
                //{
                //    //
                //    // bei LineCap Arrow (Pfeil...) kann es bei sehr kurzen Linen
                //    // zu einer Out of Memory Exception kommen...
                //    //
                //    try
                //    {
                //        this.DrawPath(display, gp);
                //    }
                //    catch
                //    {
                //        LineCap sCap = this.LineStartCap;
                //        LineCap eCap = this.LineEndCap;
                //        this.LineStartCap = (sCap == LineCap.ArrowAnchor) ? LineCap.Triangle : sCap;
                //        this.LineEndCap = (eCap == LineCap.ArrowAnchor) ? LineCap.Triangle : eCap;

                //        this.DrawPath(display, gp);

                //        this.LineStartCap = sCap;
                //        this.LineEndCap = eCap;
                //    }
                //}
                //else
                {
                    this.DrawPath(display, gp);
                }
                gp.Dispose(); gp = null;
            }
        }