Differences between revisions 19 and 20
Revision 19 as of 2016-04-30 09:12:40
Size: 2912
Editor: ip5657d226
Comment:
Revision 20 as of 2016-04-30 09:16:46
Size: 3286
Editor: ip5657d226
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
Several types of mastertools were development, depending on what type of editing application is needed. For editing a wired diagram, a different mastertool is needed as when just wanting to draw something. One can always derived are write its own mastertoool, or only push one simple dragtool <<Dox(a2dDragTool)>>.

See <<Dox(a2dBaseTool)>> for what tools are available.

Canvas Module

The canvas module is using the general module and the xmlparse module. Drawable objects or stored in a a2dDrawing, and displayed on a a2dCanvass. What part is displayed on the canvas is set through its a2dDrawingPart.

Intercative editing and drawing of a2dCanvasObjects is implemented with a2dStTool and a2dStToolContr. Using those tools one can create interactive editing applications.

A controller can be plugged into a a2dDrawingPart. A a2dDrawer2D is an abstract drawing context class, each a2dDrawingPart has one, which it uses to draw a a2dDrawing on to the a2dCanvas.

The controller intercepts all events, from the a2dCanvas window, before they are handled by the a2dDrawingPart class. The controller, has a stack of pushed tools. When a tool is active, it will receive the events, and based on that, manipulate the contents of the drawing, which is displayed on the a2dCanvas.

The a2dDrawingPart on its turn redirects events to the a2dCanvasObjects which are part of the a2dDrawing, that is displayed by that a2dDrawingPart.

The canvas module contains a stack oriented controller class, on which you can push tools used to draw objects, and edit those objects. Other tools are there to copy, drag, delete object. A zoom tool, can be used at all times to zoom into a drawing, even when one is already busy drawing etc. with a tool at that moment. In general one pushes only one are two tools at then time. For instance first push a mastertool, like a2dMasterTagGroups3, which is on its turn decide what other tool needs to be pushed to do a certain action. And if that action is for instance a draw a rectangle tool a2dDrawRectangleTool, that rectangle tool can temporary push a zoomtool a2dZoomTool. A tool is pushed on a stack, and when a tool is popped from the stack, the first tools on the stack will become active again. Like this one can push a zoom tool while busy drawing a polygon. This feature makes it easy to do extremely accurate drawing. Several types of mastertools were development, depending on what type of editing application is needed. For editing a wired diagram, a different mastertool is needed as when just wanting to draw something. One can always derived are write its own mastertoool, or only push one simple dragtool a2dDragTool.

See a2dBaseTool for what tools are available.

Several standard dialogs special for editing purposes are part of this module, to make it easy to the more general actions, which one often likes to do. Think of things like settings layer style and rendering order LayerPropertiesDialog.

You can find a general editing class in a2dEditorFrame from which you can derive and adept your own. This is part of the EditorModule, since it uses the DocviewModule also. But in the a2dEditorFrame is no more then a bunch of menus to start tools or showing dialogs for several actions. In many cases you just want your own editing frames, with just a few tools to start. And wxArt2D is setup to make this as easy as possible. The goal is to create highly interactive application with ease.

wxArt2D: CanvasModule (last edited 2016-05-03 09:29:36 by inetproxy-p)