public Polygon2DTriangulator(Polygon2DAdorner a,Polygon2DAdorner b)
        {
            Polygon2DEditor polygonEditor = null;

            if (!a.polygon.isSimple || !b.polygon.isSimple)
            {
                throw (new ArgumentException());
            }
            if (a.polygon.PointDirection != b.polygon.PointDirection)
            {
                polygonEditor = new Polygon2DEditor(a.polygon);
                polygonEditor.Invert();
            }

            Debug.Assert(a.polygon.PointDirection == b.polygon.PointDirection);
            FirstPolygon = a;
            SecondPolygon = b;
            Diviser = new Polygon2DDiviser(a.Count);
            ghostPoint = new GhostPoint2DCollection();
            ghostTriangle = new GhostTriangle2DCollection();

            polygonEditor = new Polygon2DEditor(this.FirstPolygon.polygon);
            polygonEditor.Clear();
            polygonEditor = new Polygon2DEditor(this.SecondPolygon.polygon);
            polygonEditor.Clear();
        }
        public Polygon2DTriangulator(Polygon2DAdorner a, Polygon2DAdorner b)
        {
            Polygon2DEditor polygonEditor = null;

            if (!a.polygon.isSimple || !b.polygon.isSimple)
            {
                throw (new ArgumentException());
            }
            if (a.polygon.PointDirection != b.polygon.PointDirection)
            {
                polygonEditor = new Polygon2DEditor(a.polygon);
                polygonEditor.Invert();
            }

            Debug.Assert(a.polygon.PointDirection == b.polygon.PointDirection);
            FirstPolygon  = a;
            SecondPolygon = b;
            Diviser       = new Polygon2DDiviser(a.Count);
            ghostPoint    = new GhostPoint2DCollection();
            ghostTriangle = new GhostTriangle2DCollection();

            polygonEditor = new Polygon2DEditor(this.FirstPolygon.polygon);
            polygonEditor.Clear();
            polygonEditor = new Polygon2DEditor(this.SecondPolygon.polygon);
            polygonEditor.Clear();
        }
Пример #3
0
        public void Union(GhostPoint2DCollection ghostPoint2DCollection)
        {
            Capacity += ghostPoint2DCollection.Capacity;

            GhostPoint2D[] ghostPoints = new GhostPoint2D[Capacity];

            this.GhostPoints.CopyTo(ghostPoints, 0);
            ghostPoint2DCollection.GhostPoints.CopyTo(ghostPoints, this.Count);
            this.GhostPoints = ghostPoints;
            CurrentCount    += ghostPoint2DCollection.Count;
        }
Пример #4
0
        public void Union(GhostPoint2DCollection ghostPoint2DCollection)
        {
            Capacity += ghostPoint2DCollection.Capacity;

            GhostPoint2D[] ghostPoints = new GhostPoint2D[Capacity];

            this.GhostPoints.CopyTo(ghostPoints, 0);
            ghostPoint2DCollection.GhostPoints.CopyTo(ghostPoints, this.Count);
            this.GhostPoints = ghostPoints;
            CurrentCount += ghostPoint2DCollection.Count;
        }