示例#1
0
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            if (this.list_0.Count <= 0)
            {
                return;
            }
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (!graphics.AddExistingGraphicElement1(parentGraphicElementBlock, (DxfEntity)this, plotColor))
            {
                return;
            }
            GraphicElement1 graphicElement = new GraphicElement1(plotColor);

            graphics.AddNewGraphicElement((DxfEntity)this, parentGraphicElementBlock, graphicElement);
            List <WW.Math.Point3D> point3DList = new List <WW.Math.Point3D>(4);

            foreach (DxfMeshFace dxfMeshFace in this.list_0)
            {
                point3DList.Clear();
                foreach (DxfMeshFace.Corner corner in dxfMeshFace.Corners)
                {
                    if (corner.Vertex != null)
                    {
                        point3DList.Add(corner.Vertex.Position);
                    }
                }
                Class940.smethod_22(graphicElement.Geometry, (IList <WW.Math.Point3D>)point3DList);
            }
        }
示例#2
0
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            ushort mApproximationPointCount;
            ushort nApproximationPointCount;

            this.method_13(out mApproximationPointCount, out nApproximationPointCount);
            if (mApproximationPointCount <= (ushort)0 || nApproximationPointCount <= (ushort)0)
            {
                return;
            }
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (!graphics.AddExistingGraphicElement1(parentGraphicElementBlock, (DxfEntity)this, plotColor))
            {
                return;
            }
            GraphicElement1 graphicElement = new GraphicElement1(plotColor);

            graphics.AddNewGraphicElement((DxfEntity)this, parentGraphicElementBlock, graphicElement);
            WW.Math.Point3D[,] mesh = this.method_19((int)mApproximationPointCount - 1, (int)nApproximationPointCount - 1);
            graphicElement.Geometry.Add((IPrimitive) new PolygonMesh(mesh, this.ClosedInMDirection, this.ClosedInNDirection));
        }
示例#3
0
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            DxfImageDef imageDef = this.ImageDef;

            if (imageDef == null || !imageDef.Bitmap.IsValid)
            {
                return;
            }
            List <WW.Math.Point2D> clipBoundary = (List <WW.Math.Point2D>) this.GetClipBoundary((DrawContext)context);

            if (clipBoundary == null || clipBoundary.Count <= 0 || !graphics.AddExistingGraphicElement1(parentGraphicElementBlock, (DxfEntity)this, ArgbColor.Empty))
            {
                return;
            }
            List <Triangulator2D.Triangle> triangleList = new List <Triangulator2D.Triangle>();
            List <WW.Math.Point2D>         point2DList  = new List <WW.Math.Point2D>();

            Triangulator2D.Triangulate((IList <IList <WW.Math.Point2D> >) new List <WW.Math.Point2D>[1]
            {
                clipBoundary
            }, (IList <Triangulator2D.Triangle>)triangleList, (IList <WW.Math.Point2D>)point2DList);
            Matrix4D matrix4D = this.method_15();

            WW.Math.Point2D[] point2DArray        = new WW.Math.Point2D[point2DList.Count];
            WW.Math.Point3D[] point3DArray        = new WW.Math.Point3D[point2DList.Count];
            Size2D            referencedImageSize = this.ReferencedImageSize;
            double            num1     = 1.0 / referencedImageSize.X;
            double            num2     = 1.0 / referencedImageSize.Y;
            Vector2D          vector2D = new Vector2D(0.5, 0.5);

            for (int index = point2DList.Count - 1; index >= 0; --index)
            {
                WW.Math.Point2D point = point2DList[index] + vector2D;
                point2DArray[index] = new WW.Math.Point2D(num1 * point.X, 1.0 - num2 * point.Y);
                point3DArray[index] = matrix4D.TransformTo3D(point);
            }
            GraphicElement1 graphicElement = new GraphicElement1(ArgbColor.Empty);

            graphics.AddNewGraphicElement((DxfEntity)this, parentGraphicElementBlock, graphicElement);
            TexturedTriangleList texturedTriangleList = new TexturedTriangleList();

            graphicElement.Geometry.Add((IPrimitive)texturedTriangleList);
            texturedTriangleList.RgbaBytes          = imageDef.Bitmap.GetRgbaBytes();
            texturedTriangleList.Width              = imageDef.Bitmap.Width;
            texturedTriangleList.Height             = imageDef.Bitmap.Height;
            texturedTriangleList.Normal             = matrix4D.Transform(WW.Math.Vector3D.ZAxis);
            texturedTriangleList.Triangles          = (IList <Triangulator2D.Triangle>)triangleList;
            texturedTriangleList.TextureCoordinates = (IList <WW.Math.Point2D>)point2DArray;
            texturedTriangleList.Points             = (IList <WW.Math.Point3D>)point3DArray;
        }
示例#4
0
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (!graphics.AddExistingGraphicElement1(parentGraphicElementBlock, (DxfEntity)this, plotColor))
            {
                return;
            }
            GraphicElement1 graphicElement = new GraphicElement1(plotColor);

            graphics.AddNewGraphicElement((DxfEntity)this, parentGraphicElementBlock, graphicElement);
            if (this.double_1 != 0.0)
            {
                graphicElement.Geometry.Add((IPrimitive) new WW.Cad.Drawing.Surface.Segment(this.point3D_0, this.point3D_0 + this.double_1 * this.vector3D_0));
            }
            else
            {
                graphicElement.Geometry.Add((IPrimitive) new WW.Cad.Drawing.Surface.Point(this.point3D_0));
            }
        }
示例#5
0
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            int ushort0 = (int)this.ushort_0;
            int ushort1 = (int)this.ushort_1;

            if (ushort0 <= 0 || ushort1 <= 0)
            {
                return;
            }
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (!graphics.AddExistingGraphicElement1(parentGraphicElementBlock, (DxfEntity)this, plotColor))
            {
                return;
            }
            GraphicElement1 graphicElement = new GraphicElement1(plotColor);

            graphics.AddNewGraphicElement((DxfEntity)this, parentGraphicElementBlock, graphicElement);
            WW.Math.Point3D[,] mesh = new WW.Math.Point3D[ushort0, ushort1];
            int index1 = 0;

            for (int index2 = 0; index2 < ushort0; ++index2)
            {
                int index3 = 0;
                while (index3 < ushort1)
                {
                    mesh[index2, index3] = this.dxfHandledObjectCollection_1[index1].Position;
                    ++index3;
                    ++index1;
                }
            }
            graphicElement.Geometry.Add((IPrimitive) new PolygonMesh(mesh, this.ClosedInMDirection, this.ClosedInNDirection));
        }
示例#6
0
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (!graphics.AddExistingGraphicElement1(parentGraphicElementBlock, (DxfEntity)this, plotColor))
            {
                return;
            }
            GraphicElement1 graphicElement = new GraphicElement1(plotColor);

            graphics.AddNewGraphicElement((DxfEntity)this, parentGraphicElementBlock, graphicElement);
            WW.Math.Geometry.Polyline3D polyline = this.method_13();
            if (this.double_1 != 0.0)
            {
                Class940.Extrude(graphicElement.Geometry, polyline, this.Model.Header.FillMode, this.Thickness * this.ZAxis);
            }
            else
            {
                Class940.smethod_21((DxfEntity)this, context, graphicElement.Geometry, polyline, this.Model.Header.FillMode);
            }
        }