public OverlayTool[] ToolList; // is filled in the constructor public PdfOverlayModel(IPdfOverlayView View, IOverlayShapeFactory ShapeFactory) { this.View = View; this.ShapeFactory = ShapeFactory; _DisplayTree = new TikzDisplayTree(p => TikzToScreen(p, false)); // initialize tools selectionTool = new SelectionTool(this); // must be in the same order as the ToolType enum ToolList = new OverlayTool[] { selectionTool, new NodeTool(this), new EdgeTool(this), new PathTool(this), new SmoothCurveTool(this), new BezierTool(this), new RectangleTool(this), new EllipseTool(this), new GridTool(this), new ArcTool(this), new ArcEditTool(this) }; }
public OverlayTool[] ToolList; // is filled in the constructor public PdfOverlayModel(IPdfOverlayView View, IOverlayShapeFactory ShapeFactory) { this.View = View; this.ShapeFactory = ShapeFactory; _DisplayTree = new TikzDisplayTree( p => TikzToScreen(p, false) ); // initialize tools selectionTool = new SelectionTool(this); // must be in the same order as the ToolType enum ToolList = new OverlayTool[] { selectionTool, new NodeTool(this), new EdgeTool(this), new PathTool(this), new SmoothCurveTool(this), new BezierTool(this), new RectangleTool(this), new EllipseTool(this), new GridTool(this), new ArcTool(this), new ArcEditTool(this) }; }
void DisplayTree_DisplayTreeChanged(object sender, TikzDisplayTree.DisplayTreeChangedEventArgs e) { // This method is called when the Displaytree changes, i.e., when a new OverlayShapeVM is created. // Add a view to display the OverlayShapeVM if (e.Type == TikzDisplayTree.DisplayTreeChangedType.Insert) { foreach (var os in e.AffectedItems) { if (os is OverlayScope) NewScopeView(os as OverlayScope); else if (os is OverlayControlPoint) NewCPView(os as OverlayControlPoint); else if (os is OverlayNode) NewNodeView(os as OverlayNode); } } else if (e.Type == TikzDisplayTree.DisplayTreeChangedType.Clear) { canvas1.Children.Clear(); } }