Ejemplo n.º 1
0
        /// <summary>
        /// Traces out points to generate a list of traced points.
        /// </summary>
        /// <returns>List of traced out points.</returns>
        private List <KeyPoint> TracePoints()
        {
            var tracedPoints = new List <KeyPoint>();
            var basePoint    = new BasePoint(position);
            var index        = 0;

            tracedPoints.Add(position);
            for (int i = 0; i < _stepCount; i++)
            {
                var thisAngle = new double[3]
                {
                    dendriticAngle[0],
                    dendriticAngle[1],
                    _stepSize *(i + 1),
                };
                var newPoint = basePoint.Transform(thisAngle);
                if (!newPoint.Equals(tracedPoints[index]))
                {
                    tracedPoints.Add(newPoint);
                    index++;
                }
                if (index > _pointCount)
                {
                    break;
                }
            }
            CleanPointList(tracedPoints);
            return(tracedPoints);
        }
Ejemplo n.º 2
0
        public DendriticShape(KeyPoint centerPoint)
        {
            var basePoint = new BasePoint(centerPoint);
            var angle     = new double[3]
            {
                0,
                0,
                0.5 * Math.PI,
            };

            basePoint = new BasePoint(basePoint.Transform(angle));
            Direction = new double[DirectionCount][];
            angle[0]  = centerPoint.X * _dTheta;
            angle[1]  = (centerPoint.Y * _dPhi) + _phiShift;
            for (int i = 0; i < DirectionCount; i++)
            {
                angle[2] = i * 2 * Math.PI / DirectionCount;
                var sidePoint = basePoint.Transform(angle);
                Direction[i] = new double[2]
                {
                    sidePoint.X *_dTheta,
                    (sidePoint.Y * _dPhi) + _phiShift,
                };
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Clone Constructor for the Base Point.
 /// </summary>
 /// <param name="inPoint">Input Point.</param>
 public BasePoint(BasePoint inPoint)
 {
     _position = inPoint._position;
     Near      = inPoint.Near;
     _theta    = inPoint._theta;
     _cosPhi   = inPoint._cosPhi;
     _sinPhi   = inPoint._sinPhi;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor for Plate Point.
 /// </summary>
 /// <param name="inPoint"> Input coordinates for new point.</param>
 /// <param name="inPlateNumber">Number for which plate this point is part of.</param>
 /// <param name="time">Time for point creation.</param>
 public PlatePoint(KeyPoint inPoint, int inPlateNumber = 0, int time = 0)
 {
     point = new BasePoint(inPoint);
     _birthDate = time;
     PlateNumber = inPlateNumber;
     _birthPlace = inPoint;
     History = new BoundaryHistory();
     IsContinental = false;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructor for Plate Point.
 /// </summary>
 /// <param name="point">Point to copy.</param>
 public PlatePoint(PlatePoint inPoint)
 {
     point = new BasePoint(inPoint.point);
     PlateNumber = inPoint.PlateNumber;
     _birthDate = inPoint._birthDate;
     _birthPlace = inPoint._birthPlace;
     History = inPoint.History;
     IsContinental = inPoint.IsContinental;
 }
Ejemplo n.º 6
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();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructor for plate generation for saved data.
 /// </summary>
 /// <param name="inPosition">Current position for point.</param>
 /// <param name="inBirthPlace">Birthplace for point.</param>
 /// <param name="inBirthDate">Birthdate for point.</param>
 /// <param name="inPlate">Which plate point is part of.</param>
 /// <param name="inHistory">Boundary history for point.</param>
 /// <param name="inIsContinental">Whether or not the point is continental or oceanic.</param>
 public PlatePoint(KeyPoint inPosition, KeyPoint inBirthPlace, int inBirthDate, int inPlate, BoundaryHistory inHistory, bool inIsContinental)
 {
     point = new BasePoint(inPosition);
     _birthPlace = inBirthPlace;
     _birthDate = inBirthDate;
     PlateNumber = inPlate;
     History = inHistory;
     IsContinental = inIsContinental;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructs variables and allocates space for persistent variables.
 /// </summary>
 private static void ConstructData()
 {
     BasePoint.MapSetup(rules.xHalfSize, rules.ySize);
     point = new BasePoint[2 * rules.xHalfSize, rules.ySize];
     for (int x = 0; x < 2 * rules.xHalfSize; x++)
     {
         for (int y = 0; y < rules.ySize; y++)
         {
             point[x, y] = new BasePoint(x, y);
         }
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Starts up and allocates data arrays.
 /// </summary>
 private static void ConstructData()
 {
     BasePoint.MapSetup(rules.xHalfSize, rules.ySize);
     pointActives            = new bool[2 * rules.xHalfSize, rules.ySize];
     pointHistories          = new PlatePoint[2 * rules.xHalfSize, rules.ySize];
     newContinentalCollision = new int[2 * rules.xHalfSize, rules.ySize];
     newOceanicCollision     = new int[2 * rules.xHalfSize, rules.ySize];
     nearPoints = new AdjacentPoints[2 * rules.xHalfSize, rules.ySize];
     plates     = new Plate[rules.plateCount];
     for (int i = 0; i < rules.plateCount; i++)
     {
         plates[i] = new Plate();
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Constructs data arrays.
 /// </summary>
 private static void ConstructData()
 {
     BasePoint.MapSetup(rules.xHalfSize, rules.ySize);
     points     = new BasePoint[2 * rules.xHalfSize, rules.ySize];
     waterFlow  = new double[2 * rules.xHalfSize, rules.ySize];
     waterArea  = new double[2 * rules.xHalfSize, rules.ySize];
     lakePoints = new List <KeyPoint>();
     for (int x = 0; x < 2 * rules.xHalfSize; x++)
     {
         for (int y = 0; y < rules.ySize; y++)
         {
             points[x, y] = new BasePoint(x, y);
         }
     }
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Starts up and allocates data arrays.
 /// </summary>
 /// <param name="inRules">Rules to use for constructing data.</param>
 private static void ConstructData(GenerateRules inRules)
 {
     rules = inRules;
     BasePoint.MapSetup(rules.xHalfSize, rules.ySize);
     pointMap        = new BasePoint[2 * rules.xHalfSize, rules.ySize];
     pointMagnitudes = new double[2 * rules.xHalfSize, rules.ySize];
     pointActives    = new bool[2 * rules.xHalfSize, rules.ySize];
     platePoints     = new List <KeyPoint> [rules.plateCount];
     for (int i = 0; i < rules.plateCount; i++)
     {
         platePoints[i] = new List <KeyPoint>();
     }
     Parallel.For(0, (2 * rules.xHalfSize), (x) =>
     {
         for (int y = 0; y < rules.ySize; y++)
         {
             pointMap[x, y] = new BasePoint(x, y);
         }
     });
 }