ADVANCED TOPICS
The items are stored in a hierarchy based upon the bounding box of each item. In effect, it is a kind of spatial indexing. This hierarchy is used to quickly locate the item(s) when the Pad++ widget is rendered, or when an item must be found to match an event, based on its position on the Pad++ surface. The hierarchy is defined by the invariant that every item whose bounding box is completely enclosed by another item's bounding box becomes that item's child. Pad++ automatically performs cluster analysis and adds invisible wrapper nodes around groups of items in order to keep down the fan-out of this hierarchy. These wrappers are managed automatically and are invisible in all respects to the application developer.
Pad++ renders the scene at different resolutions depending on how much time is available. For example, while panning or zooming and during other forms of interaction, Pad++ attempts to render the scene as quickly as possible. It does this by not drawing items that are very small, and by drawing larger items at lower resolution. The system refines the scene to it highest resolution, in steps, after a short pause, once the interaction is over.
These iterative refinements each have numbers. Refinement level 0 (sometimes referred to as render level 0) is the lowest-resolution, and thus the fastest. Each ensuing refinement is labeled with the next larger integer. The starting refinement level (which is usually 0) can be controlled with the -defaultRenderLevel configuration option.
Some built-in items are drawn differently depending on how much time is available to draw them, and how big the item appears on the screen. The two main examples are images and text. Images are drawn undithered at low levels of refinement, and dithered at higher refinement levels. Note that it is possible to stop images from ever being dithered with the -norgb option on the allocimage command. Text is drawn as hashmarks, at small sizes, and as horizontal lines at extremely small sizes.
In addition, facilities are provided so that user-defined items can be drawn with different levels of detail. The render and zooming callbacks can be used in combination with the getsize, getmag, and getlevel commands to modify the way the item is drawn depending on the refinement level and size of the item.
See the above section on Region Management and Screen Updating.
Pad++ adjusts the frame rate during animations and zooming to maintain constant perceptual flow. This flow is independent of processor speed, scene complexity, or window size. For example, if a particular animation is specified to take 750 milliseconds, just enough animation frames are rendered so that the animation takes 750 milliseconds.
Whenever the system is doing a slow task, such as refining or animating, any event (such as a key-press or mouse-click), will interrupt the task and give control back to the user. For example, pressing the space-bar during an animation will bring you to the end of the animation. Panning during a refinement will stop the refinement and perform high-speed panning. Interruption can be turned off with the -interruptible configuration option.
Generated with Harlequin WebMaker