public WorldSurfaceRenderer( uint samplesPerTile, double distanceAboveSeaLevel, WorldWind.World parentWorld ) { m_SamplesPerTile = samplesPerTile; m_ParentWorld = parentWorld; m_DistanceAboveSeaLevel = distanceAboveSeaLevel; double tileSize = 180.0f / m_NumberRootTilesHigh; m_RootSurfaceTiles = new SurfaceTile[m_NumberRootTilesHigh * (m_NumberRootTilesHigh * 2)]; for(int i = 0; i < m_NumberRootTilesHigh; i++) { for(int j = 0; j < m_NumberRootTilesHigh * 2; j++) { m_RootSurfaceTiles[i * m_NumberRootTilesHigh * 2 + j] = new SurfaceTile( (i + 1) * tileSize - 90.0f, i * tileSize - 90.0f, j * tileSize - 180.0f, (j + 1) * tileSize - 180.0f, 0, this); } } }
public WidgetMenuButton( string name, string iconFilePath, WorldWind.Widgets.IWidget widget) : base(iconFilePath) { this.Description = name; m_widget = widget; }
/// <summary> /// Constructor /// </summary> public Stars3DLayer(string LayerName, string pluginPath, WorldWind.WorldWindow worldWindow) : base(LayerName) { this.pluginPath = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), @"Plugins\stars3d\"); this.world = worldWindow.CurrentWorld; this.drawArgs = worldWindow.DrawArgs; this.RenderPriority = RenderPriority.SurfaceImages; //this.sphereRadius = this.drawArgs.WorldCamera.WorldRadius * 20; ReadSettings(); }
/** * Retrieves the contents of a specified {@link java.net.URL}. If successful, this places the URL * contents in a specified session cache with a specified key. This either marks the resource as available or * missing, depending on whether the retrieval succeeds or fails. Finally, this optionally notifies the caller that * the retrieval has succeeded by firing a property change event. If either the property listener or property name * are null, that functionality is disabled. * * @param url the URL contents to retrieve. * @param cache the cache which receives the retrieved data. * @param cacheKey the cache key which identifies where the retrieved data is placed in the session * cache. * @param absentResourceList the absent resource list to update. * @param resourceID the resource ID to use in the absent resource list. * @param propertyListener the property change listener which is fired when the retrieved data is available. * @param propertyName the property name to fire when retrieved data is available. * * @throws ArgumentException if any of the url, retrieval service, cache, or cache key are null. */ public static void retrieveSessionData(java.net.URL url, SessionCache cache, Object cacheKey, AbsentResourceList absentResourceList, long resourceID, PropertyChangeListener propertyListener, String propertyName) { if (url == null) { String message = Logging.getMessage("nullValue.URLIsNull"); Logging.logger().severe(message); throw new ArgumentException(message); } if (cache == null) { String message = Logging.getMessage("nullValue.CacheIsNull"); Logging.logger().severe(message); throw new ArgumentException(message); } if (cacheKey == null) { String message = Logging.getMessage("nullValue.CacheKeyIsNull"); Logging.logger().severe(message); throw new ArgumentException(message); } if (WorldWind.getNetworkStatus().isHostUnavailable(url)) { if (absentResourceList != null) { absentResourceList.markResourceAbsent(resourceID); } return; } SessionCacheRetrievalPostProcessor postProcessor = new SessionCacheRetrievalPostProcessor(cache, cacheKey, absentResourceList, resourceID, propertyListener, propertyName); postProcessor.setName(url.ToString()); Retriever retriever = URLRetriever.createRetriever(url, postProcessor); try { retriever.call(); } catch (Exception e) { String message = Logging.getMessage("layers.TiledImageLayer.ExceptionRetrievingResources", url.ToString()); Logging.logger().log(java.util.logging.Level.SEVERE, message, e); } }
public BasicOrbitView() { this.viewInputHandler = (ViewInputHandler)WorldWind.createConfigurationComponent( AVKey.VIEW_INPUT_HANDLER_CLASS_NAME); this.viewLimits = new BasicOrbitViewLimits(); if (this.viewInputHandler == null) { this.viewInputHandler = new OrbitViewInputHandler(); } this.collisionSupport.setCollisionThreshold(COLLISION_THRESHOLD); this.collisionSupport.setNumIterations(COLLISION_NUM_ITERATIONS); loadConfigurationValues(); }
internal AddImageTile(WorldWind.WorldWindow worldWindow, LayerGeneration.IBuilder oParent) { m_worldWind = worldWindow; m_oParent = oParent; InitializeComponent(); // collect the pages and leave only the start page for (int i = 0; i < tabCtl.TabPages.Count; i++) { m_tabPages.Add(tabCtl.TabPages[i]); } tabCtl.TabPages.Clear(); tabCtl.TabPages.Add(m_tabPages[0]); }
public SectorGeometryList tessellate(DrawContext dc) { if (_tessellator == null) { _tessellator = (Tessellator)WorldWind.createConfigurationComponent(AVKey.TESSELLATOR_CLASS_NAME); if (_tessellator == null) { string message = Logging.getMessage("Tessellator.TessellatorUnavailable"); Logging.logger().severe(message); throw new IllegalStateException(message); } } return(_tessellator.tessellate(dc)); }
protected final WorldWindowGLDrawable wwd; // WorldWindow interface delegates to wwd /** Constructs a new <code>WorldWindowGLCanvas</code> on the default graphics device. */ public WorldWindowGLCanvas() { base(Configuration.getRequiredGLCapabilities(), new BasicGLCapabilitiesChooser(), null); try { this.wwd = ((WorldWindowGLDrawable)WorldWind.createConfigurationComponent(AVKey.WORLD_WINDOW_CLASS_NAME)); this.wwd.initDrawable(this); this.wwd.initGpuResourceCache(WorldWindowImpl.createGpuResourceCache()); this.createView(); this.createDefaultInputHandler(); WorldWind.addPropertyChangeListener(WorldWind.SHUTDOWN_EVENT, this); this.wwd.endInitialization(); } catch (Exception e) { String message = Logging.getMessage("Awt.WorldWindowGLSurface.UnabletoCreateWindow"); Logging.logger().severe(message); throw new WWRuntimeException(message, e); } }
/** * BasicRasterServer constructor reads a list of data raster sources from *.RasterServer.xml (the file that * accompanies layer description XML file), reads sector of each source and maintains a list of data sources, their * properties, * * @param o the RasterServer.xml source to read. May by a {@link java.io.File}, a file path, a URL or an * {@link org.w3c.dom.Element} * @param parameters optional metadata associated with the data source that might be useful to the BasicRasterServer. */ public BasicRasterServer(Object o, AVList parameters) { base(); if (null != parameters) { this.setValues(params); } try { this.readerFactory = (DataRasterReaderFactory)WorldWind.createConfigurationComponent( AVKey.DATA_RASTER_READER_FACTORY_CLASS_NAME); } catch (Exception e) { this.readerFactory = new BasicDataRasterReaderFactory(); } this.init(o); }
/** * Create and initialize the texture from the image source. If the image is not in memory this method will request * that it be loaded and return null. * * @return The texture, or null if the texture is not yet available. */ protected BasicWWTexture initializeTexture() { Object imageSource = this.getImageSource(); if (imageSource is String || imageSource is URL) { URL imageURL = WorldWind.getDataFileStore().requestFile(imageSource.ToString()); if (imageURL != null) { this.texture = new BasicWWTexture(imageURL, true); this.texture.setUseAnisotropy(false); } } else if (imageSource != null) { this.texture = new BasicWWTexture(imageSource, true); return(this.texture); } return(null); }
public void BringToFront(WorldWind.NewWidgets.IWidget widget) { int foundIndex = -1; for(int index = 0; index < m_ChildWidgets.Count; index++) { WorldWind.NewWidgets.IWidget currentWidget = m_ChildWidgets[index] as WorldWind.NewWidgets.IWidget; if(currentWidget != null) { if(currentWidget == widget) { foundIndex = index; break; } } } if(foundIndex > 0) { BringToFront(foundIndex); } }
private void RenderStars(DrawArgs drawArgs, WorldWind.Renderable.RenderableObject renderable) { if (renderable is RenderableObjectList) { RenderableObjectList rol = (RenderableObjectList)renderable; for (int i = 0; i < rol.ChildObjects.Count; i++) { RenderStars(drawArgs, (RenderableObject)rol.ChildObjects[i]); } } else if (renderable.Name != null && renderable.Name.Equals("Starfield")) { try { renderable.Render(drawArgs); } catch (Exception ex) { Log.Write(ex); } } }
public override void Render(WorldWind.DrawArgs drawArgs) { lock (this) { if (m_oLayer != null) { m_oLayer.Render(drawArgs); } } }
/// <summary> /// Determine if the object is visible /// </summary> bool IsVisible(WorldWind.Camera.CameraBase camera) { if(worldXyz == Vector3.Empty) worldXyz = MathEngine.SphericalToCartesian(Latitude, Longitude, camera.WorldRadius ); return camera.ViewFrustum.ContainsPoint(worldXyz); }
public virtual void ResetCacheForCurrentView(WorldWind.Camera.CameraBase camera) { // if (!ImageStore.IsDownloadableLayer) // return; ArrayList deletionList = new ArrayList(); //reset "root" tiles that intersect current view lock (m_topmostTiles.SyncRoot) { foreach (long key in m_topmostTiles.Keys) { QuadTile qt = (QuadTile)m_topmostTiles[key]; if (camera.ViewFrustum.Intersects(qt.BoundingBox)) { qt.ResetCache(); deletionList.Add(key); } } foreach (long deletionKey in deletionList) m_topmostTiles.Remove(deletionKey); } }
private static bool IsRenderableVisible(WorldWind.Renderable.RenderableObject renderable) { if (renderable == null) { return true; } else if (!renderable.IsOn) { return false; } else if (renderable.ParentList != null) { return IsRenderableVisible(renderable.ParentList); } else { return true; } }
/** * Create a layer described by an XML layer description. * * @param domElement the XML element describing the layer to create. * @param parameters any parameters to apply when creating the layer. * * @return a new layer * * @throws WWUnrecognizedException if the layer type or service type given in the describing element is * unrecognized. * @see #createTiledImageLayer(org.w3c.dom.Element, SharpEarth.avlist.AVList). */ protected Layer createFromLayerDocument(Element domElement, AVList parameters) { String className = WWXML.getText(domElement, "@className"); if (className != null && className.length() > 0) { Layer layer = (Layer)WorldWind.createComponent(className); String actuate = WWXML.getText(domElement, "@actuate"); layer.setEnabled(WWUtil.isEmpty(actuate) || actuate.Equals("onLoad")); WWXML.invokePropertySetters(layer, domElement); return(layer); } AVList props = WWXML.copyProperties(domElement, null); if (props != null) { // Copy parameters and add any properties for this layer to the copy if (params != null) { props.setValues(params); } parameters = props; } Layer layer; String href = WWXML.getText(domElement, "@href"); if (href != null && href.length() > 0) { Object o = this.createFromConfigSource(href, parameters); if (o == null) { return(null); } if (!(o is Layer)) { String msg = Logging.getMessage("LayerFactory.UnexpectedTypeForLayer", o.GetType().Name); throw new WWRuntimeException(msg); } layer = (Layer)o; } else { String layerType = WWXML.getText(domElement, "@layerType"); if (layerType != null && layerType.Equals("TiledImageLayer")) { layer = this.createTiledImageLayer(domElement, parameters); } else if (layerType != null && layerType.Equals("ShapefileLayer")) { layer = this.createShapefileLayer(domElement, parameters); } else { String msg = Logging.getMessage("generic.UnrecognizedLayerType", layerType); throw new WWUnrecognizedException(msg); } } if (layer != null) { String actuate = WWXML.getText(domElement, "@actuate"); layer.setEnabled(actuate != null && actuate.Equals("onLoad")); WWXML.invokePropertySetters(layer, domElement); } return(layer); }
/** Constructs and attaches the {@link InputHandler} for this <code>WorldWindow</code>. */ protected void createDefaultInputHandler() { this.setInputHandler((InputHandler)WorldWind.createConfigurationComponent(AVKey.INPUT_HANDLER_CLASS_NAME)); }
private string getZOrderStringFromIRenderable(WorldWind.Renderable.RenderableObject renderable) { if(renderable.ParentList != null) { return getZOrderStringFromIRenderable(renderable.ParentList) + "." + getIRenderableIndexFromParent(renderable).ToString().PadLeft(5, '0'); } else { return ""; } }
public void Add(WorldWind.NewWidgets.IWidget widget) { m_ChildWidgets.Add(widget); }
public void Insert(WorldWind.NewWidgets.IWidget widget, int index) { if(index <= m_ChildWidgets.Count) { m_ChildWidgets.Insert(index, widget); } //probably want to throw an indexoutofrange type of exception }
public override void Initialize(WorldWind.DrawArgs drawArgs) { lock (this) { m_oLastAoI = drawArgs.CurrentRoI; m_oLastAoIChangeTime = DateTime.Now; if (m_oGroundOverlay.Icon.ViewRefreshMode == KMLViewRefreshMode.onStop) { GeographicBoundingBox oRenderBox = GetNewBox(drawArgs.CurrentRoI, m_oGroundOverlay.Icon.ViewBoundScale); m_oLayer = new ImageLayer( m_oGroundOverlay.Name, drawArgs.CurrentWorld, m_oGroundOverlay.Altitude, m_strImageFilename, oRenderBox.South, oRenderBox.North, oRenderBox.West, oRenderBox.East, (byte)(m_oGroundOverlay.Color.A * ((double)m_opacity / (double)(byte.MaxValue))), drawArgs.CurrentWorld.TerrainAccessor); if (m_oGroundOverlay.Icon.IsLocalFile) { m_oLayer.ImagePath = Path.Combine(m_strKMLDirectory, m_oGroundOverlay.Icon.HRef); } else { m_oLayer.ImageUrl = m_oGroundOverlay.Icon.GetUri(oRenderBox.West, oRenderBox.South, oRenderBox.East, oRenderBox.North); } m_oLayerAoI = drawArgs.CurrentRoI.Clone() as GeographicBoundingBox; } else { m_oLayer = new ImageLayer( m_oGroundOverlay.Name, drawArgs.CurrentWorld, m_oGroundOverlay.Altitude, m_strImageFilename, m_oGroundOverlay.LatLonBox.South, m_oGroundOverlay.LatLonBox.North, m_oGroundOverlay.LatLonBox.West, m_oGroundOverlay.LatLonBox.East, (byte)(m_oGroundOverlay.Color.A * ((double)m_opacity / (double)(byte.MaxValue))), drawArgs.CurrentWorld.TerrainAccessor); if (m_oGroundOverlay.Icon.IsLocalFile) { m_oLayer.ImagePath = Path.Combine(m_strKMLDirectory, m_oGroundOverlay.Icon.HRef); } else { m_oLayer.ImageUrl = m_oGroundOverlay.GetUri(); } } m_oLayer.Initialize(drawArgs); } }
public override void Update(WorldWind.DrawArgs drawArgs) { lock (this) { if (m_oLayer != null) { if (m_oGroundOverlay.Icon.ViewRefreshMode == KMLViewRefreshMode.onStop) { double dTimeStopped; if (drawArgs.CurrentRoI.Equals(m_oLastAoI)) { dTimeStopped = (DateTime.Now - m_oLastAoIChangeTime).Seconds; } else { dTimeStopped = 0.0; m_oLastAoI = drawArgs.CurrentRoI; m_oLastAoIChangeTime = DateTime.Now; } if (dTimeStopped > m_oGroundOverlay.Icon.ViewRefreshTime && !m_oLayerAoI.Equivalent(drawArgs.CurrentRoI, 1e-6)) { try { File.Delete(m_strImageFilename); } catch (IOException) { return; } GeographicBoundingBox oRenderBox = GetNewBox(drawArgs.CurrentRoI, m_oGroundOverlay.Icon.ViewBoundScale); m_oLayer = new ImageLayer( m_oGroundOverlay.Name, drawArgs.CurrentWorld, m_oGroundOverlay.Altitude, m_strImageFilename, oRenderBox.South, oRenderBox.North, oRenderBox.West, oRenderBox.East, (byte)(m_oGroundOverlay.Color.A * ((double)m_opacity / (double)(byte.MaxValue))), drawArgs.CurrentWorld.TerrainAccessor); if (m_oGroundOverlay.Icon.IsLocalFile) { m_oLayer.ImagePath = Path.Combine(m_strKMLDirectory, m_oGroundOverlay.Icon.HRef); } else { m_oLayer.ImageUrl = m_oGroundOverlay.Icon.GetUri(oRenderBox.West, oRenderBox.South, oRenderBox.East, oRenderBox.North); } m_oLayer.Initialize(drawArgs); m_oLayerAoI = drawArgs.CurrentRoI.Clone() as GeographicBoundingBox; } } m_oLayer.Update(drawArgs); } } }
private void Render(WorldWind.Renderable.RenderableObject renderable, WorldWind.Renderable.RenderPriority priority, DrawArgs drawArgs) { if (!renderable.IsOn || (renderable.Name != null && renderable.Name.Equals("Starfield"))) return; try { if (priority == WorldWind.Renderable.RenderPriority.Icons && renderable is Icons) { renderable.Render(drawArgs); } else if (renderable is WorldWind.Renderable.RenderableObjectList) { WorldWind.Renderable.RenderableObjectList rol = (WorldWind.Renderable.RenderableObjectList)renderable; for (int i = 0; i < rol.ChildObjects.Count; i++) { Render((WorldWind.Renderable.RenderableObject)rol.ChildObjects[i], priority, drawArgs); } } // hack at the moment else if (priority == WorldWind.Renderable.RenderPriority.TerrainMappedImages) { if (renderable.RenderPriority == WorldWind.Renderable.RenderPriority.SurfaceImages || renderable.RenderPriority == WorldWind.Renderable.RenderPriority.TerrainMappedImages) { renderable.Render(drawArgs); } } else if (renderable.RenderPriority == priority) { renderable.Render(drawArgs); } } catch (Exception ex) { Log.Write(ex); } }
internal int iGetLayerCount(bool bInterSect, WorldWind.GeographicBoundingBox extents, string strText) { int iCount = 0; if (strText == null) strText = String.Empty; GetLayerCount(bInterSect, extents, strText, ref iCount); return iCount; }
public void RenderDownloadProgress(DrawArgs drawArgs, WorldWind.Renderable.GeoSpatialDownloadRequest request, int offset) { int halfIconHeight = 24; int halfIconWidth = 24; Vector3 projectedPoint = new Vector3(DrawArgs.ParentControl.Width - halfIconWidth - 10, DrawArgs.ParentControl.Height - 34 - 4 * offset, 0.5f); /* // Render progress bar if (progressBar == null) progressBar = new ProgressBar(40, 4); progressBar.Draw(drawArgs, projectedPoint.X, projectedPoint.Y + 24, request.ProgressPercent, World.Settings.DownloadProgressColor.ToArgb()); DrawArgs.Device.RenderState.ZBufferEnable = true; */ // Render server logo if (ServerLogoFilePath == null) return; if (m_iconTexture == null) m_iconTexture = ImageHelper.LoadIconTexture(ServerLogoFilePath); if (logosprite == null) { using (Surface s = m_iconTexture.GetSurfaceLevel(0)) { SurfaceDescription desc = s.Description; m_spriteSize = new Rectangle(0, 0, desc.Width, desc.Height); } this.logosprite = new Sprite(DrawArgs.Device); } float scaleWidth = (float)2.0f * halfIconWidth / m_spriteSize.Width; float scaleHeight = (float)2.0f * halfIconHeight / m_spriteSize.Height; this.logosprite.Begin(SpriteFlags.AlphaBlend); this.logosprite.Transform = Matrix.Transformation2D(new Vector2(0.0f, 0.0f), 0.0f, new Vector2(scaleWidth, scaleHeight), new Vector2(0, 0), 0.0f, new Vector2(projectedPoint.X, projectedPoint.Y)); this.logosprite.Draw(m_iconTexture, m_spriteSize, new Vector3(1.32f * 48, 1.32f * 48, 0), new Vector3(0, 0, 0), World.Settings.DownloadLogoColor); this.logosprite.End(); }
/** Constructs and attaches the {@link View} for this <code>WorldWindow</code>. */ protected void createView() { this.setView((View)WorldWind.createConfigurationComponent(AVKey.VIEW_CLASS_NAME)); }
public SurfaceImage( string imageFilePath, double north, double south, double west, double east, Texture texture, WorldWind.Renderable.RenderableObject parentRenderable) { m_ParentRenderable = parentRenderable; m_ImageFilePath = imageFilePath; m_North = north; m_South = south; m_West = west; m_East = east; m_Texture = texture; }
/** * Schedule a task to mark a link as updated after a delay. The task only executes once. * * @param task Task to schedule. * @param delay Delay to wait before executing the task. The time unit is determined by {code timeUnit}. * @param timeUnit The time unit of {@code delay}. * * @return Future that represents the scheduled task. */ protected ScheduledFuture scheduleDelayedTask(Runnable task, long delay, TimeUnit timeUnit) { return(WorldWind.getScheduledTaskService().addScheduledTask(task, delay, timeUnit)); }
/// <summary> /// Removes a child widget /// </summary> /// <param name="widget">The widget to be removed</param> new public void Remove(WorldWind.NewWidgets.IWidget widget) { m_ChildWidgets.Remove(widget); }
protected override string GetDownloadUrl(WorldWind.Renderable.QuadTile qt) { if(m_serverGetMapUrl.IndexOf('?')>=0) { // Allow custom format string url // http://server.net/path?imageformat=png&width={WIDTH}&north={NORTH}... string url = m_serverGetMapUrl; url = url.Replace("{WIDTH}", m_textureSizePixels.ToString(CultureInfo.InvariantCulture)); url = url.Replace("{HEIGHT}", m_textureSizePixels.ToString(CultureInfo.InvariantCulture)); url = url.Replace("{WEST}", qt.West.ToString(CultureInfo.InvariantCulture)); url = url.Replace("{EAST}", qt.East.ToString(CultureInfo.InvariantCulture)); url = url.Replace("{NORTH}", qt.North.ToString(CultureInfo.InvariantCulture)); url = url.Replace("{SOUTH}", qt.South.ToString(CultureInfo.InvariantCulture)); return url; } else { string url = string.Format(CultureInfo.InvariantCulture, "{0}?request=GetMap&layers={1}&srs=EPSG:4326&width={2}&height={3}&bbox={4},{5},{6},{7}&format={8}&version={9}&styles={10}", m_serverGetMapUrl, m_wmsLayerName, m_textureSizePixels, m_textureSizePixels, qt.West, qt.South, qt.East, qt.North, m_imageFormat, m_version, m_wmsLayerStyle ); return url; } }
private void GetLayerCount(bool bInterSect, WorldWind.GeographicBoundingBox extents, string strText, ref int iCount) { if (strText == null) throw new ArgumentNullException("strText"); foreach (IBuilder builder in SubList) (builder as BuilderDirectory).GetLayerCount(bInterSect, extents, strText, ref iCount); foreach (LayerBuilder builder in LayerBuilders) { if ((strText != string.Empty && builder.Title.IndexOf(strText, 0, StringComparison.InvariantCultureIgnoreCase) == -1) || (extents != null && bInterSect && !extents.Intersects(builder.Extents) && !extents.Contains(builder.Extents))) continue; iCount++; } }
private string GetAbsoluteRenderableObjectPath(WorldWind.Renderable.RenderableObject ro) { if(ro.ParentList != null) { return GetAbsoluteRenderableObjectPath(ro.ParentList) + "//" + ro.Name; } else { return ro.Name; } }
public void shutdown() { WorldWind.removePropertyChangeListener(WorldWind.SHUTDOWN_EVENT, this); this.wwd.shutdown(); }
/// <summary> /// Go to worldwind URI /// </summary> public void Goto( WorldWind.Net.WorldWindUri uri ) { GotoLatLon( uri.Latitude.Degrees, uri.Longitude.Degrees, uri.Direction.Degrees, uri.Altitude, uri.ViewRange.Degrees, uri.Tilt.Degrees); drawArgs.WorldCamera.Bank = uri.Bank; drawArgs.UpperLeftCornerText = uri.ToString(); CurrentWorld.RenderableObjects.Enable( uri.Layer ); }
private int getIRenderableIndexFromParent(WorldWind.Renderable.RenderableObject renderable) { if(renderable.ParentList == null) { return -1; } else { for(int index = 0; index < renderable.ParentList.ChildObjects.Count; index++) { if(renderable == renderable.ParentList.ChildObjects[index]) { return index; } } } return -1; }
/// <summary> /// Adds a new child widget /// </summary> /// <param name="widget">The widget to be added</param> new public void Add(WorldWind.NewWidgets.IWidget widget) { m_ChildWidgets.Add(widget); widget.ParentWidget = this; }
/// <summary> /// Initializes a new instance of the <see cref= "T:WorldWind.Menu.LayerShortcutMenuButton"/> class. /// </summary> /// <param name="imageFilePath"></param> /// <param name="ro"></param> public LayerShortcutMenuButton( string imageFilePath, WorldWind.Renderable.RenderableObject ro) : base(imageFilePath) { this.Description = ro.Name; this._ro = ro; this._isPushed = ro.IsOn; }
public static System.Drawing.Drawing2D.HatchStyle getGDIHatchStyle(WorldWind.ShapeFillStyle shapeFillStyle) { if(shapeFillStyle == WorldWind.ShapeFillStyle.BackwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.BackwardDiagonal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Cross) { return System.Drawing.Drawing2D.HatchStyle.Cross; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DarkDownwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.DarkDownwardDiagonal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DarkHorizontal) { return System.Drawing.Drawing2D.HatchStyle.DarkHorizontal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DarkUpwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.DarkUpwardDiagonal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DarkVertical) { return System.Drawing.Drawing2D.HatchStyle.DarkVertical; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DashedDownwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.DashedDownwardDiagonal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DashedHorizontal) { return System.Drawing.Drawing2D.HatchStyle.DashedHorizontal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DashedUpwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.DashedUpwardDiagonal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DashedVertical) { return System.Drawing.Drawing2D.HatchStyle.DashedVertical; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DiagonalBrick) { return System.Drawing.Drawing2D.HatchStyle.DiagonalBrick; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DiagonalCross) { return System.Drawing.Drawing2D.HatchStyle.DiagonalCross; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Divot) { return System.Drawing.Drawing2D.HatchStyle.Divot; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DottedDiamond) { return System.Drawing.Drawing2D.HatchStyle.DottedDiamond; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.DottedGrid) { return System.Drawing.Drawing2D.HatchStyle.DottedGrid; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.ForwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.ForwardDiagonal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Horizontal) { return System.Drawing.Drawing2D.HatchStyle.Horizontal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.LargeCheckerBoard) { return System.Drawing.Drawing2D.HatchStyle.LargeCheckerBoard; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.LargeConfetti) { return System.Drawing.Drawing2D.HatchStyle.LargeConfetti; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.LargeGrid) { return System.Drawing.Drawing2D.HatchStyle.LargeGrid; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.LightDownwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.LightDownwardDiagonal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.LightHorizontal) { return System.Drawing.Drawing2D.HatchStyle.LightHorizontal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.LightUpwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.LightUpwardDiagonal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.LightVertical) { return System.Drawing.Drawing2D.HatchStyle.LightVertical; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Max) { return System.Drawing.Drawing2D.HatchStyle.Max; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Min) { return System.Drawing.Drawing2D.HatchStyle.Min; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.NarrowHorizontal) { return System.Drawing.Drawing2D.HatchStyle.NarrowHorizontal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.NarrowVertical) { return System.Drawing.Drawing2D.HatchStyle.NarrowVertical; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.OutlinedDiamond) { return System.Drawing.Drawing2D.HatchStyle.OutlinedDiamond; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent05) { return System.Drawing.Drawing2D.HatchStyle.Percent05; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent10) { return System.Drawing.Drawing2D.HatchStyle.Percent10; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent20) { return System.Drawing.Drawing2D.HatchStyle.Percent20; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent25) { return System.Drawing.Drawing2D.HatchStyle.Percent25; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent30) { return System.Drawing.Drawing2D.HatchStyle.Percent30; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent40) { return System.Drawing.Drawing2D.HatchStyle.Percent40; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent50) { return System.Drawing.Drawing2D.HatchStyle.Percent50; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent60) { return System.Drawing.Drawing2D.HatchStyle.Percent60; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent70) { return System.Drawing.Drawing2D.HatchStyle.Percent70; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent75) { return System.Drawing.Drawing2D.HatchStyle.Percent75; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent80) { return System.Drawing.Drawing2D.HatchStyle.Percent80; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Percent90) { return System.Drawing.Drawing2D.HatchStyle.Percent90; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Plaid) { return System.Drawing.Drawing2D.HatchStyle.Plaid; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Shingle) { return System.Drawing.Drawing2D.HatchStyle.Shingle; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.SmallCheckerBoard) { return System.Drawing.Drawing2D.HatchStyle.SmallCheckerBoard; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.SmallConfetti) { return System.Drawing.Drawing2D.HatchStyle.SmallConfetti; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.SmallGrid) { return System.Drawing.Drawing2D.HatchStyle.SmallGrid; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.SolidDiamond) { return System.Drawing.Drawing2D.HatchStyle.SolidDiamond; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Sphere) { return System.Drawing.Drawing2D.HatchStyle.Sphere; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Trellis) { return System.Drawing.Drawing2D.HatchStyle.Trellis; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Wave) { return System.Drawing.Drawing2D.HatchStyle.Wave; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.Weave) { return System.Drawing.Drawing2D.HatchStyle.Weave; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.WideDownwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.WideDownwardDiagonal; } else if(shapeFillStyle == WorldWind.ShapeFillStyle.WideUpwardDiagonal) { return System.Drawing.Drawing2D.HatchStyle.WideUpwardDiagonal; } else { return System.Drawing.Drawing2D.HatchStyle.ZigZag; } }
public PlaceFinder(WorldWind.WorldWindow ww) { // // Required for Windows Form Designer support // InitializeComponent(); try { Image yahooImage = Image.FromFile( Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Plugins\\PlaceFinder\\yahoowebservices.gif")); pictureBoxYahoo.Size = new Size(yahooImage.Width, yahooImage.Height); pictureBoxYahoo.Image = yahooImage; Image wwImage = Image.FromFile( Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Plugins\\PlaceFinder\\fef2.png")); pictureBoxWW.Size = new Size(wwImage.Width, wwImage.Height); pictureBoxWW.Image = wwImage; Image veImage = Image.FromFile( Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Plugins\\PlaceFinder\\vejewel.png")); pictureBoxVE.Size = new Size(veImage.Width, veImage.Height); pictureBoxVE.Image = veImage; } catch{} m_WorldWindow = ww; }
/** * Returns the memory cache used to cache tiles for this class and its subclasses, initializing the cache if it * doesn't yet exist. * * @return the memory cache associated with the tile. */ public static synchronized MemoryCache getMemoryCache() { if (!WorldWind.getMemoryCacheSet().containsCache(TextureTile.class.getName()))
private string[] getWplFiles(WorldWind.Renderable.RenderableObject ro) { if(ro is WorldWind.Renderable.TiledPlacenameSet) { if(ro.MetaData.Contains("PlacenameDataFile")) { return (string[])new string[] {(string)ro.MetaData["PlacenameDataFile"]}; } } else if(ro is WorldWind.Renderable.RenderableObjectList) { WorldWind.Renderable.RenderableObjectList rol = (WorldWind.Renderable.RenderableObjectList)ro; ArrayList wplFiles = new ArrayList(); foreach(WorldWind.Renderable.RenderableObject childRo in rol.ChildObjects) { string[] childStrings = getWplFiles(childRo); if(childStrings != null) foreach(string childString in childStrings) wplFiles.Add(childString); } if(wplFiles.Count > 0) return (string[])wplFiles.ToArray(typeof(string)); } return null; }