コード例 #1
0
        public IFuture GetImageBounds(FutureFeatures features)
        {
            IFuture future = GetAccessFuture(AccessMethod.FetchBounds, FutureFeatures.Cached, new IFuture[0]);

            future = new MemCacheFuture(cachePackage.boundsCache, future);
            return(AddAsynchrony(future, features));
        }
コード例 #2
0
		public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
		{
			if (parameterType == null)
			{
				parameterType = new ImageParameterFromTileAddress(this.GetDefaultCoordinateSystem());
			}
			FutureFeatures futureFeatures = FutureFeatures.Raw;
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Transparency))
			{
				futureFeatures |= FutureFeatures.Transparency;
			}
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
			{
				futureFeatures |= FutureFeatures.MemoryCached;
			}
			IFuturePrototype futurePrototype = new ApplyPrototype(new WarpImageVerb(this.imageTransformer, this.GetImageBounds(FutureFeatures.Cached), this.unwarpedMapTileSource.GetImagePrototype(new ImageParameterFromRawBounds(WarpedMapTileSource.sourceImageOversampleSize), futureFeatures)), new IFuturePrototype[]
			{
				parameterType.GetBoundsParameter(),
				parameterType.GetSizeParameter()
			});
			if (parameterType is ImageParameterFromTileAddress)
			{
				futurePrototype = new ApplyPrototype(new FadeVerb(this.unwarpedMapTileSource.GetTransparencyOptions().GetFadeOptions()), new IFuturePrototype[]
				{
					futurePrototype,
					new UnevaluatedTerm(TermName.TileAddress)
				});
			}
			else
			{
				D.Say(2, "Warning: Ignoring fade options because I don't have a tile address.");
			}
			futurePrototype = this.unwarpedMapTileSource.AddCaching(futurePrototype, features);
			return this.unwarpedMapTileSource.AddAsynchrony(futurePrototype, features);
		}
コード例 #3
0
 internal IFuture AddAsynchrony(IFuture future, FutureFeatures features)
 {
     if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async))
     {
         future = new MemCacheFuture(this.cachePackage.asyncCache, new OpenDocumentSensitivePrioritizedFuture(this.cachePackage.openDocumentPrioritizer, Asynchronizer.MakeFuture(this.cachePackage.computeAsyncScheduler, future), this.GetOpenDocumentFuture(FutureFeatures.MemoryCached)));
     }
     return(future);
 }
コード例 #4
0
		private IFuturePrototype GetAccessPrototype(AccessMethod accessMethod, FutureFeatures openDocFeatures, params IFuturePrototype[] methodParams)
		{
			IFuturePrototype[] array = new IFuturePrototype[2 + methodParams.Length];
			array[0] = this.GetOpenDocumentFuture(openDocFeatures);
			array[1] = new ConstantFuture(new IntParameter((int)accessMethod));
			Array.Copy(methodParams, 0, array, 2, methodParams.Length);
			return new ApplyPrototype(new ApplyVerbPresent(), array);
		}
コード例 #5
0
		public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
		{
			if (latentRegionHolder == null)
			{
				latentRegionHolder = this.replacementLatentRegionHolder;
			}
			return this.underSource.GetUserBounds(latentRegionHolder, features);
		}
コード例 #6
0
        public IFuture GetImageBounds(FutureFeatures features)
        {
            IFuture future = new ApplyFuture(new WarpBoundsVerb(imageTransformer),
                                             new[] { unwarpedMapTileSource.GetImageBounds(features) });

            future = new MemCacheFuture(cachePackage.boundsCache, future);
            return(unwarpedMapTileSource.AddAsynchrony(future, features));
        }
コード例 #7
0
 private IFuturePrototype GetAccessPrototype(AccessMethod accessMethod, FutureFeatures openDocFeatures, params IFuturePrototype[] methodParams)
 {
     IFuturePrototype[] array = new IFuturePrototype[2 + methodParams.Length];
     array[0] = this.GetOpenDocumentFuture(openDocFeatures);
     array[1] = new ConstantFuture(new IntParameter((int)accessMethod));
     Array.Copy(methodParams, 0, array, 2, methodParams.Length);
     return(new ApplyPrototype(new ApplyVerbPresent(), array));
 }
コード例 #8
0
        public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
        {
            IFuture future = new ApplyFuture(new WarpBoundsVerb(imageTransformer),
                                             new[] { unwarpedMapTileSource.GetUserBounds(latentRegionHolder, FutureFeatures.Cached) });

            future = new MemCacheFuture(cachePackage.boundsCache, future);
            return(unwarpedMapTileSource.AddAsynchrony(future, features));
        }
コード例 #9
0
 public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
 {
     if (latentRegionHolder == null)
     {
         latentRegionHolder = this.replacementLatentRegionHolder;
     }
     return(this.underSource.GetUserBounds(latentRegionHolder, features));
 }
コード例 #10
0
		public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
		{
			IFuture future = new ApplyFuture(new WarpBoundsVerb(this.imageTransformer), new IFuture[]
			{
				this.unwarpedMapTileSource.GetUserBounds(latentRegionHolder, FutureFeatures.Cached)
			});
			future = new MemCacheFuture(this.cachePackage.boundsCache, future);
			return this.unwarpedMapTileSource.AddAsynchrony(future, features);
		}
コード例 #11
0
ファイル: RenderedTileSource.cs プロジェクト: mikhp/greatmaps
		public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
		{
			D.Assert(parameterType == null);
			IFuturePrototype prototype = new ApplyPrototype(new RenderedTileFetch(this.namingScheme), new IFuturePrototype[]
			{
				new UnevaluatedTerm(TermName.TileAddress)
			});
			return VETileSource.AddFeatures(prototype, features & (FutureFeatures)(-3), this.cachePackage);
		}
コード例 #12
0
 internal IFuturePrototype AddAsynchrony(IFuturePrototype prototype, FutureFeatures features)
 {
     if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async))
     {
         D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached), "should always cache async stuff, I think.");
         prototype = new MemCachePrototype(this.cachePackage.asyncCache, new OpenDocumentSensitivePrioritizedPrototype(this.cachePackage.openDocumentPrioritizer, new Asynchronizer(this.cachePackage.computeAsyncScheduler, prototype), this.GetOpenDocumentFuture(FutureFeatures.MemoryCached)));
     }
     return(prototype);
 }
コード例 #13
0
		public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
		{
			if (this.cachedImageRequest == null || this.lastImageRequest_parameterType != parameterType || this.lastImageRequest_features != features)
			{
				this.lastImageRequest_parameterType = parameterType;
				this.lastImageRequest_features = features;
				this.cachedImageRequest = this.backingSource.GetImagePrototype(parameterType, features);
			}
			return this.cachedImageRequest;
		}
コード例 #14
0
 public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
 {
     if (this.cachedImageRequest == null || this.lastImageRequest_parameterType != parameterType || this.lastImageRequest_features != features)
     {
         this.lastImageRequest_parameterType = parameterType;
         this.lastImageRequest_features      = features;
         this.cachedImageRequest             = this.backingSource.GetImagePrototype(parameterType, features);
     }
     return(this.cachedImageRequest);
 }
コード例 #15
0
		public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
		{
			if (this.cachedUserBounds == null || this.lastUserBoundsRequest_latentRegionHolder != latentRegionHolder || this.lastUserBoundsRequest_features != features)
			{
				this.lastUserBoundsRequest_latentRegionHolder = latentRegionHolder;
				this.lastUserBoundsRequest_features = features;
				this.cachedUserBounds = this.backingSource.GetUserBounds(latentRegionHolder, features);
			}
			return this.cachedUserBounds;
		}
コード例 #16
0
ファイル: VETileSource.cs プロジェクト: mikhp/greatmaps
		public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
		{
			D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Cached));
			IFuture future = new MemCacheFuture(this.cachePackage.boundsCache, new ApplyFuture(new ConstantVerb(new BoundsPresent(new RenderRegion(new MapRectangle(-85.0, -5000.0, 85.0, 5000.0), new DirtyEvent()))), new IFuture[0]));
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async))
			{
				future = new MemCacheFuture(this.cachePackage.asyncCache, Asynchronizer.MakeFuture(this.cachePackage.networkAsyncScheduler, future));
			}
			return future;
		}
コード例 #17
0
 public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
 {
     D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async));
     return(new MemCacheFuture(cachePackage.asyncCache,
                               Asynchronizer.MakeFuture(cachePackage.computeAsyncScheduler,
                                                        new MemCacheFuture(cachePackage.boundsCache,
                                                                           new ApplyFuture(new ConstantVerb(new BoundsPresent(
                                                                                                                new RenderRegion(new MapRectangle(-85.0, -5000.0, 85.0, 5000.0), new DirtyEvent()))),
                                                                                           new IFuture[0])))));
 }
コード例 #18
0
 public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
 {
     if (this.cachedUserBounds == null || this.lastUserBoundsRequest_latentRegionHolder != latentRegionHolder || this.lastUserBoundsRequest_features != features)
     {
         this.lastUserBoundsRequest_latentRegionHolder = latentRegionHolder;
         this.lastUserBoundsRequest_features           = features;
         this.cachedUserBounds = this.backingSource.GetUserBounds(latentRegionHolder, features);
     }
     return(this.cachedUserBounds);
 }
コード例 #19
0
		public IFuture GetOpenDocumentFuture(FutureFeatures features)
		{
			IFuture future = new FetchDocumentFuture(this.localDocumentFuture);
			D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached));
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
			{
				future = new MemCacheFuture(this.cachePackage.openSourceDocumentCache, future);
			}
			D.Assert(!UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async));
			return future;
		}
コード例 #20
0
		public IFuturePrototype GetImageDetailPrototype(FutureFeatures features)
		{
			IFuturePrototype prototype = this.GetAccessPrototype(AccessMethod.ImageDetail, FutureFeatures.Cached, new IFuturePrototype[]
			{
				new UnevaluatedTerm(TermName.ImageDetail)
			});
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
			{
				prototype = new MemCachePrototype(this.cachePackage.computeCache, prototype);
			}
			return this.AddAsynchrony(prototype, features);
		}
コード例 #21
0
        public IFuture GetOpenDocumentFuture(FutureFeatures features)
        {
            IFuture future = new FetchDocumentFuture(this.localDocumentFuture);

            D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached));
            if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
            {
                future = new MemCacheFuture(this.cachePackage.openSourceDocumentCache, future);
            }
            D.Assert(!UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async));
            return(future);
        }
コード例 #22
0
		public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
		{
			D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached));
			D.Assert(!UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Transparency));
			if (latentRegionHolder == null)
			{
				latentRegionHolder = this.sourceMap.latentRegionHolder;
			}
			latentRegionHolder.RequestRenderRegion(this.GetImageBounds((FutureFeatures)7));
			IFuture future = new MemCacheFuture(this.cachePackage.boundsCache, new ApplyFuture(new UserBoundsRefVerb(latentRegionHolder, this.GetImageBounds(FutureFeatures.Cached)), new IFuture[0]));
			return this.AddAsynchrony(future, features);
		}
コード例 #23
0
 internal IFuturePrototype AddCaching(IFuturePrototype prototype, FutureFeatures features)
 {
     if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.DiskCached))
     {
         prototype = new DiskCachePrototype(this.cachePackage.diskCache, prototype);
     }
     if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
     {
         prototype = new MemCachePrototype(this.cachePackage.computeCache, prototype);
     }
     return(prototype);
 }
コード例 #24
0
        public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
        {
            if (cachedUserBounds == null || lastUserBoundsRequest_latentRegionHolder != latentRegionHolder ||
                lastUserBoundsRequest_features != features)
            {
                lastUserBoundsRequest_latentRegionHolder = latentRegionHolder;
                lastUserBoundsRequest_features           = features;
                cachedUserBounds = backingSource.GetUserBounds(latentRegionHolder, features);
            }

            return(cachedUserBounds);
        }
コード例 #25
0
        public IFuturePrototype GetImageDetailPrototype(FutureFeatures features)
        {
            IFuturePrototype prototype = GetAccessPrototype(AccessMethod.ImageDetail,
                                                            FutureFeatures.Cached,
                                                            new IFuturePrototype[] { new UnevaluatedTerm(TermName.ImageDetail) });

            if (HasFeature(features, FutureFeatures.MemoryCached))
            {
                prototype = new MemCachePrototype(cachePackage.computeCache, prototype);
            }

            return(AddAsynchrony(prototype, features));
        }
コード例 #26
0
        public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
        {
            D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached));
            D.Assert(!UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Transparency));
            if (latentRegionHolder == null)
            {
                latentRegionHolder = this.sourceMap.latentRegionHolder;
            }
            latentRegionHolder.RequestRenderRegion(this.GetImageBounds((FutureFeatures)7));
            IFuture future = new MemCacheFuture(this.cachePackage.boundsCache, new ApplyFuture(new UserBoundsRefVerb(latentRegionHolder, this.GetImageBounds(FutureFeatures.Cached)), new IFuture[0]));

            return(this.AddAsynchrony(future, features));
        }
コード例 #27
0
        public IFuture GetOpenDocumentFuture(FutureFeatures features)
        {
            IFuture future = new FetchDocumentFuture(localDocumentFuture);

            D.Assert(HasFeature(features, FutureFeatures.MemoryCached));
            if (HasFeature(features, FutureFeatures.MemoryCached))
            {
                future = new MemCacheFuture(cachePackage.openSourceDocumentCache, future);
            }

            D.Assert(!HasFeature(features, FutureFeatures.Async));
            return(future);
        }
コード例 #28
0
ファイル: VETileSource.cs プロジェクト: mikhp/greatmaps
		public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
		{
			D.Assert(parameterType == null);
			IFuturePrototype futurePrototype = new ApplyPrototype(new VETileFetch(this.veStyle), new IFuturePrototype[]
			{
				new UnevaluatedTerm(TermName.TileAddress)
			});
			futurePrototype = VETileSource.AddFeatures(futurePrototype, FutureFeatures.Cached & features, this.cachePackage);
			IFuturePrototype prototype = new ApplyPrototype(new VETileUpsamplerVerb(futurePrototype), new IFuturePrototype[]
			{
				new UnevaluatedTerm(TermName.TileAddress)
			});
			return VETileSource.AddFeatures(prototype, features, this.cachePackage);
		}
コード例 #29
0
        internal IFuturePrototype AddCaching(IFuturePrototype prototype, FutureFeatures features)
        {
            if (HasFeature(features, FutureFeatures.DiskCached))
            {
                prototype = new DiskCachePrototype(cachePackage.diskCache, prototype);
            }

            if (HasFeature(features, FutureFeatures.MemoryCached))
            {
                prototype = new MemCachePrototype(cachePackage.computeCache, prototype);
            }

            return(prototype);
        }
コード例 #30
0
        public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
        {
            if (parameterType == null)
            {
                parameterType = new ImageParameterFromTileAddress(GetDefaultCoordinateSystem());
            }

            FutureFeatures   openDocFeatures = FutureFeatures.Cached;
            IFuturePrototype accessPrototype = GetAccessPrototype(AccessMethod.Render,
                                                                  openDocFeatures,
                                                                  new IFuturePrototype[]
            {
                new UnevaluatedTerm(TermName.ImageBounds), new UnevaluatedTerm(TermName.OutputSize),
                new UnevaluatedTerm(TermName.UseDocumentTransparency), new UnevaluatedTerm(TermName.ExactColors)
            });
            Verb             verb            = new SourceImageDownsamplerVerb(AddCaching(accessPrototype, FutureFeatures.Cached));
            IFuturePrototype futurePrototype = new ApplyPrototype(verb,
                                                                  new[]
            {
                parameterType.GetBoundsParameter(), parameterType.GetSizeParameter(),
                new ConstantFuture(
                    new BoolParameter(sourceMap.transparencyOptions.useDocumentTransparency)),
                new ConstantFuture(new BoolParameter(HasFeature(features, FutureFeatures.ExactColors)))
            });

            if (HasFeature(features, FutureFeatures.Transparency))
            {
                IFuturePrototype futurePrototype2 = new ApplyPrototype(verb,
                                                                       new[]
                {
                    parameterType.GetBoundsParameter(), parameterType.GetSizeParameter(),
                    new ConstantFuture(
                        new BoolParameter(sourceMap.transparencyOptions.useDocumentTransparency)),
                    new ConstantFuture(new BoolParameter(true))
                });
                if (HasFeature(features, FutureFeatures.MemoryCached))
                {
                    futurePrototype  = AddCaching(futurePrototype, FutureFeatures.MemoryCached);
                    futurePrototype2 = AddCaching(futurePrototype2, FutureFeatures.MemoryCached);
                }

                futurePrototype = new TransparencyPrototype(sourceMap.transparencyOptions,
                                                            futurePrototype,
                                                            futurePrototype2);
            }

            futurePrototype = AddCaching(futurePrototype, features);
            return(AddAsynchrony(futurePrototype, features));
        }
コード例 #31
0
		public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
		{
			List<IFuture> list = new List<IFuture>();
			foreach (SourceMap current in this.layer)
			{
				if (current.ReadyToLock())
				{
					LatentRegionHolder latentRegionHolder2 = new LatentRegionHolder(new DirtyEvent(), new DirtyEvent());
					list.Add(this.mapTileSourceFactory.CreateRenderableWarpedSource(current).GetUserBounds(latentRegionHolder2, features));
				}
			}
			IFuture future = new ApplyFuture(new CompositeBoundsVerb(), list.ToArray());
			D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached));
			return new MemCacheFuture(this.mapTileSourceFactory.GetCachePackage().boundsCache, future);
		}
コード例 #32
0
ファイル: VETileSource.cs プロジェクト: mikhp/greatmaps
		public static IFuturePrototype AddFeatures(IFuturePrototype prototype, FutureFeatures features, CachePackage cachePackage)
		{
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.DiskCached))
			{
				prototype = new DiskCachePrototype(cachePackage.diskCache, prototype);
			}
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Cached))
			{
				prototype = new MemCachePrototype(cachePackage.networkCache, prototype);
			}
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async))
			{
				prototype = new MemCachePrototype(cachePackage.asyncCache, new Asynchronizer(cachePackage.networkAsyncScheduler, prototype));
			}
			return prototype;
		}
コード例 #33
0
 public static IFuturePrototype AddFeatures(IFuturePrototype prototype, FutureFeatures features, CachePackage cachePackage)
 {
     if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.DiskCached))
     {
         prototype = new DiskCachePrototype(cachePackage.diskCache, prototype);
     }
     if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Cached))
     {
         prototype = new MemCachePrototype(cachePackage.networkCache, prototype);
     }
     if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async))
     {
         prototype = new MemCachePrototype(cachePackage.asyncCache, new Asynchronizer(cachePackage.networkAsyncScheduler, prototype));
     }
     return(prototype);
 }
コード例 #34
0
        public IFuture GetUserBounds(LatentRegionHolder latentRegionHolder, FutureFeatures features)
        {
            List <IFuture> list = new List <IFuture>();

            foreach (SourceMap current in this.layer)
            {
                if (current.ReadyToLock())
                {
                    LatentRegionHolder latentRegionHolder2 = new LatentRegionHolder(new DirtyEvent(), new DirtyEvent());
                    list.Add(this.mapTileSourceFactory.CreateRenderableWarpedSource(current).GetUserBounds(latentRegionHolder2, features));
                }
            }
            IFuture future = new ApplyFuture(new CompositeBoundsVerb(), list.ToArray());

            D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached));
            return(new MemCacheFuture(this.mapTileSourceFactory.GetCachePackage().boundsCache, future));
        }
コード例 #35
0
ファイル: Legend.cs プロジェクト: ymx0627/GMap.NET
        public IFuture GetRenderedLegendFuture(IDisplayableSource displayableSource, FutureFeatures features)
        {
            RenderRegion renderRegion = latentRegionHolder.renderRegion;

            if (renderRegion == null)
            {
                throw new RenderFailedException("Region unavailable");
            }

            renderRegion = renderRegion.Copy(new DirtyEvent());
            MapRectangleParameter mapRectangleParameter = new MapRectangleParameter(renderRegion.GetBoundingBox());
            Size             outputSize     = OutputSizeFromRenderRegion(renderRegion);
            IFuturePrototype imagePrototype =
                displayableSource.GetImagePrototype(new ImageParameterFromRawBounds(outputSize), features);

            return(imagePrototype.Curry(new ParamDict(new object[] { TermName.ImageBounds, mapRectangleParameter })));
        }
コード例 #36
0
        public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
        {
            if (parameterType == null)
            {
                parameterType = new ImageParameterFromTileAddress(GetDefaultCoordinateSystem());
            }

            FutureFeatures futureFeatures = FutureFeatures.Raw;

            if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Transparency))
            {
                futureFeatures |= FutureFeatures.Transparency;
            }

            if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
            {
                futureFeatures |= FutureFeatures.MemoryCached;
            }

            IFuturePrototype futurePrototype = new ApplyPrototype(
                new WarpImageVerb(imageTransformer,
                                  GetImageBounds(FutureFeatures.Cached),
                                  unwarpedMapTileSource.GetImagePrototype(
                                      new ImageParameterFromRawBounds(sourceImageOversampleSize),
                                      futureFeatures)),
                new[] { parameterType.GetBoundsParameter(), parameterType.GetSizeParameter() });

            if (parameterType is ImageParameterFromTileAddress)
            {
                futurePrototype =
                    new ApplyPrototype(
                        new FadeVerb(unwarpedMapTileSource.GetTransparencyOptions().GetFadeOptions()),
                        new[] { futurePrototype, new UnevaluatedTerm(TermName.TileAddress) });
            }
            else
            {
                D.Say(2, "Warning: Ignoring fade options because I don't have a tile address.");
            }

            futurePrototype = unwarpedMapTileSource.AddCaching(futurePrototype, features);
            return(unwarpedMapTileSource.AddAsynchrony(futurePrototype, features));
        }
コード例 #37
0
		public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
		{
			List<IFuturePrototype> list = new List<IFuturePrototype>();
			list.Add(parameterType.GetSizeParameter());
			foreach (SourceMap current in this.layer)
			{
				if (current.ReadyToLock())
				{
					IDisplayableSource displayableSource = this.mapTileSourceFactory.CreateDisplayableWarpedSource(current);
					list.Add(displayableSource.GetImagePrototype(parameterType, features));
				}
			}
			IFuturePrototype futurePrototype = new ApplyPrototype(new CompositeImageVerb(), list.ToArray());
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.DiskCached))
			{
				futurePrototype = new DiskCachePrototype(this.mapTileSourceFactory.GetCachePackage().diskCache, futurePrototype);
			}
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
			{
				futurePrototype = new MemCachePrototype(this.mapTileSourceFactory.GetCachePackage().computeCache, futurePrototype);
			}
			return futurePrototype;
		}
コード例 #38
0
        static Expression ParseAndBindExpr(string expText)
        {
            if (expText.IndexOf("::", StringComparison.Ordinal) > 0)
            {
                throw FutureFeatures.ExpressionNSSyntax();
            }

            bool skipBind = false;

            if (expText.StartsWith("::", StringComparison.Ordinal))
            {
                expText  = expText.Substring(2);
                skipBind = true;
            }

            Expression e = Expression.Parse(expText);

            if (!skipBind)
            {
                e = BindVariables(e);
            }
            return(e);
        }
コード例 #39
0
        public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
        {
            D.Assert(parameterType == null);
            IFuturePrototype futurePrototype = new ApplyPrototype(new VETileFetch(veStyle),
                                                                  new IFuturePrototype[] { new UnevaluatedTerm(TermName.TileAddress) });

            futurePrototype = AddFeatures(futurePrototype, FutureFeatures.Cached & features, cachePackage);
            IFuturePrototype prototype = new ApplyPrototype(new VETileUpsamplerVerb(futurePrototype),
                                                            new IFuturePrototype[] { new UnevaluatedTerm(TermName.TileAddress) });

            return(AddFeatures(prototype, features, cachePackage));
        }
コード例 #40
0
ファイル: Legend.cs プロジェクト: mikhp/greatmaps
		public IFuture GetRenderedLegendFuture(IDisplayableSource displayableSource, FutureFeatures features)
		{
			RenderRegion renderRegion = this.latentRegionHolder.renderRegion;
			if (renderRegion == null)
			{
				throw new Legend.RenderFailedException("Region unavailable");
			}
			renderRegion = renderRegion.Copy(new DirtyEvent());
			MapRectangleParameter mapRectangleParameter = new MapRectangleParameter(renderRegion.GetBoundingBox());
			Size outputSize = this.OutputSizeFromRenderRegion(renderRegion);
			IFuturePrototype imagePrototype = displayableSource.GetImagePrototype(new ImageParameterFromRawBounds(outputSize), features);
			return imagePrototype.Curry(new ParamDict(new object[]
			{
				TermName.ImageBounds,
				mapRectangleParameter
			}));
		}
コード例 #41
0
        public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
        {
            D.Assert(parameterType == null);
            IFuturePrototype prototype = new ApplyPrototype(new RenderedTileFetch(namingScheme),
                                                            new IFuturePrototype[] { new UnevaluatedTerm(TermName.TileAddress) });

            return(VETileSource.AddFeatures(prototype, features & (FutureFeatures)(-3), cachePackage));
        }
コード例 #42
0
		public IFuture GetOpenDocumentFuture(FutureFeatures features)
		{
			return this.unwarpedMapTileSource.GetOpenDocumentFuture(features);
		}
コード例 #43
0
 public IFuture GetOpenDocumentFuture(FutureFeatures features)
 {
     return(unwarpedMapTileSource.GetOpenDocumentFuture(features));
 }
コード例 #44
0
        public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
        {
            List <IFuturePrototype> list = new List <IFuturePrototype>();

            list.Add(parameterType.GetSizeParameter());
            foreach (SourceMap current in layer)
            {
                if (current.ReadyToLock())
                {
                    IDisplayableSource displayableSource =
                        mapTileSourceFactory.CreateDisplayableWarpedSource(current);
                    list.Add(displayableSource.GetImagePrototype(parameterType, features));
                }
            }

            IFuturePrototype futurePrototype = new ApplyPrototype(new CompositeImageVerb(), list.ToArray());

            if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.DiskCached))
            {
                futurePrototype = new DiskCachePrototype(mapTileSourceFactory.GetCachePackage().diskCache,
                                                         futurePrototype);
            }

            if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
            {
                futurePrototype = new MemCachePrototype(mapTileSourceFactory.GetCachePackage().computeCache,
                                                        futurePrototype);
            }

            return(futurePrototype);
        }
コード例 #45
0
		public IFuture GetImageBounds(FutureFeatures features)
		{
			IFuture future = new ApplyFuture(new WarpBoundsVerb(this.imageTransformer), new IFuture[]
			{
				this.unwarpedMapTileSource.GetImageBounds(features)
			});
			future = new MemCacheFuture(this.cachePackage.boundsCache, future);
			return this.unwarpedMapTileSource.AddAsynchrony(future, features);
		}
コード例 #46
0
		internal IFuture AddAsynchrony(IFuture future, FutureFeatures features)
		{
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async))
			{
				future = new MemCacheFuture(this.cachePackage.asyncCache, new OpenDocumentSensitivePrioritizedFuture(this.cachePackage.openDocumentPrioritizer, Asynchronizer.MakeFuture(this.cachePackage.computeAsyncScheduler, future), this.GetOpenDocumentFuture(FutureFeatures.MemoryCached)));
			}
			return future;
		}
コード例 #47
0
		public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
		{
			FutureFeatures features2 = features & (FutureFeatures)(-9);
			return this.underSource.GetImagePrototype(parameterType, features2);
		}
コード例 #48
0
		internal IFuturePrototype AddCaching(IFuturePrototype prototype, FutureFeatures features)
		{
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.DiskCached))
			{
				prototype = new DiskCachePrototype(this.cachePackage.diskCache, prototype);
			}
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
			{
				prototype = new MemCachePrototype(this.cachePackage.computeCache, prototype);
			}
			return prototype;
		}
コード例 #49
0
ファイル: VETileSource.cs プロジェクト: mikhp/greatmaps
		public IFuture GetOpenDocumentFuture(FutureFeatures features)
		{
			return new FakeOpenDocumentFuture();
		}
コード例 #50
0
		internal IFuturePrototype AddAsynchrony(IFuturePrototype prototype, FutureFeatures features)
		{
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Async))
			{
				D.Assert(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached), "should always cache async stuff, I think.");
				prototype = new MemCachePrototype(this.cachePackage.asyncCache, new OpenDocumentSensitivePrioritizedPrototype(this.cachePackage.openDocumentPrioritizer, new Asynchronizer(this.cachePackage.computeAsyncScheduler, prototype), this.GetOpenDocumentFuture(FutureFeatures.MemoryCached)));
			}
			return prototype;
		}
コード例 #51
0
		public IFuture GetImageBounds(FutureFeatures features)
		{
			IFuture future = this.GetAccessFuture(AccessMethod.FetchBounds, FutureFeatures.Cached, new IFuture[0]);
			future = new MemCacheFuture(this.cachePackage.boundsCache, future);
			return this.AddAsynchrony(future, features);
		}
コード例 #52
0
 public IFuture GetOpenDocumentFuture(FutureFeatures features)
 {
     return(new FakeOpenDocumentFuture());
 }
コード例 #53
0
ファイル: HxlLangElement.cs プロジェクト: Carbonfrost/f-hxl
 public override void Render()
 {
     throw FutureFeatures.InterpretedLanguageElements();
 }
コード例 #54
0
		public IFuturePrototype GetImagePrototype(ImageParameterTypeIfc parameterType, FutureFeatures features)
		{
			if (parameterType == null)
			{
				parameterType = new ImageParameterFromTileAddress(this.GetDefaultCoordinateSystem());
			}
			FutureFeatures openDocFeatures = FutureFeatures.Cached;
			IFuturePrototype accessPrototype = this.GetAccessPrototype(AccessMethod.Render, openDocFeatures, new IFuturePrototype[]
			{
				new UnevaluatedTerm(TermName.ImageBounds),
				new UnevaluatedTerm(TermName.OutputSize),
				new UnevaluatedTerm(TermName.UseDocumentTransparency),
				new UnevaluatedTerm(TermName.ExactColors)
			});
			Verb verb = new SourceImageDownsamplerVerb(this.AddCaching(accessPrototype, FutureFeatures.Cached));
			IFuturePrototype futurePrototype = new ApplyPrototype(verb, new IFuturePrototype[]
			{
				parameterType.GetBoundsParameter(),
				parameterType.GetSizeParameter(),
				new ConstantFuture(new BoolParameter(this.sourceMap.transparencyOptions.useDocumentTransparency)),
				new ConstantFuture(new BoolParameter(UnwarpedMapTileSource.HasFeature(features, FutureFeatures.ExactColors)))
			});
			if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.Transparency))
			{
				IFuturePrototype futurePrototype2 = new ApplyPrototype(verb, new IFuturePrototype[]
				{
					parameterType.GetBoundsParameter(),
					parameterType.GetSizeParameter(),
					new ConstantFuture(new BoolParameter(this.sourceMap.transparencyOptions.useDocumentTransparency)),
					new ConstantFuture(new BoolParameter(true))
				});
				if (UnwarpedMapTileSource.HasFeature(features, FutureFeatures.MemoryCached))
				{
					futurePrototype = this.AddCaching(futurePrototype, FutureFeatures.MemoryCached);
					futurePrototype2 = this.AddCaching(futurePrototype2, FutureFeatures.MemoryCached);
				}
				futurePrototype = new TransparencyPrototype(this.sourceMap.transparencyOptions, futurePrototype, futurePrototype2);
			}
			futurePrototype = this.AddCaching(futurePrototype, features);
			return this.AddAsynchrony(futurePrototype, features);
		}
コード例 #55
0
		public static bool HasFeature(FutureFeatures features, FutureFeatures query)
		{
			return (features & query) > FutureFeatures.Raw;
		}
コード例 #56
0
 public static bool HasFeature(FutureFeatures features, FutureFeatures query)
 {
     return((features & query) > FutureFeatures.Raw);
 }