Ejemplo n.º 1
0
		public CachePackage DeriveCache(string identifier)
		{
			CachePackage cachePackage = new CachePackage(identifier);
			cachePackage.openSourceDocumentCache = this.openSourceDocumentCache;
			cachePackage.openDocumentPrioritizer = this.openDocumentPrioritizer;
			cachePackage.diskCache = this.diskCache;
			cachePackage.Flush();
			return cachePackage;
		}
Ejemplo n.º 2
0
        public CachePackage DeriveCache(string identifier)
        {
            CachePackage cachePackage = new CachePackage(identifier);

            cachePackage.openSourceDocumentCache = this.openSourceDocumentCache;
            cachePackage.openDocumentPrioritizer = this.openDocumentPrioritizer;
            cachePackage.diskCache = this.diskCache;
            cachePackage.Flush();
            return(cachePackage);
        }
Ejemplo n.º 3
0
 public WarpedMapTileSource(UnwarpedMapTileSource unwarpedTileSource, CachePackage cachePackage, SourceMap sourceMap)
 {
     this.unwarpedMapTileSource = unwarpedTileSource;
     this.cachePackage          = cachePackage;
     this.coordinateSystem      = new MercatorCoordinateSystem();
     if (sourceMap.registration.GetAssociationList().Count < sourceMap.registration.warpStyle.getCorrespondencesRequired())
     {
         throw new InsufficientCorrespondencesException();
     }
     this.imageTransformer = sourceMap.registration.warpStyle.getImageTransformer(sourceMap.registration, RenderQualityStyle.theStyle.warpInterpolationMode);
 }
		public SourceDocument RealizeSynchronously(CachePackage cachePackage)
		{
			Present present = this.GetSynchronousFuture(cachePackage).Realize("SourceDocument.RealizeSynchronously");
			if (present is SourceDocument)
			{
				SourceDocument sourceDocument = (SourceDocument)present;
				D.Assert(sourceDocument.localDocument != null, "We waited for document to arrive synchronously.");
				return sourceDocument;
			}
			throw ((PresentFailureCode)present).exception;
		}
		internal OneLayerBoundApplier(IRenderableSource source, Layer layer, CachePackage cachePackage)
		{
			this.source = source;
			this.layer = layer;
			this.clippedImageFuture = new MemCachePrototype(cachePackage.computeCache, new ApplyPrototype(new UserClipperVerb(), new IFuturePrototype[]
			{
				source.GetImagePrototype(null, (FutureFeatures)11),
				new UnevaluatedTerm(TermName.TileAddress),
				source.GetUserBounds(null, FutureFeatures.Cached)
			}));
		}
Ejemplo n.º 6
0
		public WarpedMapTileSource(UnwarpedMapTileSource unwarpedTileSource, CachePackage cachePackage, SourceMap sourceMap)
		{
			this.unwarpedMapTileSource = unwarpedTileSource;
			this.cachePackage = cachePackage;
			this.coordinateSystem = new MercatorCoordinateSystem();
			if (sourceMap.registration.GetAssociationList().Count < sourceMap.registration.warpStyle.getCorrespondencesRequired())
			{
				throw new InsufficientCorrespondencesException();
			}
			this.imageTransformer = sourceMap.registration.warpStyle.getImageTransformer(sourceMap.registration, RenderQualityStyle.theStyle.warpInterpolationMode);
		}
Ejemplo n.º 7
0
		public RenderedMashupViewer(CachePackage cachePackage, ToolStripMenuItem dmsMenuItem)
		{
			this.InitializeComponent();
			this.cachePackage = cachePackage;
			this.mapPos = new MapPosition(this.viewer);
			this.viewer.Initialize(new MapPositionDelegate(this.GetMapPos), "Map Location");
			this.viewer.ShowDMS = new MapDrawingOption(this.viewer, dmsMenuItem, false);
			this.SetVEMapStyle(VirtualEarthWebDownloader.RoadStyle);
			this.mapPos.setPosition(this.viewer.GetCoordinateSystem().GetDefaultView());
			this.printDoc = new PrintDocument();
			this.printDoc.PrintPage += new PrintPageEventHandler(this.PrintPage);
		}
Ejemplo n.º 8
0
        public SourceDocument RealizeSynchronously(CachePackage cachePackage)
        {
            Present present = this.GetSynchronousFuture(cachePackage).Realize("SourceDocument.RealizeSynchronously");

            if (present is SourceDocument)
            {
                SourceDocument sourceDocument = (SourceDocument)present;
                D.Assert(sourceDocument.localDocument != null, "We waited for document to arrive synchronously.");
                return(sourceDocument);
            }
            throw ((PresentFailureCode)present).exception;
        }
Ejemplo n.º 9
0
		public static RenderedLayerDisplayInfo GetLayerSelector(ViewerControl viewer, CachePackage cachePackage)
		{
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = string.Format("MapCruncher Rendered Layers (*{0})|*{1}{2}", CrunchedFile.CrunchedFilenameExtension, CrunchedFile.CrunchedFilenameExtension, BuildConfig.theConfig.allFilesOption);
			openFileDialog.FilterIndex = 1;
			openFileDialog.RestoreDirectory = true;
			if (openFileDialog.ShowDialog() != DialogResult.OK)
			{
				return null;
			}
			Uri uri = new Uri(openFileDialog.FileName);
			return RenderedLayerSelector.GetLayerSelector(viewer, cachePackage, uri);
		}
Ejemplo n.º 10
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;
		}
Ejemplo n.º 11
0
		public static RenderedLayerDisplayInfo GetLayerSelector(ViewerControl viewer, CachePackage cachePackage, Uri uri)
		{
			RenderedLayerDisplayInfo result;
			try
			{
				CrunchedFile renderedMashupsFromFile = RenderedLayerSelector.GetRenderedMashupsFromFile(uri);
				D.Assert(uri.IsFile);
				string localPath = uri.LocalPath;
				result = RenderedLayerSelector.BuildLayerSelector(viewer, cachePackage, Path.GetDirectoryName(localPath), renderedMashupsFromFile);
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, "Error opening crunched file ", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				result = null;
			}
			return result;
		}
Ejemplo n.º 12
0
		private static RenderedLayerDisplayInfo BuildLayerSelector(ViewerControl viewer, CachePackage cachePackage, string basePath, CrunchedFile crunchedFile)
		{
			RenderedLayerDisplayInfo renderedLayerDisplayInfo = new RenderedLayerDisplayInfo();
			renderedLayerDisplayInfo.tsmiList = new List<ToolStripMenuItem>();
			foreach (CrunchedLayer current in crunchedFile.crunchedLayers)
			{
				RenderedLayerSelector renderedLayerSelector = new RenderedLayerSelector(current);
				renderedLayerSelector.viewer = viewer;
				renderedLayerSelector.menuItem = new ToolStripMenuItem(current.displayName);
				renderedLayerSelector.tileSource = new RenderedTileSource(cachePackage, new VENamingScheme(Path.Combine(basePath, current.namingScheme.GetFilePrefix()), current.namingScheme.GetFileSuffix()));
				renderedLayerSelector.menuItem.Tag = renderedLayerSelector;
				renderedLayerSelector.menuItem.Click += new EventHandler(RenderedLayerSelector.MenuItem_Click);
				renderedLayerDisplayInfo.tsmiList.Add(renderedLayerSelector.menuItem);
			}
			for (int i = 0; i < renderedLayerDisplayInfo.tsmiList.Count; i++)
			{
				((RenderedLayerSelector)renderedLayerDisplayInfo.tsmiList[renderedLayerDisplayInfo.tsmiList.Count - 1 - i].Tag).ToggleLayer();
			}
			renderedLayerDisplayInfo.defaultView = crunchedFile.crunchedLayers[0].defaultView;
			return renderedLayerDisplayInfo;
		}
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
 public VETileSource(CachePackage cachePackage, string veStyle)
 {
     this.cachePackage = cachePackage;
     this.veStyle      = veStyle;
     coordinateSystem  = new MercatorCoordinateSystem();
 }
Ejemplo n.º 15
0
		public void AccumulateRobustHash_PerTile(CachePackage cachePackage, IRobustHash hash)
		{
			hash.Accumulate("Layer(");
			foreach (SourceMap current in this.sourceMaps)
			{
				current.AccumulateRobustHash_PerTile(cachePackage, hash);
			}
			hash.Accumulate(")");
		}
Ejemplo n.º 16
0
 public IFuture GetAsynchronousFuture(CachePackage cachePackage)
 {
     return(new MemCacheFuture(cachePackage.asyncCache, Asynchronizer.MakeFuture(cachePackage.computeAsyncScheduler, this.GetSynchronousFuture(cachePackage))));
 }
Ejemplo n.º 17
0
		public RenderedTileSource(CachePackage cachePackage, RenderedTileNamingScheme namingScheme)
		{
			this.cachePackage = cachePackage;
			this.namingScheme = namingScheme;
			this.coordinateSystem = new MercatorCoordinateSystem();
		}
Ejemplo n.º 18
0
 public void StartUpApplication()
 {
     try
     {
         D.SetDebugLevel(BuildConfig.theConfig.debugLevel);
         this.cachePackage = new CachePackage();
         this.renderedTileCachePackage = this.cachePackage.DeriveCache("renderedTile");
         this.InitializeComponent();
         this.SetOptionsPanelVisibility(OptionsPanelVisibility.Nothing);
         this.mapTileSourceFactory = new MapTileSourceFactory(this.cachePackage);
     }
     catch (ConfigurationException)
     {
         this.UndoConstruction();
         throw;
     }
     this.layerControls.SetLayerControl(this);
     this.RestoreWindowParameters();
     this.SetInterfaceNoMashupOpen();
     System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
     timer.Interval = 10000;
     timer.Tick += new EventHandler(this.saveBackupTimer_Tick);
     timer.Start();
     this.registrationControls.ShowDMS = new MapDrawingOption(this.registrationControls, this.showDMSMenuItem, false);
     this.smViewerControl.ShowCrosshairs = new MapDrawingOption(this.smViewerControl, this.showCrosshairsMenuItem, true);
     this.smViewerControl.ShowTileBoundaries = new MapDrawingOption(this.smViewerControl, this.showTileBoundariesMenuItem, true);
     this.smViewerControl.ShowPushPins = new MapDrawingOption(this.smViewerControl, this.showPushPinsMenuItem, true);
     this.smViewerControl.ShowTileNames = new MapDrawingOption(this.smViewerControl, this.showTileNamesMenuItem, false);
     this.smViewerControl.ShowSourceCrop = new MapDrawingOption(this.smViewerControl, this.showSourceCropToolStripMenuItem, true);
     this.smViewerControl.ShowDMS = new MapDrawingOption(this.smViewerControl, this.showDMSMenuItem, false);
     this.smViewerControl.SetLLZBoxLabelStyle(LLZBox.LabelStyle.XY);
     this.SetVEMapStyle(VirtualEarthWebDownloader.RoadStyle);
     this.veViewerControl.ShowCrosshairs = new MapDrawingOption(this.veViewerControl, this.showCrosshairsMenuItem, true);
     this.veViewerControl.ShowTileBoundaries = new MapDrawingOption(this.veViewerControl, this.showTileBoundariesMenuItem, false);
     this.veViewerControl.ShowPushPins = new MapDrawingOption(this.veViewerControl, this.showPushPinsMenuItem, true);
     this.veViewerControl.ShowTileNames = new MapDrawingOption(this.veViewerControl, this.showTileNamesMenuItem, false);
     this.veViewerControl.ShowDMS = new MapDrawingOption(this.veViewerControl, this.showDMSMenuItem, false);
     this.veViewerControl.configureLLZBoxEditable();
     this.uiPosition = new UIPositionManager(this.smViewerControl, this.veViewerControl);
     this.uiPosition.GetVEPos().setPosition(this.veViewerControl.GetCoordinateSystem().GetDefaultView());
     this.recordSnapViewMenuItem.Click += new EventHandler(this.recordSnapViewMenuItem_Click);
     this.restoreSnapViewMenuItem.Click += new EventHandler(this.restoreSnapViewMenuItem_Click);
     this.recordSnapZoomMenuItem.Click += new EventHandler(this.recordSnapZoomMenuItem_Click);
     this.restoreSnapZoomMenuItem.Click += new EventHandler(this.restoreSnapZoomMenuItem_Click);
     this.registrationControls.setAssociationIfc(this);
     this.setDisplayedRegistration(null);
     this.sourceMapInfoPanel.Initialize(new SourceMapInfoPanel.PreviewSourceMapZoomDelegate(this.PreviewSourceMapZoom));
     BigDebugKnob.theKnob.AddListener(new BigDebugKnob.DebugKnobListener(this.debugKnobChanged));
     BigDebugKnob.theKnob.debugFeaturesEnabled = false;
     this.enableDebugModeToolStripMenuItem.Visible = BuildConfig.theConfig.debugModeEnabled;
     this.debugModeToolStripSeparator.Visible = BuildConfig.theConfig.debugModeEnabled;
     if (this.startDocumentPath != null)
     {
         this.LoadMashup(Path.GetFullPath(this.startDocumentPath));
     }
     else
     {
         this.NewMashup();
     }
     if (this.renderOnLaunch)
     {
         this.currentMashup.AutoSelectMaxZooms(this.mapTileSourceFactory);
         this.LaunchRenderWindow();
         this.renderWindow.StartRender(new RenderProgressPanel2.RenderCompleteDelegate(this.LaunchedRenderComplete));
         base.Shown += new EventHandler(this.MainAppForm_Shown_BringRenderWindowToFront);
     }
 }
Ejemplo n.º 19
0
 public void AccumulateRobustHash_PerTile(CachePackage cachePackage, IRobustHash hash)
 {
     hash.Accumulate("SourceMap:");
     SourceDocument sourceDocument = this._documentFuture.RealizeSynchronously(cachePackage);
     sourceDocument.localDocument.AccumulateRobustHash(hash);
     this.AccumulateRobustHash_Common(hash);
 }
		public IFuture GetAsynchronousFuture(CachePackage cachePackage)
		{
			return new MemCacheFuture(cachePackage.asyncCache, Asynchronizer.MakeFuture(cachePackage.computeAsyncScheduler, this.GetSynchronousFuture(cachePackage)));
		}
		public IFuture GetSynchronousFuture(CachePackage cachePackage)
		{
			return new MemCacheFuture(cachePackage.documentFetchCache, this.documentFuture);
		}
Ejemplo n.º 22
0
		public VETileSource(CachePackage cachePackage, string veStyle)
		{
			this.cachePackage = cachePackage;
			this.veStyle = veStyle;
			this.coordinateSystem = new MercatorCoordinateSystem();
		}
Ejemplo n.º 23
0
 public IFuture GetSynchronousFuture(CachePackage cachePackage)
 {
     return(new MemCacheFuture(cachePackage.documentFetchCache, this.documentFuture));
 }
		public UnwarpedMapTileSource(CachePackage cachePackage, IFuture localDocumentFuture, SourceMap sourceMap)
		{
			this.cachePackage = cachePackage;
			this.localDocumentFuture = localDocumentFuture;
			this.sourceMap = sourceMap;
		}
Ejemplo n.º 25
0
 public UnwarpedMapTileSource(CachePackage cachePackage, IFuture localDocumentFuture, SourceMap sourceMap)
 {
     this.cachePackage        = cachePackage;
     this.localDocumentFuture = localDocumentFuture;
     this.sourceMap           = sourceMap;
 }
Ejemplo n.º 26
0
		public MapTileSourceFactory(CachePackage cachePackage)
		{
			this.cachePackage = cachePackage;
		}
Ejemplo n.º 27
0
 public RenderedTileSource(CachePackage cachePackage, RenderedTileNamingScheme namingScheme)
 {
     this.cachePackage     = cachePackage;
     this.namingScheme     = namingScheme;
     this.coordinateSystem = new MercatorCoordinateSystem();
 }