InterViews Reference Manual -- Damage
NAME
Damage - manage and repair damage to graphics
SYNOPSIS
#include <InterViews/Graphic/damage.h>
DESCRIPTION
Damage is a class that keeps track of and repairs portions of
a graphic that have been damaged, that is, that need to be redrawn. A
graphic is damaged when its (component's) appearance changes. Damage objects
try to minimize the amount of redraw needed to repair a graphic. They are most
useful when the graphic is complicated enough that it would be undesirable to
redraw the entire canvas when the graphic is modified. Damage objects do
not eliminate the need for an interactor's Redraw member
function, though they could be used to implement it.
PUBLIC OPERATIONS
Damage(Canvas* = nil, Painter* = nil, Graphic* = nil)
Create a new Damage object for a graphic on the given canvas. The painter is
used to erase damaged areas using its ClearRect function prior to redrawing
them.
void Incur(Graphic*)
void Incur(BoxObj&)
void Incur(Coord left, Coord bottom, Coord right, Coord
top)
Notify the damage object that a rectangular area has been damaged, either by
passing the graphic that contributed the area or the area itself.
void Repair()
Repair all damage incurred since the last Repair (or since the damage object
was created if this is the first Repair).
void Added(Graphic*)
Notify the damage object that the given graphic was appended (not
inserted) to the graphic but never drawn. The damage object can thus be
responsible for drawing newly added graphics as well.
void Reset()
Reset the damage object. Any damage incurred is lost.
bool Incurred()
Returns true if any damage has been incurred.
void SetCanvas(Canvas*)
void
SetPainter(Painter*)
void SetGraphic(Graphic*)
Canvas* GetCanvas()
Painter*
GetPainter()
Graphic* GetGraphic()
Set and get attributes of the damage object.
SEE ALSO
libgraphic
Next: Deck
| Prev: Cursor
| Up: index
| Top: index