コード例 #1
0
ファイル: Primitives2d.cs プロジェクト: unitycoder/Drawing3D
        /// <summary>
        /// draws a list of <see cref="xyzArray"/>.The first array is the outer contur the other are holes.
        /// </summary>
        /// <param name="Loxyz">a list of <see cref="xyzArray"/></param>
        public void drawPolyPolyLine(Loxyz Loxyz)
        {
            Object Handle = null;

            if ((RenderKind == RenderKind.SnapBuffer))
            {
                Handle = Selector.RegisterSnapItem(new PolyPolyLineSnappItem3D(Loxyz));
            }
            if ((PolygonMode == PolygonMode.Fill) && (Loxyz.planar))
            {
                Loxy L = Loxyz.ToLoxy();
                PushMatrix();
                MulMatrix(Loxyz.Base.ToMatrix());
                drawFilledArray2d(this, L);
                PopMatrix();
                if ((RenderKind == RenderKind.SnapBuffer))
                {
                    Selector.UnRegisterSnapItem(Handle);
                }

                return;
            }

            for (int i = 0; i < Loxyz.Count; i++)
            {
                Primitives3d.drawArrayLined(this, Loxyz[i]);
            }

            if ((RenderKind == RenderKind.SnapBuffer))
            {
                Selector.UnRegisterSnapItem(Handle);
            }
        }
コード例 #2
0
ファイル: Primitives2d.cs プロジェクト: unitycoder/Drawing3D
        /// <summary>
        /// draws a 3d-polygon, which is stored in Array. See also <see cref="xyzArray"/> if the <see cref="OpenGlDevice.PolygonMode"/> = <b>Fill</b> and the array is planar then
        /// the polygon is drawn as filled polygon else as a lined polygon.
        /// </summary>
        /// <param name="Array"><see cref="xyzArray"/>hollds the array information</param>
        public void drawPolyLine(xyzArray Array)
        {
            Object Handle = null;

            if ((RenderKind == RenderKind.SnapBuffer))
            {
                Handle = Selector.RegisterSnapItem(new PolyLineSnappItem3D(Array));
            }
            if ((PolygonMode == PolygonMode.Fill) && (Array.Count > 2) && (Array.planar))
            {
                Loxy L = new Loxy();
                PushMatrix();
                MulMatrix(Array.Base.ToMatrix());
                xyArray A = Array.ToxyArray();
                L.Add(A);
                drawFilledArray2d(this, L);
                PopMatrix();
                if ((RenderKind == RenderKind.SnapBuffer))
                {
                    Selector.UnRegisterSnapItem(Handle);
                }
                if (PolygonMode == PolygonMode.Fill)
                {
                    return;
                }
            }


            Primitives3d.drawArrayLined(this, Array);
            if ((RenderKind == RenderKind.SnapBuffer))
            {
                Selector.UnRegisterSnapItem(Handle);
            }
        }