Biomedical Engineering Reference
In-Depth Information
nal cmgui mesh and field structures, which although fairly flexible do not support all
the rich expressions possible in the FieldML language. Current plans are to migrate
cmgui's internal data structures to be fully FieldML compatible so that FieldML can
become the native file format for cmgui. Note that FieldML will eventually support
serialization of computed fields.
Graphics
A proportion of the graphics data consists of some globally managed resources:
graphical materials giving basic material colours and lighting parameters, with
optional texturing with image fields plus OpenGL shader programs:
-
spectrums, which map field values to colours, modifying an underlying mate-
rial;
-
static graphics objects or 'glyphs' which can be drawn at points in the scene;
-
Scenes which control what is visible in a rendering device by filtering the
graphics for a model.
The remainder of the graphics code is essentially concerned with making graphi-
cal visualisations of the fields in a region, which is termed its “rendition”. These
consist of algorithms for making particular types of graphics from compatible field
definitions:
lines and cylinders from 1-D elements;
surfaces from 2D elements:
-
points illustrated with glyphs from point data (e.g. nodes) and at discrete lo-
cations in n-D elements;
-
iso-surfaces/iso-lines from volume/surface elements;
-
streamlines.
Each of the factors affecting the appearance of these visualisations is controlled
by a field, including the choice of coordinate field, data field for colouring with
spectrums, texture coordinates (surfaces), orientation and scaling fields (for point
glyphs), iso-scalar field (iso-surfaces/lines), stream vector field (streamlines), visi-
bility field (where supported) etc. This degree of control combined with the arbitrary
field functions, gives cmgui most of its flexibility and power.
The output of each of these algorithms is a graphics object which stores graph-
ics primitives in a form ready to be efficiently sent to a rendering engine such as
OpenGL.
Rendering
Rendering is a separate block in the architecture diagram; it is feasible to remove it
from the cmgui library to have regions, fields and graphical conversion without any
user-interface. Some rendering outputs such as VRML are also UI-less, but OpenGL
output requires code to interface with the windowing system, for which cmgui sup-
ports the respective drawing canvas objects for wxWidgets, gtk, motif, win32 and
carbon (Mac). Support for rendering to a Qt canvas is planned.
OpenGL rendering in cmgui is powerful and high quality, supporting advanced
features such as controllable tessellation of curved surfaces, arbitrary shaders, order-
Search WWH ::




Custom Search