public Present Evaluate(Present[] paramList) { MapRectangle mapRectangle = null; int i = 0; while (i < paramList.Length) { Present present = paramList[i]; Present result; if (present is PresentFailureCode) { result = new PresentFailureCode((PresentFailureCode)present, "CompositeBoundsVerb"); } else { if (present is BoundsPresent) { ((BoundsPresent)present).GetRenderRegion().AccumulateBoundingBox(ref mapRectangle); i++; continue; } result = new PresentFailureCode(new Exception("Unexpected result of child computation in CompositeBoundsVerb")); } return result; } if (mapRectangle == null) { return new PresentFailureCode("No valid sourcemaps in input."); } RenderRegion renderRegion = new RenderRegion(mapRectangle, new DirtyEvent()); return new BoundsPresent(renderRegion); }
public Present Evaluate(Present[] paramList) { MapRectangle mapRectangle = null; int i = 0; while (i < paramList.Length) { Present present = paramList[i]; Present result; if (present is PresentFailureCode) { result = new PresentFailureCode((PresentFailureCode)present, "CompositeBoundsVerb"); } else { if (present is BoundsPresent) { ((BoundsPresent)present).GetRenderRegion().AccumulateBoundingBox(ref mapRectangle); i++; continue; } result = new PresentFailureCode(new Exception("Unexpected result of child computation in CompositeBoundsVerb")); } return(result); } if (mapRectangle == null) { return(new PresentFailureCode("No valid sourcemaps in input.")); } RenderRegion renderRegion = new RenderRegion(mapRectangle, new DirtyEvent()); return(new BoundsPresent(renderRegion)); }
public UserBoundsRefVerb(LatentRegionHolder latentRegionHolder, IFuture delayedStaticBoundsFuture) { RenderRegion renderRegion = latentRegionHolder.renderRegion; if (renderRegion == null) { this.userRegion = null; } else { this.userRegion = renderRegion.Copy(new DirtyEvent()); } this.delayedStaticBoundsFuture = delayedStaticBoundsFuture; }
public Present Evaluate(Present[] paramList) { D.Assert(paramList.Length == 1); IBoundsProvider boundsProvider = (IBoundsProvider)paramList[0]; RenderRegion renderRegion = boundsProvider.GetRenderRegion(); IPointTransformer robustPointTransform = this.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); }
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); }
public BoundsPresent(RenderRegion renderRegion) { this._renderRegion = renderRegion; }
public BoundsPresent(RenderRegion renderRegion) { _renderRegion = renderRegion; }