next up previous contents
Next: Colour-Map Selection Up: Tina View Previous: Zoom Facilities   Contents

Adding Redraw Facilities

Suppose we draw a rectangle into a Tv

void tv_rect2(tv, vec2(0.0, 0.0) , vec2(2.0, 1.0))

If the tvtool on which the tv is installed is resized the display will be damaged and the rectangle lost.

This can be rectified by defining a function

void fulldraw(Tv *tv)
{
    tv_rect2(tv, vec2(0.0, 0.0) , vec2(2.0, 1.0));
}

and setting this to be the fulldraw function for the Tv with

tv_set_fulldraw(tv, fulldraw)

whenever the display is resized or damaged the function fulldraw will be called.

During an interactive zoom the display is repeatedly redrawn in overlay (xor) mode. It is often slow to redraw everything in the display, this makes the interactive zoom difficult to use. For this reason the user must define a second function to quickly draw a skeleton version of the display

void skeldraw(Tv *tv)
{
    ...
}

and set this to be the skeleton draw function for the Tv with

tv_set_skeldraw(tv, skeldraw)

Sometimes the display has an unchanging background but a foreground which must be repeatedly re-drawn. When the background is expensive to draw it may be worthwhile to define a background draw function

void backdraw(Tv *tv)
{
    ...
}

and set this to be the background draw function for the Tv with

tv_set_backdraw(tv, backdraw)

When the background changes, for example on a re-size, this function will be called to display the new background, this background is then re-displayed in future by a fast raster-op. The fulldraw function is then responsible only for drawing the foreground features.


next up previous contents
Next: Colour-Map Selection Up: Tina View Previous: Zoom Facilities   Contents
root 2017-09-21