예제 #1
0
        public GridAxisIterator3D(EGridAxis3D axis, GridCoord3D startCoord, GridSize3D gridSize)
        {
            Axis       = axis;
            StartIndex = startCoord.Index;

            GridIterator3D iterator = new GridIterator3D(gridSize);

            Step = iterator.Get(axis);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public DataGrid3D(GridSize3D size)
 {
     Size     = size;
     Iterator = new GridIterator3D(size);
     Cells    = new TCell[size.Length];
 }