Пример #1
0
 protected Element(BasePoint center, double xLength, double yLength, double zLength, Element[] neighbours, string material, int?index)
     : base(xLength, yLength, zLength)
 {
     Center     = center;
     XLength    = xLength;
     YLength    = yLength;
     ZLength    = zLength;
     Material   = material;
     Neighbours = neighbours;
     Index      = index;
 }
Пример #2
0
        public Direction?GetPosition(BasePoint another)
        {
            Direction?   result;
            const double deltaX = 0.1;
            const double deltaY = 0.1;
            const double deltaZ = 0.1;

            if ((Z < another.Z) && (Math.Abs(Y - another.Y) < deltaY) && (Math.Abs(X - another.X) < deltaX))
            {
                result = Direction.Top;
            }

            else if ((Z > another.Z) && (Math.Abs(Y - another.Y) < deltaY) && (Math.Abs(X - another.X) < deltaX))
            {
                result = Direction.Bottom;
            }

            else if ((Y > another.Y) && (Math.Abs(Z - another.Z) < deltaZ) && (Math.Abs(X - another.X) < deltaX))
            {
                result = Direction.Front;
            }

            else if ((Y < another.Y) && (Math.Abs(Z - another.Z) < deltaZ) && (Math.Abs(X - another.X) < deltaX))
            {
                result = Direction.Back;
            }

            else if ((X < another.X) && (Math.Abs(Y - another.Y) < deltaY) && (Math.Abs(Z - another.Z) < deltaZ))
            {
                result = Direction.Right;
            }

            else if ((X > another.X) && (Math.Abs(Y - another.Y) < deltaY) && (Math.Abs(Z - another.Z) < deltaZ))
            {
                result = Direction.Left;
            }

            else
            {
                result = null;
            }
            // Todo : cross fingers and hope that all of the conditions will be true.
            return(result);
        }
Пример #3
0
 /// <summary>
 /// Compares probe to basis
 /// </summary>
 /// <param name="probe">Probe to be compared</param>
 /// <returns>True if probe GREATER than basis by all coordinates</returns>
 public bool IsGreater(BasePoint probe)
 {
     return(X > probe.X && Y > probe.Y && Z > probe.Z);
 }
Пример #4
0
 /// <summary>
 /// Compares probe to basis
 /// </summary>
 /// <param name="probe">Probe to be compared</param>
 /// <returns>True if probe LOWER than basis by all coordinates</returns>
 public bool IsLower(BasePoint probe)
 {
     return(X < probe.X && Y < probe.Y && Z < probe.Z);
 }
Пример #5
0
 public void MoveUsingNegativeOffsetVector(BasePoint vector)
 {
     X += vector.X;
     Y += vector.Y;
     Z += vector.Z;
 }
Пример #6
0
 public Element(BasePoint center, ElementBase elementBase, int index)
     : this(center, elementBase.XLength, elementBase.YLength, elementBase.ZLength, new Element[neighboursNumber], string.Empty, index)
 {
 }
Пример #7
0
 public Element(BasePoint center, double xLength, double yLength, double zLength, string material)
     : this(center, xLength, yLength, zLength, new Element[neighboursNumber], material, null)
 {
 }
Пример #8
0
 public Element(BasePoint center, double xLength, double yLength, double zLength)
     : this(center, xLength, yLength, zLength, new Element[neighboursNumber], string.Empty, null)
 {
 }