public GridAxisIterator3D(EGridAxis3D axis, GridCoord3D startCoord, GridSize3D gridSize) { Axis = axis; StartIndex = startCoord.Index; GridIterator3D iterator = new GridIterator3D(gridSize); Step = iterator.Get(axis); }
public static EGridAxis3D GetRemainingAxis(EGridAxis3D a, EGridAxis3D b) { if (a != EGridAxis3D.Z && b != EGridAxis3D.Z) { return(EGridAxis3D.Z); } else if (a != EGridAxis3D.Y && b != EGridAxis3D.Y) { return(EGridAxis3D.Y); } else { return(EGridAxis3D.X); } }
public int Get(EGridAxis3D axis) { switch (axis) { case EGridAxis3D.X: return(X); case EGridAxis3D.Y: return(Y); case EGridAxis3D.Z: return(Z); } throw new NotImplementedException(); }
public GridCoord3D Set(GridSize3D size, EGridAxis3D axis, int value) { switch (axis) { case EGridAxis3D.X: return(new GridCoord3D(size, value, Point.Y, Point.Z)); case EGridAxis3D.Y: return(new GridCoord3D(size, Point.X, value, Point.Z)); case EGridAxis3D.Z: return(new GridCoord3D(size, Point.X, Point.Y, value)); default: throw new NotImplementedException(); } }
public GridPoint3D Set(EGridAxis3D axis, int value) { switch (axis) { case EGridAxis3D.X: return(new GridPoint3D(value, Y, Z)); case EGridAxis3D.Y: return(new GridPoint3D(X, value, Z)); case EGridAxis3D.Z: return(new GridPoint3D(X, Y, value)); default: throw new NotImplementedException(); } }
public GridPoint3D Translate(EGridAxis3D axis, int distance) { switch (axis) { case EGridAxis3D.X: return(new GridPoint3D(X + distance, Y, Z)); case EGridAxis3D.Y: return(new GridPoint3D(X, Y + distance, Z)); case EGridAxis3D.Z: return(new GridPoint3D(X, Y, Z + distance)); default: throw new NotImplementedException(); } }
public static GridCoord3D GetIterator(this EGridAxis3D axis, GridSize3D size, int step = 1, bool negative = false) { int direction = (negative ? -step : step); switch (axis) { case EGridAxis3D.X: return(new GridCoord3D(size, direction, 0, 0)); case EGridAxis3D.Y: return(new GridCoord3D(size, 0, direction, 0)); case EGridAxis3D.Z: return(new GridCoord3D(size, 0, 0, direction)); default: throw new NotImplementedException(); } }
public GridAxes3D(EGridAxis3D a, EGridAxis3D b) { A = a; B = b; C = EGridAxis3DExt.GetRemainingAxis(A, B); }
public GridAxes3D(EGridAxis3D a, EGridAxis3D b, EGridAxis3D c) { A = a; B = b; C = c; }