2010-07-15

arclight qt prototype

Arclight is a prototype written to explore app development with the Qt framework. The app loads a 2D polygon from a .svg file, extrudes it into 3D with a beveling algorithm, then lights the resulting geometry.

DOWNLOAD. C++ project written for the Qt framework. Source is included, as well as an executable for OS X.

I was curious to try out app development with Qt, so I grabbed several previous projects (one in Go, one in Java) and mashed them up into a simple Qt project. This app has no value for end users, it's purely a research project.

The code design is fairly standard: A UI operates by setting values on a model, which communicates changes via Qt's "signals and slots" mechanism. When the main view receives a change notice, it starts the rendering engine, which then creates an image by operating on chains of discrete processing objects (sort of -- there's only one and a half at the moment, a bevel FX to load the SVG file and extrude the geometry, then a light FX currently embedded in the bevel, responsible for lighting the scene).

There's a single background thread to handle image rendering. Communication is again via the signals and slots mechanism. The rendering widget supplies a QImage surface to the renderer, which returns it when it's finished generating image data.

The model is very simple, with a single available project containing the FX chain. There's an abstracted parameter mechanism, so clients can query the FX for what behaviour is available.

Overall opinion on Qt: Thumbs up. It's a clean, full-featured framework that by and large doesn't do anything surprising, and includes all the necessary tools for app development. The most unique feature, signals and slots, is a fine alternative to a traditional messaging mechanism. Given a choice I'd probably take a more robust model along the lines of what BeOS had, but there are almost certainly performance advantages to Qt's system, and they were nice enough to hide the details of doing IPC.

No comments:

Post a Comment