Example #1
0
 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);
 }
Example #2
0
 public static ICoordTranslator BuildDefaultSystem(Coord machineMin, Coord machineMax)
 {
     return new IdentityTranslator(new MachineCoordSystem(machineMin, machineMax));
 }
Example #3
0
 public Coord ToInner(Coord c)
 {
     return new Coord(c.X, c.Y + c.X * _xShear, c.Z, c.A);
 }
Example #4
0
 public bool BoundsCheck(Coord c)
 {
     return _inner.BoundsCheck(ToInner(c));
 }
Example #5
0
 public Coord FromInner(Coord c)
 {
     return new Coord(c.X, c.Y - c.X * _xShear, c.Z, c.A);
 }
Example #6
0
 /// <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);
 }
Example #7
0
 /// <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);
 }
Example #8
0
 public bool BoundsCheck(Coord c)
 {
     return CoordSystemUtils.BoundsCheck(this, c);
 }
Example #9
0
 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;
 }
Example #10
0
 public Coord ToInner(Coord c)
 {
     return c;
 }
Example #11
0
 public Coord FromInner(Coord c)
 {
     return c;
 }
Example #12
0
 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;
 }