コード例 #1
0
ファイル: myPolygon.cs プロジェクト: puninvv/university
        //меняю подход к задаче:
        public myPolygon GetUnionWith(myPolygon polygon, Graphics graphics, Pen pen, bool paint_or_not)
        {
            this.SetOrinentation();
            polygon.SetOrinentation();

            int arrangment_of_polygons = this.HasVertexesInside(polygon);

            if (arrangment_of_polygons == 0)
            {
                return this.GetUnionWithIntersectedPolygons(polygon, graphics, pen, paint_or_not);
            }
            else
                if (arrangment_of_polygons == 1)
                {
                    return polygon.GetUnionWithIntersectedPolygons(this, graphics, pen, paint_or_not);
                }
                else
                    if (arrangment_of_polygons == 3)
                    {
                        //this.Paint(graphics, pen);
                        this.Fill(graphics, Color.Brown, Color.White, null);
                        polygon.Fill(graphics, Color.Brown, Color.White, null);
                        //polygon.Paint(graphics, pen);
                        return null;
                    }
                    else
                    {
                        //this.Paint(graphics, pen);
                        this.Fill(graphics, Color.Brown, Color.White, null);

                        return this;
                    }
        }