private void AssertIndexCalculation(GridSize3D gridSize, int x, int y, int z) { GridCoord3D coord = new GridCoord3D(gridSize, x, y, z); GridCoord3D index = new GridCoord3D(gridSize, coord.Index); AssertPoint(coord.Point, index.Point.X, index.Point.Y, index.Point.Z); }
public GridAxisIterator3D(EGridAxis3D axis, GridCoord3D startCoord, GridSize3D gridSize) { Axis = axis; StartIndex = startCoord.Index; GridIterator3D iterator = new GridIterator3D(gridSize); Step = iterator.Get(axis); }
public void GridTraversal() { GridSize3D size = new GridSize3D(5, 6, 7); GridCoord3D coord = new GridCoord3D(size, 3, 3, 3); GridIterator3D traversal = new GridIterator3D(size); GridCoord3D changed = new GridCoord3D(size, coord.Index + traversal.Y); AssertPoint(changed.Point, 3, 4, 3); changed = new GridCoord3D(size, coord.Index - traversal.Y); AssertPoint(changed.Point, 3, 2, 3); changed = new GridCoord3D(size, coord.Index + traversal.X); AssertPoint(changed.Point, 4, 3, 3); changed = new GridCoord3D(size, coord.Index - traversal.X); AssertPoint(changed.Point, 2, 3, 3); changed = new GridCoord3D(size, coord.Index + traversal.Z); AssertPoint(changed.Point, 3, 3, 4); changed = new GridCoord3D(size, coord.Index - traversal.Z); AssertPoint(changed.Point, 3, 3, 2); }
public DataGrid3D(GridSize3D size) { Size = size; Iterator = new GridIterator3D(size); Cells = new TCell[size.Length]; }