public IShape4D Transform(IShape4D shape) { switch (shape.CheckClipping((IInsideTester4D)this.interface32_0)) { case InsideTestResult.None: case InsideTestResult.Outside: return(NullShape4D.Instance); case InsideTestResult.Inside: shape.Transform(this.matrix4D_0); return(shape); default: IList <Polyline4D> polylines4D = shape.ToPolylines4D(this.double_0); List <Polyline4D> polyline4DList = new List <Polyline4D>(polylines4D.Count); int count = polylines4D.Count; for (int index = 0; index < count; ++index) { polyline4DList.AddRange((IEnumerable <Polyline4D>) this.interface32_0.Clip(polylines4D[index], shape.IsFilled)); } IShape4D shape4D = (IShape4D) new PolylineShape4D((IList <Polyline4D>)polyline4DList, shape.IsFilled); shape4D.Transform(this.matrix4D_0); return(shape4D); } }
public IShape4D Transform(IShape4D shape) { foreach (IClippingTransformer clippingTransformer in this.linkedList_0) { shape = clippingTransformer.Transform(shape); } return(shape); }
public virtual void CreateShape( DxfEntity entity, DrawContext.Wireframe drawContext, ArgbColor color, bool forText, IShape4D shape) { }
public void CreateShape( DxfEntity entity, DrawContext.Wireframe drawContext, ArgbColor color, bool forText, IShape4D shape) { this.linkedListNodeRef_0.Insert((IWireframeDrawable) new WireframeGraphicsCache.Class969(entity, drawContext, color, forText, shape)); }
public void CreateShape( DxfEntity entity, DrawContext.Wireframe drawContext, ArgbColor color, bool forText, IShape4D shape) { this.iwireframeGraphicsFactory_0.CreateShape(entity, drawContext, this.func_0(color), forText, shape); }
public void CreateShape( DxfEntity entity, DrawContext.Wireframe drawContext, ArgbColor color, bool forText, IShape4D shape) { shape.UpdateBounds(this.bounds3D_0, this.matrix4D_0); }
public InsideTestResult IsInside(IShape4D shape, out bool transformedShape) { transformedShape = true; shape.Transform(this.matrix4D_0); InsideTestResult insideTestResult = ClipUtil.IsInside((IClipper4D)this.blinnClipper4D_0, shape, this.double_1); shape.Transform(this.matrix4D_1); return(insideTestResult); }
public void CreateShape( DxfEntity entity, DrawContext.Wireframe drawContext, ArgbColor color, bool forText, IShape4D shape) { WW.Math.Point2D[] points = new WW.Math.Point2D[3]; if (shape.IsEmpty) { return; } this.textWriter_0.WriteLine("newpath"); WW.Math.Point2D point2D = new WW.Math.Point2D(); WW.Math.Point2D p0 = new WW.Math.Point2D(); ISegment2DIterator iterator = shape.ToShape2D(Matrix4D.Identity).CreateIterator(); while (iterator.MoveNext()) { switch (iterator.Current(points, 0)) { case SegmentType.MoveTo: WW.Math.Point2D p; p0 = p = points[0]; point2D = p; this.method_8(p); continue; case SegmentType.LineTo: this.method_9(p0 = points[0]); continue; case SegmentType.QuadTo: Pair <WW.Math.Point2D, WW.Math.Point2D> cubicBezier = ShapeTool.QuadToCubicBezier(p0, points[0], points[1]); this.method_10(cubicBezier.First, cubicBezier.Second, p0 = points[1]); continue; case SegmentType.CubicTo: this.method_10(points[0], points[1], p0 = points[2]); continue; case SegmentType.Close: this.textWriter_0.WriteLine("closepath"); p0 = point2D; continue; default: continue; } } if (shape.IsFilled) { this.textWriter_0.WriteLine("fill"); } this.textWriter_0.WriteLine("stroke"); }
public void CreateShape( DxfEntity entity, DrawContext.Wireframe drawContext, ArgbColor color, bool forText, IShape4D shape) { using (GraphicsPath graphicsPath = ShapeTool.ToGraphicsPath(shape.ToShape2D(Matrix4D.Identity))) this.graphicsPath_0.AddPath(graphicsPath, false); }
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); } } } }
public void CreateShape( DxfEntity entity, DrawContext.Wireframe drawContext, ArgbColor color, bool forText, IShape4D shape) { Interface12 drawable = (Interface12) new Class342(this.GetColor(color), shape, shape.IsFilled ? (short)0 : drawContext.GetLineWeight(entity)); this.method_4(forText, drawable); }
public Class969( DxfEntity entity, DrawContext.Wireframe drawContext, ArgbColor color, bool forText, IShape4D shape) : base(entity, drawContext, color) { this.bool_0 = forText; this.ishape4D_0 = shape; }
public void DrawCharPath( IShape2D path, Matrix4D transform, Color color, short lineWeight, bool filled, double extrusion) { IShape4D shape = (IShape4D) new FlatShape4D(path, filled); shape.Transform(transform); this.ipathDrawer_0.DrawCharPath(this.iclippingTransformer_0.Transform(shape).ToShape2D(Matrix4D.Identity), Matrix4D.Identity, color, lineWeight, filled, extrusion); }
public void DrawPath(IShape4D shape, Color color, short lineWeight) { if (shape.IsEmpty) { return; } IShape4D shape1 = this.wireframe_0.GetTransformer().Transform(shape); if (shape1.IsEmpty) { return; } this.iwireframeGraphicsFactory_0.CreateShape(this.dxfEntity_0, this.wireframe_0, this.wireframe_0.GetPlotColor(this.dxfEntity_0, color), false, shape1); }
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]); } } } }
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(); } }
public InsideTestResult IsInside(IShape4D shape, out bool transformedShape) { transformedShape = false; InsideTestResult insideTestResult1 = InsideTestResult.None; foreach (IClippingTransformer clippingTransformer in this.linkedList_0) { bool transformedShape1; InsideTestResult insideTestResult2 = clippingTransformer.IsInside(shape, out transformedShape1); transformedShape |= transformedShape1; if (insideTestResult2 == InsideTestResult.Outside) { return(insideTestResult2); } insideTestResult1 |= insideTestResult2; if (!transformedShape1) { shape.Transform(clippingTransformer.Matrix); transformedShape = true; } } return(insideTestResult1); }
public static InsideTestResult IsInside( IClipper4D clipper, IShape4D shape, double shapeFlattenEpsilonForBoundsCalculation) { InsideTestResult insideTestResult = InsideTestResult.None; foreach (Polyline4D polyline in (IEnumerable <Polyline4D>)shape.ToPolylines4D(shapeFlattenEpsilonForBoundsCalculation)) { IList <Polyline4D> polyline4DList = clipper.Clip(polyline, shape.IsFilled); switch (polyline4DList.Count) { case 0: insideTestResult |= InsideTestResult.Outside; break; case 1: if (polyline == polyline4DList[0]) { insideTestResult |= InsideTestResult.Inside; break; } insideTestResult = InsideTestResult.BothSides; break; default: insideTestResult = InsideTestResult.BothSides; break; } if (insideTestResult == InsideTestResult.BothSides) { break; } } return(insideTestResult); }
public IShape4D Transform(IShape4D shape) { shape.Transform(this.matrix4D_0); switch (shape.CheckClipping((IInsideTester4D)this.blinnClipper4D_0)) { case InsideTestResult.None: case InsideTestResult.Outside: return(NullShape4D.Instance); case InsideTestResult.Inside: shape.Transform(this.matrix4D_1); return(shape); default: IList <Polyline4D> polylines4D = shape.ToPolylines4D(this.double_0); List <Polyline4D> polyline4DList1 = new List <Polyline4D>(polylines4D.Count); int count = polylines4D.Count; bool flag = true; for (int index = 0; index < count; ++index) { Polyline4D polyline = polylines4D[index]; IList <Polyline4D> polyline4DList2 = this.blinnClipper4D_0.Clip(polyline, shape.IsFilled); if (polyline4DList2.Count != 1 || polyline4DList2[0] != polyline) { flag = false; } polyline4DList1.AddRange((IEnumerable <Polyline4D>)DxfUtil.GetTransformed((IEnumerable <Polyline4D>)polyline4DList2, this.matrix4D_1)); } if (!flag) { return((IShape4D) new PolylineShape4D((IList <Polyline4D>)polyline4DList1, shape.IsFilled)); } shape.Transform(this.matrix4D_1); return(shape); } }
public Class342(ArgbColor color, IShape4D shape, short lineWeight) : base(color, lineWeight) { this.ishape4D_0 = shape; }
public void Transform(ITransformer4D transformer, GraphicsConfig graphicsConfig) { this.ishape4D_0 = this.ishape4D_0.GetFlattened(transformer, graphicsConfig.ShapeFlattenEpsilon); }
private bool method_5(IShape4D shape) { if (shape.IsEmpty) { return(false); } StringBuilder stringBuilder = this.stack_0.Peek().StringBuilder; WW.Math.Point2D[] points = new WW.Math.Point2D[3]; SegmentType segmentType = SegmentType.MoveTo; ISegment2DIterator iterator = shape.CreateIterator(this.xamlExporter_0.matrix4D_0); while (iterator.MoveNext()) { switch (iterator.Current(points, 0)) { case SegmentType.MoveTo: stringBuilder.Append('M'); stringBuilder.Append(points[0].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(','); stringBuilder.Append(points[0].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); segmentType = SegmentType.MoveTo; break; case SegmentType.LineTo: if (segmentType != SegmentType.LineTo) { stringBuilder.Append('L'); } stringBuilder.Append(points[0].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(','); stringBuilder.Append(points[0].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); segmentType = SegmentType.LineTo; break; case SegmentType.QuadTo: if (segmentType != SegmentType.QuadTo) { stringBuilder.Append('Q'); } stringBuilder.Append(points[0].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(','); stringBuilder.Append(points[0].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(' '); stringBuilder.Append(points[1].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(','); stringBuilder.Append(points[1].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); segmentType = SegmentType.QuadTo; break; case SegmentType.CubicTo: if (segmentType != SegmentType.CubicTo) { stringBuilder.Append('C'); } stringBuilder.Append(points[0].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(','); stringBuilder.Append(points[0].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(' '); stringBuilder.Append(points[1].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(','); stringBuilder.Append(points[1].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(' '); stringBuilder.Append(points[2].X.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); stringBuilder.Append(','); stringBuilder.Append(points[2].Y.ToString(this.xamlExporter_0.string_2, (IFormatProvider)CultureInfo.InvariantCulture)); segmentType = SegmentType.CubicTo; break; case SegmentType.Close: stringBuilder.Append('Z'); segmentType = SegmentType.Close; break; } stringBuilder.Append(' '); } return(true); }
public void CreateShape(DxfEntity entity, IShape4D shape) { if (shape.IsEmpty) { return; } WW.Math.Point2D[] points = new WW.Math.Point2D[3]; List <bool> boolList = new List <bool>(); ISegment2DIterator iterator1 = shape.CreateIterator(this.matrix4D_0); while (iterator1.MoveNext()) { switch (iterator1.CurrentType) { case SegmentType.MoveTo: boolList.Add(false); continue; case SegmentType.Close: boolList[boolList.Count - 1] = true; continue; default: continue; } } int num = 0; List <System.Windows.Point> pointList = new List <System.Windows.Point>(); ISegment2DIterator iterator2 = shape.CreateIterator(this.matrix4D_0); while (iterator2.MoveNext()) { switch (iterator2.Current(points, 0)) { case SegmentType.MoveTo: this.class453_0.method_1((System.Windows.Point)points[0], this.class453_0.Fill, boolList[num++]); continue; case SegmentType.LineTo: this.class453_0.method_4((System.Windows.Point)points[0]); continue; case SegmentType.QuadTo: pointList.Clear(); pointList.Add((System.Windows.Point)points[0]); pointList.Add((System.Windows.Point)points[1]); this.class453_0.method_6((IList <System.Windows.Point>)pointList); continue; case SegmentType.CubicTo: pointList.Clear(); pointList.Add((System.Windows.Point)points[0]); pointList.Add((System.Windows.Point)points[1]); pointList.Add((System.Windows.Point)points[2]); this.class453_0.method_8((IList <System.Windows.Point>)pointList); continue; default: continue; } } }
public void CreateShape(DxfEntity entity, IShape4D shape) { this.iwireframeGraphicsFactory2_0.CreateShape(entity, shape); }
public void CreateShape(DxfEntity entity, IShape4D shape) { this.method_5(shape); }
public void DrawPath(IShape4D path, Color color, short lineWeight) { FlatShape4D flatShape = path.ToFlatShape(); this.DrawPath(flatShape.FlatShape, flatShape.Transformation, color, lineWeight, flatShape.IsFilled, false, 0.0); }
public IShape4D Transform(IShape4D shape) { shape.Transform(this.matrix4D_0); return(shape); }
public InsideTestResult IsInside(IShape4D shape, out bool transformed) { transformed = false; return(InsideTestResult.Inside); }
public void DrawPath(IShape4D path, Color color, short lineWeight) { FlatShape4D flatShape = path.ToFlatShape(); this.method_0(flatShape.FlatShape, color, flatShape.Transformation, flatShape.IsFilled, 0.0, false); }
public InsideTestResult IsInside(IShape4D shape, out bool transformedShape) { transformedShape = false; return(ClipUtil.IsInside((IClipper4D)this.interface32_0, shape, this.double_1)); }