Native 3D widgets in PVSS 3.6 - technology overview

Piotr Golonka CERN IT/CO-BE

FWWG meeting

07 Decem ber 2006 “Native” widgets: EWO

● PVSS EWO

– “Extended Widget Object”, in PVSS 3.5 – A dynamic library, loaded by PVSS0ui

● Compiler compatibility! – Uses /3 framework

● Qt 3.3.6 – Requires commercial license for development on Windows

● qmake-based, portability-assuring build system

● QWidget base class

● Slots, signals, properties – out of the box

● The variety of Qt features available out of the box – Database access, XML, networking/web, OpenGL, – Needs to follow some conven tions

● Example of an “EWO” code available in the / folder In quest of 3D...

● Silicon Graphics: two standards for 3D graphics API

– OpenGL

● Open, “industry standard”

● Hardware-accelerated on all graphic cards nowadays

● Low-level functions – Shaders, nodes, planes – OpenInventor

● Higher-level, object-oriented, extendable framework API (C/C++) – Scenes, spheres, cubes, cameras, animators – User-interaction and event handling ● Viewers and manipulators ● Object picking, selecting, highlighting ● Uses OpenGL for low level

● Bindings to windowing system : Xt, Windows, Java, ... OpenGL and OpenInventor

● OpenGL: a part of your operating system!

● OpenInventor...

– Open specification – many implementations possible – COIN3D (www.coin3d.org)

● Portable: Windows, Unix, Linux, Mac, *BSD

● Open Source (GPL) or “Professional Edition” – Open Source available on ALL platforms! ● May use a variety of windowing system bindings - “extensions” – native Windows - SoWin – Cocoa on MacOS - Sc21 – X11/Xt on UNIX - SoXt – Qt (any supported) – SoQt ● We tried COIN+SoQt on Win dows and Linux – Compiled from sources, not a big effort: two DLLs COIN3D: OpenInventor API implementation

COIN3D/SoQt application

SoQt: rapid development...

#include #include #include #include #include int main(int argc, char ** argv) { QWidget * mainwin = SoQt::init(argc, argv, argv[0]); SoSeparator * root = new SoSeparator; root->ref(); root->addChild(new SoCone); SoQtExaminerViewer * eviewer = new SoQtExaminerViewer(mainwin); eviewer->setSceneGraph(root); eviewer->show(); SoQt::show(mainwin); SoQt::mainLoop(); return 0; }

Missing pieces

● 3D Geometry Shapes (a`la GEANT)

– Already provided by the IGUANA project (CMS Visualization)

● They use Coin3D/SoQt as well; support ?

● Some problems with compilation on Windows need to be resolved ● Data source

– May use Qt's SQL module to query them from a database – Load VRML or OpenInventor files (“Caching”? Simpler code)

● Dynamic loading of the OI shape extensions possible “on the flight” ● Parse the data and create the scene

● Add PVSS infrastructure for widget control

– Properties, signals, etc – Picking and selecting objects, interface to PVSS Technologies to pick up...

● EWOs

– Build system (qmake-based)

● Already set up! – Architecture for EWOs: relatively easy

● Passing data/events between PVSS and C++ code of the EWO – Qt: some basic concepts

– “The Inventor Mentor” - available in the CERN library – Most bulky part; need to pick up some concepts – Plenty of examples on the web

● DB Connectivity – Qt: relatively intuitive PVSS GEANT Geometry Shapes for Open Inventor

EWO

SoQt

Coin3D Qt Open Inventor ● We've gone already quite far

– Integration of technologies

● Build system, development environment

● Compiled COIN3D, SoQt into DLLs, ported IGUANA parts – Evaluation of technologies

● Portability

● Availability on both platforms – Simple “proof of concept”:

● embed a viewer into an EWO

● The development may be done as a “standalone program” at first, then “wrapped” into an EWO

● How much to do remains? It depends...