Esempio n. 1
0
 /// <summary>
 /// Constructs a PVM task accumulator tailored to accumulate cell information to be rendered by this displayer
 /// Note: This intentionally does not pin the bounds of the accumulator to the bounds of the rendered map view
 /// as map view rotation and smoothing operations may require large areas of data to be requested to supply the final
 /// rendered outcome.
 /// </summary>
 /// <param name="valueStoreCellSizeX">The world X dimension size of cells in the value store</param>
 /// <param name="valueStoreCellSizeY">The world X dimension size of cells in the value store</param>
 /// <param name="cellsWidth">The number of cells in the X axis in the value store</param>
 /// <param name="cellsHeight">The number of cells in the X axis in the value store</param>
 /// <param name="originX">The world coordinate origin on the X axis of the area covered by the value store</param>
 /// <param name="originY">The world coordinate origin on the X axis of the area covered by the value store</param>
 /// <param name="worldX">The world coordinate width of the area covered by the value store</param>
 /// <param name="worldY">The world coordinate width of the area covered by the value store</param>
 /// <param name="sourceCellSize">The (square) size of the cells data elements are extracted from in the source data set</param>
 public IPVMTaskAccumulator GetPVMTaskAccumulator(double valueStoreCellSizeX, double valueStoreCellSizeY,
                                                  int cellsWidth, int cellsHeight,
                                                  double originX, double originY, double worldX, double worldY, double sourceCellSize
                                                  )
 {
     _taskAccumulator = new PVMTaskAccumulator <TC, TS>(valueStoreCellSizeX, valueStoreCellSizeY, cellsWidth, cellsHeight, originX, originY, worldX, worldY, sourceCellSize);
     return(_taskAccumulator);
 }
Esempio n. 2
0
        public void AllCellsAssignment_AtOrigin()
        {
            var accum = new PVMTaskAccumulator <float, ClientHeightLeafSubGrid>(
                SubGridTreeConsts.DefaultCellSize, SubGridTreeConsts.DefaultCellSize, SubGridTreeConsts.SubGridTreeDimension, SubGridTreeConsts.SubGridTreeDimension,
                0, 0,
                SubGridTreeConsts.SubGridTreeDimension * SubGridTreeConsts.DefaultCellSize, SubGridTreeConsts.SubGridTreeDimension * SubGridTreeConsts.DefaultCellSize,
                SubGridTreeConsts.DefaultCellSize);
            var subGrid = NewClientSubGrid();

            accum.Transcribe(new IClientLeafSubGrid[] { subGrid }).Should().Be(true);

            SubGridUtilities.SubGridDimensionalIterator((x, y) => Math.Abs(accum.ValueStore[x, y] - (x + y)).Should().BeLessThan(0.01f));
        }
Esempio n. 3
0
        public void SkippedCellsAssignment_AtOrigin()
        {
            var accum = new PVMTaskAccumulator <float, ClientHeightLeafSubGrid>(SubGridTreeConsts.DefaultCellSize, SubGridTreeConsts.DefaultCellSize,
                                                                                SubGridTreeConsts.SubGridTreeDimension / 2, SubGridTreeConsts.SubGridTreeDimension / 2,
                                                                                0, 0,
                                                                                SubGridTreeConsts.SubGridTreeDimension * SubGridTreeConsts.DefaultCellSize, SubGridTreeConsts.SubGridTreeDimension * SubGridTreeConsts.DefaultCellSize,
                                                                                SubGridTreeConsts.DefaultCellSize);
            var subGrid = NewClientSubGrid();

            accum.Transcribe(new IClientLeafSubGrid[] { subGrid }).Should().Be(true);

            for (var i = 0; i < 15; i++)
            {
                for (var j = 0; j < 15; j++)
                {
                    (accum.ValueStore[i, j] - ((i + j + 1) * 2)).Should().BeLessThan(0.01f);
                }
            }
        }
Esempio n. 4
0
        public void FailWithTooManySubGrids()
        {
            var accum = new PVMTaskAccumulator <float, ClientHeightLeafSubGrid>(1, 1, SubGridTreeConsts.SubGridTreeDimension, SubGridTreeConsts.SubGridTreeDimension, 0, 0, 0, 0, 0);

            accum.Transcribe(new IClientLeafSubGrid[] { null, null }).Should().Be(false);
        }
Esempio n. 5
0
        public void FailWithNullSubGridArray()
        {
            var accum = new PVMTaskAccumulator <float, ClientHeightLeafSubGrid>(1, 1, SubGridTreeConsts.SubGridTreeDimension, SubGridTreeConsts.SubGridTreeDimension, 0, 0, 0, 0, 0);

            accum.Transcribe(null).Should().Be(false);
        }
Esempio n. 6
0
        public void Creation()
        {
            var accum = new PVMTaskAccumulator <float, ClientHeightLeafSubGrid>(1, 1, 1, 1, 0, 0, 1, 1, 0);

            accum.Should().NotBeNull();
        }