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; } }
private void GetPolylines4D( DrawContext context, IClippingTransformer transformer, out bool fill, out IList <Polyline4D> polylines4D) { DxfHeader header = context.Model.Header; GraphicsConfig config = context.Config; IList <WW.Math.Geometry.Polyline3D> polylines = (IList <WW.Math.Geometry.Polyline3D>) new List <WW.Math.Geometry.Polyline3D>(); fill = false; if (header.ShowSplineControlPoints || config.ShowSplineControlPoints) { this.method_14(polylines); } if (config.ShowSplineApproximationPoints) { this.method_15(polylines); } if (!header.ShowSplineControlPoints || config.ShowSplineInterpolatedPoints) { int splineLineSegments = (int)context.Config.NoOfSplineLineSegments; this.method_18(polylines, splineLineSegments, splineLineSegments); } IClippingTransformer transformer1 = (IClippingTransformer)transformer.Clone(); transformer1.SetPreTransform(this.Transform); polylines4D = DxfUtil.smethod_36(polylines, false, transformer1); }
internal Matrix4D method_14() { Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(this.vector3D_0); toWcsTransform.Transpose(); Matrix4D matrix4D1 = Transformation4D.RotateZ(this.double_6) * toWcsTransform; Matrix4D matrix4D2; Matrix4D matrix4D3; Matrix4D matrix4D4; if (this.PerspectiveMode) { double num1 = Class484.smethod_0(this.size2D_0, this.double_1, this.double_4); matrix4D2 = this.method_24(); matrix4D3 = new Matrix4D(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0 / this.double_1, 0.0, 0.0, -1.0 / this.double_1, 0.0) * Transformation4D.Translation(0.0, 0.0, -num1); double num2 = System.Math.Sqrt(this.size2D_0.X * this.size2D_0.X + this.size2D_0.Y * this.size2D_0.Y) / 42.0; matrix4D4 = Transformation4D.Scaling(num2, num2, 1.0); } else { matrix4D2 = this.method_25(); matrix4D3 = Matrix4D.Identity; double num = this.size2D_0.Y / this.double_4; matrix4D4 = Transformation4D.Scaling(num, num, 1.0); } Matrix4D matrix4D5 = Transformation4D.Translation(-this.point2D_0.X, -this.point2D_0.Y, 0.0); return(matrix4D2 * matrix4D4 * matrix4D5 * matrix4D3 * matrix4D1 * Transformation4D.Translation(-(WW.Math.Vector3D) this.point3D_1)); }
private IList <Polyline4D> method_14( DrawContext context, IClippingTransformer transformer) { bool closed = this.Closed; List <Polyline3D> polyline3DList = new List <Polyline3D>(); if (this.Style.DisplayMiters) { int num1 = closed ? 0 : 1; int num2 = closed ? this.list_0.Count : this.list_0.Count - 1; for (int index = num1; index < num2; ++index) { DxfMLine.Segment segment = this.list_0[index]; if (segment.Elements.Count >= 2) { DxfMLine.Segment.Element element1 = segment.Elements[0]; DxfMLine.Segment.Element element2 = segment.Elements[segment.Elements.Count - 1]; if (element1.Parameters.Count > 0 && element2.Parameters.Count > 0) { Polyline3D polyline3D = new Polyline3D(2, false); polyline3D.Add(segment.Position + element1.Parameters[0] * segment.MiterDirection); polyline3D.Add(segment.Position + element2.Parameters[0] * segment.MiterDirection); polyline3DList.Add(polyline3D); } } } } return(DxfUtil.smethod_36((IList <Polyline3D>)polyline3DList, false, transformer)); }
public override void DrawInternal( DrawContext.Wireframe context, IWireframeGraphicsFactory2 graphicsFactory) { if (context.Config.TryDrawingTextAsText && graphicsFactory.SupportsText) { graphicsFactory.BeginGeometry((DxfEntity)this, context, context.GetPlotColor((DxfEntity)this), true, true, false, true); graphicsFactory.CreateMText(this); graphicsFactory.EndGeometry(); } else { this.method_16((DrawContext)context, (IPathDrawer) new Class396((DxfEntity)this, context, graphicsFactory)); if (!context.Config.ShowTextAlignmentPoints) { return; } IList <Polyline4D> polylines = DxfUtil.smethod_36(this.method_18(), false, context.GetTransformer()); if (polylines.Count <= 0) { return; } Class940.smethod_3((DxfEntity)this, context, graphicsFactory, context.GetPlotColor((DxfEntity)this), true, false, true, polylines); } }
private unsafe WriteableBitmap CreateBitmap() { WriteableBitmap writeableBitmap = null; FrameworkElement frameworkElement = mainGrid; if ( model != null && !double.IsNaN(frameworkElement.ActualWidth) && !double.IsNaN(frameworkElement.ActualHeight) && frameworkElement.ActualWidth != 0 && frameworkElement.ActualHeight != 0 ) { int pixelWidth = (int)frameworkElement.ActualWidth; int pixelHeight = (int)frameworkElement.ActualHeight; SixLabors.Primitives.Size size = new SixLabors.Primitives.Size(pixelWidth, pixelHeight); Matrix4D transform = DxfUtil.GetScaleTransform( bounds.Min, bounds.Max, bounds.Center, new Point3D(0, size.Height, 0), new Point3D(size.Width, 0, 0), new Point3D(0.5d * size.Width, 0.5d * size.Height, 0) ); writeableBitmap = new WriteableBitmap(pixelWidth, pixelHeight); cadGraphics.Draw(writeableBitmap, new Rectangle(0, 0, size.Width, size.Height), transform); } return(writeableBitmap); }
internal override void GetPolylines( DrawContext context, ILineTypeScaler lineTypeScaler, out IList <IList <WW.Cad.Drawing.Polyline2D2N> > polylinesList1, out IList <IList <WW.Cad.Drawing.Polyline2D2N> > polylinesList2, out IList <FlatShape4D> shapes, out bool fill) { DxfHeader header = context.Model.Header; WW.Cad.Drawing.Polyline2D2WN polyline = new Class639(this.DefaultStartWidth, this.DefaultEndWidth).method_0((IVertex2DCollection)this.dxfVertex2DCollection_0, context.Config, this.Closed); polylinesList1 = (IList <IList <WW.Cad.Drawing.Polyline2D2N> >) new List <IList <WW.Cad.Drawing.Polyline2D2N> >(); polylinesList2 = (IList <IList <WW.Cad.Drawing.Polyline2D2N> >) new List <IList <WW.Cad.Drawing.Polyline2D2N> >(); shapes = (IList <FlatShape4D>)null; fill = false; IList <WW.Cad.Drawing.Polyline2D2N> resultPolylines1; IList <WW.Cad.Drawing.Polyline2D2N> resultPolylines2; if (polyline != null && DxfUtil.smethod_27(context.Config, polyline, context.Config.ApplyLineType ? this.GetLineType(context) : (DxfLineType)null, context.TotalLineTypeScale * this.LineTypeScale, lineTypeScaler, this.Plinegen, out resultPolylines1, out resultPolylines2, out shapes, out fill)) { polylinesList1.Add(resultPolylines1); polylinesList2.Add(resultPolylines2); if (shapes != null && shapes.Count == 0) { shapes = (IList <FlatShape4D>)null; } } fill &= context.Model.Header.FillMode; }
public static Bitmap CreateAutoSizedBitmap( DxfModel model, GDIGraphics3D cadGraphics, SmoothingMode smoothingMode, Matrix4D transform, System.Drawing.Color backColor, Size maxSize) { cadGraphics.CreateDrawables(model); Bounds3D bounds = new Bounds3D(); cadGraphics.BoundingBox(bounds, transform); int num1 = maxSize.Width - 4; int num2 = maxSize.Height - 4; Matrix4D transform1 = DxfUtil.GetScaleTransform(bounds.Corner1, bounds.Corner2, new WW.Math.Point3D(bounds.Corner1.X, bounds.Corner2.Y, 0.0), new WW.Math.Point3D(0.0, (double)num2, 0.0), new WW.Math.Point3D((double)num1, 0.0, 0.0), new WW.Math.Point3D(2.0, 2.0, 0.0)) * transform; bounds.Reset(); cadGraphics.BoundingBox(bounds, transform1); if (!bounds.Initialized) { return(ImageExporter.CreateEmptyBitmap(backColor, maxSize.Width, maxSize.Height)); } WW.Math.Vector3D delta = bounds.Delta; int width = System.Math.Min(maxSize.Width, (int)System.Math.Ceiling(delta.X) + 4); int height = System.Math.Min(maxSize.Height, (int)System.Math.Ceiling(delta.Y) + 4); return(ImageExporter.CreateBitmap(cadGraphics, smoothingMode, transform1, backColor, width, height)); }
public static Bitmap CreateAutoSizedBitmap( DxfModel model, DxfLayout layout, ICollection <DxfViewport> viewports, Matrix4D transform, GraphicsConfig graphicsConfig, SmoothingMode smoothingMode, System.Drawing.Color backColor, Size maxSize) { BoundsCalculator boundsCalculator = new BoundsCalculator(graphicsConfig); boundsCalculator.GetBounds(model, layout, viewports, transform); Bounds3D bounds = boundsCalculator.Bounds; if (!bounds.Initialized) { return(ImageExporter.CreateEmptyBitmap(backColor, maxSize.Width, maxSize.Height)); } int num1 = maxSize.Width - 4; int num2 = maxSize.Height - 4; Matrix4D scaleTransform = DxfUtil.GetScaleTransform(bounds.Corner1, bounds.Corner2, new WW.Math.Point3D(bounds.Corner1.X, bounds.Corner2.Y, 0.0), new WW.Math.Point3D(0.0, (double)num2, 0.0), new WW.Math.Point3D((double)num1, 0.0, 0.0), new WW.Math.Point3D(2.0, 2.0, 0.0)); Matrix4D to2DTransform = scaleTransform * transform; WW.Math.Vector3D vector3D = scaleTransform.Transform(bounds.Corner2) - scaleTransform.Transform(bounds.Corner1); int width = System.Math.Min(maxSize.Width, (int)System.Math.Ceiling(System.Math.Abs(vector3D.X)) + 4); int height = System.Math.Min(maxSize.Height, (int)System.Math.Ceiling(System.Math.Abs(vector3D.Y)) + 4); return(ImageExporter.CreateBitmap(model, layout, viewports, graphicsConfig, smoothingMode, backColor, to2DTransform, width, height)); }
private void method_1(WW.Math.Geometry.Polyline3D polyline) { List <WW.Math.Geometry.Polyline3D> result = new List <WW.Math.Geometry.Polyline3D>(); DxfUtil.smethod_22(this.graphicsConfig_0, (IList <WW.Math.Geometry.Polyline3D>)result, polyline, this.matrix4D_0, this.dxfLineType_0, this.double_0, this.bool_0); this.vmethod_0(result); }
private static Image <Bgra32> RenderToBitmap(DxfModel model) { var graphicsConfig = (GraphicsConfig)GraphicsConfig.AcadLikeWithWhiteBackground.Clone(); BoundsCalculator boundsCalculator = new BoundsCalculator(); boundsCalculator.GetBounds(model); Bounds3D bounds = boundsCalculator.Bounds; int size = 2000; Matrix4D transform = DxfUtil.GetScaleTransform( bounds.Min, bounds.Max, bounds.Center, new Point3D(0, size, 0), new Point3D(size, 0, 0), new Point3D(0.5d * size, 0.5d * size, 0) ); Memory <Bgra32> memory = new Memory <Bgra32>(); Image.WrapMemory <Bgra32>(memory, 10, 10); Image <Bgra32> bitmap = ImageExporter.CreateBitmap <Bgra32>( model, transform, graphicsConfig, //new GraphicsOptions(false), new Size(size, size)); return(bitmap); }
private void GetPolylines( DrawContext context, ILineTypeScaler lineTypeScaler, out IList <Polyline3D> polylines, out IList <FlatShape4D> flatShapes) { Polyline3D polyline = this.method_14(); polylines = (IList <Polyline3D>) new List <Polyline3D>(); if (polyline != null) { DxfHeader header = context.Model.Header; GraphicsConfig config = context.Config; WW.Math.Vector3D upward = WW.Math.Vector3D.CrossProduct(this.point3D_0 - this.point3D_3, this.point3D_2 - this.point3D_3); upward.Normalize(); if (config.ApplyLineType) { flatShapes = (IList <FlatShape4D>) new List <FlatShape4D>(); DxfUtil.smethod_3(context.Config, polylines, flatShapes, polyline, this.GetLineType(context), upward, context.TotalLineTypeScale * this.LineTypeScale, lineTypeScaler, true); } else { polylines.Add(polyline); flatShapes = (IList <FlatShape4D>)null; } } else { flatShapes = (IList <FlatShape4D>)null; } }
public override void DrawInternal( DrawContext.Surface context, ISurfaceGraphicsFactory graphicsFactory) { graphicsFactory.SetColor(context.GetPlotColor((DxfEntity)this)); IList <WW.Math.Geometry.Polyline3D> polylines; IList <FlatShape4D> shapes; this.GetPolylines((DrawContext)context, context.GetTransformer().LineTypeScaler, out polylines, out shapes); Interface41 transformer = (Interface41)context.GetTransformer().Clone(); transformer.SetPreTransform(this.Transform); IList <Polyline4D> polyline4DList = DxfUtil.smethod_51(polylines, transformer); if (polyline4DList.Count > 0) { foreach (Polyline4D polyline4D in (IEnumerable <Polyline4D>)polyline4DList) { graphicsFactory.CreatePolyline((IList <Vector4D>)polyline4D, polyline4D.Closed); } } if (shapes == null) { return; } Class940.smethod_24((IPathDrawer) new Class473((DxfEntity)this, context, graphicsFactory), (IEnumerable <FlatShape4D>)shapes, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this), 0.0); }
public Matrix4D CalculateTo2DTransform1() { Matrix4D to2DTransform = Matrix4D.Identity; if (model != null && bounds != null) { double halfHeight = ImageControl.ClientSize.Height / 2; double halfWidth = ImageControl.ClientSize.Width / 2; double margin = 5d; // 5 pixels margin on each size. to2DTransform = Transformation4D.Translation(translation) * Transformation4D.Translation(halfWidth, halfHeight, 0) * Transformation4D.Scaling(scaleFactor) * DxfUtil.GetScaleTransform( bounds.Corner1, bounds.Corner2, bounds.Center, new Point3D(margin, ImageControl.ClientSize.Height - margin, 0d), new Point3D(ImageControl.ClientSize.Width - margin, margin, 0d), Point3D.Zero ); } gdiGraphics3D.To2DTransform = to2DTransform * modelTransform; from2DTransform = gdiGraphics3D.To2DTransform.GetInverse(); return(to2DTransform); }
private void GetPolylines( DrawContext context, ILineTypeScaler lineTypeScaler, out IList <Polyline3D> polylines, out IList <FlatShape4D> shapes, out bool fill) { IList <IList <Polyline2D> > polylines1; IList <IList <Polyline2D> > polylines2; this.GetPolylines(context, lineTypeScaler, out polylines1, out polylines2, out shapes, out fill); polylines = (IList <Polyline3D>) new List <Polyline3D>(); int count = polylines1.Count; Matrix4D transform = this.Transform; if (polylines2 != null && polylines2.Count != 0) { for (int index = 0; index < count; ++index) { DxfUtil.smethod_14(polylines1[index], polylines2[index], transform, polylines, true); } } else { for (int index1 = 0; index1 < count; ++index1) { IList <Polyline2D> polyline2DList = polylines1[index1]; for (int index2 = 0; index2 < polylines1.Count; ++index2) { polylines.Add(DxfUtil.smethod_42(polyline2DList[index2], transform)); } } } }
public Matrix4D GetTransform() { Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(this.vector3D_0); toWcsTransform.Transpose(); Matrix4D matrix4D = Transformation4D.RotateZ(this.double_3) * toWcsTransform; return((!this.PerspectiveMode ? Matrix4D.Identity : new Matrix4D(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0 / this.double_0, 0.0, 0.0, -1.0 / this.double_0, 0.0) * Transformation4D.Translation(0.0, 0.0, -this.vector3D_0.GetLength())) * Transformation4D.Translation(-this.point2D_0.X, -this.point2D_0.Y, 0.0) * matrix4D * Transformation4D.Translation(-(Vector3D)this.point3D_0)); }
public Matrix4D GetTransform(Size2D targetSize) { Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(this.vector3D_0); toWcsTransform.Transpose(); Matrix4D matrix4D = Transformation4D.RotateZ(this.double_6) * toWcsTransform; return(Transformation4D.Translation(this.point2D_2.X, this.point2D_2.Y, 0.0) * (!this.PerspectiveMode ? Matrix4D.Identity : new Matrix4D(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0 / this.double_2, 0.0, 0.0, -1.0 / this.double_2, 0.0) * Transformation4D.Translation(0.0, 0.0, -Class484.smethod_0(new Size2D(targetSize.X * this.double_1, targetSize.Y), this.double_2, this.double_0))) * matrix4D * Transformation4D.Translation(-this.point3D_0.X, -this.point3D_0.Y, -this.point3D_0.Z)); }
private void DrawInternal(DxfInsert.Interface46 drawHandler, bool drawBlock) { Matrix4D toWcsTransform = DxfUtil.GetToWCSTransform(this.ZAxis); Matrix4D matrix4D1 = Transformation4D.Translation((WW.Math.Vector3D) this.InsertionPoint); Matrix4D matrix4D2 = Transformation4D.RotateZ(this.Rotation); Matrix4D matrix4D3 = Transformation4D.Scaling(this.ScaleFactor); ushort num1 = this.RowCount; if (num1 < (ushort)1) { num1 = (ushort)1; } ushort num2 = this.ColumnCount; if (num2 < (ushort)1) { num2 = (ushort)1; } for (int row = 0; row < (int)num1; ++row) { for (int column = 0; column < (int)num2; ++column) { if (drawBlock) { Matrix4D matrix4D4 = toWcsTransform * matrix4D1 * matrix4D2 * Transformation4D.Translation((double)column * this.ColumnSpacing, (double)row * this.RowSpacing, 0.0) * matrix4D3; drawHandler.imethod_0(row, column, matrix4D4); if (this.Block != null) { switch (this.method_16(matrix4D4, drawHandler)) { case DxfInsert.Enum44.const_1: case DxfInsert.Enum44.const_2: drawHandler.Draw(this.Block, true); break; case DxfInsert.Enum44.const_3: drawHandler.Draw(this.Block, true); drawHandler.InsertCellDrawContext.vmethod_1(); break; } } } if (this.Attributes.Count > 0) { WW.Math.Vector3D vector = new WW.Math.Vector3D((double)column * this.ColumnSpacing, (double)row * this.RowSpacing, 0.0); vector = (toWcsTransform * matrix4D2).Transform(vector); Matrix4D instanceTransform = Transformation4D.Translation(vector.X, vector.Y, vector.Z); drawHandler.imethod_1(row, column, instanceTransform); foreach (DxfAttribute attribute in (IEnumerable <DxfAttribute>) this.Attributes) { drawHandler.Draw(attribute); } } } } }
public void Visit(Polyline2D2WN visitee) { List <WW.Cad.Drawing.Polyline2D2WN> polyline2D2WnList = new List <WW.Cad.Drawing.Polyline2D2WN>(); DxfUtil.smethod_19 <Point2D2WN, WW.Cad.Drawing.Polyline2D2WN>(this.graphicsConfig_0, WW.Cad.Drawing.Polyline2D2WN.Factory, (IList <WW.Cad.Drawing.Polyline2D2WN>)polyline2D2WnList, visitee.Wrappee, this.matrix4D_0 * visitee.Transform, this.dxfLineType_0, this.double_0, this.bool_0); foreach (WW.Cad.Drawing.Polyline2D2WN wrappee in polyline2D2WnList) { this.graphicElement1_1.Geometry.Add((IPrimitive) new Polyline2D2WN(wrappee, visitee.Fill, visitee.Transform)); } }
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); } } } }
private void GetPolylines4D( DrawContext context, IClippingTransformer transformer, out IList <Polyline4D> polylines4D, out IList <FlatShape4D> shapes) { IList <WW.Math.Geometry.Polyline3D> polylines; this.GetPolylines(context, transformer.LineTypeScaler, out polylines, out shapes); polylines4D = DxfUtil.smethod_36(polylines, false, transformer); }
private void GetPolylines4D( IClippingTransformer transformer, out IList <Polyline4D> polylines4D, out bool fill) { IList <WW.Math.Geometry.Polyline3D> polylines = (IList <WW.Math.Geometry.Polyline3D>) new List <WW.Math.Geometry.Polyline3D>(); fill = false; this.method_13(polylines); DxfUtil.Transform(polylines, this.Transform); polylines4D = DxfUtil.smethod_36(polylines, false, transformer); }
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)); }
public static void smethod_19( DxfEntity entity, DrawContext.Surface context, ISurfaceGraphicsFactory graphicsFactory, List <WW.Math.Point3D> boundary, List <bool> edgeVisibleList) { Interface41 transformer = context.GetTransformer(); Polyline4D boundary1 = DxfUtil.smethod_46(new WW.Math.Geometry.Polyline3D((IList <WW.Math.Point3D>)boundary), transformer); Class940.smethod_20(entity, context, graphicsFactory, boundary1, edgeVisibleList); }
public override void DrawInternal( DrawContext.Wireframe context, IWireframeGraphicsFactory graphicsFactory) { Polyline3DT imageBoundaryPolyline; IClippingTransformer transformer; IList <Polyline4D> polylines1 = this.method_16(context, out imageBoundaryPolyline, out transformer); if (polylines1.Count <= 0) { return; } graphicsFactory.CreatePath((DxfEntity)this, context, context.Config.BackColor, false, polylines1, true, false); IList <FlatShape4D> flatShape4DList = (IList <FlatShape4D>)null; if (!context.WipeoutVariables.DisplayFrame) { return; } IList <WW.Math.Geometry.Polyline3D> polyline3DList; if (context.Config.ApplyLineType) { IList <FlatShape4D> resultShapes = (IList <FlatShape4D>) new List <FlatShape4D>(); polyline3DList = (IList <WW.Math.Geometry.Polyline3D>) new List <WW.Math.Geometry.Polyline3D>(); Vector3D upward = Vector3D.CrossProduct(this.XAxis, this.YAxis); if (upward == Vector3D.Zero) { upward = Vector3D.ZAxis; } else { upward.Normalize(); } DxfUtil.smethod_11(context.Config, polyline3DList, resultShapes, imageBoundaryPolyline, this.GetLineType((DrawContext)context), upward, context.TotalLineTypeScale * this.LineTypeScale, context.GetTransformer().LineTypeScaler); if (resultShapes.Count == 0) { flatShape4DList = (IList <FlatShape4D>)null; } } else { polyline3DList = (IList <WW.Math.Geometry.Polyline3D>) new WW.Math.Geometry.Polyline3D[1] { imageBoundaryPolyline.ToPolyline3D() }; flatShape4DList = (IList <FlatShape4D>)null; } IList <Polyline4D> polylines2 = DxfUtil.smethod_36(polyline3DList, false, transformer); graphicsFactory.CreatePath((DxfEntity)this, context, this.GetColor((DrawContext)context), false, polylines2, false, true); }
private void GetPolylines4D( DrawContext context, IClippingTransformer transformer, out IList <Polyline4D> polylines4D, out IList <IShape4D> shapes) { IList <Polyline3D> polylines; IList <FlatShape4D> flatShapes; this.GetPolylines(context, transformer.LineTypeScaler, out polylines, out flatShapes); polylines4D = DxfUtil.smethod_36(polylines, false, transformer); shapes = DxfUtil.smethod_37((ICollection <FlatShape4D>)flatShapes, transformer); }
private void method_13( DrawContext context, IClippingTransformer transformer, out IList <WW.Math.Geometry.Polyline3D> polylines, out IList <FlatShape4D> flatShapes) { this.GetPolylines(context, transformer.LineTypeScaler, out polylines, out flatShapes); if (this.double_1 == 0.0) { return; } DxfUtil.Extrude(polylines, this.double_1, this.vector3D_0); }
public override void DrawInternal( DrawContext.Surface context, ISurfaceGraphicsFactory graphicsFactory) { IList <IList <Polyline2D2N> > polylines1; IList <IList <Polyline2D2N> > polylines2; IList <FlatShape4D> shapes; bool fill; this.GetPolylines((DrawContext)context, context.GetTransformer().LineTypeScaler, out polylines1, out polylines2, out shapes, out fill); ArgbColor plotColor = context.GetPlotColor((DxfEntity)this); graphicsFactory.SetColor(plotColor); int count = polylines1.Count; for (int index = 0; index < count; ++index) { IList <Polyline2D2N> polyline2D2NList = polylines1[index]; IList <Polyline2D2N> polylinesB = polylines2[index]; bool flag = this.Thickness != 0.0; if (polylinesB == null) { if (flag) { Class940.smethod_5((DxfEntity)this, context, graphicsFactory, polyline2D2NList, fill, this.Transform, this.ZAxis, this.Thickness); } else { IList <Polyline3D> polyline3DList = (IList <Polyline3D>) new List <Polyline3D>(); DxfUtil.smethod_15(polyline2D2NList, (IList <Polyline2D2N>)null, this.Transform, polyline3DList, false); Class940.smethod_15((DxfEntity)this, context, graphicsFactory, polyline3DList); } } else if (flag) { Class940.smethod_7((DxfEntity)this, context, graphicsFactory, polyline2D2NList, polylinesB, fill, this.Transform, this.ZAxis, this.Thickness); } else { Class940.smethod_10((DxfEntity)this, context, graphicsFactory, polyline2D2NList, polylinesB, this.Transform, this.ZAxis, fill); } if (shapes != null) { Class473 class473 = new Class473((DxfEntity)this, context, graphicsFactory); foreach (FlatShape4D flatShape4D in (IEnumerable <FlatShape4D>)shapes) { class473.DrawPath(flatShape4D.FlatShape, flatShape4D.Transformation, this.Color.ToColor(), (short)0, flatShape4D.IsFilled, false, this.Thickness); } } } }
internal static void smethod_4( DrawContext context, ILineTypeScaler lineTypeScaler, ILeader leader, IList <WW.Math.Point3D> vertices, DxfLineType lineType, Vector3D zAxis, double lineTypeScale, out IList <Polyline3D> polylines, out IList <FlatShape4D> shapes) { Polyline3D polyline = DxfLeader.smethod_3(context, leader, vertices); if (context.Config.ApplyLineType) { polylines = (IList <Polyline3D>) new List <Polyline3D>(); if (polyline != null) { shapes = (IList <FlatShape4D>) new List <FlatShape4D>(); DxfUtil.smethod_4(context.Config, polylines, shapes, polyline, lineType, zAxis, context.TotalLineTypeScale * lineTypeScale, lineTypeScaler); if (shapes.Count != 0) { return; } shapes = (IList <FlatShape4D>)null; } else { shapes = (IList <FlatShape4D>)null; } } else { ref IList <Polyline3D> local = ref polylines; List <Polyline3D> polyline3DList; if (polyline == null) { polyline3DList = new List <Polyline3D>(); } else { polyline3DList = new List <Polyline3D>() { polyline } }; local = (IList <Polyline3D>)polyline3DList; shapes = (IList <FlatShape4D>)null; } }
public static void smethod_15( DxfEntity entity, DrawContext.Surface context, ISurfaceGraphicsFactory graphicsFactory, IList <WW.Math.Geometry.Polyline3D> polylines) { Interface41 transformer = context.GetTransformer(); foreach (WW.Math.Geometry.Polyline3D polyline in (IEnumerable <WW.Math.Geometry.Polyline3D>)polylines) { Polyline4D polyline4D = DxfUtil.smethod_46(polyline, transformer); graphicsFactory.CreatePolyline((IList <Vector4D>)polyline4D, polyline.Closed); } }