Differences between revisions 5 and 9 (spanning 4 versions)
Revision 5 as of 2008-08-07 07:10:39
Size: 18233
Comment:
Revision 9 as of 2009-07-03 09:20:36
Size: 12247
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
    ## page was renamed from ModuleHierarchy

= Samples Overview =

The samples on this page might give you an idea of the capabilities of wxArt2D. Their sources are in {{{wxArt2D\samples}}}. So you have a starting point on how to implement the features you need.
Line 3: Line 8:
     == editor module samples ==
Line 4: Line 11:
= Module Dependencies =

See ModuleDependencies
                    
== Module Hierarchy ==

wxArt2D is set up in modules. A modules contains mainly files that form together a certain funtionality.
         
Modules do depend upon eachother, and a certain hierarchy is in them. The hierarchy is not strict, sometimes in modules other modules are used but when wanted they can be switched on or off. Special attention is payed to be able to remove higher order modules, without problem, So the docview module can be used without the canvas module. But also lower order modules like xmlparse are optional for the docview module.

== General Module ==

 The module general is used by all modules. It contains classes etc. that can be used in all other modules.<br> wxRefObject and its derived property classes are in this module. Another one is wxSmrtPtr, which is a smart pointer template class. It works for classes with a Release and Own mechanism, which &nbsp;are all wxRefObject derived classes.
         
== xmlparse Module ==

This module contains the code for the Pullparser, it uses expat for parsing the xml for a file or string. <br> XML Pull parsing is ideal for parsing XML data from a file, but where the reading of this data is distributed through all classes in other modules, and those classes are deciding what needs to be read from the file. This is different from a parser that reads all XML data at once into a DOM tree. Next to reading XML data, this module also support you to easily write XML data from a file, and again in such a manner that the writing of the data is distributed through all classes in other modules.<br> The CVG format uses this module for saving a wxCanvasDocument to a file and/or&nbsp; load it from a file. wxDocviewIOHandlerXmlSer is the class used for that, and it is a general class for serialising class data.
        
== artbase Module ==

This module contains basic geometric classes, and the abstract wxDrawer2D clas, classes derived from this are drawing context classes.<br> The drawing context is able to draw relative to a matrix that is set to the drawing context first.<br> The&nbsp; drawing contexts classes can be used standalone for wxWidgets, and that do not depend on the rest of wxArt2D.<br> That is, it uses the general module, and the xmlparse module is used inside the style classes, but it can be switched off.<br> There is one drawing context in this module which uses wxDc and wxMemoryDc to do normal drawing. <br> The module aggdrawer and libartdrawer, use this module to implement a drawing context which can do antialiased drawing.
         
== aggdrawer Module ==

 This module defines drawing context classes for anti aliased double buffer drawing. It only depends on the general and artbase module. The module is an implementation of the wxDrawer2D class, and doesn't depend on the canvas module. So use for drawing, but in combination with the canvas module, can be used to render canvas documents. This module use the Antigrain to the drawing.

== gdiplusdrawer Module ==

 This module defines drawing context classes for anti aliased double buffer drawing. It only depends on the general and artbase module. The module is an implementation of the wxDrawer2D class, and doesn't depend on the canvas module. So use for drawing, but in combination with the canvas module, can be used to render canvas documents. Gdi+ is used to do the actual drawing.
         
== docview module ==
 The docview module contains the classes for the docview framework. It makes it easy to implement applications that open several documents, and display its data one or more windows using views. The canvas module and editor module depend on it. A base wrapping class for wrapping commands/functions to external scripting languages is also in here.
         
== canvas module ==
         
The canvas module builds on top of the docview module a library for 2D drawing applications. A a2dCanvasDocument does contain a hierarchy of drawing objects (wxCanvasOject), and the document can be displayed on windows, using specialized view called a2dCanvasView. a2dCanvasView usues internal the a2dDrawer2D derived classes to really draw the objects in the a2dCanvasDocument. Each view can display a different part and level of the hierarchy in the a2dCanvasDocument. The module depends on the following modules: general, xmlparse (optional), artbase, docview.

== io Modules ==

The modules svgio and gdsio are using the canvas module. But the canvas module can do without them, so this is the way to add extra IO formats. The classes parse a file and translates the contents to a a2dCanvasDocument containing the drawing in the form of a2dCanvasOjects. They can also write the a2dCanvasDocument back to a file, by traversing the document from the outside, and translating the contents of the document back to a the file format. The idea is to add more formats without extending the canvas module.
         
== editor Module ==

The editor module is for editing 2d graphical data. Here are the tools, editor frame and the command wrappers.
         
== curve Module ==

The curve module is on top of the canvas module, and so is canextobj. Both implement complicated non basic a2dCanvasObjects. Since the curve module has a tool inside, it also depend on the editor module. Very likely it is the best to combine higher order a2dCanvasObjects together with its tools to draw/manipulate them. So therefore they will depend on the editor module in general.

= Samples overview =
All samples are situated in the module of which it tries to demo certain features. This does not mean it only uses that module, but its main purpose is towards that module. For example in the sample of the aggdrawer, you will find it depends on the editor module, but it is located there because it demos the aggdrawer. Down here an overview of samples and what they are meant &nbsp;for. The more advanged ( and therefore more complex ) samples are in the higher order modules. To get a good overview what wxArt2D is capable of, try first the samples vdrawm, vdraws. But do not start with thse, since they are also the more complex.
     
== editor module samples ==
Line 60: Line 14:
Is the most advanged example. It sets up a multi document drawing program. And has a menu of screens which demo all drawing features<br> of the library. You can open files in SVG, CVG and GDSII format. You can draw and edit all kinds of primitives. Each new drawing gets its own drawing editor complete with undo redo. There are dialogs to set style for drawing primitives. For many features there is a menu to test it.<br> You can create multiple views on a document via the main window its file open icons, and see how all view are updated when drawing things.<br> The screen are all created by program code, so if you need to know how to fill a drawing document using program code, look at the specific screen<br> its code. Is the most advanged example. It sets up a multi document drawing program. And has a menu of screens which demo all drawing features of the library. You can open files in SVG, CVG and GDSII format. You can draw and edit all kinds of primitives. Each new drawing gets its own drawing editor complete with undo redo. There are dialogs to set style for drawing primitives. For many features there is a menu to test it. You can create multiple views on a document via the main window its file open icons, and see how all view are updated when drawing things. The screen are all created by program code, so if you need to know how to fill a drawing document using program code, look at the specific screen its code.
Line 72: Line 26:
 Mdi type application to explain how to work with graphs and pins. Graphs are wxCanvasObject with wxCanvasPins as children which form the nodes of the graph, and other wxCanvasObject like wxCanvasWirePolylineL which connect the objects having pins. Pins can be of different class types, pins with pinclasses of compatible/connectable types can be connected to eachother or to specific wires types. This all makes it possible to have several independent graphs, or several flows within one graph. In the sample one can draw a schematic diagram using a simple build in library of resistor, capacitor and ground symbols. Next to that non schematic objects can be connected with a separate class of pins. Pins are e.g. automatically generated on rectangles. The routing used is based on a Lee algorithm, and result in manhattan like wires with minimal cost in terms of corners and length. There is even a simple netlist generator for a spice simulator. Mdi type application to explain how to work with graphs and pins. Graphs are a2dCanvasObject with a2dPin's as children which form the nodes of the graph, and other a2dCanvasObject like a2dCanvasWirePolylineL which connect the objects having pins. Pins can be of different class types, pins with pinclasses of compatible/connectable types can be connected to eachother or to specific wires types. This all makes it possible to have several independent graphs, or several flows within one graph. In the sample one can draw a schematic diagram using a simple build in library of resistor, capacitor and ground symbols. Next to that non schematic objects can be connected with a separate class of pins. Pins are e.g. automatically generated on rectangles. The routing used is based on a Lee algorithm, and result in manhattan like wires with minimal cost in terms of corners and length. There is even a simple netlist generator for a spice simulator.
Line 80: Line 34:
The basis for a multiple view and document drawing program is shown. You can create drawings with rectangles in a specific style using the draw rectangle tool. After drawing you can edit and drag the rectangles around. You can save and open the drawings you create. The document used is not a default wxCanvasDocument, but a derived one with its own saving and loading methods. The same for the views new view connector are created, which &nbsp;are used to create application specific views for the documents. The basis for a multiple view and document drawing program is shown. You can create drawings with rectangles in a specific style using the draw rectangle tool. After drawing you can edit and drag the rectangles around. You can save and open the drawings you create. The document used is not a default a2dCanvasDocument, but a derived one with its own saving and loading methods. The same for the views new view connector are created, which &nbsp;are used to create application specific views for the documents.
Line 84: Line 38:
A single window application, showing how to fill a derived wxCanvas its document with objects. The derived canvas class creates a stack based toolcontroller&nbsp; in order to have the default zoom and dragtools available. It aslo set the canvas to have the Yaxis pointing up. It shows you how to set up scroll bars and drawing size mapping. The canvas intercepts some events to automatically zoomout at startup and when resizing the canvas window, the drawing fits the new size. The document contains the special wxCanvasXYDisplayGroup to contain some curve objects and markers on those curves. A single window application, showing how to fill a derived a2dCanvas its document with objects. The derived canvas class creates a stack based toolcontroller&nbsp; in order to have the default zoom and dragtools available. It aslo set the canvas to have the Yaxis pointing up. It shows you how to set up scroll bars and drawing size mapping. The canvas intercepts some events to automatically zoomout at startup and when resizing the canvas window, the drawing fits the new size. The document contains the special a2dCanvasXYDisplayGroup to contain some curve objects and markers on those curves.
Line 90: Line 44:
This sample sets up a wxCanvas window with mapping and scrolling. And set a toolcontroller for zooming and dragging. Its fill the document with drawing objects in order to have the canvas display the sin(x)/x function plus a ticed y and x axis with text at each tic. You can zoom and in and out using the popup menu. And you can drag parts of the drawing around. This sample uses plaind basic drawing primitives to fill a document, and to show this to the user in a flexible zoomable manner. It does not create advanged objects from basic objects to achieve this, and also does not use advanged curve object to achieve the same more easily. For use of advanged objects look at tuto4. This sample sets up a a2dCanvas window with mapping and scrolling. And set a toolcontroller for zooming and dragging. Its fill the document with drawing objects in order to have the canvas display the sin(x)/x function plus a ticed y and x axis with text at each tic. You can zoom and in and out using the popup menu. And you can drag parts of the drawing around. This sample uses plaind basic drawing primitives to fill a document, and to show this to the user in a flexible zoomable manner. It does not create advanged objects from basic objects to achieve this, and also does not use advanged curve object to achieve the same more easily. For use of advanged objects look at tuto4.
Line 98: Line 52:
 This samples explains how to setup a canvas with your own created document, canvas and view object. In simple cases one makes the wxCanvas create and own its wxDrawer view and its wxCanvasDocument. Here this is not the case, creation and deletion of documents is under control of the global wxDocviewCommandProcessor to be reached via wxDocviewGlobals->GetDocviewCommandProcessor(). This is the first step to using a single canvas for multiple documents which can be switched. It also demos how to setup a polygon tools, which can be started via a menu, and used to draw polygons. The standard stack based toolcontroller will hold this tools next to the default zoom and drag tool. This samples explains how to setup a canvas with your own created document, canvas and view object. In simple cases one makes the a2dCanvas create and own its a2dCanvasView view and its a2dCanvasDocument. Here this is not the case, creation and deletion of documents is under control of the global a2dDocviewCommandProcessor to be reached via a2dDocviewGlobals->GetDocviewCommandProcessor(). This is the first step to using a single canvas for multiple documents which can be switched. It also demos how to setup a polygon tools, which can be started via a menu, and used to draw polygons. The standard stack based toolcontroller will hold this tools next to the default zoom and drag tool.
Line 101: Line 55:
 Shows three ways to setup a wxCanvas. One which creates a wxDrawer view and wxCanvasDocument internal. Second how to created an external wxDrawer and wxCanvasDocument. Third how to created a wxCanvasSim, which is based on wxScrolledWindow, and sets the mapping of a drawing to the canvas in a simpler manner, but less flexible too. Shows three ways to setup a a2dCanvas. One which creates a a2dDrawer view and a2dCanvasDocument internal. Second how to created an external a2dCanvasView and a2dCanvasDocument. Third how to created a a2dCanvasSim, which is based on wxScrolledWindow, and sets the mapping of a drawing to the canvas in a simpler manner, but less flexible too.
Line 104: Line 58:
 An mdi based drawing application, which allows you to read and save CVG files. Two drawing tools are created to fill documents. The editor tools is used to edit the objects. It shows you how to push and pop those tools from the toolcontroller. It shows how to open the standard style and tool dialog from the editor module. The style dialog is used to change style of drawing objects. A derived &nbsp;wxCanvasDocument is used to show how to give it a default drawing, and how to intercept events when view is created or removed. A derived wxViewConnector, explains how to write connectors to connect new views on documents into the application, and to control its settings based on the document contents. An mdi based drawing application, which allows you to read and save CVG files. Two drawing tools are created to fill documents. The editor tools is used to edit the objects. It shows you how to push and pop those tools from the toolcontroller. It shows how to open the standard style and tool dialog from the editor module. The style dialog is used to change style of drawing objects. A derived a2dCanvasDocument is used to show how to give it a default drawing, and how to intercept events when view is created or removed. A derived a2dViewConnector, explains how to write connectors to connect new views on documents into the application, and to control its settings based on the document contents.
Line 109: Line 63:
=== canvas module samples === == canvas module samples ==
Line 111: Line 65:
==== simple ==== === simple ===
Line 117: Line 71:
==== split ====
Two smilies walking across vertical lines using a timer, and three wxCanvasWidgetButton's in a wxCanvasWidgetButtonGroup.<br>
=== split ===
Two smilies walking across vertical lines using a timer, and three a2dCanvasWidgetButton's in a a2dCanvasWidgetButtonGroup.<br>
Line 122: Line 76:
==== canmdi ==== === canmdi ===
Line 128: Line 82:
==== cansim ====
 Sample to demo use of the wxCanvasSim class, this is directly based on the wxScrolledWindow, and that class takes care of scrolling. Making of the wxDrawer view is mapped to the canvas in any way wanted. But that mapping stays constant when scrolling in the window. So one actually maps a drawing to the whole scrollable area. In the wxCanavs class, the scrolling does modify the mapping of wxDrawer, and redrawing drawing is optimized when scrolling.
=== cansim ===
Sample to demo use of the a2dCanvasSim class, this is directly based on the wxScrolledWindow, and that class takes care of scrolling. Making of the wxDrawer view is mapped to the canvas in any way wanted. But that mapping stays constant when scrolling in the window. So one actually maps a drawing to the whole scrollable area. In the wxCanavs class, the scrolling does modify the mapping of wxDrawer, and redrawing drawing is optimized when scrolling.
Line 131: Line 85:
==== boolop ====
Sample to demo the use of the boolean operation module kbool, and how to use the wxBooleanWalkerHandler and wxDocviewWalkerIOHandler to perform boolean operation on a wxCanvasDocument its wxCanavsObjects. wxDocviewWalkerIOHandler is a base class for interating through a wxCanvasDocument, it allows you te write algorithms for wxCanvasDocument, without the need to extend the library itself.
=== boolop ===
Sample to demo the use of the boolean operation module kbool, and how to use the a2dBooleanWalkerHandler and a2dDocviewWalkerIOHandler to perform boolean operation on a a2dCanvasDocument its a2dCanvasObjects. a2dDocviewWalkerIOHandler is a base class for interating through a a2dCanvasDocument, it allows you te write algorithms for a2dCanvasDocument, without the need to extend the library itself.
Line 137: Line 91:
=== curves module samples === == curves module samples ==
Line 139: Line 93:
==== curtuto1 ==== === curtuto1 ===
Line 141: Line 95:
Display different curves types in curve groups. Marker objects and marker show objects are used to display values at certain points on the curves. Deep edit can be used to edit the curves one by one, and one can zoom into a curve group. The Curve markers can be dragged along the curves.<br> The titles of the curve plot can be edited. The showmarker objects can be edited to move markers. Several tools can be pushed on the tools stack in order to draw on the curves/canvas and to add text. In that sence this sample is just a graphics editor that also displays some curve objects. The whole drawing can be saved and loaded back in CVG format. Display different curves types in curve groups. Marker objects and marker show objects are used to display values at certain points on the curves. Deep edit can be used to edit the curves one by one, and one can zoom into a curve group. The Curve markers can be dragged along the curves. The titles of the curve plot can be edited. The showmarker objects can be edited to move markers. Several tools can be pushed on the tools stack in order to draw on the curves/canvas and to add text. In that sence this sample is just a graphics editor that also displays some curve objects. The whole drawing can be saved and loaded back in CVG format.
Line 146: Line 100:
=== aggdrawer module samples ===
== aggdrawer module samples ==
Line 148: Line 103:
==== tutoagg ====
 The antigrain library used to render a wxCanvasDocument and edit it. wxCanvas displays a view on a wxCanvasDocument, called wxDrawer. The last one has a wxDrawer2D internal which it uses for rendering. wxDarwer2D is abstract, and wxAggDrawer is an implemtation which is used here to render in anti aliased mode.
=== tutoagg ===
The antigrain library used to render a a2dCanvasDocument and edit it. wxCanvas displays a view on a a2dCanvasDocument, called wxDrawer. The last one has a a2dDrawer2D internal which it uses for rendering. a2dDrawer2D is abstract, and a2dAggDrawer is an implemtation which is used here to render in anti aliased mode.
Line 152: Line 107:
Line 153: Line 109:
=== docview module samples === == docview module samples ==
Line 155: Line 111:
This samples do only use the docview module, and although they do draw something, the canvas and editor module are not involved. The examples multiframe, singleframe, splitwin, multiwin use one and the same editor class and 3 view classes. The singleframe is actually a combination of single switch views in one frame, and view generating new frames and window. Splitwin has a single frame with a splitter window which can have attached views.<br> MultiWin is an experiment, it has moveable window in a frame ( sort of MDI like thing ). The Nonmanaged example show how the docview classes can be used without a docmanager. This samples do only use the docview module, and although they do draw something, the canvas and editor module are not involved. The examples multiframe, singleframe, splitwin, multiwin use one and the same editor class and 3 view classes. The singleframe is actually a combination of single switch views in one frame, and view generating new frames and window. Splitwin has a single frame with a splitter window which can have attached views. MultiWin is an experiment, it has moveable window in a frame ( sort of MDI like thing ). The Nonmanaged example show how the docview classes can be used without a docmanager.
Line 157: Line 113:
==== !MultiFrame ====
Multiframe demonstrates the use of wxViewConnector to generate frames with a view.
=== MultiFrame ===
Multiframe demonstrates the use of a2dViewConnector to generate frames with a view.
Line 162: Line 118:
==== !SingleFrame ==== === SingleFrame ===
Line 168: Line 124:
==== Splitwin ====
The use of a wxSplitterWindow to have seperate wxViewRef's in each wxWindow of the splitter.
=== Splitwin ===
The use of a wxSplitterWindow to have seperate a2dView's in each wxWindow of the splitter.
Line 173: Line 129:
==== TabFrame ====
 How to use a wxNoteBook as a container for wxView's plus its display Windows. One Tab contains the drawing and the other a statistics view of colors and objects used.
=== TabFrame ===
How to use a wxNoteBook as a container for a2dView's plus its display Windows. One Tab contains the drawing and the other a statistics view of colors and objects used.
Line 179: Line 135:
==== mdi ==== === mdi ===
Line 184: Line 140:
==== nonmanaged ==== === nonmanaged ===
Line 186: Line 142:
 Shows how to use a view and its display window in a standalone situation, without a central command controller ( which normally keeps track of open documents etc.) . It still can Do and Undo changes to the document of the view, since a document will have its own command stack. Shows how to use a view and its display window in a standalone situation, without a central command controller (which normally keeps track of open documents etc.). It still can Do and Undo changes to the document of the view, since a document will have its own command stack.
Line 188: Line 145:
= Application overview = = Application Overview =
Line 190: Line 147:
For the moment there is only one application called teto, which goal is a multi document drawing application. For the moment there is only one application called teto, its goal is a multi document drawing application.

Samples Overview

The samples on this page might give you an idea of the capabilities of wxArt2D. Their sources are in wxArt2D\samples. So you have a starting point on how to implement the features you need.

editor module samples

vdrawm

Is the most advanged example. It sets up a multi document drawing program. And has a menu of screens which demo all drawing features of the library. You can open files in SVG, CVG and GDSII format. You can draw and edit all kinds of primitives. Each new drawing gets its own drawing editor complete with undo redo. There are dialogs to set style for drawing primitives. For many features there is a menu to test it. You can create multiple views on a document via the main window its file open icons, and see how all view are updated when drawing things. The screen are all created by program code, so if you need to know how to fill a drawing document using program code, look at the specific screen its code.

vdrawm sample

vdraws

Instead of a multiple view and document drawing program, this sample shows how to make a single view but multiple document drawing program.

sample

wires

Mdi type application to explain how to work with graphs and pins. Graphs are a2dCanvasObject with a2dPin's as children which form the nodes of the graph, and other a2dCanvasObject like a2dCanvasWirePolylineL which connect the objects having pins. Pins can be of different class types, pins with pinclasses of compatible/connectable types can be connected to eachother or to specific wires types. This all makes it possible to have several independent graphs, or several flows within one graph. In the sample one can draw a schematic diagram using a simple build in library of resistor, capacitor and ground symbols. Next to that non schematic objects can be connected with a separate class of pins. Pins are e.g. automatically generated on rectangles. The routing used is based on a Lee algorithm, and result in manhattan like wires with minimal cost in terms of corners and length. There is even a simple netlist generator for a spice simulator.

sample sample sample sample

viewmul

The basis for a multiple view and document drawing program is shown. You can create drawings with rectangles in a specific style using the draw rectangle tool. After drawing you can edit and drag the rectangles around. You can save and open the drawings you create. The document used is not a default a2dCanvasDocument, but a derived one with its own saving and loading methods. The same for the views new view connector are created, which  are used to create application specific views for the documents.

tuto4

A single window application, showing how to fill a derived a2dCanvas its document with objects. The derived canvas class creates a stack based toolcontroller  in order to have the default zoom and dragtools available. It aslo set the canvas to have the Yaxis pointing up. It shows you how to set up scroll bars and drawing size mapping. The canvas intercepts some events to automatically zoomout at startup and when resizing the canvas window, the drawing fits the new size. The document contains the special a2dCanvasXYDisplayGroup to contain some curve objects and markers on those curves.

sample

tuto3

This sample sets up a a2dCanvas window with mapping and scrolling. And set a toolcontroller for zooming and dragging. Its fill the document with drawing objects in order to have the canvas display the sin(x)/x function plus a ticed y and x axis with text at each tic. You can zoom and in and out using the popup menu. And you can drag parts of the drawing around. This sample uses plaind basic drawing primitives to fill a document, and to show this to the user in a flexible zoomable manner. It does not create advanged objects from basic objects to achieve this, and also does not use advanged curve object to achieve the same more easily. For use of advanged objects look at tuto4.

vdraws sample

tuto

This sample sets up a wxCanvas window with mapping and scrolling. And set a toolcontroller for zooming and dragging. It also creates a derived circle object, with special style and added text property and its property display object. It intercepts wxCanvasObject events to display some properties, when the mouse hits the object.

single2

This samples explains how to setup a canvas with your own created document, canvas and view object. In simple cases one makes the a2dCanvas create and own its a2dCanvasView view and its a2dCanvasDocument. Here this is not the case, creation and deletion of documents is under control of the global a2dDocviewCommandProcessor to be reached via a2dDocviewGlobals->GetDocviewCommandProcessor(). This is the first step to using a single canvas for multiple documents which can be switched. It also demos how to setup a polygon tools, which can be started via a menu, and used to draw polygons. The standard stack based toolcontroller will hold this tools next to the default zoom and drag tool.

single

Shows three ways to setup a a2dCanvas. One which creates a a2dDrawer view and a2dCanvasDocument internal. Second how to created an external a2dCanvasView and a2dCanvasDocument. Third how to created a a2dCanvasSim, which is based on wxScrolledWindow, and sets the mapping of a drawing to the canvas in a simpler manner, but less flexible too.

editmdi

An mdi based drawing application, which allows you to read and save CVG files. Two drawing tools are created to fill documents. The editor tools is used to edit the objects. It shows you how to push and pop those tools from the toolcontroller. It shows how to open the standard style and tool dialog from the editor module. The style dialog is used to change style of drawing objects. A derived a2dCanvasDocument is used to show how to give it a default drawing, and how to intercept events when view is created or removed. A derived a2dViewConnector, explains how to write connectors to connect new views on documents into the application, and to control its settings based on the document contents.

vdraws sample

canvas module samples

simple

Two smilies walking across vertical lines using a times and a wxWidgets button on top.

sample

split

Two smilies walking across vertical lines using a timer, and three a2dCanvasWidgetButton's in a a2dCanvasWidgetButtonGroup.<br>

vdraws sample

canmdi

Mdi application using docview module. Like editmdi sample, but not using tools from the editor module.

cansim

Sample to demo use of the a2dCanvasSim class, this is directly based on the wxScrolledWindow, and that class takes care of scrolling. Making of the wxDrawer view is mapped to the canvas in any way wanted. But that mapping stays constant when scrolling in the window. So one actually maps a drawing to the whole scrollable area. In the wxCanavs class, the scrolling does modify the mapping of wxDrawer, and redrawing drawing is optimized when scrolling.

boolop

Sample to demo the use of the boolean operation module kbool, and how to use the a2dBooleanWalkerHandler and a2dDocviewWalkerIOHandler to perform boolean operation on a a2dCanvasDocument its a2dCanvasObjects. a2dDocviewWalkerIOHandler is a base class for interating through a a2dCanvasDocument, it allows you te write algorithms for a2dCanvasDocument, without the need to extend the library itself.

sample

curves module samples

curtuto1

Display different curves types in curve groups. Marker objects and marker show objects are used to display values at certain points on the curves. Deep edit can be used to edit the curves one by one, and one can zoom into a curve group. The Curve markers can be dragged along the curves. The titles of the curve plot can be edited. The showmarker objects can be edited to move markers. Several tools can be pushed on the tools stack in order to draw on the curves/canvas and to add text. In that sence this sample is just a graphics editor that also displays some curve objects. The whole drawing can be saved and loaded back in CVG format.

sample sample

aggdrawer module samples

tutoagg

The antigrain library used to render a a2dCanvasDocument and edit it. wxCanvas displays a view on a a2dCanvasDocument, called wxDrawer. The last one has a a2dDrawer2D internal which it uses for rendering. a2dDrawer2D is abstract, and a2dAggDrawer is an implemtation which is used here to render in anti aliased mode.

sample

docview module samples

This samples do only use the docview module, and although they do draw something, the canvas and editor module are not involved. The examples multiframe, singleframe, splitwin, multiwin use one and the same editor class and 3 view classes. The singleframe is actually a combination of single switch views in one frame, and view generating new frames and window. Splitwin has a single frame with a splitter window which can have attached views. MultiWin is an experiment, it has moveable window in a frame ( sort of MDI like thing ). The Nonmanaged example show how the docview classes can be used without a docmanager.

MultiFrame

Multiframe demonstrates the use of a2dViewConnector to generate frames with a view.

sample

SingleFrame

A single frame, meaning documents are opened in a single frame window, but still other frames can be generated. In principle there is no need for a single frame specific setting. It is just a matter of allowing the user to generate extra frames or not.

sample

Splitwin

The use of a wxSplitterWindow to have seperate a2dView's in each wxWindow of the splitter.

sample

TabFrame

How to use a wxNoteBook as a container for a2dView's plus its display Windows. One Tab contains the drawing and the other a statistics view of colors and objects used.

sample sample

mdi

mdi application showing two open documents with several views.

sample

nonmanaged

Shows how to use a view and its display window in a standalone situation, without a central command controller (which normally keeps track of open documents etc.). It still can Do and Undo changes to the document of the view, since a document will have its own command stack.

Application Overview

For the moment there is only one application called teto, its goal is a multi document drawing application.

wxArt2D: WxArt2dSamples (last edited 2009-07-03 09:20:36 by KlaasHolwerda)