예제 #1
0
        /// <summary>
        /// draws a 2d-polygon, which is stored in Array. See also <see cref="xyArray"/>.
        /// </summary>
        /// <param name="Array"><see cref="xyArray"/>.</param>
        public void drawPolyLine(xyArray Array)
        {
            Object Handle = null;

            if ((RenderKind == RenderKind.SnapBuffer))
            {
                Handle = Selector.RegisterSnapItem(new PolyLineSnappItem(Array));
            }
            if (PolygonMode == PolygonMode.Fill)
            {
                Loxy L = new Loxy();
                L.Add(Array);

                drawFilledArray2d(this, L);
                if ((RenderKind == RenderKind.SnapBuffer))
                {
                    Selector.UnRegisterSnapItem(Handle);
                }
                if (PolygonMode == PolygonMode.Fill)
                {
                    return;
                }
            }
            Primitives2d.drawArrayLined(this, Array);
            if ((RenderKind == RenderKind.SnapBuffer))
            {
                Selector.UnRegisterSnapItem(Handle);
            }
        }
예제 #2
0
        void _drawPolyPolyCurve(Loxy L, Loca Loca, int id)
        {
            Object Handle = null;

            if (PolygonMode == PolygonMode.Fill)
            {
                if ((RenderKind == RenderKind.SnapBuffer))
                {
                    Handle = Selector.RegisterSnapItem(getSI(id, Loca, L, -1));
                }
                drawFilledArray2d(this, L);

                if ((RenderKind == RenderKind.SnapBuffer))
                {
                    MeshCreator.Renew();
                    Selector.UnRegisterSnapItem(Handle);
                }
                return;
            }

            if ((RenderKind == RenderKind.SnapBuffer))
            {
                SnappItem S = (getSI(id, Loca, L, -1));

                Handle = Selector.RegisterSnapItem(S);
            }
            {
                for (int i = 0; i < L.Count; i++)
                {
                    //IndexType[] Indices = new IndexType[L[i].Count];
                    //for (int k = 0;k < L[i].Count; k++)
                    //{
                    //    Indices[k] = k;
                    //}
                    //xyzf[] Points = new xyzf[L[i].Count];
                    //for (int k = 0; k < L[i].Count; k++)
                    //{
                    //    Points[k] = new xyzf((float)L[i][k].X, (float)L[i][k].y, 0f);
                    //}
                    //Primitives3d.drawTriangles(this,Indices, Points, null, null, null);
                    ////if ((RenderKind == RenderKind.SnapBuffer))
                    ////  Selector.ToSnapBuffer((uint)i);
                    Primitives2d.drawArrayLined(this, L[i]);
                }
            }
            if ((RenderKind == RenderKind.SnapBuffer))
            {
                Selector.UnRegisterSnapItem(Handle);
            }
        }