X11PCDisplayListObject.h
Classes
- X11PCDisplayListObject -- Base class for caching of X11 device (ie. X11PixelCanvas) display lists. (full description)
Interface
- Public Members
- virtual ~X11PCDisplayListObject()
- virtual void translate(Int xt, Int yt) = 0
- virtual void draw(::XDisplay *display, Drawable d, GC gc, Int xt, Int yt) = 0
- virtual Char optType() const = 0
- Protected Members
- X11PCDisplayListObject()
- X11PCDisplayListObject(const X11PCDisplayListObject &other)
- X11PCDisplayListObject &operator=(const X11PCDisplayListObject &other)
Review Status
- Reviewed By:
- Bob Garwood
- Date Reviewed:
- 2000/02/01
Prerequisite
Etymology
"X11PCDisplayListObject" is a contraction and concatenation of
"X11PixelCanvas", "Display List" and "Object".
Synopsis
This class forms the base interface for a set of classes which
provide storing (and optimisation) of drawing commands for the
X11PixelCanvas class.
Most primitive graphics routines available on the X11PixelCanvas,
for example drawImage and drawRectangle, have
corresponding objects derived from this class, which are
constructed by the primitive routines, and then called upon to draw
themselves when necessary.
Each instance of a class derived from X11PCDisplayListObject keeps
with it information necessary to draw to the X11 drawable or to
change the X11PixelCanvas's attributes. Furthermore, these objects
tend to store the information necessary to do the drawing in native
X11 format, or as close to that as is practicable, thus lending a
level of optimisation to the drawing process.
Some X11PCDisplayListObjects take over the memory the PixelCanvas
used to create the object when constructed and therefore undertake
to destroy the memory when the X11PCDisplayListObject is destroyed.
Examples of this include images and sets of points or lines.
Each derived class must implement the draw and translate functions
correctly.
Motivation
Is is extremely convenient to place all output graphics commands
(including context changes) in a display list for fast and
efficient handling. The user gets control over drawn objects
without knowing how the objects are drawn, or how they are cached.
Thrown Exceptions
To Do
Member Description
A virtual destructor is needed so that it will use the
actual destructor in the derived class.
virtual void translate(Int xt, Int yt) = 0
Translate the object by the specified displacements.
virtual void draw(::XDisplay *display, Drawable d, GC gc, Int xt, Int yt) = 0
Draw to the current context provided with the translation given.
virtual Char optType() const = 0
Return a special character code identifying the type of drawing,
and therefore enabling down-stream caching. Presently, the character codes are listed in
X11PCCaceOpt.cc, and are used in calls to
X11PixelCanvas::packDisplayList.
(Required) default constructor.
(Required) copy constructor.
X11PCDisplayListObject &operator=(const X11PCDisplayListObject &other)
(Required) copy assignment.