コード例 #1
0
        public override List <DisplayCell> RenderCells(List <Cell> cells, CellRenderOptions options)
        {
            var maxHeat = cells.Max(cell => cell.MantleLayer.Heat);
            var minHeat = cells.Min(cell => cell.MantleLayer.Heat);

            return(cells.Select(cell => RenderCell(cell, options, maxHeat, minHeat)).Where(cell => cell != null).ToList());
        }
コード例 #2
0
        private DisplayCell RenderCell(Cell cell, CellRenderOptions options, double maxHeat, double minHeat)
        {
            var newCell = RenderBaseCell(cell, options);

            var percentColor = (cell.MantleLayer.Heat - minHeat) / (maxHeat - minHeat);

            newCell.HasColor = true;
            newCell.Color    = ColorTools.Gradiated(Color.DarkRed, Color.Yellow, double.IsNaN(percentColor) ? 1.0 : percentColor);

            return(newCell);
        }
コード例 #3
0
        protected DisplayCell RenderBaseCell(Cell cell, CellRenderOptions options)
        {
            var newCell = new DisplayCell();

            newCell.Points = cell.Points.ToArray();
            if (newCell.Points.Any(point => point == null))
            {
                return(null);
            }

            newCell.HasOutline = options.ShowCellOutline;

            return(newCell);
        }
コード例 #4
0
        private DisplayCell RenderCell(Cell cell, CellRenderOptions options)
        {
            var newCell = RenderBaseCell(cell, options);

            newCell.HasColor = true;
            if (cell.Longitude >= 0)
            {
                newCell.Color = cell.Latitude >= 0 ? Color.Red : Color.Green;
            }
            else
            {
                newCell.Color = cell.Latitude >= 0 ? Color.Blue : Color.Yellow;
            }

            return(newCell);
        }
コード例 #5
0
 public virtual List <DisplayCell> RenderCells(List <Cell> cells, CellRenderOptions options)
 {
     return(cells.Select(cell => RenderBaseCell(cell, options)).Where(cell => cell != null).ToList());
 }