Ejemplo n.º 1
0
 /// <summary>
 /// The only constructor requires that you provide the number
 /// of parts in this feature so that the first dimention of 
 /// the array can be created.
 /// </summary>
 /// @param numOfParts the number of sub-features in this feature
 /// @param mapMetrics the GIS.MapMetrics object for this map
 public VectorFeature( int numOfParts, MapMetrics mapMetrics )
 {
     if ( numOfParts == 1094233352 )
     {
         numOfParts = 5;
     }
     _segment		= new PointD[ numOfParts ][];
     _mapMetrics		= mapMetrics;
     _extents		= new RectangleD();
     _segmentCounter = 0;
     _featureAngle	= 0;
 }
Ejemplo n.º 2
0
 public RectangleD( RectangleD rect )
 {
     _UL = rect.UL;
     _LR = rect.LR;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Determines if the GIS.RectangleD object intersects this rectangle
        /// </summary>
        /// @param rect the rectangle to test
        /// @returns true if any part of the rectangles intersect
        public bool Intersects( RectangleD rect )
        {
            // It's not pretty, but it works.
            // Is there a mathematician in the house?

            if ( Contains( rect.UL ) )
            {
                return true;
            }

            if ( Contains( rect.LR ) )
            {
                return true;
            }

            if ( rect.Xmin <= this.Xmax &&
                 rect.Xmax >= this.Xmax )
            {
                if ( this.Ymax >= rect.Ymax &&
                    this.Ymin <= rect.Ymax )
                {
                    return true;
                }

                if ( this.Ymax >= rect.Ymin &&
                    this.Ymin <= rect.Ymin )
                {
                    return true;
                }
            }

            if ( rect.Xmin <= this.Xmin &&
                rect.Xmax >= this.Xmin )
            {
                if ( this.Ymax >= rect.Ymax &&
                    this.Ymin <= rect.Ymax )
                {
                    return true;
                }

                if ( this.Ymax >= rect.Ymin &&
                    this.Ymin <= rect.Ymin )
                {
                    return true;
                }
            }

            if ( rect.Ymin <= this.Ymax &&
                rect.Ymax >= this.Ymax )
            {
                if ( this.Xmax >= rect.Xmax &&
                    this.Xmin <= rect.Xmax )
                {
                    return true;
                }

                if ( this.Xmax >= rect.Xmin &&
                    this.Xmin <= rect.Xmin )
                {
                    return true;
                }
            }

            if ( rect.Ymin <= this.Ymin &&
                rect.Ymax >= this.Ymin )
            {
                if ( this.Xmax >= rect.Xmax &&
                    this.Xmin <= rect.Xmax )
                {
                    return true;
                }

                if ( this.Xmax >= rect.Xmin &&
                    this.Xmin <= rect.Xmin )
                {
                    return true;
                }
            }

            if ( rect.UL < this.UL &&
                rect.LR > this.LR )
            {
                return true;
            }

            return false;
        }
Ejemplo n.º 4
0
 public MapMetrics()
 {
     _viewport = new RectangleD();
     _extents = new RectangleD();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Set the viewport to the specified coordinates.
 /// </summary>
 /// @param rect Geographic rectangle for the viewport.
 public void ZoomArea( RectangleD rect )
 {
     _mapMetrics.Viewport = rect;
 }