From WxWiki
Jump to navigation Jump to search

wxArt2d is a library for 2D graphical programming. Graphical primitives are stored in a document. The primitives are read from a file or setup with source code. The drawing document can be made hierarchical by adding child primitives to a parent primitive. A unique part or level in the hierarchy can be referenced and drawn at different locations.

Website: http://wxart2d.sf.net

Views are used to display the contents of a document on a device. A document traverses itself, starting at a chosen level of hierarchy and with a given viewport. Everything that it encounters within the viewport will be displayed on the view of its device. This can be a window, a bitmap or even a file. A view is used to display certain parts of a document, but at the same time functions as the drawing context for the document. Everything that is drawn from within a document, is done by calling drawing methods via a a2dCanvasView through it's device context a2dDrawer2D. A document can have several views open at the same time. And each view displays a particular part of the document.

Some Features

  • The basis of wxArt2D is an advanced multi document/view framework. But in simple use you don't notice this.
  • Highly optimized rendering strategy for drawing and redrawing a hierarchy of 2d objects.
  • Updating the views to changes in the document takes place in idle time, with minimum effort from the user.
  • Coordinates are in world coordnates (doubles or integer), and objects are placed relative to parent object(s) with a matrix.
  • The visible part of a drawing and its size as shown on a window or bitmap can be set independently of the data within the document itself.
  • The document containing the hierarchy of 2d objects, can be displayed in several views.
  • Tool Classes to edit the displayed objects in a view.
  • Data can be read or written to a file in SVG or CVG. New graphical file formats are easily added.
  • wxCanvasObject being the base class for all primitives in a document, can intercept/receive events in the same manner as wxWidgets handles events.

wxArt2d vs wxCanvas

  • wxArt2D is a debugged and a much extended version of wxCanvas.
  • wxCanvas is not maintained anymore.
  • wxArt2D has so much more to offer.
  • wxArt2D will not be in wxWidgets CVS.