Beispiel #1
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory graphicsFactory)
        {
            IClippingTransformer transformer = context.GetTransformer();
            Vector3D             vector3D    = 10000000.0 * this.vector3D_0;

            WW.Math.Point3D start = this.point3D_0 - vector3D;
            WW.Math.Point3D end   = this.point3D_0 + vector3D;
            foreach (Segment4D segment in (IEnumerable <Segment4D>)transformer.Transform(new Segment3D(start, end)))
            {
                Vector4D?startPoint = transformer.Transform(this.point3D_0);
                graphicsFactory.CreateXLine((DxfEntity)this, context, context.GetPlotColor((DxfEntity)this), startPoint, segment);
            }
        }
Beispiel #2
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            PointDisplayMode pointDisplayMode = context.Model.Header.PointDisplayMode;
            bool             flag             = this.Layer != null && this.Layer == context.DefPointsLayer;

            if (pointDisplayMode == PointDisplayMode.None && !flag)
            {
                return;
            }
            ArgbColor            plotColor   = context.GetPlotColor((DxfEntity)this);
            IClippingTransformer transformer = context.GetTransformer();

            if (this.double_1 != 0.0)
            {
                foreach (Segment4D segment4D in (IEnumerable <Segment4D>)transformer.Transform(new Segment3D(this.point3D_0, this.point3D_0 + this.double_1 * this.vector3D_0)))
                {
                    graphicsFactory.BeginGeometry((DxfEntity)this, context, plotColor, false, false, true, true);
                    graphicsFactory.CreateLine((DxfEntity)this, segment4D.Start, segment4D.End);
                    graphicsFactory.EndGeometry();
                }
            }
            else if (pointDisplayMode != PointDisplayMode.Point && context.Model.Header.PointDisplaySize > 0.0 && !flag)
            {
                IShape4D shape = transformer.Transform((IShape4D) new FlatShape4D(context.PointShape2D, Transformation4D.Translation(this.point3D_0.X, this.point3D_0.Y, this.point3D_0.Z), false));
                if (shape.IsEmpty)
                {
                    return;
                }
                graphicsFactory.BeginGeometry((DxfEntity)this, context, plotColor, false, true, false, true);
                graphicsFactory.CreateShape((DxfEntity)this, shape);
                graphicsFactory.EndGeometry();
            }
            else
            {
                Vector4D?nullable = transformer.Transform(this.point3D_0);
                if (!nullable.HasValue)
                {
                    return;
                }
                graphicsFactory.BeginGeometry((DxfEntity)this, context, plotColor, false, true, false, true);
                graphicsFactory.CreateDot((DxfEntity)this, nullable.Value);
                graphicsFactory.EndGeometry();
            }
        }
Beispiel #3
0
        private IList <Polyline4D> method_21(
            DrawContext context,
            IClippingTransformer transformer)
        {
            Polyline3D polyline = new Polyline3D(true, new WW.Math.Point3D[4] {
                new WW.Math.Point3D(this.point3D_0.X - this.size2D_0.X * 0.5, this.point3D_0.Y - this.size2D_0.Y * 0.5, 0.0), new WW.Math.Point3D(this.point3D_0.X + this.size2D_0.X * 0.5, this.point3D_0.Y - this.size2D_0.Y * 0.5, 0.0), new WW.Math.Point3D(this.point3D_0.X + this.size2D_0.X * 0.5, this.point3D_0.Y + this.size2D_0.Y * 0.5, 0.0), new WW.Math.Point3D(this.point3D_0.X - this.size2D_0.X * 0.5, this.point3D_0.Y + this.size2D_0.Y * 0.5, 0.0)
            });

            return(transformer.Transform(polyline, false));
        }
Beispiel #4
0
        public void DrawPath(
            IShape2D path,
            Matrix4D transform,
            Color color,
            short lineWeight,
            bool filled,
            bool forText,
            double extrusion)
        {
            if (!path.HasSegments)
            {
                return;
            }
            IClippingTransformer transformer = (IClippingTransformer)this.wireframe_0.GetTransformer().Clone();

            transformer.SetPreTransform(transform);
            if (extrusion == 0.0)
            {
                IShape4D shape1 = (IShape4D) new FlatShape4D(path, filled);
                IShape4D shape2 = transformer.Transform(shape1);
                if (shape2.IsEmpty)
                {
                    return;
                }
                this.iwireframeGraphicsFactory2_0.BeginGeometry(this.dxfEntity_0, this.wireframe_0, this.wireframe_0.GetPlotColor(this.dxfEntity_0, color), false, filled, !filled, true);
                this.iwireframeGraphicsFactory2_0.CreateShape(this.dxfEntity_0, shape2);
                this.iwireframeGraphicsFactory2_0.EndGeometry();
            }
            else
            {
                IList <Polyline2D> flattened  = (IList <Polyline2D>)ShapeTool.GetFlattened(path, this.wireframe_0.Config.ShapeFlattenEpsilon);
                IList <Polyline4D> polylines1 = DxfUtil.smethod_39(flattened, filled, transformer);
                ArgbColor          plotColor  = this.wireframe_0.GetPlotColor(this.dxfEntity_0, color);
                Class940.smethod_3(this.dxfEntity_0, this.wireframe_0, this.iwireframeGraphicsFactory2_0, plotColor, forText, false, true, polylines1);
                transformer.SetPreTransform(Transformation4D.Translation(0.0, 0.0, extrusion));
                IList <Polyline4D> polylines2 = DxfUtil.smethod_39(flattened, filled, transformer);
                Class940.smethod_3(this.dxfEntity_0, this.wireframe_0, this.iwireframeGraphicsFactory2_0, plotColor, forText, false, true, polylines2);
                Polyline4D polyline4D1 = new Polyline4D(2);
                polyline4D1.Add(Vector4D.Zero);
                polyline4D1.Add(Vector4D.Zero);
                IList <Polyline4D> polylines3 = (IList <Polyline4D>) new List <Polyline4D>(1);
                polylines3.Add(polyline4D1);
                for (int index1 = polylines1.Count - 1; index1 >= 0; --index1)
                {
                    Polyline4D polyline4D2 = polylines1[index1];
                    Polyline4D polyline4D3 = polylines2[index1];
                    for (int index2 = polyline4D2.Count - 1; index2 >= 0; --index2)
                    {
                        polyline4D1[0] = polyline4D2[index2];
                        polyline4D1[1] = polyline4D3[index2];
                        Class940.smethod_2(this.dxfEntity_0, this.wireframe_0, this.iwireframeGraphicsFactory2_0, plotColor, forText, false, true, polylines3);
                    }
                }
            }
        }
Beispiel #5
0
        public void DrawPath(
            IShape2D path,
            Matrix4D transform,
            Color color,
            short lineWeight,
            bool filled,
            bool forText,
            double extrusion)
        {
            if (!path.HasSegments)
            {
                return;
            }
            IClippingTransformer transformer = (IClippingTransformer)this.wireframe_0.GetTransformer().Clone();

            transformer.SetPreTransform(transform);
            IWireframeGraphicsFactory graphicsFactory0 = this.iwireframeGraphicsFactory_0;

            if (extrusion == 0.0)
            {
                IShape4D shape1 = (IShape4D) new FlatShape4D((IShape2D)(path as GeneralShape2D ?? new GeneralShape2D(path, true)), filled);
                IShape4D shape2 = transformer.Transform(shape1);
                if (shape2.IsEmpty)
                {
                    return;
                }
                graphicsFactory0.CreateShape(this.dxfEntity_0, this.wireframe_0, this.wireframe_0.GetPlotColor(this.dxfEntity_0, color), forText, shape2);
            }
            else
            {
                IList <Polyline2D> flattened  = (IList <Polyline2D>)ShapeTool.GetFlattened(path, this.wireframe_0.Config.ShapeFlattenEpsilon);
                IList <Polyline4D> polylines1 = DxfUtil.smethod_39(flattened, filled, transformer);
                ArgbColor          plotColor  = this.wireframe_0.GetPlotColor(this.dxfEntity_0, color);
                graphicsFactory0.CreatePathAsOne(this.dxfEntity_0, this.wireframe_0, plotColor, forText, polylines1, false, true);
                transformer.SetPreTransform(Transformation4D.Translation(0.0, 0.0, extrusion));
                IList <Polyline4D> polylines2 = DxfUtil.smethod_39(flattened, filled, transformer);
                graphicsFactory0.CreatePathAsOne(this.dxfEntity_0, this.wireframe_0, plotColor, forText, polylines2, false, true);
                for (int index1 = polylines1.Count - 1; index1 >= 0; --index1)
                {
                    Polyline4D polyline4D1 = polylines1[index1];
                    Polyline4D polyline4D2 = polylines2[index1];
                    for (int index2 = polyline4D1.Count - 1; index2 >= 0; --index2)
                    {
                        graphicsFactory0.CreateLine(this.dxfEntity_0, this.wireframe_0, plotColor, forText, polyline4D1[index2], polyline4D2[index2]);
                    }
                }
            }
        }
Beispiel #6
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory graphicsFactory)
        {
            if (this.list_0.Count <= 0)
            {
                return;
            }
            Polygon2D clipBoundary = this.GetClipBoundary((DrawContext)context);

            if (clipBoundary == null)
            {
                return;
            }
            Matrix4D             preTransform        = this.method_15();
            IClippingTransformer clippingTransformer = (IClippingTransformer)context.GetTransformer().Clone();

            clippingTransformer.SetPreTransform(preTransform);
            Matrix4D matrix = clippingTransformer.Matrix;

            WW.Math.Point3D point             = new WW.Math.Point3D(-0.5, -0.5, 0.0);
            Vector4D        transformedOrigin = matrix.TransformTo4D(point);
            Vector4D        transformedXAxis  = matrix.TransformTo4D(point + WW.Math.Vector3D.XAxis);
            Vector4D        transformedYAxis  = matrix.TransformTo4D(point + WW.Math.Vector3D.YAxis);

            WW.Math.Geometry.Polyline3D polyline = new WW.Math.Geometry.Polyline3D(true);
            foreach (WW.Math.Point2D point2D in (List <WW.Math.Point2D>)clipBoundary)
            {
                polyline.Add((WW.Math.Point3D)point2D);
            }
            IList <Polyline4D> polyline4DList = clippingTransformer.Transform(polyline, true);

            if (polyline4DList.Count <= 0)
            {
                return;
            }
            Polyline4D imageBoundary = polyline4DList[0];

            graphicsFactory.CreateImage(this, context, this.bool_2 ? imageBoundary : (Polyline4D)null, imageBoundary, transformedOrigin, transformedXAxis, transformedYAxis);
        }
Beispiel #7
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            if (this.list_0.Count > 0)
            {
                Bounds2D             bounds2D            = this.method_14((DrawContext)context);
                Matrix4D             preTransform        = this.method_15();
                IClippingTransformer clippingTransformer = (IClippingTransformer)context.GetTransformer().Clone();
                clippingTransformer.SetPreTransform(preTransform);
                Vector4D?nullable1 = clippingTransformer.Transform(WW.Math.Point3D.Zero);
                Vector4D?nullable2 = clippingTransformer.Transform(WW.Math.Point3D.Zero + WW.Math.Vector3D.XAxis);
                Vector4D?nullable3 = clippingTransformer.Transform(WW.Math.Point3D.Zero + WW.Math.Vector3D.YAxis);
                if (this.ImageDef != null && nullable1.HasValue && (nullable2.HasValue && nullable3.HasValue))
                {
                    graphicsFactory.BeginGeometry((DxfEntity)this, context, ArgbColor.Empty, false, false, false, true);
                    graphicsFactory.CreateImage(this, bounds2D.Corner1, bounds2D.Corner2, nullable1.Value, nullable2.Value, nullable3.Value, context);
                    graphicsFactory.EndGeometry();
                }
            }
            if (this.ImageDef != null && !context.Config.DrawImageFrame)
            {
                return;
            }
            Polygon2D clipBoundary = this.GetClipBoundary((DrawContext)context);

            if (clipBoundary == null)
            {
                return;
            }
            Matrix4D             preTransform1        = this.method_15();
            IClippingTransformer clippingTransformer1 = (IClippingTransformer)context.GetTransformer().Clone();

            clippingTransformer1.SetPreTransform(preTransform1);
            WW.Math.Geometry.Polyline3D polyline1 = new WW.Math.Geometry.Polyline3D(true);
            foreach (WW.Math.Point2D point2D in (List <WW.Math.Point2D>)clipBoundary)
            {
                polyline1.Add((WW.Math.Point3D)point2D);
            }
            List <Polyline4D> polyline4DList = new List <Polyline4D>((IEnumerable <Polyline4D>)clippingTransformer1.Transform(polyline1, true));

            if (this.ImageDef == null)
            {
                graphicsFactory.BeginGeometry((DxfEntity)this, context, context.Config.BackColor, false, true, false, false);
                foreach (Polyline4D polyline2 in polyline4DList)
                {
                    graphicsFactory.CreatePolyline((DxfEntity)this, polyline2);
                }
                graphicsFactory.EndGeometry();
            }
            if (this.ImageDef != null && !context.Config.DrawImageFrame)
            {
                return;
            }
            graphicsFactory.BeginGeometry((DxfEntity)this, context, this.GetColor((DrawContext)context), false, false, true, true);
            foreach (Polyline4D polyline2 in polyline4DList)
            {
                graphicsFactory.CreatePolyline((DxfEntity)this, polyline2);
            }
            graphicsFactory.EndGeometry();
        }
Beispiel #8
0
        public override void DrawInternal(
            DrawContext.Wireframe context,
            IWireframeGraphicsFactory2 graphicsFactory)
        {
            IList <Polyline3D>  polylines1;
            IList <FlatShape4D> shapes;

            this.method_14((DrawContext)context, context.GetTransformer().LineTypeScaler, out polylines1, out shapes);
            IList <Polyline4D> polylines2 = DxfUtil.smethod_36(polylines1, false, context.GetTransformer());

            if (polylines2.Count > 0)
            {
                Class940.smethod_3((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this, this.dxfDimensionStyleOverrides_0.DimensionLineColor), false, false, true, polylines2);
            }
            if (shapes != null)
            {
                Class940.smethod_23((IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory), (IEnumerable <IShape4D>)shapes, this.dxfDimensionStyleOverrides_0.DimensionLineColor, context.GetLineWeight((DxfEntity)this));
            }
            if (!DxfLeader.smethod_7((ILeader)this, (IList <WW.Math.Point3D>) this.list_0))
            {
                return;
            }
            if (this.dxfDimensionStyleOverrides_0.LeaderArrowBlock == null)
            {
                Polyline3D polyline1 = this.method_15();
                if (polyline1 == null)
                {
                    return;
                }
                IClippingTransformer clippingTransformer = (IClippingTransformer)context.GetTransformer().Clone();
                clippingTransformer.SetPreTransform(this.method_16());
                foreach (Polyline4D polyline2 in new List <Polyline4D>((IEnumerable <Polyline4D>)clippingTransformer.Transform(polyline1, polyline1.Closed)))
                {
                    Class940.smethod_1((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this, this.dxfDimensionStyleOverrides_0.DimensionLineColor), false, true, false, polyline2);
                }
            }
            else
            {
                DxfInsert.Interface46 nterface46 = (DxfInsert.Interface46) new DxfInsert.Class1020((DxfEntity)this, context, graphicsFactory);
                nterface46.imethod_0(0, 0, this.method_16());
                nterface46.Draw(this.dxfDimensionStyleOverrides_0.LeaderArrowBlock, true);
            }
        }
Beispiel #9
0
        private IList <Polyline4D> method_16(
            DrawContext.Wireframe context,
            out Polyline3DT imageBoundaryPolyline,
            out IClippingTransformer transformer)
        {
            Polygon2D clipBoundary = this.GetClipBoundary((DrawContext)context);

            if (clipBoundary != null && clipBoundary.Count != 0)
            {
                Matrix4D preTransform = this.method_15();
                transformer = context.GetTransformer();
                transformer = (IClippingTransformer)transformer.Clone();
                transformer.SetPreTransform(preTransform);
                imageBoundaryPolyline = new Polyline3DT(true);
                foreach (WW.Math.Point2D point2D in (List <WW.Math.Point2D>)clipBoundary)
                {
                    imageBoundaryPolyline.Add(new Point3DT((WW.Math.Point3D)point2D, 0U));
                }
                return((IList <Polyline4D>) new List <Polyline4D>((IEnumerable <Polyline4D>)transformer.Transform(imageBoundaryPolyline.ToPolyline3D(), true)));
            }
            imageBoundaryPolyline = (Polyline3DT)null;
            transformer           = (IClippingTransformer)null;
            return((IList <Polyline4D>) new Polyline4D[0]);
        }