Exemple #1
0
        protected void DrawInternal(
            DrawContext.Surface context,
            WW.Cad.Drawing.Surface.Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock,
            double startAngle,
            double endAngle)
        {
            ArgbColor   plotColor     = context.GetPlotColor((DxfEntity)this);
            DxfLineType lineType      = this.GetLineType((DrawContext)context);
            double      lineTypeScale = context.TotalLineTypeScale * this.LineTypeScale;

            if (!graphics.AddExistingGraphicElement2(parentGraphicElementBlock, (DxfEntity)this, plotColor, lineType, lineTypeScale, false))
            {
                return;
            }
            GraphicElement2 graphicElement2 = new GraphicElement2(plotColor, lineType, lineTypeScale, true);

            graphics.AddNewGraphicElement((DxfEntity)this, parentGraphicElementBlock, (GraphicElement1)graphicElement2);
            if (this.double_2 != 0.0)
            {
                graphicElement2.Geometry.Extrusion = this.double_2 * this.vector3D_0;
            }
            WW.Math.Geometry.Polyline3D polyline = this.method_14(context.Config, startAngle, endAngle);
            graphicElement2.Geometry.Add(WW.Cad.Drawing.Surface.Polyline3D.CreatePrimitive(polyline));
        }
Exemple #2
0
 private void GetPolylines(
     DrawContext context,
     ILineTypeScaler lineTypeScaler,
     double startAngle,
     double endAngle,
     out IList <WW.Math.Geometry.Polyline3D> polylines,
     out IList <FlatShape4D> shapes)
 {
     WW.Math.Geometry.Polyline3D polyline = this.method_14(context.Config, startAngle, endAngle);
     polylines = (IList <WW.Math.Geometry.Polyline3D>) new List <WW.Math.Geometry.Polyline3D>();
     if (context.Config.ApplyLineType)
     {
         shapes = (IList <FlatShape4D>) new List <FlatShape4D>();
         DxfUtil.smethod_4(context.Config, polylines, shapes, polyline, this.GetLineType(context), this.vector3D_0, context.TotalLineTypeScale * this.LineTypeScale, lineTypeScaler);
         if (shapes.Count != 0)
         {
             return;
         }
         shapes = (IList <FlatShape4D>)null;
     }
     else
     {
         polylines.Add(polyline);
         shapes = (IList <FlatShape4D>)null;
     }
 }
Exemple #3
0
        private WW.Math.Geometry.Polyline3D method_14(
            GraphicsConfig graphicsConfig,
            double startAngle,
            double endAngle)
        {
            double   num1 = 2.0 * System.Math.PI / (double)graphicsConfig.NoOfArcLineSegments;
            double   num2 = startAngle;
            Matrix4D denormalizationTransform = this.DenormalizationTransform;

            WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D();
            if ((endAngle - num2) / num1 < (double)graphicsConfig.NoOfArcLineSegmentsMinimum)
            {
                double lineSegmentsMinimum = (double)graphicsConfig.NoOfArcLineSegmentsMinimum;
                double a = (endAngle - num2) / lineSegmentsMinimum;
                if (!MathUtil.AreApproxEqual(a, 0.0))
                {
                    num1 = a;
                }
            }
            for (; num2 <= endAngle; num2 += num1)
            {
                WW.Math.Point2D point = new WW.Math.Point2D(System.Math.Cos(num2), System.Math.Sin(num2));
                polyline3D.Add(denormalizationTransform.TransformTo3D4x3(point));
            }
            polyline3D.Add(denormalizationTransform.TransformTo3D4x3(new WW.Math.Point2D(System.Math.Cos(endAngle), System.Math.Sin(endAngle))));
            return(polyline3D);
        }
Exemple #4
0
        private WW.Math.Geometry.Polyline3D method_14(GraphicsConfig graphicsConfig)
        {
            double num1    = 2.0 * System.Math.PI / (double)graphicsConfig.NoOfArcLineSegments;
            double double2 = this.double_2;
            double double3 = this.double_3;

            if (double3 <= double2)
            {
                double3 += 2.0 * System.Math.PI;
            }
            Matrix4D transform = this.Transform;
            Vector3D vector3D0 = this.vector3D_0;

            vector3D0.Normalize();
            Vector3D vector3D = Vector3D.CrossProduct(this.vector3D_1, vector3D0);

            vector3D.Normalize();
            double length = this.vector3D_0.GetLength();
            double num2   = this.double_1 * length;

            WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D();
            for (; double2 < double3; double2 += num1)
            {
                WW.Math.Point3D point = (WW.Math.Point3D)(length * System.Math.Cos(double2) * vector3D0 + num2 * System.Math.Sin(double2) * vector3D);
                polyline3D.Add(transform.Transform(point));
            }
            polyline3D.Add(transform.Transform((WW.Math.Point3D)(length * System.Math.Cos(double3) * vector3D0 + num2 * System.Math.Sin(double3) * vector3D)));
            return(polyline3D);
        }
Exemple #5
0
        private WW.Math.Geometry.Polyline3D method_18(int power, int noOfSplineLineParts)
        {
            WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D(this.Closed);
            int count = this.dxfVertex3DCollection_0.Count;

            if (count < power + 1)
            {
                return(this.method_17());
            }
            BSplineD bsplineD = new BSplineD(power, count, this.Closed);

            double[] result = new double[power + 1];
            double   maxU   = bsplineD.MaxU;
            int      num1   = noOfSplineLineParts + 1;
            double   num2   = maxU / (double)(num1 - 1);
            int      num3   = 0;
            double   u      = 0.0;

            while (num3 < num1)
            {
                int knotSpanIndex = bsplineD.GetKnotSpanIndex(u);
                bsplineD.EvaluateBasisFunctions(knotSpanIndex, u, result);
                WW.Math.Point3D zero = WW.Math.Point3D.Zero;
                for (int index = 0; index < power + 1; ++index)
                {
                    DxfVertex3D dxfVertex3D = this.dxfVertex3DCollection_0[(knotSpanIndex - power + index) % count];
                    zero += result[index] * (Vector3D)dxfVertex3D.Position;
                }
                polyline3D.Add(zero);
                ++num3;
                u += num2;
            }
            return(polyline3D);
        }
Exemple #6
0
        private WW.Math.Geometry.Polyline3D method_14(
            GraphicsConfig config,
            out bool approximationPointsDrawn)
        {
            approximationPointsDrawn = false;
            WW.Math.Geometry.Polyline3D polyline3D = (WW.Math.Geometry.Polyline3D)null;
            if (config.ShowSplineInterpolatedPoints)
            {
                switch (this.splineType_0)
                {
                case SplineType.None:
                    polyline3D = this.method_17();
                    approximationPointsDrawn = true;
                    break;

                case SplineType.QuadraticBSpline:
                    polyline3D = this.method_18(2, (int)config.NoOfSplineLineSegments);
                    break;

                case SplineType.CubicBSpline:
                    polyline3D = this.method_18(3, (int)config.NoOfSplineLineSegments);
                    break;
                }
            }
            return(polyline3D);
        }
Exemple #7
0
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            ArgbColor   plotColor     = context.GetPlotColor((DxfEntity)this);
            DxfLineType lineType      = this.GetLineType((DrawContext)context);
            bool        plinegen      = (this.Flags & Enum21.flag_8) != Enum21.flag_0;
            double      lineTypeScale = context.TotalLineTypeScale * this.LineTypeScale;

            if (!graphics.AddExistingGraphicElement2(parentGraphicElementBlock, (DxfEntity)this, plotColor, lineType, lineTypeScale, plinegen))
            {
                return;
            }
            GraphicElement2 graphicElement2 = new GraphicElement2(plotColor, lineType, lineTypeScale, plinegen);

            graphics.AddNewGraphicElement((DxfEntity)this, parentGraphicElementBlock, (GraphicElement1)graphicElement2);
            bool approximationPointsDrawn;

            WW.Math.Geometry.Polyline3D polyline = this.method_14(context.Config, out approximationPointsDrawn);
            graphicElement2.Geometry.Add(WW.Cad.Drawing.Surface.Polyline3D.CreatePrimitive(polyline));
            if (context.Config.ShowSplineControlPoints)
            {
                graphicElement2.Geometry.Add(WW.Cad.Drawing.Surface.Polyline3D.CreatePrimitive(this.method_16()));
            }
            if (!context.Config.ShowSplineApproximationPoints || approximationPointsDrawn)
            {
                return;
            }
            graphicElement2.Geometry.Add(WW.Cad.Drawing.Surface.Polyline3D.CreatePrimitive(this.method_17()));
        }
Exemple #8
0
        private void method_22(
            IList <WW.Math.Geometry.Polyline3D> polylines,
            int mNoOfSplineLineParts,
            int nNoOfSplineLineParts)
        {
            WW.Math.Point3D[,] point3DArray = this.method_23(mNoOfSplineLineParts, nNoOfSplineLineParts);
            int  length1            = point3DArray.GetLength(0);
            int  length2            = point3DArray.GetLength(1);
            bool closedInNdirection = this.ClosedInNDirection;

            for (int index1 = 0; index1 < length1; ++index1)
            {
                WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D(closedInNdirection);
                polylines.Add(polyline3D);
                for (int index2 = 0; index2 < length2; ++index2)
                {
                    polyline3D.Add(point3DArray[index1, index2]);
                }
            }
            bool closedInMdirection = this.ClosedInMDirection;

            for (int index1 = 0; index1 < length2; ++index1)
            {
                WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D(closedInMdirection);
                polylines.Add(polyline3D);
                for (int index2 = 0; index2 < length1; ++index2)
                {
                    polyline3D.Add(point3DArray[index2, index1]);
                }
            }
        }
Exemple #9
0
            public void Draw(WW.Math.Geometry.Polyline3D polygon)
            {
                this.isurfaceGraphicsFactory_0.SetColor(this.surface_0.GetPlotColor(this.dxfEntity_0));
                IList <WW.Math.Geometry.Polyline3D> polylines = (IList <WW.Math.Geometry.Polyline3D>) new List <WW.Math.Geometry.Polyline3D>(1);

                polylines.Add(polygon);
                Class940.smethod_16(this.dxfEntity_0, this.surface_0, this.isurfaceGraphicsFactory_0, polylines, false);
            }
Exemple #10
0
 private WW.Math.Geometry.Polyline3D method_13()
 {
     WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D(this.Closed);
     foreach (DxfVertex3D dxfVertex3D in (DxfHandledObjectCollection <DxfVertex3D>) this.dxfVertex3DCollection_0)
     {
         polyline3D.Add(dxfVertex3D.Position);
     }
     return(polyline3D);
 }
Exemple #11
0
 public void RecalculateApproximationPoints(int noOfSplineLineParts)
 {
     WW.Math.Geometry.Polyline3D polyline3D = this.method_18(this.method_15(), noOfSplineLineParts);
     this.dxfVertex3DCollection_1.Clear();
     for (int index = 0; index < polyline3D.Count; ++index)
     {
         this.dxfVertex3DCollection_1.Add(new DxfVertex3D(polyline3D[index]));
     }
 }
Exemple #12
0
        public Polyline3D ToPolyline3D()
        {
            Polyline3D polyline3D = new Polyline3D(this.Count, this.Closed);

            foreach (Vector4D vector4D in (List <Vector4D>) this)
            {
                polyline3D.Add(vector4D.ToPoint3D());
            }
            return(polyline3D);
        }
Exemple #13
0
        public Polyline3D GetReverse()
        {
            Polyline3D polyline3D = new Polyline3D(this.Count, this.Closed);

            for (int index = this.Count - 1; index >= 0; --index)
            {
                polyline3D.Add(this[index]);
            }
            return(polyline3D);
        }
Exemple #14
0
            public void Draw(WW.Math.Geometry.Polyline3D polygon)
            {
                IList <Polyline4D> polyline4DList = this.wireframe_0.GetTransformer().Transform(polygon, false);

                this.iwireframeGraphicsFactory2_0.BeginGeometry(this.dxfEntity_0, this.wireframe_0, this.wireframe_0.GetPlotColor(this.dxfEntity_0), false, false, false, true);
                foreach (Polyline4D polyline in (IEnumerable <Polyline4D>)polyline4DList)
                {
                    this.iwireframeGraphicsFactory2_0.CreatePolyline(this.dxfEntity_0, polyline);
                }
                this.iwireframeGraphicsFactory2_0.EndGeometry();
            }
Exemple #15
0
        public static Polyline3D GetSubPolyline(IList <Point3D> points, int start, int length)
        {
            Polyline3D polyline3D = new Polyline3D(length);
            int        num        = start + length;

            for (int index = start; index < num; ++index)
            {
                polyline3D.Add(points[index]);
            }
            return(polyline3D);
        }
Exemple #16
0
        public static void smethod_18(
            DxfEntity entity,
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory,
            WW.Math.Geometry.Polyline3D boundary,
            List <bool> edgeVisibleList)
        {
            Interface41 transformer = context.GetTransformer();
            Polyline4D  boundary1   = DxfUtil.smethod_46(boundary, transformer);

            Class940.smethod_20(entity, context, graphicsFactory, boundary1, edgeVisibleList);
        }
Exemple #17
0
        private IList <Polyline4D> GetPolylines4D(IClippingTransformer transformer)
        {
            WW.Math.Geometry.Polyline3D        polyline3D     = this.method_13();
            List <WW.Math.Geometry.Polyline3D> polyline3DList = new List <WW.Math.Geometry.Polyline3D>(1);

            polyline3DList.Add(polyline3D);
            if (this.Thickness != 0.0)
            {
                DxfUtil.Extrude((IList <WW.Math.Geometry.Polyline3D>)polyline3DList, this.Thickness, this.ZAxis);
            }
            return(DxfUtil.smethod_36((IList <WW.Math.Geometry.Polyline3D>)polyline3DList, polyline3D.Closed, transformer));
        }
Exemple #18
0
        public override IList <Polygon2D> GetClipBoundary(GraphicsConfig graphicsConfig)
        {
            WW.Math.Geometry.Polyline3D polyline3D = this.method_13();
            Polygon2D polygon2D = new Polygon2D(polyline3D.Count);

            foreach (WW.Math.Point3D point3D in (List <WW.Math.Point3D>)polyline3D)
            {
                polygon2D.Add((WW.Math.Point2D)point3D);
            }
            return((IList <Polygon2D>) new Polygon2D[1] {
                polygon2D
            });
        }
Exemple #19
0
 internal static void Extrude(
     WW.Cad.Drawing.Surface.Geometry geometry,
     WW.Math.Geometry.Polyline3D polyline,
     bool isSurface,
     Vector3D extrusion)
 {
     if (polyline.Count == 1)
     {
         WW.Math.Point3D start = polyline[0];
         geometry.Add((IPrimitive) new WW.Cad.Drawing.Surface.Segment(start, start + extrusion));
     }
     else if (polyline.Count == 2)
     {
         WW.Math.Point3D v0 = polyline[0];
         WW.Math.Point3D v1 = polyline[1];
         geometry.Add((IPrimitive) new Quad(v0, v1, v1 + extrusion, v0 + extrusion));
     }
     else if (isSurface)
     {
         Class940.smethod_22(geometry, (IList <WW.Math.Point3D>)polyline);
         WW.Math.Point3D             v1         = polyline[polyline.Count - 1];
         WW.Math.Point3D             v2         = v1 + extrusion;
         WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D(polyline.Count, polyline.Closed);
         for (int index = 0; index < polyline.Count; ++index)
         {
             WW.Math.Point3D v0 = polyline[index];
             WW.Math.Point3D v3 = v0 + extrusion;
             polyline3D.Add(v3);
             geometry.Add((IPrimitive) new Quad(v0, v1, v2, v3));
             v1 = v0;
             v2 = v3;
         }
         Class940.smethod_22(geometry, (IList <WW.Math.Point3D>)polyline3D);
     }
     else
     {
         WW.Math.Point3D             v1         = polyline[polyline.Count - 1];
         WW.Math.Point3D             v2         = v1 + extrusion;
         WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D(polyline.Count, polyline.Closed);
         for (int index = 0; index < polyline.Count; ++index)
         {
             WW.Math.Point3D v0 = polyline[index];
             WW.Math.Point3D v3 = v0 + extrusion;
             polyline3D.Add(v3);
             geometry.Add((IPrimitive) new Quad(v0, v1, v2, v3));
             v1 = v0;
             v2 = v3;
         }
     }
 }
Exemple #20
0
 public override void DrawInternal(
     DrawContext.Surface context,
     ISurfaceGraphicsFactory graphicsFactory)
 {
     graphicsFactory.SetColor(context.GetPlotColor((DxfEntity)this));
     WW.Math.Geometry.Polyline3D polyline = this.method_13();
     if (this.Thickness != 0.0)
     {
         Class940.Extrude((DxfEntity)this, context, graphicsFactory, polyline, this.Model.Header.FillMode, this.Thickness * this.ZAxis);
     }
     else
     {
         Class940.smethod_17((DxfEntity)this, context, graphicsFactory, polyline, this.Model.Header.FillMode);
     }
 }
Exemple #21
0
 public static void smethod_21(
     DxfEntity entity,
     DrawContext.Surface context,
     WW.Cad.Drawing.Surface.Geometry geometry,
     WW.Math.Geometry.Polyline3D polyline,
     bool isSurface)
 {
     if (isSurface)
     {
         Class940.smethod_22(geometry, (IList <WW.Math.Point3D>)polyline);
     }
     else
     {
         geometry.Add(WW.Cad.Drawing.Surface.Polyline3D.CreatePrimitive(polyline));
     }
 }
Exemple #22
0
        private void method_13(IList <WW.Math.Geometry.Polyline3D> polylines)
        {
            foreach (DxfMeshFace dxfMeshFace in this.list_0)
            {
                int count = dxfMeshFace.Corners.Count;
                if (count > 0)
                {
                    DxfMeshFace.Corner corner1 = dxfMeshFace.Corners[0];
                    int num;
                    switch (count)
                    {
                    case 1:
                        WW.Math.Geometry.Polyline3D polyline3D1 = new WW.Math.Geometry.Polyline3D(new WW.Math.Point3D[1] {
                            corner1.Vertex.Position
                        });
                        polylines.Add(polyline3D1);
                        continue;

                    case 2:
                        num = 1;
                        break;

                    default:
                        num = count;
                        break;
                    }
                    for (int index = 0; index < num; ++index)
                    {
                        DxfMeshFace.Corner corner2 = dxfMeshFace.Corners[(index + 1) % count];
                        if (corner1.EdgeVisible)
                        {
                            WW.Math.Geometry.Polyline3D polyline3D2 = new WW.Math.Geometry.Polyline3D();
                            polylines.Add(polyline3D2);
                            if (corner1.Vertex != null)
                            {
                                polyline3D2.Add(corner1.Vertex.Position);
                            }
                            if (corner2.Vertex != null)
                            {
                                polyline3D2.Add(corner2.Vertex.Position);
                            }
                        }
                        corner1 = corner2;
                    }
                }
            }
        }
Exemple #23
0
        public IList <Polygon2D> GetClipBoundary(GraphicsConfig graphicsConfig)
        {
            if (this.double_1 == 0.0)
            {
                return((IList <Polygon2D>) new Polygon2D[0]);
            }
            WW.Math.Geometry.Polyline3D polyline3D = this.method_14(graphicsConfig, 0.0, 2.0 * System.Math.PI);
            Polygon2D polygon2D = new Polygon2D(polyline3D.Count);

            foreach (WW.Math.Point3D point3D in (List <WW.Math.Point3D>)polyline3D)
            {
                polygon2D.Add((WW.Math.Point2D)point3D);
            }
            return((IList <Polygon2D>) new Polygon2D[1] {
                polygon2D
            });
        }
Exemple #24
0
        private WW.Math.Geometry.Polyline3D method_17(DrawContext.Surface context)
        {
            Polygon2D clipBoundary = this.GetClipBoundary((DrawContext)context);

            if (clipBoundary == null || clipBoundary.Count == 0)
            {
                return(new WW.Math.Geometry.Polyline3D());
            }
            Matrix4D matrix4D = this.method_15();

            WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D(true);
            foreach (WW.Math.Point2D point in (List <WW.Math.Point2D>)clipBoundary)
            {
                polyline3D.Add(matrix4D.TransformTo3D(point));
            }
            return(polyline3D);
        }
Exemple #25
0
        private void GetPolylines(
            DrawContext context,
            ILineTypeScaler lineTypeScaler,
            out IList <WW.Math.Geometry.Polyline3D> polylines,
            out IList <FlatShape4D> shapes)
        {
            WW.Math.Geometry.Polyline3D polyline3D = this.method_13();
            polylines = (IList <WW.Math.Geometry.Polyline3D>) new List <WW.Math.Geometry.Polyline3D>();
            shapes    = (IList <FlatShape4D>)null;
            if (polyline3D == null || polyline3D.Count <= 0)
            {
                return;
            }
            DxfHeader      header = context.Model.Header;
            GraphicsConfig config = context.Config;

            polylines.Add(polyline3D);
        }
Exemple #26
0
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            ArgbColor   plotColor     = context.GetPlotColor((DxfEntity)this);
            DxfLineType lineType      = this.GetLineType((DrawContext)context);
            double      lineTypeScale = context.TotalLineTypeScale * this.LineTypeScale;

            if (!graphics.AddExistingGraphicElement2(parentGraphicElementBlock, (DxfEntity)this, plotColor, lineType, lineTypeScale, false))
            {
                return;
            }
            GraphicElement2 graphicElement2 = new GraphicElement2(plotColor, lineType, lineTypeScale, true);

            graphics.AddNewGraphicElement((DxfEntity)this, parentGraphicElementBlock, (GraphicElement1)graphicElement2);
            WW.Math.Geometry.Polyline3D polyline = this.method_14(context.Config);
            graphicElement2.Geometry.Add(WW.Cad.Drawing.Surface.Polyline3D.CreatePrimitive(polyline));
        }
Exemple #27
0
        public static void smethod_17(
            DxfEntity entity,
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory,
            WW.Math.Geometry.Polyline3D polyline,
            bool isSurface)
        {
            Interface41 transformer = context.GetTransformer();
            Polyline4D  boundary    = DxfUtil.smethod_46(polyline, transformer);

            if (isSurface)
            {
                Class940.smethod_20(entity, context, graphicsFactory, boundary, (List <bool>)null);
            }
            else
            {
                graphicsFactory.CreatePolyline((IList <Vector4D>)boundary, polyline.Closed);
            }
        }
Exemple #28
0
        private WW.Math.Geometry.Polyline3D method_13()
        {
            WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D(true);
            Matrix4D transform = this.Transform;

            polyline3D.Add(transform.Transform(this.list_0[0]));
            polyline3D.Add(transform.Transform(this.list_0[1]));
            if (this.list_0.Count == 3)
            {
                polyline3D.Add(transform.Transform(this.list_0[2]));
            }
            else
            {
                if (this.list_0[3] != this.list_0[0] && this.list_0[3] != this.list_0[2])
                {
                    polyline3D.Add(transform.Transform(this.list_0[3]));
                }
                polyline3D.Add(transform.Transform(this.list_0[2]));
            }
            return(polyline3D);
        }
Exemple #29
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);
        }
Exemple #30
0
 private void GetPolylines(
     DrawContext context,
     ILineTypeScaler lineTypeScaler,
     out IList <WW.Math.Geometry.Polyline3D> polylines,
     out IList <FlatShape4D> shapes)
 {
     if (this.point3D_0 == this.point3D_1)
     {
         polylines = (IList <WW.Math.Geometry.Polyline3D>) new WW.Math.Geometry.Polyline3D[1]
         {
             new WW.Math.Geometry.Polyline3D(new WW.Math.Point3D[1] {
                 this.point3D_0
             })
         };
         shapes = (IList <FlatShape4D>)null;
     }
     else
     {
         polylines = (IList <WW.Math.Geometry.Polyline3D>) new List <WW.Math.Geometry.Polyline3D>();
         WW.Math.Geometry.Polyline3D polyline = new WW.Math.Geometry.Polyline3D(new WW.Math.Point3D[2] {
             this.point3D_0, this.point3D_1
         });
         if (context.Config.ApplyLineType)
         {
             shapes = (IList <FlatShape4D>) new List <FlatShape4D>();
             DxfUtil.smethod_4(context.Config, polylines, shapes, polyline, this.GetLineType(context), this.ZAxis, context.TotalLineTypeScale * this.LineTypeScale, lineTypeScaler);
             if (shapes.Count != 0)
             {
                 return;
             }
             shapes = (IList <FlatShape4D>)null;
         }
         else
         {
             polylines.Add(polyline);
             shapes = (IList <FlatShape4D>)null;
         }
     }
 }