コード例 #1
0
ファイル: Types.cs プロジェクト: lverre/CartaMei
        /// <summary>
        /// Checks whether a rectangle intersects with this one.
        /// </summary>
        /// <param name="other">The rectangle to test.</param>
        /// <returns>true if <paramref name="other"/> intersects with this one, false otherwise.</returns>
        public bool Intersects(LatLonBoundaries other)
        {
            var latDiff = Math.Abs(other.CenterLatitude.FixCoordinate(true) - this.CenterLatitude);
            var lonDiff = Math.Abs(other.CenterLongitude.FixCoordinate(false) - this.CenterLongitude);

            return
                (Math.Abs(other.CenterLatitude.FixCoordinate(true) - this.CenterLatitude) <= ((this.LatitudeSpan + other.LatitudeSpan) / 2) &&
                 Math.Abs(other.CenterLongitude.FixCoordinate(true) - this.CenterLongitude) <= ((this.LongitudeSpan + other.LongitudeSpan) / 2));
        }
コード例 #2
0
 public DrawContext(UIElement container, RedrawType redrawType, Transform transform, MatrixTransform cumulativeTransform, LatLonBoundaries boundaries, IProjection projection, DisplayType displayType, long animationStep)
 {
     this.Container           = container;
     this.RedrawType          = redrawType;
     this.Transform           = transform;
     this.CumulativeTransform = cumulativeTransform;
     this.Boundaries          = boundaries;
     this.Projection          = projection;
     this.DisplayType         = displayType;
     this.AnimationStep       = animationStep;
 }
コード例 #3
0
ファイル: Types.cs プロジェクト: lverre/CartaMei
 private static bool equals(LatLonBoundaries x, LatLonBoundaries y)
 {
     return(System.Object.ReferenceEquals(x, y) || (x?.Equals(y) ?? false));
 }
コード例 #4
0
ファイル: Types.cs プロジェクト: lverre/CartaMei
 /// <summary>
 /// Checks whether a rectangle is completely inside this one.
 /// </summary>
 /// <param name="other">The rectangle to test.</param>
 /// <returns>true if <paramref name="other"/> is completely inside this one, false otherwise.</returns>
 public bool Contains(LatLonBoundaries other)
 {
     return(other != null &&
            other.LeftNotBound >= this.LeftNotBound && other.RightNotBound <= this.RightNotBound &&
            other.BottomNotBound >= this.BottomNotBound && other.TopNotBound <= this.TopNotBound);
 }
コード例 #5
0
ファイル: Types.cs プロジェクト: lverre/CartaMei
 public LatLonBoundaries(LatLonBoundaries boundaries) : this(boundaries.CenterLatitude, boundaries.CenterLongitude, boundaries.LatitudeSpan, boundaries.LongitudeSpan)
 {
 }