public static ICoordTranslator BuildCompositeCoordSystem( double xShear, double xAdj, double yAdj, double zAdj, Coord machineMin, Coord machineMax) { return new ShearingCoordSystem( new ScalingCoordSystem( new MachineCoordSystem(machineMin, machineMax), xAdj, yAdj, zAdj), xShear); }
public static ICoordTranslator BuildDefaultSystem(Coord machineMin, Coord machineMax) { return new IdentityTranslator(new MachineCoordSystem(machineMin, machineMax)); }
public Coord ToInner(Coord c) { return new Coord(c.X, c.Y + c.X * _xShear, c.Z, c.A); }
public bool BoundsCheck(Coord c) { return _inner.BoundsCheck(ToInner(c)); }
public Coord FromInner(Coord c) { return new Coord(c.X, c.Y - c.X * _xShear, c.Z, c.A); }
/// <summary> /// Converts a coordiante in inner system coordinates to the outer system coordinates. /// </summary> public Coord FromInner(Coord c) { return new Coord(c.X / _xAdj, c.Y / _yAdj, c.Z / _zAdj, c.A); }
/// <summary> /// Converts a coordiante in this system's coordinates to the inner system coordiantes. /// </summary> public Coord ToInner(Coord c) { return new Coord(c.X * _xAdj, c.Y * _yAdj, c.Z * _zAdj, c.A); }
public bool BoundsCheck(Coord c) { return CoordSystemUtils.BoundsCheck(this, c); }
public MachineCoordSystem(Coord min, Coord max) { Contract.Assert(min.X < max.X); Contract.Assert(min.Y < max.Y); Contract.Assert(min.Z < max.Z); Contract.Assert(min.A < max.A); _min = min; _max = max; }
public Coord ToInner(Coord c) { return c; }
public Coord FromInner(Coord c) { return c; }
public static bool BoundsCheck(this ICoordSystem system, Coord c) { var min = system.Min; var max = system.Max; return c.X >= min.X && c.X <= max.X && c.Y >= min.Y && c.Y <= max.Y && c.Z >= min.Z && c.Z <= max.Z && c.A >= min.A && c.A <= max.A; }