Esempio n. 1
0
		public ShapeTile(
			GeographicBoundingBox geoBB,
			ShapeTileArgs shapeTileArgs
			)
		{
			m_GeoBB = geoBB;
			m_ShapeTileArgs = shapeTileArgs;

			BoundingBox = new BoundingBox( (float)geoBB.South, (float)geoBB.North, (float)geoBB.West, (float)geoBB.East, 
				(float)m_ShapeTileArgs.LayerRadius, (float)m_ShapeTileArgs.LayerRadius + 300000f);
		}
Esempio n. 2
0
		public ShapeFileLayer(
			string id,
			World parentWorld,
			string shapeFilePath,
			double minimumViewingAltitude,
			double maximumViewingAltitude,
			float lztsd,
			GeographicBoundingBox bounds,
			string dataKey,
			bool scaleColorsToData,
			double scalarFilterMin,
			double scalarFilterMax,
			double scaleMin,
			double scaleMax,
			string[] noDataValues,
			string[] activeDataValues,
			bool polygonFill,
			bool outlinePolygons,
			System.Drawing.Color polygonFillColor,
			ShapeFillStyle shapeFillHatchStyle,
			System.Drawing.Color lineColor,
			float lineWidth,
			bool showLabels,
			System.Drawing.Color labelColor,
			string iconFilePath,
			int iconWidth,
			int iconHeight,
			byte iconOpacity) : base(id, parentWorld.Position, parentWorld.Orientation)
		{

			this.RenderPriority = WorldWind.Renderable.RenderPriority.LinePaths;

			m_MinimumViewingAltitude = minimumViewingAltitude;
			m_MaximumViewingAltitude = maximumViewingAltitude;
			m_lztsd = lztsd;

			m_ShapeTileArgs = new ShapeTileArgs(
				parentWorld,
				new System.Drawing.Size(256, 256),
				parentWorld.EquatorialRadius,
				this,
				dataKey,
				scaleColorsToData,
				scaleMin,
				scaleMax,
				noDataValues,
				activeDataValues,
				polygonFill,
				outlinePolygons,
				polygonFillColor,
				shapeFillHatchStyle,
				lineColor,
				labelColor,
				lineWidth,
				showLabels
				);

			m_ScalarFilterMin = scalarFilterMin;
			m_ScalarFilterMax = scalarFilterMax;

			m_ShapeFilePath = shapeFilePath;

			m_IconFilePath = iconFilePath;
			m_IconWidth = iconWidth;
			m_IconHeight = iconHeight;
			m_IconOpacity = iconOpacity;
			/*Produces tile tree for whole earth*/
			/*Need to implement clipping*/			
			m_NumberRootTilesHigh = (int)(180.0f/m_lztsd);
			double tileSize = 180.0f/m_NumberRootTilesHigh;
			m_RootTiles = new ShapeTile[m_NumberRootTilesHigh * (m_NumberRootTilesHigh * 2)];

			System.Console.WriteLine("North:{0} South:{1} East:{2} West:{3}",
				bounds.North,bounds.South,bounds.East,bounds.West);
			int istart = 0;
			int iend = m_NumberRootTilesHigh;
			int jstart = 0;
			int jend = m_NumberRootTilesHigh * 2;

			int createdtiles = 0;
			for(int i = istart; i < iend; i++)
			{
				for(int j = jstart; j < jend; j++)
				{
					double north = (i + 1) * tileSize - 90.0f;
					double south = i  * tileSize - 90.0f;
					double west = j * tileSize - 180.0f;
					double east = (j + 1) * tileSize - 180.0f;
					m_RootTiles[i * m_NumberRootTilesHigh * 2 + j] = new ShapeTile(
							new GeographicBoundingBox(
							north,
							south,
							west,
							east),
							m_ShapeTileArgs);
					createdtiles++;
				}
			}
			Console.WriteLine("Created Tiles "+createdtiles);
		}