Example #1
0
        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);
        }
Example #2
0
 public TCell Get(GridCoord3D coord)
 {
     if (Cells.Length <= coord.Index)
     {
         throw new System.Exception();
     }
     return(Cells[coord.Index]);
 }
Example #3
0
 public void Set(TCell cell, GridCoord3D coord)
 {
     if (Cells.Length <= coord.Index)
     {
         throw new System.Exception();
     }
     Cells[coord.Index] = cell;
 }
Example #4
0
        public GridAxisIterator3D(EGridAxis3D axis, GridCoord3D startCoord, GridSize3D gridSize)
        {
            Axis       = axis;
            StartIndex = startCoord.Index;

            GridIterator3D iterator = new GridIterator3D(gridSize);

            Step = iterator.Get(axis);
        }
Example #5
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);
        }
Example #6
0
        public void Set(TCell cell, GridPoint3D point)
        {
            GridCoord3D coord = new GridCoord3D(Size, point.X, point.Y, point.Z);

            Set(cell, coord);
        }
Example #7
0
        public void Set(TCell cell, int x, int y, int z)
        {
            GridCoord3D coord = new GridCoord3D(Size, x, y, z);

            Set(cell, coord);
        }
Example #8
0
        public TCell Get(GridPoint3D point)
        {
            GridCoord3D coord = new GridCoord3D(Size, point);

            return(Get(coord));
        }
Example #9
0
        public TCell Get(int x, int y, int z)
        {
            GridCoord3D coord = new GridCoord3D(Size, x, y, z);

            return(Get(coord));
        }