Drawing

TCanvasView has a DrawContents function that takes a drawing port as a parameter and sequentially calls functions to draw the background (DrawBackground), canvas graphics (DrawGraphics), and a temporary selection feedback graphic (DrawFeedback).

GrafEdit calls the DrawContents function whenever data in the representation has been changed so that the canvas view can be updated. See "Change notification" on page 123 for more information on change notification.

    TCanvasView::DrawContents( TGrafPort& port ) const;
You can override DrawContents and call these functions directly to enhance your own drawing algorithm, or you can override any of these functions and change its specific behavior with or without changing the overall drawing algorithm.

DrawBackground draws anything that appears behind everything else. By default, it draws the canvas with a background color fill bundle.

DrawGraphics draws the canvas graphics. By default it draws all invalid graphics (the canvas graphics that have been changed) from back to front. DrawGraphics calls TCanvasView::EnumerateGraphics with a filter and a funnel to accomplish this. See "Graphic enumeration" on page 119 for details on funnels, filters, and TCanvasView::EnumerateGraphics.

DrawFeedback draws a temporary feedback graphic that has been adopted into the canvas view by an interactor. For example, the temporary curve sketch during a curve drawing. See Chapter 7, "Commands, interactors, and cursor tools," for more information on feedback graphics.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker