コード例 #1
0
ファイル: EdgeRing.cs プロジェクト: ghq1254544150/_SharpMap
        /// <summary>
        /// This method will cause the ring to be computed.
        /// It will also check any holes, if they have been assigned.
        /// </summary>
        /// <param name="p"></param>
        public bool ContainsPoint(ICoordinate p)
        {
            ILinearRing shell = LinearRing;
            IEnvelope   env   = shell.EnvelopeInternal;

            if (!env.Contains(p))
            {
                return(false);
            }
            if (!CGAlgorithms.IsPointInRing(p, shell.Coordinates))
            {
                return(false);
            }
            for (IEnumerator i = holes.GetEnumerator(); i.MoveNext();)
            {
                EdgeRing hole = (EdgeRing)i.Current;
                if (hole.ContainsPoint(p))
                {
                    return(false);
                }
            }
            return(true);
        }