Differences between revisions 17 and 18
Revision 17 as of 2009-07-02 14:24:08
Size: 12617
Comment:
Revision 18 as of 2009-07-02 14:24:45
Size: 12619
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
At de very bottom is de [[GeneralModule|general module]]. Next is the [[XmlParseModule|xmlparse module]], used for XML io, and optional. The [[ArtBaseModule|artbase module]] is the base for drawing context classes, it depends only upon the GeneralModule. And [[AggDrawerModule]] and GdiPlusDrawerModule]] are derived from that. The [[ArtBaseModule|artbase module]] has all defention for style like stroke, fill and fonts. At de very bottom is de [[GeneralModule|general module]]. Next is the [[XmlParseModule|xmlparse module]], used for XML io, and optional. The [[ArtBaseModule|artbase module]] is the base for drawing context classes, it depends only upon the GeneralModule. And [[AggDrawerModule]] and [[GdiPlusDrawerModule]] are derived from that. The [[ArtBaseModule|artbase module]] has all defention for style like stroke, fill and fonts.

Modules Overview and Hierarchy

The wxArt2D code is implemented as a hierarchy of modules with higher level modules depending on the lower level ones. Each module compiles and links to a library. Whereas, some of the modules require third party libraries, the basic wxArt2D modules require only the wxWidgets library.

Module Hierarchy

wxArt2D is set up in modules. A module contains mainly files that form together a certain functionality. Modules do depend upon each other, 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.

At de very bottom is de general module. Next is the xmlparse module, used for XML io, and optional. The artbase module is the base for drawing context classes, it depends only upon the GeneralModule. And AggDrawerModule and GdiPlusDrawerModule are derived from that. The artbase module has all defention for style like stroke, fill and fonts. The DocviewModule is above the general module, defines the document view framework. The CanvasModule is on top of the DocviewModule and the artbase module. And is an extension to the document framework designed for containing drawing in documents. The CanExtObjModule is an extension on the CanvasModule, mainly for more advanced grahical objects and io. The GdsIOModule, KeyIOModule, SvgIOModule are all implementing a specific way to save and load documents as defined in the CanvasModule. The CurveModule defines very advanved canvas objects, to display sets of curves and plots, which can be edited. The EditorModule extends the CanvasModule to add editing functionality to canvas document. It defines tools to interactively edit canvas objects. On top of all this is the LuaWrapsModule, which implements scripting based on wxLua using wxArt2D its functionality.

Common Modules

This group contains all modules, but IO and drawer related ones.

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 (a2dCanvasOject), and the document can be displayed on windows, using specialized view called a2dCanvasView. a2dCanvasView uses 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 basic tool and toolcontroller plus a commandprocessor are also here.

The module depends on the following modules: general, xmlparse (optional), artbase, docview.

See CanvasModule for more.

CanExtObj Module

This module defines canvas objects which are more advanced, and not used for any application. The idea is not to make the canvas module to big, and instead add extra fancy a2dCanvasObject derived objects here. Currently there are several object to make references on a canvas towards other canvas documents a2dCanvasDocumentReference. Like an overview of document which are open. Also those can be used to make documents which contain libraries of complex objects, a2dLibraryReference Also interesting is a2dCanvasDocumentIOHandlerImageIn, which allows you to save what is in a document to image files. You can define the size of the image, and automatically the document will be rendered into the image and saved into the format you choose.

Curve Module

Special objects for drawing multiple curves or bars etc. on a plot object. It can have markers attached to curves, and show-marker objects to display and edit the position of the markers on the curve.

This module gets the maximum from the wxArt2D library. It uses dependencies between curve objects and its marker object, in order to keep them in sync while editing the curve or marker. It also uses sub-editing, therefore in a plot of curves, one can edit each curve and the markers on the curve. First one starts editing the plot itself, but the plot object pushes other tools when clicking on the objects contained within the plot. Events in a2dCanvasObjects are organized such, that events travel through a hierarchy of nested a2dCanvasObjects. This makes the sub-editing of object possible.

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.

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 their 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. See DocviewModule for more.

Editor Module

The editor module is for editing 2d graphical data. Here are the tools, editor frame and a command processor to extend the canvas command processor for editing purposes. a2dEditorFrame is the spill together with a lot of dialog classes which are called from it, but not directly. Instead all is going via the a2dCentralEditorCommandProcessor. That way wxArt2D can record actions to a script. Most dialogs are more are less standalone, and work on the context and contenets of the current active view. See EditorModule for more.

General Module

The module general is used by all modules. It contains classes etc. that can be used in all other modules. 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 are all wxRefObject derived classes. See GeneralModule for more.

XmlParse Module

This module contains the code for the Pullparser, it uses expat for parsing the xml for a file or string. 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. The CVG format uses this module for saving a wxCanvasDocument to a file and/or load it from a file. wxDocviewIOHandlerXmlSer is the class used for that, and it is a general class for serialising class data.

Drawer Modules

ArtBase Module

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

AggDrawer Module

Drawing context for a2dCanvasDoucment, based on the AntiGrain rendering Library, http://www.antigrain.com/. This library is still in development. But with the current version (which is included with wxArt2D), one can already do anti-aliased rendering and editing.

This module defines drawing context classes for anti aliased double buffer drawing. It only depends on the general and artbase modules. The module is an implementation of the wxDrawer2D class, and does not 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 uses the Antigrain to the drawing.

GdiPlusDrawer Module

Gdi+ (part of WinXP and newer) is used to do the actual drawing. 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.

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 translate 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.

CVG IO

This is not a real module, but a built in option. It allows you to save a a2dCanvasDocument into a file and read it back. The format is XML based, and save a hierarchical a2dCanvasDocument into a file. This format uses the wxWidgets dynamic class information, to store a class and its lower level children to a file, and later read them back. Based on the class name which is stored into the CVG format, the class can be reconstructed. The nice thing is that you can easily save your own canvas objects into the CVG format also. Two member functions to read and write the CVG format for a derived canvas object , is all that is needed. When another wxArt2D based program does not know the object you have written, it will skip it when reading it.

SVG IO Module

Basic Scalable Vector Graphics In and Output. Its understands all basic primitives in SVG and hierarchy, but the fancy stuff like animation etc. not. When reading SVG, it is translated/mapped into a2dCanvasDocument.

When writing as SVG, all object stored into the a2dCanvasDocument are mapped to most advanced SVG drawing possible. A a2dCanvasDocument is meant for many drawing application, and not just for viewing SVG. The idea is that a2dCanvasObject derived complex objects can also be saved and loaded. But in case of saving as SVG, this will result in a simple drawing, and the original object can never be reconstructed. For that we have the CVG format.

GDSIO Module

GdsII format In and Output. This is a Computer Aided Design format for the chip industry. It is layers based, and contains hierarchy in so called structures. Structures are like sub-drawings, which can be referenced at any position on a higher level. This a key feature in wxArt2D, it knows how to deal with multiple references to one drawing. Automatic updating, and bounding box calculation is all based on this principle. Many canvas classes can not do this.

KeyIO Module

KeyIO format In and Output. Which is an ascii readable representation of GDSII, plus extra objects like circles. Also the object can have properties added to them. See also GDSIO Module.

Scripting

LuaWraps Module

This module uses all other modules and wraps its functionality into wxLua bindings. That way you can write programs in wxLua that are using wxArt2D. But more often you will like to use the scripting to automate things in your own C++ application. This all becomes easy with this module, you can also easily extend the bindings with your own application functionality. A typical use is to startup your application by reading a configuration file written in lua. This gives the user of your application an enormous amount of flexibility. WxArt2D does even have opbject which can be placed in a canvas document, but which are drawn/created using a lua script. For more see LuaWraps.


CategoryModules

wxArt2D: WxArt2dModules (last edited 2016-05-12 13:59:07 by inetproxy-p)