コード例 #1
0
 /// <summary>
 /// return true iff there is a node with the rectangle and UserData that equals to the parameter "userData"
 /// </summary>
 /// <param name="rectangle"></param>
 /// <param name="userData"></param>
 /// <returns></returns>
 public bool Contains(Interval rectangle, TData userData)
 {
     if (rootNode == null)
     {
         return(false);
     }
     return
         (rootNode.GetLeafIntervalNodesIntersectingInterval(rectangle)
          .Any(node => node.UserData.Equals(userData)));
 }
コード例 #2
0
 /// <summary>
 /// Get all leaf nodes with rectangles intersecting the specified rectangular region
 /// </summary>
 /// <param name="queryRegion"></param>
 /// <returns></returns>
 internal IEnumerable <IntervalNode <TData> > GetAllLeavesIntersectingInterval(Interval queryRegion)
 {
     return(rootNode == null || Count == 0 ? new IntervalNode <TData> [0] : rootNode.GetLeafIntervalNodesIntersectingInterval(queryRegion));
 }