Beispiel #1
0
        public ShapeTileArgs(World parentWorld, Size tilePixelSize, double layerRadius, ShapeFileLayer parentShapeLayer, string dataKey, bool scaleColors, double scaleMin, double scaleMax, string[] noDataValues, string[] activeDataValues, bool polygonFill, bool outlinePolygons, Color polygonColor, ShapeFillStyle shapeFillStyle, Color lineColor, Color labelColor, float lineWidth, bool showLabels)
        {
            ParentShapeFileLayer = parentShapeLayer;
            LayerRadius = layerRadius;

            m_ParentWorld = parentWorld;
            m_TilePixelSize = tilePixelSize;
            m_DataKey = dataKey;
            m_ScaleColors = scaleColors;
            m_PolygonFill = polygonFill;
            m_ScaleMin = scaleMin;
            m_ScaleMax = scaleMax;
            m_NoDataValues = noDataValues;
            m_ActiveDataValues = activeDataValues;
            m_PolygonFill = polygonFill;
            m_OutlinePolygons = outlinePolygons;
            m_PolygonColor = polygonColor;
            m_ShapeFillStyle = shapeFillStyle;
            m_LineColor = lineColor;
            m_LabelColor = labelColor;
            m_LineWidth = lineWidth;
            m_ShowLabels = showLabels;
        }
Beispiel #2
0
 public static HatchStyle getGDIHatchStyle(ShapeFillStyle shapeFillStyle)
 {
     if (shapeFillStyle == ShapeFillStyle.BackwardDiagonal) {
         return HatchStyle.BackwardDiagonal;
     }
     else if (shapeFillStyle == ShapeFillStyle.Cross) {
         return HatchStyle.Cross;
     }
     else if (shapeFillStyle == ShapeFillStyle.DarkDownwardDiagonal) {
         return HatchStyle.DarkDownwardDiagonal;
     }
     else if (shapeFillStyle == ShapeFillStyle.DarkHorizontal) {
         return HatchStyle.DarkHorizontal;
     }
     else if (shapeFillStyle == ShapeFillStyle.DarkUpwardDiagonal) {
         return HatchStyle.DarkUpwardDiagonal;
     }
     else if (shapeFillStyle == ShapeFillStyle.DarkVertical) {
         return HatchStyle.DarkVertical;
     }
     else if (shapeFillStyle == ShapeFillStyle.DashedDownwardDiagonal) {
         return HatchStyle.DashedDownwardDiagonal;
     }
     else if (shapeFillStyle == ShapeFillStyle.DashedHorizontal) {
         return HatchStyle.DashedHorizontal;
     }
     else if (shapeFillStyle == ShapeFillStyle.DashedUpwardDiagonal) {
         return HatchStyle.DashedUpwardDiagonal;
     }
     else if (shapeFillStyle == ShapeFillStyle.DashedVertical) {
         return HatchStyle.DashedVertical;
     }
     else if (shapeFillStyle == ShapeFillStyle.DiagonalBrick) {
         return HatchStyle.DiagonalBrick;
     }
     else if (shapeFillStyle == ShapeFillStyle.DiagonalCross) {
         return HatchStyle.DiagonalCross;
     }
     else if (shapeFillStyle == ShapeFillStyle.Divot) {
         return HatchStyle.Divot;
     }
     else if (shapeFillStyle == ShapeFillStyle.DottedDiamond) {
         return HatchStyle.DottedDiamond;
     }
     else if (shapeFillStyle == ShapeFillStyle.DottedGrid) {
         return HatchStyle.DottedGrid;
     }
     else if (shapeFillStyle == ShapeFillStyle.ForwardDiagonal) {
         return HatchStyle.ForwardDiagonal;
     }
     else if (shapeFillStyle == ShapeFillStyle.Horizontal) {
         return HatchStyle.Horizontal;
     }
     else if (shapeFillStyle == ShapeFillStyle.LargeCheckerBoard) {
         return HatchStyle.LargeCheckerBoard;
     }
     else if (shapeFillStyle == ShapeFillStyle.LargeConfetti) {
         return HatchStyle.LargeConfetti;
     }
     else if (shapeFillStyle == ShapeFillStyle.LargeGrid) {
         return HatchStyle.LargeGrid;
     }
     else if (shapeFillStyle == ShapeFillStyle.LightDownwardDiagonal) {
         return HatchStyle.LightDownwardDiagonal;
     }
     else if (shapeFillStyle == ShapeFillStyle.LightHorizontal) {
         return HatchStyle.LightHorizontal;
     }
     else if (shapeFillStyle == ShapeFillStyle.LightUpwardDiagonal) {
         return HatchStyle.LightUpwardDiagonal;
     }
     else if (shapeFillStyle == ShapeFillStyle.LightVertical) {
         return HatchStyle.LightVertical;
     }
     else if (shapeFillStyle == ShapeFillStyle.Max) {
         return HatchStyle.Max;
     }
     else if (shapeFillStyle == ShapeFillStyle.Min) {
         return HatchStyle.Min;
     }
     else if (shapeFillStyle == ShapeFillStyle.NarrowHorizontal) {
         return HatchStyle.NarrowHorizontal;
     }
     else if (shapeFillStyle == ShapeFillStyle.NarrowVertical) {
         return HatchStyle.NarrowVertical;
     }
     else if (shapeFillStyle == ShapeFillStyle.OutlinedDiamond) {
         return HatchStyle.OutlinedDiamond;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent05) {
         return HatchStyle.Percent05;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent10) {
         return HatchStyle.Percent10;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent20) {
         return HatchStyle.Percent20;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent25) {
         return HatchStyle.Percent25;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent30) {
         return HatchStyle.Percent30;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent40) {
         return HatchStyle.Percent40;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent50) {
         return HatchStyle.Percent50;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent60) {
         return HatchStyle.Percent60;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent70) {
         return HatchStyle.Percent70;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent75) {
         return HatchStyle.Percent75;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent80) {
         return HatchStyle.Percent80;
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent90) {
         return HatchStyle.Percent90;
     }
     else if (shapeFillStyle == ShapeFillStyle.Plaid) {
         return HatchStyle.Plaid;
     }
     else if (shapeFillStyle == ShapeFillStyle.Shingle) {
         return HatchStyle.Shingle;
     }
     else if (shapeFillStyle == ShapeFillStyle.SmallCheckerBoard) {
         return HatchStyle.SmallCheckerBoard;
     }
     else if (shapeFillStyle == ShapeFillStyle.SmallConfetti) {
         return HatchStyle.SmallConfetti;
     }
     else if (shapeFillStyle == ShapeFillStyle.SmallGrid) {
         return HatchStyle.SmallGrid;
     }
     else if (shapeFillStyle == ShapeFillStyle.SolidDiamond) {
         return HatchStyle.SolidDiamond;
     }
     else if (shapeFillStyle == ShapeFillStyle.Sphere) {
         return HatchStyle.Sphere;
     }
     else if (shapeFillStyle == ShapeFillStyle.Trellis) {
         return HatchStyle.Trellis;
     }
     else if (shapeFillStyle == ShapeFillStyle.Wave) {
         return HatchStyle.Wave;
     }
     else if (shapeFillStyle == ShapeFillStyle.Weave) {
         return HatchStyle.Weave;
     }
     else if (shapeFillStyle == ShapeFillStyle.WideDownwardDiagonal) {
         return HatchStyle.WideDownwardDiagonal;
     }
     else if (shapeFillStyle == ShapeFillStyle.WideUpwardDiagonal) {
         return HatchStyle.WideUpwardDiagonal;
     }
     else {
         return HatchStyle.ZigZag;
     }
 }
Beispiel #3
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, Color polygonFillColor, ShapeFillStyle shapeFillHatchStyle, Color lineColor, float lineWidth, bool showLabels, Color labelColor, string iconFilePath, int iconWidth, int iconHeight, byte iconOpacity)
            : base(id, parentWorld.Position, parentWorld.Orientation)
        {
            m_MinimumViewingAltitude = minimumViewingAltitude;
            m_MaximumViewingAltitude = maximumViewingAltitude;
            m_lztsd = lztsd;

            m_ShapeTileArgs = new ShapeTileArgs(parentWorld, new 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);
                    m_RootTiles[i*m_NumberRootTilesHigh*2 + j].Level = 0;
                    m_RootTiles[i*m_NumberRootTilesHigh*2 + j].Row = i;
                    m_RootTiles[i*m_NumberRootTilesHigh*2 + j].Col = j;

                    createdtiles++;
                }
            }
            //Console.WriteLine("Created Tiles "+createdtiles);
        }
Beispiel #4
0
 public static System.Drawing.Drawing2D.HatchStyle getGDIHatchStyle(ShapeFillStyle shapeFillStyle)
 {
     if (shapeFillStyle == ShapeFillStyle.BackwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.BackwardDiagonal);
     }
     else if (shapeFillStyle == ShapeFillStyle.Cross)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Cross);
     }
     else if (shapeFillStyle == ShapeFillStyle.DarkDownwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DarkDownwardDiagonal);
     }
     else if (shapeFillStyle == ShapeFillStyle.DarkHorizontal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DarkHorizontal);
     }
     else if (shapeFillStyle == ShapeFillStyle.DarkUpwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DarkUpwardDiagonal);
     }
     else if (shapeFillStyle == ShapeFillStyle.DarkVertical)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DarkVertical);
     }
     else if (shapeFillStyle == ShapeFillStyle.DashedDownwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DashedDownwardDiagonal);
     }
     else if (shapeFillStyle == ShapeFillStyle.DashedHorizontal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DashedHorizontal);
     }
     else if (shapeFillStyle == ShapeFillStyle.DashedUpwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DashedUpwardDiagonal);
     }
     else if (shapeFillStyle == ShapeFillStyle.DashedVertical)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DashedVertical);
     }
     else if (shapeFillStyle == ShapeFillStyle.DiagonalBrick)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DiagonalBrick);
     }
     else if (shapeFillStyle == ShapeFillStyle.DiagonalCross)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DiagonalCross);
     }
     else if (shapeFillStyle == ShapeFillStyle.Divot)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Divot);
     }
     else if (shapeFillStyle == ShapeFillStyle.DottedDiamond)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DottedDiamond);
     }
     else if (shapeFillStyle == ShapeFillStyle.DottedGrid)
     {
         return(System.Drawing.Drawing2D.HatchStyle.DottedGrid);
     }
     else if (shapeFillStyle == ShapeFillStyle.ForwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.ForwardDiagonal);
     }
     else if (shapeFillStyle == ShapeFillStyle.Horizontal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Horizontal);
     }
     else if (shapeFillStyle == ShapeFillStyle.LargeCheckerBoard)
     {
         return(System.Drawing.Drawing2D.HatchStyle.LargeCheckerBoard);
     }
     else if (shapeFillStyle == ShapeFillStyle.LargeConfetti)
     {
         return(System.Drawing.Drawing2D.HatchStyle.LargeConfetti);
     }
     else if (shapeFillStyle == ShapeFillStyle.LargeGrid)
     {
         return(System.Drawing.Drawing2D.HatchStyle.LargeGrid);
     }
     else if (shapeFillStyle == ShapeFillStyle.LightDownwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.LightDownwardDiagonal);
     }
     else if (shapeFillStyle == ShapeFillStyle.LightHorizontal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.LightHorizontal);
     }
     else if (shapeFillStyle == ShapeFillStyle.LightUpwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.LightUpwardDiagonal);
     }
     else if (shapeFillStyle == ShapeFillStyle.LightVertical)
     {
         return(System.Drawing.Drawing2D.HatchStyle.LightVertical);
     }
     else if (shapeFillStyle == ShapeFillStyle.Max)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Max);
     }
     else if (shapeFillStyle == ShapeFillStyle.Min)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Min);
     }
     else if (shapeFillStyle == ShapeFillStyle.NarrowHorizontal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.NarrowHorizontal);
     }
     else if (shapeFillStyle == ShapeFillStyle.NarrowVertical)
     {
         return(System.Drawing.Drawing2D.HatchStyle.NarrowVertical);
     }
     else if (shapeFillStyle == ShapeFillStyle.OutlinedDiamond)
     {
         return(System.Drawing.Drawing2D.HatchStyle.OutlinedDiamond);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent05)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent05);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent10)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent10);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent20)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent20);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent25)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent25);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent30)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent30);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent40)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent40);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent50)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent50);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent60)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent60);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent70)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent70);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent75)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent75);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent80)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent80);
     }
     else if (shapeFillStyle == ShapeFillStyle.Percent90)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Percent90);
     }
     else if (shapeFillStyle == ShapeFillStyle.Plaid)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Plaid);
     }
     else if (shapeFillStyle == ShapeFillStyle.Shingle)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Shingle);
     }
     else if (shapeFillStyle == ShapeFillStyle.SmallCheckerBoard)
     {
         return(System.Drawing.Drawing2D.HatchStyle.SmallCheckerBoard);
     }
     else if (shapeFillStyle == ShapeFillStyle.SmallConfetti)
     {
         return(System.Drawing.Drawing2D.HatchStyle.SmallConfetti);
     }
     else if (shapeFillStyle == ShapeFillStyle.SmallGrid)
     {
         return(System.Drawing.Drawing2D.HatchStyle.SmallGrid);
     }
     else if (shapeFillStyle == ShapeFillStyle.SolidDiamond)
     {
         return(System.Drawing.Drawing2D.HatchStyle.SolidDiamond);
     }
     else if (shapeFillStyle == ShapeFillStyle.Sphere)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Sphere);
     }
     else if (shapeFillStyle == ShapeFillStyle.Trellis)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Trellis);
     }
     else if (shapeFillStyle == ShapeFillStyle.Wave)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Wave);
     }
     else if (shapeFillStyle == ShapeFillStyle.Weave)
     {
         return(System.Drawing.Drawing2D.HatchStyle.Weave);
     }
     else if (shapeFillStyle == ShapeFillStyle.WideDownwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.WideDownwardDiagonal);
     }
     else if (shapeFillStyle == ShapeFillStyle.WideUpwardDiagonal)
     {
         return(System.Drawing.Drawing2D.HatchStyle.WideUpwardDiagonal);
     }
     else
     {
         return(System.Drawing.Drawing2D.HatchStyle.ZigZag);
     }
 }