Beispiel #1
0
        private void TryDisplay(ContourLine[] cntLines, frmContourSettings.ContourItem[] items, bool isLabel, bool isFillColor, bool isNew, IRasterDataProvider dataProvider)
        {
            if (cntLines == null || cntLines.Length == 0)
            {
                return;
            }
            var v = cntLines.Where((cntLine) => { return(cntLine != null); });

            if (v == null || v.Count() == 0)
            {
                return;
            }
            ContourClass[] dstItems = ToContourClass(items);
            foreach (ContourLine cntLine in v)
            {
                for (int i = 0; i < dstItems.Length; i++)
                {
                    if (Math.Abs(dstItems[i].ContourValue - cntLine.ContourValue) < double.Epsilon)
                    {
                        cntLine.ClassIndex = i;
                        break;
                    }
                }
            }
            if (isNew)
            {
                string fname = dataProvider.fileName;
                dataProvider.Dispose();
                OpenFileFactory.Open(fname);
            }
            ICanvasViewer cv = _smartSession.SmartWindowManager.ActiveCanvasViewer;

            if (cv == null)
            {
                return;
            }
            IContourLayer lyr = new ContourLayer("等值线");

            lyr.Apply(v.ToArray(), dstItems, isLabel, isFillColor);
            cv.Canvas.LayerContainer.Layers.Add(lyr as GeoDo.RSS.Core.DrawEngine.ILayer);
            cv.Canvas.Refresh(Core.DrawEngine.enumRefreshType.All);
        }
        private void TryDisplay(ContourLine[] cntLines, frmPointContour.ContourItem[] items, bool isLabel)
        {
            if (cntLines == null || cntLines.Length == 0)
            {
                return;
            }
            var v = cntLines.Where((cntLine) => { return(cntLine != null); });

            if (v == null || v.Count() == 0)
            {
                return;
            }
            ContourClass[] dstItems = ToContourClass(items);
            foreach (ContourLine cntLine in v)
            {
                for (int i = 0; i < dstItems.Length; i++)
                {
                    if (Math.Abs(dstItems[i].ContourValue - cntLine.ContourValue) < double.Epsilon)
                    {
                        cntLine.ClassIndex = i;
                        break;
                    }
                }
            }
            ICanvasViewer cv = _smartSession.SmartWindowManager.ActiveCanvasViewer;

            if (cv == null)
            {
                return;
            }
            IContourLayer lyr = new ContourLayer("等值线");

            lyr.Apply(v.ToArray(), dstItems, isLabel, false);
            cv.Canvas.LayerContainer.Layers.Add(lyr as GeoDo.RSS.Core.DrawEngine.ILayer);
            cv.Canvas.Refresh(Core.DrawEngine.enumRefreshType.All);
        }