VWLib 1.1 REFERENCE MANUAL INDEX


Modifications from version 1.0.

Download vwLib Version 1.3

Download vwLib Version 1.1 Example Programs

INTRODUCTION
vwLib is a C++ widget class library for virtual reality applications. It requires both OGL Performer and CAVElib. The event model used by vwLib is based on an Observer Pattern in conjuction with a Mediator Pattern as described in "Design Patterns: Elements of Reusable Object-Oriented Software" by Erich Gamma, et.al. The three primary abstract base classes are vwSubject, vwObserver and vwMediator. vwWidget (the abstract widget class) inherits publically from vwSubject. Since all widgets are subclasses of vwWidget, all widgets are in turn non-abstract vwSubjects (concrete subjects). Concrete subjects generate events. An event occures when a concrete subject calls the notify() method. All non-abstract subclasses of vwObserver (concrete observers) which have been attached, via attach(),  to the notifying subject will generate an update() call. In short, concrete subjects call notify(). notify() generates an update() in all concrete observers attached to that particular concrete subject. A subclass of vwMediator (concrete mediator), manages the subject - observer mappings and handles the event propogation. The concrete mediator's relationship to concrete subjects (widgets) and concrete observers is illustrated in the following interaction diagram.


Normally, an application would have only one concrete mediator managing all of the widgets. However, it is possible to have multiple concrete mediators handling different groups of widgets. Each widget can only be associated with a single concrete mediator. This is also the case with concrete observers. Both widgets and observers require the concrete mediator as an argument to their respective constructors.

notify() is not public. It is a protected method which is called from within the event routines of all but one of the generic widgets. The generic widgets (direct subclasses of vwWidget) are vwButton, vwSlider, vwIncrementor  and vwFrame. vwFrame does not have an event interface. The public method that generates an event in vwButtons is setPressed(). The public method that generates an event in vwSliders is drag(). And the public methods that generate events in vwIncrementor are increment() and decrement().

All widgets have a Performer grouping node assocated with them. pfDCS in the case of vwButton and vwSlider. pfSCS in the case of vwIncrementor and vwFrame.

As illustrated in the class diagram, below, widgets can act as both vwSubjects and vwObservers. The vwRadioButton is a good example of this. An application can have numerous non-widget concrete observers. Through their update() methods, they may take direct action or act as intermediaries between an interface and other portions of the application.

CLASS DIAGRAM
 
 
ABSTACT CLASSES
vwSubject
vwObserver
vwMediator
vwWidget
vwLabel

GENERIC WIDGET CLASSES
vwSlider
vwIncrementor
vwFrame
vwButton

NON-GENERIC WIDGET CLASSES
vwTextFrame
vwValueFrame
vwPushButton
vwRadioButton

INTERFACE CONFIGURATION FILES
Configuration File