Ejemplo n.º 1
0
        //
        // Find all regions that overlap this region.
        //
        private static void GetInterestingRegions(List <AtomicRegion> atoms, AtomicRegion theAtom,
                                                  out List <AtomicRegion> intersecting, out List <AtomicRegion> contained)
        {
            intersecting = new List <AtomicRegion>();
            contained    = new List <AtomicRegion>();

            foreach (AtomicRegion atom in atoms)
            {
                // An atom should not intersect itself.
                if (!theAtom.Equals(atom))
                {
                    if (theAtom.Contains(atom))
                    {
                        contained.Add(atom);
                    }
                    //else if (theAtom.StrictlyContains(atom))
                    //{
                    //    contained.Add(theAtom);
                    //}
                    else if (theAtom.OverlapsWith(atom))
                    {
                        intersecting.Add(atom);
                    }
                }
            }
        }