Exemplo n.º 1
0
        /// <summary>
        /// Perform an interval intersection query on the node
        /// </summary>
        /// <param name="queryInterval"></param>
        /// <returns></returns>
        public List <Interval> Query(Interval queryInterval)
        {
            List <Interval> results = IntervalsCenter.Where(i => i.Intersects(queryInterval)).ToList();

            if (queryInterval.OneBasedStart < Center && LeftNode != null)
            {
                results.AddRange(LeftNode.Query(queryInterval));
            }
            if (queryInterval.OneBasedStart > Center && RightNode != null)
            {
                results.AddRange(RightNode.Query(queryInterval));
            }
            return(results.Distinct().ToList());
        }