public override void CopyFrom(DxfHandledObject from, CloneContext cloneContext) { base.CopyFrom(from, cloneContext); DxfLayout dxfLayout = (DxfLayout)from; this.bool_0 = dxfLayout.bool_0; this.string_8 = dxfLayout.string_8; this.layoutOptions_0 = dxfLayout.layoutOptions_0; this.int_0 = dxfLayout.int_0; this.rectangle2D_1 = dxfLayout.rectangle2D_1; this.point3D_0 = dxfLayout.point3D_0; this.point3D_1 = dxfLayout.point3D_1; this.point3D_2 = dxfLayout.point3D_2; this.double_7 = dxfLayout.double_7; this.Ucs = Class906.smethod_2(cloneContext, dxfLayout.Ucs); this.orthographicType_0 = dxfLayout.orthographicType_0; DxfBlock ownerBlock = dxfLayout.OwnerBlock; if (ownerBlock != null && ownerBlock.BlockBegin != null) { this.OwnerBlock = Class906.smethod_0(cloneContext, ownerBlock, true); } foreach (DxfHandledObject dxfHandledObject in (DxfHandledObjectCollection <DxfViewport>)dxfLayout.dxfViewportCollection_0) { this.dxfViewportCollection_0.Add((DxfViewport)dxfHandledObject.Clone(cloneContext)); } this.LastActiveViewport = (DxfHandledObject)cloneContext.GetExistingClone((IGraphCloneable)dxfLayout.LastActiveViewport); switch (dxfLayout.Handle) { case 30: case 34: this.SetHandle(dxfLayout.Handle); break; } }
internal static DxfLayout smethod_5( DxfModel model, DxfBlock modelSpaceBlockRecord, bool useFixedHandles) { DxfLayout layout; if (modelSpaceBlockRecord.Layout == null) { layout = new DxfLayout(modelSpaceBlockRecord); if (useFixedHandles) { layout.SetHandle(34UL); } layout.Name = "Model"; layout.PlotLayoutFlags = PlotLayoutFlags.UseStandardScale | PlotLayoutFlags.PlotPlotStyles | PlotLayoutFlags.PrintLineweights | PlotLayoutFlags.DrawViewportsFirst | PlotLayoutFlags.ModelType; layout.PlotArea = PlotArea.LastScreenDisplay; layout.StandardScaleType = (short)0; layout.Options = LayoutOptions.PaperSpaceLinetypeScaling; layout.TabOrder = 0; layout.Limits = new Rectangle2D(0.0, 0.0, 12.0, 9.0); layout.LastActiveViewport = (DxfHandledObject)model.VPorts.GetActiveVPort(); modelSpaceBlockRecord.Layout = layout; model.Layouts.Add(layout); } else { layout = modelSpaceBlockRecord.Layout; } DxfLayout.smethod_6(model, layout); return(layout); }
internal static void smethod_6(DxfModel model, DxfLayout layout) { layout.bool_0 = false; layout.method_9(model.Entities, false); if (layout.OwnerBlock == null) { return; } layout.OwnerBlock.method_10(model.Entities); }
public override IGraphCloneable Clone(CloneContext cloneContext) { DxfLayout dxfLayout = (DxfLayout)cloneContext.GetExistingClone((IGraphCloneable)this); if (dxfLayout == null) { dxfLayout = new DxfLayout(); cloneContext.RegisterClone((IGraphCloneable)this, (IGraphCloneable)dxfLayout); dxfLayout.CopyFrom((DxfHandledObject)this, cloneContext); } return((IGraphCloneable)dxfLayout); }
public PlotInfo( DxfLayout layout, Size2D paperSize, Rectangle2D printableArea, Matrix4D toPaperTransform, double scaling) { this.Layout = layout; this.PaperSize = paperSize; this.PrintableArea = printableArea; this.ToPaperTransform = toPaperTransform; this.Scaling = scaling; }
internal static DxfLayout smethod_4( DxfModel model, DxfBlock paperSpaceBlockRecord, bool useFixedHandles) { if (paperSpaceBlockRecord.Layout != null) { return(paperSpaceBlockRecord.Layout); } DxfLayout dxfLayout = new DxfLayout(paperSpaceBlockRecord); if (useFixedHandles) { dxfLayout.SetHandle(38UL); } dxfLayout.Name = "Layout2"; dxfLayout.StandardScaleType = (short)16; dxfLayout.Options = LayoutOptions.PaperSpaceLinetypeScaling; dxfLayout.TabOrder = 2; dxfLayout.Limits = new Rectangle2D(0.0, 0.0, 12.0, 9.0); paperSpaceBlockRecord.Layout = dxfLayout; model.Layouts.Add(dxfLayout); return(dxfLayout); }
public Bounds2D GetPlotAreaBounds() { Bounds2D bounds2D = new Bounds2D(); switch (this.PlotArea) { case PlotArea.LastScreenDisplay: if (this.LastActiveViewport is DxfVPort) { bounds2D = DxfLayout.smethod_7(((DxfVPort)this.LastActiveViewport).ViewDescription); } if (this.LastActiveViewport is DxfViewport) { bounds2D = DxfLayout.smethod_7(((DxfViewport)this.LastActiveViewport).ViewDescription); break; } break; case PlotArea.DrawingExtents: bounds2D.Update(this.MinExtents.X, this.MinExtents.Y); bounds2D.Update(this.MaxExtents.X, this.MaxExtents.Y); break; case PlotArea.DrawingLimits: bounds2D.Update(this.Limits.Corner1); bounds2D.Update(this.Limits.Corner2); break; case PlotArea.SpecifiedByViewName: bounds2D = DxfLayout.smethod_7(this.Model.Views[this.PlotViewName].ViewDescription); break; case PlotArea.SpecifiedByPlotWindowArea: bounds2D.Update(this.PlotWindowArea.Corner1); bounds2D.Update(this.PlotWindowArea.Corner2); break; case PlotArea.LayoutInformation: if (this.PlotPaperSize == Size2D.Zero) { return(bounds2D); } switch (this.PlotRotation) { case PlotRotation.None: Vector2D vector2D1 = -new Vector2D(this.UnprintableMarginLeft, this.UnprintableMarginBottom) - (Vector2D)this.PaperImageOrigin; bounds2D.Update(new WW.Math.Point2D(0.0, 0.0) + vector2D1); bounds2D.Update(new WW.Math.Point2D(this.PlotPaperSize.X, this.PlotPaperSize.Y) + vector2D1); break; case PlotRotation.QuarterCounterClockwise: Vector2D vector2D2 = -new Vector2D(this.UnprintableMarginTop, this.UnprintableMarginLeft) - (Vector2D)this.PaperImageOrigin; bounds2D.Update(new WW.Math.Point2D(0.0, 0.0) + vector2D2); bounds2D.Update(new WW.Math.Point2D(this.PlotPaperSize.Y, this.PlotPaperSize.X) + vector2D2); break; case PlotRotation.Half: Vector2D vector2D3 = -new Vector2D(this.UnprintableMarginRight, this.UnprintableMarginTop) - (Vector2D)this.PaperImageOrigin; bounds2D.Update(new WW.Math.Point2D(0.0, 0.0) + vector2D3); bounds2D.Update(new WW.Math.Point2D(this.PlotPaperSize.X, this.PlotPaperSize.Y) + vector2D3); break; case PlotRotation.QuarterClockwise: Vector2D vector2D4 = -new Vector2D(this.UnprintableMarginBottom, this.UnprintableMarginRight) - (Vector2D)this.PaperImageOrigin; bounds2D.Update(new WW.Math.Point2D(0.0, 0.0) + vector2D4); bounds2D.Update(new WW.Math.Point2D(this.PlotPaperSize.Y, this.PlotPaperSize.X) + vector2D4); break; } if (this.PlotPaperUnits == PlotPaperUnits.Inches) { double num = 5.0 / (double)sbyte.MaxValue; bounds2D = new Bounds2D((WW.Math.Point2D)(num * (Vector2D)bounds2D.Min), (WW.Math.Point2D)(num * (Vector2D)bounds2D.Max)); break; } break; } return(bounds2D); }