fx-advanced (original) 18 sep 96 1 interactive graphics capability (igc) overview igc_process (main)...

30
FX-Advanced (original) 18 Sep 96 1 Interactive Graphics Capability (IGC) Overview IGC_Process (main) Event Dispatcher • IGC_Impl • DisplayMgr • DisplayPanel Looping Mgr • ViewMgr • FrameSeq • Frame • DepictTuple • DepictSeq Main Objects and their Interaction

Upload: blaze-blankenship

Post on 14-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

FX-Advanced (original) 18 Sep 961

Interactive Graphics Capability (IGC) Overview

• IGC_Process (main)• Event Dispatcher• IGC_Impl• DisplayMgr• DisplayPanel• Looping Mgr• ViewMgr• FrameSeq• Frame• DepictTuple• DepictSeq

Main Objects and their Interaction

FX-Advanced (original) 18 Sep 962

Walkthrough of Basic IGC Operations

• Load of a Product– To an empty display– To a non-empty display– Combo Image– MultiLoad

• Product Update (Auto Update)• Display

– Current Frame– Background Frame– Image Rendering– Graphic Rendering

• Zooming• Overlay Toggling• Sampling• Swapping• Looping

FX-Advanced (original) 18 Sep 963

Topics Not Covered

• Roaming• PopUp Menus• Interactive Drawing• Restoring and Saving Display State• Usage Logging

FX-Advanced (original) 18 Sep 964

IGC Process

• Can run either as child or stand-alone process• Argument parsing

– type– image window ID– X connection info

• Object Creation– EventDispatcher– IGC_Impl

• Event Dispatch Loop• Object Destruction

FX-Advanced (original) 18 Sep 965

EventDispatcher

• Listens for different kinds of events by polling, and dispatches these kinds of events to multiple clients.– Polling is inefficient! Preferable to use UNIX select system call, but

DMQ doesn’t support file descriptors.• IPC messages

– UI process FXA listens to keypad– Notification Server– Extension process

• OI/X events– PopUp Menus– Color Chooser Dialog

• DisplayArea X events– Button clicks, cursor movement, exposure, and key presses inside a

panel window. Dispatched to displayPanel objects.• Timer events

– Granularity is in milliseconds– Used for looping, and distinguishing a button click from a button drag

• Idle events– Useful in preparing non-current frames for display

FX-Advanced (original) 18 Sep 966

IGC_Impl

• Singleton• Public interface same as the IGC object in UI process• Creates main singleton objects• Receives IPC requests from the UI process and

passes them on to FrameSeq, DisplayMgr, etc.

FX-Advanced (original) 18 Sep 967

LoopingMgr

• Singleton (one object per processor)

• Capable of receiving timer events from the event dispatcher

• Manages the looping parameters– Looping on/off– Speed– Direction– Dwell (first frame or last frame)

• Tells the frame sequence which frame to display

FX-Advanced (original) 18 Sep 968

DisplayMgr

• Runs in either single or four panel mode. Switches modes by creating or destroying displayPanel objects.

• Manages cursor resources– Pie Cursor– Busy Cursor– Interactive drawing cursors

• Manages font resources for legends and sampling.– Font size dependent on magnification and panel size

• Maintains the image display parameters (fade/dim).• Allocates the colors used for graphics/legends.

– Color set initialized from Config file– Keeps track of which colors have been used thus far– All 8 bit display panel objects use the same X colormap

for their graphics window– Color set can be changed dynamically

FX-Advanced (original) 18 Sep 969

DisplayPanel

• Either one or four exist depending on the panel layout.• Capable or receiving timer and display area events

from the event dispatcher.• Maintains sets of pixmaps (each set contains a

pixmap for every active frame), so that graphics and images can be displayed quickly for fast looping speeds (up to 20 frames/second).

• Provides a mechanism for selecting a legend by clicking on it.

• Responsible for displaying depictable output, sample text, and legends.

FX-Advanced (original) 18 Sep 9610

8 Bit Mode• Uses two X windows displayed on same screen space

– Window displaying graphics and legends, using a transparent background, and a private colormap that all 8 bit display panels share. Uses the overlay planes of the H-CRX24 hardware.

– Window displaying images using a private colormap. All 256 colors of the colormap are used. Uses the underlay (image) planes of the H-CRX24 hardware.

• Two-window architecture advantages– Image and graphic colors don’t have to be shared. Big advantage

for 8 bit image combo. Lesson learned from earlier prototypes.– Graphics can be drawn independently of the image.

• Two-window disadvantages– Depends on the graphics hardware to provide transparency and

overlay planes.– In order to achieve fast looping, two sets of pixmaps must be

allocated (each set contains a pixmap for each frame). Substantial pixmap allocation can cause memory resource problems for the X server.

DisplayPanel - Can Run in Either 8 Bit or 24 Bit Mode

FX-Advanced (original) 18 Sep 9611

24 Bit Mode• Uses one X window using 24 bit true color.• Images (even combos) and graphics can be

displayed without any color conflict.• Image combo looks more realistic, but much

slower to fade and dim.• 24 bit pixmaps require four times more X

server memory than 8 bit pixmaps.

DisplayPanel - Can Run in Either 8 Bit or 24 Bit Mode

FX-Advanced (original) 18 Sep 9612

ViewMgr

• Singleton• Manages the scale/map projection that all displayed

products use.• Manages the current view.

– Zoom factor– Display center– Magnification– Default relative picture density

• Manages the coordinate conversation between screen coordinates and lat/lon. (in addition to coord XFM by depictable)

FX-Advanced (original) 18 Sep 9613

FrameSeq

• Singleton• Responsible for loading, unloading, and initiating the

display and printing of products.• Capable of receiving idle events from the event

dispatcher.• Object that organizes depictable objects with matching

times into frames by managing frame, depictSeq, and depictTuple objects.

• Responsible for keeping the extension processes up to date with what is being displayed.

• Capable of storing and retrieving its state from a file.• Provides a mechanism for changing the number of

displayed frames and the frame that is currently displayed (current frame).

FX-Advanced (original) 18 Sep 9614

Frame

• The number of frame objects is equal to the Frame Sequence actual frame count, which varies during the life of the IGC process.

• Stores pointers to depict tuple/depictable objects that all have matching times in common.

• Provides a mechanism for adding and removing tuples from the frame. The order of the tuple list is important since it is also the order that depictables will be displayed and printed. Thus, map background tuples/depictables are first on the list, so all other graphics will be drawn on top.

• No limit on the number of tuples/depictables that a frame can contain.

• A frame can contain multiple image tuples/depictables as long as the tuples are being displayed in different display panels.

FX-Advanced (original) 18 Sep 9615

DepictTuple

• Wrapper around an X drawable and a depictable object (or several depictables in the case of image combinations).

• Every loaded product will have a number of depict tuple objects created for its display which coincides with the number of unique times returned from the time matching algorithms.

• Graphics and images have a number of characteristics in common, and a few different ones, so a simple class hierarchy is used.

• Every object has a TextString object containing the legend which is the product name plus the data time of the depictable.

• Every object has data describing the IGC view of the last time this object’s depictable was rendered.

FX-Advanced (original) 18 Sep 9616

GraphicDepictTuple

• Derived from DepictTuple.• Manages a graphic depictable object, and a pixmap

of depth one (bitmap). The pixmap’s size matches the size of the panel windows.

• Also contains a pointer to a GraphicDepictSeq object.

FX-Advanced (original) 18 Sep 9617

ImageDepictTuple

• Derived from DepictTuple.• Manages an image depictable object if it is a single

image, or two image depictables if it is a 24 bit combination, or three image depictables if it is an 8 bit combination.

• Manages a pixmap of depth 8 or 24, depending on the type of display panel(s) it will be displayed into. The pixmap’s size matches the size of the panel windows.

• Also contains a pointer to an ImageDepictSeq object.

FX-Advanced (original) 18 Sep 9618

DepictSeq

• The number of depict seq objects is equal to the total number of overlays that an IGC is displaying.

• Manager of all the attributes that all the depictables of a product have in common.

• Some of the attributes apply specifically to graphics or images so a class hierarchy is used. ImageDepictSeq and GraphicDepictSeq will be derived from DepictSeq.

• Some of the attributes that both images and graphics have:– Load Attributes (time matching mode, forecast time, inventory time)– Relative picture density– Whether the overlay is displayed or toggled off (visibility)– A set of display panel identifiers that depictables of this sequence

will be drawn into– Information about the product obtained from dataMgmt’s depictable

information file (depictInfo.txt)• Attributes only GraphicDepictSeq objects have:

– Overlay color (index into a colormap)• Attributes only ImageDepictSeq objects have:

– ColorTable object(s) – two for combination images

FX-Advanced (original) 18 Sep 9619

Tuple Table

Map Tuple4

IR-Vis Vis

IR23:451

IR-Vis

IR23:301

IR-Vis

IR23:15

Vis1

IR-Vis

IR23:00

Vis1

METAR0z

METAR2

METAR0z

METAR2

Index Object Index Object

Static – Map Seq

23:45 – IR-Vis Seq

23:30 – IR-Vis Seq23:30

23:15 – IR-Vis Seq

23:00 – IR-Vis Seq

0Z – METAR Seq

23Z – METAR Seq

FX-Advanced (original) 18 Sep 9620

Frame List

MapTuple MapTuple MapTuple MapTuple

IR-Vis 23z IR-Vis 23:15 IR-Vis 23:30 IR-Vis 23:45

METAR 23z METAR 23z METAR 0z METAR 0z

Frame 023:00

Frame 123:15

Frame 223:30

Frame 323:45

FX-Advanced (original) 18 Sep 9621

Load Order List

METAR Seq

IR-Vis Seq

Map Seq

FX-Advanced (original) 18 Sep 9622

Display Contents

Empty Display

IR Before 22:30 22:45 23:00 23:15 23:30 23:45After 23:00 23:15 23:30 23:45

METAR Before 21 22 23 0ZAfter 23 23 0Z 0Z

Vis Before 22:45 23:00 23:15 23:45After 23:00 23:15 23:45 00:00

0

1

2

3

FX-Advanced (original) 18 Sep 9623

1. User selects product from UI. IPC message is sent containing depict key, load mode, inventory time, forecast time, combine flag. IGC_Impl object receives message, calls FrameSeq::load.

2. Check for implicit clear. Product may require a different map projection than the one being used.

3. If combine flag is not set, and the new product is an image, unload any images that are being displayed in the same panel that the new image will be displayed into.

4. Obtain an inventory from dataMgmt.

Initial Situation: No time-varying products loaded, but static products (maps/topo image, etc...) may be displayed.

Load of a Product to an Empty Display

FX-Advanced (original) 18 Sep 9624

Load of a Product to an Empty Display

5. Call the routine that time-matches primary sequences, passing the preferred frame count.

6. Assign each time on the time match list to a frame, creating new frames if necessary.

7. Copy the pointers to the static tuples in the first frame, to the rest of the frames, and increase the use count of these static tuples.

8. Create a new depictSeq object, and add to the beginning of the load list.

9. For each time in the time match list, check to see if there is a DepictTuple object with the same time and sequence. If not, create one and add it to the tuple table. Then add a pointer to that tuple to the corresponding frame, and increase the tuple’s use count.

10. Redraw the display.

Cont.

FX-Advanced (original) 18 Sep 9625

1. User selects product from UI. IPC message is sent containing depict key, load mode, inventory time, forecast time, combine flag. IGC_Impl object receives message, calls FrameSeq::load.

2. Check for implicit clear. Product may require a different map projection than the one being used.

3. If combine flag is not set, and the new product is an image, unload any images that are being displayed in the same panel that the new image will be displayed into.

4. Obtain an inventory from dataMgmt.

Initial Situation: One or more time-varying products have already been loaded.

Load of a Product to a Non-Empty Display

FX-Advanced (original) 18 Sep 9626

Load of a Product to a Non-Empty Display

5. Call the routine that time-matches overlay sequences, passing the nominal frame times.

6. Try to find a DepictSeq object with the same load attributes. If not, create one, and add to the load list, before all the static products but after all the existing time-varying products.

7. For each time in the time match list, check to see if there is a DepictTuple object with the same time and sequence. If not, create one and add it to the tuple table. Then add that tuple’s pointer to the corresponding frame, and increase the tuple’s use count.

8. Redraw the display.

Cont.

FX-Advanced (original) 18 Sep 9627

Image Combo Load

• Same steps as the single image, except that an existing image is not unloaded. Rather, its depictTuple and depictSeq objects are expanded to include the new image as the second image.

FX-Advanced (original) 18 Sep 9628

MultiLoad

• Way of loading multiple products with one load command. Useful for families and four panel configurations.

• A single load command arrives from the UI, and the IGC uses that key to look up the following info in a dataMgmt table:– Which products should be loaded.– Into which panels the products should go.– Should the products be initially displayed or toggled off?

• The IGC then loads each product, but defers the display and rendering until all the products are processed.

FX-Advanced (original) 18 Sep 9629

Product Update (Auto-Update)

• When a DepictSeq object for a time-varying product is created, it sends a message to the NotificationServer process asking for updates. When this object is destructed, it un-registers with the server.

• When a new time for a loaded product arrives, the NotificationServer sends a message to the IGC_process containing the depict key and a new time.

• The frame sequence removes all the tuple objects from the frames, but does not delete the tuples from the tuple table, or the depictSeqs from the load order list.

• For every product in the list, obtain a new inventory, redo the time matching, and place tuples back in the frame object according to the time matching. Some new tuples may need to be created, and some tuples will not be re-added to the frames.

• Delete all unused tuples and depictSeq objects.

FX-Advanced (original) 18 Sep 9630

End Notes

This document was created September 1996, probably by Sean Kelly. The material was used for a presentation to the Taiwan CWB, and is included in a spiral-bound document titled “WFO-Advanced Seminar.” The blue text on slides 5, 7, and 12 is from handwritten notes by Herb Grote, possibly added during the presentation at CWB. Slides 19-22 are from a hand-drawn page, also by Herb Grote. The document was recreated December 2005 by John Osborn from a hard copy. The most recent edits are by Joe Wakefield, March 2006.