complex scenes in the graphical environment. In
figure 5 the diagram of the main classes, used to
develop software components, is shown. Most of
these classes can be grouped into three categories:
A) Basic Graphic Classes, which provides
methods for graphic interfaces and for setting
environmental graphic options;
B) Events Classes, which includes all the classes
used to handle events generated by user’s
commands;
C) Application Class, which includes the
methods to properly integrate OSG and VR Juggler
libraries
3.1 Basic Graphic Classes
BoundingBoxExtractor class calculates the bounding
boxes of all objects in the scene during the traversal
of the scene graph. The user can select an object and
visualize its bounding box to define a bounding box
of a scene graph.
MenuBar is used to generate the graphical menu
with push-buttons. When an instance of this class is
created, it executes one or more calls to the
addButton () method specifying the data of the push-
buttons to be added; therefore the buildSceneGraph
() method is called in order to generate the subgraph
of the menu. At this point the instance of the
MenuBar class can be destroyed;
RefAxes class is responsible for the visualization
of the reference axes. It inherits from osg::Drawable
class which allows to design geometries
compounded by lines, triangles, etc. An instance of
this class visualizes a system of three orthogonal
axes in the left inferior angle of the window. The
guideline of the axes is calculated for every frame
and is updated according to camera orientation;
RefGrid class allows the visualization (if
required) of the reference grid. Like RefAxes class it
inherits from osg::Drawable class. Instance of this
class visualizes a grid with variable dimension and
step, layered on a plane with z=0.
3.2 Event Classes
MenuCommandCallback is a virtual class in which
are defined the virtual methods for activate or
disable the menu commands.
MenuCallback class inherits from the previous
class and implements the virtual methods enable()
and disable() which are called by an activation/de-
activation action from the menu.
PickHandler class intercepts the mouse events to
make possible the selection and the highlighting of
the nodes of interest of the 3D model. This is
obtained through Application::selectNode() and
Application::highlightNode() methods.
TransformManager class manages the
transformations (translation and rotation) on the 3D
model. It is an event handler that concurs to modify
the transformation matrix of a MatrixTransform
node. These modifications are performed according
to the user input device movements.
3.3 Application Class
A very important class, which is not included in the
previously mentioned class categories is the
Application class.
Application is the core class of the whole
system. Through the vrj::App interface, the VR
Juggler kernel runs an instance of the class and
manages all the computations required by the user
inputs, updates consequently the 3D scene and can
detect collisions among the objects.
In order to have an integrated use of OSG and
VR Juggler, the Application class implements the
vrj::OsgApp::initscene() method which initializes
the SG structure, that represents all the 3D scene
elements. The currently active SG is accessed
calling the vrj::OsgApp::getScene() method
whenever it is required (i. e. for rendering or
updating aims).
4 SYSTEM PROTOTYPE
We developed a first prototype of the Virtual Reality
System implementing the software architecture
described in section 2.
This prototype includes the following hardware
devices:
a graphical bi-processor workstation;
a Stereoscopic Video Projection System,
with two DLP 3000ANSI LUMEN
projectors and a 1,5X2 Mt screen;
a HiRes900 Cybermind Head Mounted
Display;
an HP iPAQ hx2490 Pocket PC with PDA
functionalities.
A VIRTUAL REALITY SYSTEM FOR MEDICAL IMAGING
219