Exemplo n.º 1
0
        public Present Evaluate(Present[] paramList)
        {
            D.Assert(paramList.Length == 1);
            IBoundsProvider boundsProvider = (IBoundsProvider)paramList[0];
            RenderRegion renderRegion = boundsProvider.GetRenderRegion();
            IPointTransformer robustPointTransform = imageTransformer.getSourceToDestLatLonTransformer();
            double num = 0.05;
            List<LatLon> asLatLonList = renderRegion.GetAsLatLonList();
            List<LatLon> list = new List<LatLon>();
            for (int i = 0; i < asLatLonList.Count; i++)
            {
                int index = (i + 1) % asLatLonList.Count;
                LatLon source = asLatLonList[i];
                LatLon dest = asLatLonList[index];
                ParametricLine parametricLine = new ParametricLine(source, dest);
                int numSteps = (int)Math.Max(1.0, parametricLine.Length() / num);
                List<LatLon> list2 = parametricLine.Interpolate(numSteps);
                list.AddRange(list2.ConvertAll<LatLon>((LatLon inp) => robustPointTransform.getTransformedPoint(inp)));
            }

            RenderRegion renderRegion2 = new RenderRegion(list, new DirtyEvent());
            return new BoundsPresent(renderRegion2);
        }
Exemplo n.º 2
0
 internal IPointTransformer GetSourceToDestLatLonTransformer()
 {
     return(imageTransformer.getSourceToDestLatLonTransformer());
 }