internal ProjectedVectorTile( GeographicBoundingBox geographicBoundingBox, ProjectedVectorRenderer parentLayer ) { m_geographicBoundingBox = geographicBoundingBox; m_parentProjectedLayer = parentLayer; BoundingBox = new BoundingBox( (float)geographicBoundingBox.South, (float)geographicBoundingBox.North, (float)geographicBoundingBox.West, (float)geographicBoundingBox.East, (float)(parentLayer.World.EquatorialRadius + geographicBoundingBox.MinimumAltitude), (float)(parentLayer.World.EquatorialRadius + geographicBoundingBox.MaximumAltitude + 300000f)); }
public ProjectedVectorTile( GeographicBoundingBox geographicBoundingBox, ProjectedVectorRenderer parentLayer ) { m_geographicBoundingBox = geographicBoundingBox; m_parentProjectedLayer = parentLayer; BoundingBox = new BoundingBox((float)geographicBoundingBox.South, (float)geographicBoundingBox.North, (float)geographicBoundingBox.West, (float)geographicBoundingBox.East, (float)(parentLayer.World.EquatorialRadius + geographicBoundingBox.MinimumAltitude), (float)(parentLayer.World.EquatorialRadius + geographicBoundingBox.MaximumAltitude + 300000f)); }
/// <summary> /// Initializes a new instance of the <see cref= "T:WorldWind.World"/> class. /// </summary> /// <param name="name"></param> /// <param name="position"></param> /// <param name="orientation"></param> /// <param name="equatorialRadius"></param> /// <param name="cacheDirectory"></param> /// <param name="terrainAccessor"></param> public World(string name, Point3d position, Quaternion4d orientation, double equatorialRadius, string cacheDirectory, TerrainAccessor terrainAccessor) : base(name, position, orientation) { this.equatorialRadius = equatorialRadius; this._terrainAccessor = terrainAccessor; this._renderableObjects = new RenderableObjectList(this.Name); this.MetaData.Add("CacheDirectory", cacheDirectory); // this.m_WorldSurfaceRenderer = new WorldSurfaceRenderer(32, 0, this); this.m_projectedVectorRenderer = new ProjectedVectorRenderer("World Default ProjectedVectorRenderer", this); m_outerSphere = new AtmosphericScatteringSphere(); AtmosphericScatteringSphere.m_fInnerRadius = (float)equatorialRadius; AtmosphericScatteringSphere.m_fOuterRadius = (float)equatorialRadius * 1.025f; m_outerSphere.Init((float)equatorialRadius * 1.025f); }
private static RenderableObject Construct(String strRelativeDirectory, KMLObject oSource, World oWorld, GeographicBoundingBox oBounds, ProjectedVectorRenderer oPVR, Icons oIcons) { if (oSource is KMLContainer) { KMLContainer oCastSource = oSource as KMLContainer; KMLRenderableObjectList result = new KMLRenderableObjectList(oCastSource.Name); if (oPVR == null) { oPVR = new ProjectedVectorRenderer("Polygons and LineStrings", oWorld); result.Add(oPVR); } if (oIcons == null) { oIcons = new Icons("Icons"); result.Add(oIcons); } for (int count = 0; count < oCastSource.Count; count++) { if (oCastSource[count].Visibility == true) { RenderableObject oLayer = Construct(strRelativeDirectory, oCastSource[count], oWorld, oBounds, oPVR, oIcons); if (oLayer != null) { result.Add(oLayer); } } } return result; } else if (oSource is KMLPlacemark) { KMLPlacemark oCastSource = oSource as KMLPlacemark; return Construct(strRelativeDirectory, oCastSource.Geometry, oWorld, oBounds, oPVR, oIcons); } else if (oSource is KMLMultiGeometry) { KMLMultiGeometry oCastSource = oSource as KMLMultiGeometry; KMLRenderableObjectList result = new KMLRenderableObjectList("MultiGeometry"); for (int count = 0; count < oCastSource.Count; count++) { RenderableObject oLayer = Construct(strRelativeDirectory, oCastSource[count], oWorld, oBounds, oPVR, oIcons); if (oLayer != null) { result.Add(oLayer); } } return result; } else if (oSource is KMLPoint) { KMLPoint oCastSource = oSource as KMLPoint; KMLIcon result = new KMLIcon(oCastSource.Owner.Name, oCastSource.Coordinates.Latitude, oCastSource.Coordinates.Longitude, oCastSource.Coordinates.Altitude); result.DrawGroundStick = oCastSource.Extrude; result.Rotation = WorldWind.Angle.FromDegrees(oCastSource.Style.NormalStyle.IconStyle.Heading); result.IsRotated = oCastSource.Style.NormalStyle.IconStyle.Heading != 0.0f; result.NormalColor = oCastSource.Style.NormalStyle.LabelStyle.Color; result.HotColor = oCastSource.Style.HighlightStyle.LabelStyle.Color; oIcons.Add(result); oBounds.Union(oCastSource.Coordinates.Longitude, oCastSource.Coordinates.Latitude, oCastSource.Coordinates.Altitude); return null; } else if (oSource is KMLPolygon) { KMLPolygon oCastSource = oSource as KMLPolygon; Polygon oTool = new Polygon(); oTool.outerBoundary = new WorldWind.LinearRing(GetPoints(oCastSource.OuterBoundary)); oTool.innerBoundaries = GetInnerBoundaries(oCastSource); oTool.PolgonColor = oCastSource.Style.NormalStyle.PolyStyle.Color; oTool.Fill = oCastSource.Style.NormalStyle.PolyStyle.Fill; oTool.LineWidth = oCastSource.Style.NormalStyle.LineStyle.Width; oTool.Outline = oCastSource.Style.NormalStyle.PolyStyle.Outline; oTool.OutlineColor = oCastSource.Style.NormalStyle.LineStyle.Color; oPVR.Add(oTool); oBounds.Union(oTool.GetGeographicBoundingBox()); return null; } else if (oSource is KMLLineString) { KMLLineString oCastSource = oSource as KMLLineString; LineString oTool = new LineString(); oTool.Coordinates = GetPoints(oCastSource); oTool.Color = oCastSource.Style.NormalStyle.LineStyle.Color; oTool.LineWidth = oCastSource.Style.NormalStyle.LineStyle.Width; oPVR.Add(oTool); oBounds.Union(oTool.GetGeographicBoundingBox()); return null; } else if (oSource is KMLGroundOverlay) { KMLGroundOverlay oCastSource = oSource as KMLGroundOverlay; KMLGroundOverlayRenderable result = new KMLGroundOverlayRenderable(oCastSource, strRelativeDirectory); oBounds.Union(new GeographicBoundingBox(oCastSource.LatLonBox.North, oCastSource.LatLonBox.South, oCastSource.LatLonBox.West, oCastSource.LatLonBox.East)); return result; } else { return null; } }