Esempio n. 1
0
 /// <summary>
 /// Checks a border point in point queue.
 /// </summary>
 /// <param name="pointQueue">Point queue to withdraw point from.</param>
 /// <param name="borderPoint">Border point to dequeue and check.</param>
 /// <returns>True if still valid border point, otherwise false.</returns>
 private static bool DequeueBorderPoint(Queue <OverlapPoint> pointQueue, out OverlapPoint borderPoint)
 {
     borderPoint = pointQueue.Dequeue();
     if (UCheck(borderPoint))
     {
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor for plate expansion.
 /// </summary>
 /// <param name="inPoint">Input point.</param>
 public PlatePoint(OverlapPoint inPoint, int inBirthDate = 0)
 {
     _birthPlace = new KeyPoint(inPoint.X, inPoint.Y);
     point = new BasePoint(_birthPlace);
     _birthDate = inBirthDate;
     PlateNumber = inPoint.plateIndex[0];
     IsContinental = false;
     History = new BoundaryHistory();
 }
Esempio n. 3
0
        /// <summary>
        /// Checks points near input point and adds border points to point queue.
        /// </summary>
        /// <param name="pointQueue">Queue to add border points to.</param>
        /// <param name="iPoint">Point to check around.</param>
        /// <param name="plateIndex">Index of plate.</param>
        private static void CheckBorderPoints(Queue <OverlapPoint> pointQueue, IPoint iPoint, int plateIndex)
        {
            var newPoints = pointMap[iPoint.X, iPoint.Y].Near.Points;

            foreach (KeyPoint newSimplePoint in newPoints)
            {
                if (UCheck(newSimplePoint))
                {
                    var newPoint = new OverlapPoint(newSimplePoint, plateIndex);
                    pointQueue.Enqueue(newPoint);
                }
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Adds border point to point list.
 /// </summary>
 /// <param name="iPoint">Point to add.</param>
 private static void AddBorderPoint(OverlapPoint iPoint)
 {
     pointActives[iPoint.X, iPoint.Y] = true;
     platePoints[iPoint.plateIndex[0]].Add(new KeyPoint(iPoint.X, iPoint.Y));
 }