Exemple #1
0
        public bool TryFind(UV uv, out Node node)
        {
            if (!Contains(uv))
            {
                node = null;
                return(false);
            }

            if (IsLeafNode)
            {
                if (Point.IsAlmostEqualTo(uv))
                {
                    node = this;
                    return(true);
                }
                else
                {
                    node = null;
                    return(false);
                }
            }

            if (NW.Contains(uv))
            {
                if (NW.TryFind(uv, out node))
                {
                    return(true);
                }
            }

            else if (NE.Contains(uv))
            {
                if (NE.TryFind(uv, out node))
                {
                    return(true);
                }
            }


            else if (SW.Contains(uv))
            {
                if (SW.TryFind(uv, out node))
                {
                    return(true);
                }
            }

            else if (SE.Contains(uv))
            {
                if (SE.TryFind(uv, out node))
                {
                    return(true);
                }
            }

            node = null;
            return(false);
        }