[comp.sys.mac.programmer] Drawing part of a picture.

ph@cci632.UUCP (Pete Hoch) (07/21/88)

  I am trying to figure out how to draw only part of a picture.

 I am working on a plotting program that plots a two dimentional function
as a set of contours.  This is done by splitting up the screen into
quarters and recursivly attacking each quarter until the area only contains
straight lines.  To speed up redrawing the screen I a capturing all of the
MoveTo and LineTo commands in a picture.  However when I update the window
I must now replay the entire picture.

 What I would like to do is only draw the quarters that are nessesary.
For example if LEVEL 1 QUADRENT 1 does not intersect the ViewRgn on an
update then I don't need to draw any of the levels in Q1.  Or lets say that
part of Q2 overlaps the update area but only L2 Q3.  Well then I want to skip
redrawing Q1, Q2, and Q4 on that level and below.

 I know that I can put in picture comments that contain bounding information
for the quarters.  I can even group and subgroup the quadrents into the
L/Q terminology above.  What I can not figure out is how to selectivly ignore
sections of the picture from within DrawPicture without having to parse the
picture data myself and skip all the MoveTo and LineTo commands when I need
to.

Has anyone else done this?  Is there something simple I am missing?  All
help would be much appreceated.

Pete  Hoch