Exemplo n.º 1
0
            public List <PolygonPart> GetShapes()
            {
                if (!m_polygonIsCut)
                {
                    return(m_polygonPartsList);
                }
                List <PolygonPart> list = new List <PolygonPart>();

                if (!m_polygonIsClosed)
                {
                    foreach (PolygonPart polygonParts in m_polygonPartsList)
                    {
                        list.Add(polygonParts);
                    }
                    return(list);
                }
                if (m_polygonPartsList.Count > 1)
                {
                    m_polygonPartsList.Sort(new PolygonPart.Comparer());
                    int num;
                    for (num = 0; num < m_polygonPartsList.Count; num++)
                    {
                        PolygonPart polygonPart = m_polygonPartsList[num];
                        polygonPart.CollectKids(m_polygonPartsList);
                        num = m_polygonPartsList.IndexOf(polygonPart);
                    }
                }
                foreach (PolygonPart polygonParts2 in m_polygonPartsList)
                {
                    polygonParts2.SaveToResultsWithChildren(list);
                }
                return(list);
            }
Exemplo n.º 2
0
 public void CollectKids(List <PolygonPart> list)
 {
     if (!this.IsComplete())
     {
         int num = 0;
         while (num < list.Count)
         {
             PolygonPart polygonPart = list[num];
             if (this != polygonPart && this.IsOnTheSameSide(polygonPart) && polygonPart.TopPointY < this.TopPointY && polygonPart.BottomPointY > this.BottomPointY)
             {
                 this.Kids.Add(polygonPart);
                 polygonPart.CollectKids(list);
                 list.Remove(polygonPart);
             }
             else
             {
                 num++;
             }
         }
     }
 }