TOC PREV NEXT INDEX

Gaudi logo


Chapter 15
Visualization Facilities
15.1 Overview

In this chapter we describe how visualization facilities are provided to the applications based on the Gaudi framework. We present how we interface the physics event data objects, detector components or statistical objects to their graphical representation. One example of an application that uses the visualization services is an event display program. With this program we display graphically the event data from files or being acquired by the data acquisition. Another example could be an interactive analysis program that combines in the same application histogramming or manipulation of statistical entities, event display, and full interactive control by the end user of the data objects and algorithms of the application.

In the current release we have implemented the mechanism of converting event and detector objects into their graphical representation and built an event display application (Panoramix). This application can be used to help in the development of physics algorithms (e.g. pattern recognition) or in the verification of the detector geometry.

15.2 The data visualization model

The Gaudi architecture envisaged implementing data visualization using a similar pattern to data persistency. We do not want to implement visualization methods in each data object. In other words, we do not want to tell an object to "draw" itself. Instead we would implement converters as separate entities that are able to create specific graphical representations for each type of data object and for each graphical package that we would like to use. In that way, as for the persistency case, we decouple the definition and behaviour of the data objects from the various technologies for graphics. We could configure at run time to have 2D or 3D graphics depending on the needs of the end-user at that moment.

Figure 15.1 illustrates the components that need to be included in an application to make it capable of visualizing data objects. The interactive user interface is a Service which allows the end-user to interact with all the components of the application. The user could select which objects to display, which algorithms to run, what properties of which algorithm to inspect and modify, etc. This interaction can be implemented using a graphical user interface or by using a scripting language.

The User interface service is also in charge of managing one or more GUI windows where views of the graphical representations are going to be displayed.
Figure 15.1 Components for visualization

The other main component is a Conversion Service that handles the conversion of objects into their graphical representation. This service requires the help of a number of specialized converters, one for each type of data object that needs to be graphically displayed. The transient store of graphical representations is shared by the conversion service, together with the converters, and the user interface component. The form of this transient store depends on the choice of graphics package. Typically it is the user interface component that would trigger the conversion service to start the conversion of a number of objects (next event), but this service can also be triggered by any algorithm that would like to display some objects.

15.3 VisSys - the Gaudi visualisation services
15.3.1   Design layout

The Gaudi Visualisation service (OnXSvc) uses the OnX(ML) package to drive interactivity. From an XML description of the graphical user interface (GUI), OnX creates an application GUI by using various "toolkits" like Motif, Win32, GTK+. It permits also to handle various scripting languages (currently tcl, CINT, KUIP) in the GUI XML files, to describe the behaviour of the GUI pieces.

The graphics are handled by Open Inventor. The Inventor "viewers", being part of the GUI, are created by OnX from a placement in the application GUI XML files.

Connection to Gaudi is done through the wrapping of Gaudi C++ code to scripting languages (Panoramix package).

Inventor modeling of the LHCb detector and event data uses Gaudi Inventor converters (the So<xxx>Cnv classes, SoLHCb package) to produce Inventor scene graphs.

The SoDetElemCnv and SoLVolumeCnv build the Inventor scene graph for the detector. Others (such as SoMCParticleCnv) build Inventor scene graphs for event data.

15.3.2   Writing graphic converters

The role of each converter So<xxx>Cnv is to produce an Open Inventor node that represents the object. The following fragment of code shows how this is done for the geometry of a detector element.The code has been simplified to be more illustrative. The 3D graphical objects that are created are standard OpenInventor objects (in bold).
Listing 15.1 Fragment of SoDetectorElementCnv
30: StatusCode SoDetElemCnv::createRep(DataObject* aObject,IOpaqueAddress&*)
31: {
32:   DetectorElement* de = dynamic_cast<DetectorElement*>(aObject);
33: ILVolume*    lv = de->geometry()->lvolume();
34:   SolidBox*    box = dynamic_cast<SolidBox*>(lv->solid()->coverTop());
35:
36: SoSeparator* separator = new SoSeparator;
37: SoDrawStyle* drawStyle = new SoDrawStyle;
38: SoMaterial*  material      = new SoMaterial;
39:   separator->addChild(drawStyle);
40: separator->addChild(material);
41:   // set drawing styles
42: drawStyle->style.setValue(SoDrawStyle::LINES);
43: drawStyle->linePattern.setValue(0xFFFF);
44:   material->diffuseColor.setValue(SbColor(0.,1.,0.));
45:
46: // Code related to the transformation
47:   SoTransform* trans = new SoTransform;
48:   ...
49:   separator->addChild(trans);
50:
51: SoCube* cube = new SoCube();
52: cube->width = box->xHalfLength() * 2;
53: cube->height = box->yHalfLength() * 2;
54: cube->depth = box->zHalfLength() * 2;
55:
56: separator->addChild(cube);
57:   m_pSo->addNode(separator);
58:   return StatusCode::SUCCESS;
59: }

15.4 Panoramix - the LHCb event display

Panoramix is the association of the three packages Vis/OnXSvc, Vis/SoLHCb, Vis/Panoramix, and of sub-detector converter packages (Vis/So<Det>) to produce an interactive event and geometry display for LHCb. Detailed instructions for its installation and use can be found in the Visualisation pages of the LHCb web, at http://cern.ch/lhcb-comp/Frameworks/Visualization/.



Quadralay Corporation
http://www.webworks.com
Voice: (512) 719-3399
Fax: (512) 719-3606
sales@webworks.com
TOC PREV NEXT INDEX