public CadSystem(PointF origin, SizeF containerSize, float scale, int dpi) { this.gridSystem = new GridSystem(origin, containerSize, scale, dpi); ShapeSystem.InitSystem(); ShapeSystem.SetGrid(gridSystem); //SET FUNCTIONS this.drawingFunctions.Add("L", Line.AddLine); this.drawingFunctions.Add("RT", Rect.AddRect); this.drawingFunctions.Add("E", Ellipse.AddEllipse); this.drawingFunctions.Add("C", gridSystem.SetCursor); this.drawingFunctions.Add("P", cadPoint.AddPoint); this.drawingFunctions.Add("AJD", LinearDimension.AdjDim); this.drawingFunctions.Add("DIM", LinearDimension.AddNewDim); this.drawingFunctions.Add("FILL", ShapeSystem.SetShapeFillColor); Action PosToggle = () => gridSystem.TogglePositioning(); Action DimActiveLine = () => ShapeSystem.DimensionActiveLine(); this.gridFunctions.Add("R", PosToggle); this.gridFunctions.Add("D", DimActiveLine); }
public static void SetGrid(GridSystem grid) { gridSystem = grid; }