Display Lists
 
Functions Introduced:
To generate the display of a solid in a window, maintains two display lists. A display list contains a set of vectors used to represent the shape of the solid in the view.
The 3-D display list contains a set of three-dimensional vectors that represent an approximation to the geometry of the edges of the solid. It gets rebuilt every time the solid is regenerated.
The 2-D display list contains the two-dimensional projections of the 3-D display list onto the current window. It is rebuilt from the 3-D display list when the orientation of the solid changes.
The functions in this section enable you to add your own vectors to the display lists, so your own graphics will be redisplayed automatically by , until the display lists are rebuilt.
For example, if you just use the functions described in the section Displaying Graphics, the items you draw remain on the screen only until the window is repainted. Furthermore, the objects are not plotted with the rest of the contents of the window because does not know about them.
If, however, you add the same graphics items to the 2-D display list, they will survive each repaint (when zooming and panning, for example) and will be included in plots created by .
If you add graphics to the 3-D display list, you get the further benefit that the graphics survive a change to the orientation of the solid and are displayed, even when you spin the solid dynamically.
To add graphics to a display list, you must write a function that displays the necessary vectors in three dimensions, using the graphics display functions in the usual way. For the 2-D display list, you call ProDisplist2dCreate() to tell to use your function to create the display list vectors, then call ProDisplist2dDisplay() to ask it to display the new graphics those vectors represent.
Note:
 
If you save the display information, you can reuse it in any session. The application should delete the display list data when it is no longer needed.
Using 3-D display lists is exactly analogous to using 2-D display lists.
Note that the function ProWindowRefresh() does not cause either of the display lists to be regenerated, but simply repaints the window using the 2-D display list.
The function ProSolidDisplay() regenerates both display lists, and therefore not only recenters the solid in the view and removes any highlights, but also removes any graphics you added using the 2-D display list functions.
這是否有幫助?