White_dune developer documentation
"white_dune", what's that ?
"white_dune" is a continuation of the "dune" project by Stephan F. White.
"dune" is a graphical VRML97 Editor and animation tool with some OpenGL
scene rendering capabilities.
white_dune program overview
In princple, the structure of the white_dune program can be written as:
-
evaluate commandline parameters
-
enter GUI (Grapical User Interface) mainloop
For details, see the file main.cpp
white_dune GUI overview
The GUI of white_dune consists of 2 parts:
-
2D GUI
This handles two dimensional operations like opening windows,
display icons, menus, buttons etc.
2D GUI operations are seperated in a extra programming level,
called swt (Stephan White Toolkit).
Currently, there are two different implementations of swt written in C,
one for Motif/Lesstif (Unix/Linux) and one for Win32 (M$Windows).
For details, see the directory swt.
swt use M$Windows rc files. For details about non M$Windows
implementation see the directory swt/rc.
- 3D GUI
This handles three dimensional operations. This is displaying 3D data
(rendering, implemented in OpenGL) and manipulating 3D Objects.
Some 3D operations, like mouseinput and reaction to desktop events
(e.g. resize of Windows) are handled in connection with the 2D GUI
(see the file Scene3DView.cpp for details).
Additional, there are other sources of information for manipulating
3D Objects (also handled in Scene3DView.cpp): input from
devices like joystick, dialbox or spaceball. Code for input
from this devices is located in the file InputDevice.cpp.
The 2D GUI mainloop of white_dune is event driven. Typical events are
mouse-movement, mouse-click, resize of window and so on.
Additionally the mainloop can produce timer events.
When a event occures, the matching callback function is started.
The callbacks work for every subwindow of white_dune.
The following image shows the subwindows (red text) of the mainwindow.
Some 2D GUI events are distributed to the different subwindows.
The distribution of this events is based on inheritance.
The class SceneView define inheritable 2D GUI callbacks like
OnMouseMove and is parent class to the classes
ChannelView, FieldView, Scene3DView,
SceneGraphView, SceneTreeView, StatusBar,
ToolbarWindow and PanedWindow. PanedWindow is
parent class to the class MainWindow.
The name of classes is identical to the filenames.
A additional callback OnUpdate is used to distribute
messages like UPDATE_FIELD or UPDATE_ADD_NODE to the
child classes of SceneView. OnUpdate is started by
the function UpdateViews of class Scene.
The class Scene can be identified with one VRML file.
The global variable TheApp of class DuneApp can be identified
with things that are global to all VRML files.