AAOGlimpse Interfaces
AAOGlimpse has a thin
system-dependent layer and a much more substantial
system-independent layer. The system-independent layer is
portable C++ that makes standard OpenGL calls to draw into an
OpenGL context set up by the system-dependent layer. The
system-dependent layer interface to the system-dependent layer
is all handled by a single DisplaySupervisor C++ object. This
object provides a number of methods for the system-dependent
layer to call under various circumstances (menu item selected,
mouse moved in the OpenGL display, etc). One of these calls sets
up a callback routine that the DisplaySupervisor can use to make
specific requests of the system-dependent layer (please redraw
the display, please change the state of this check box, etc.)
The DisplaySupervisor contains all the routines that the
system-dependent layer needs to call.
The system-dependent layer is responsible for:
The following lists need to be fleshed out in much greater detail, but they may give some sort of idea of the details of the interface to the DisplaySupervisor.
DisplaySupervisor routines to be called by the system-dependent layer.
void Animate (bool On)
bool BasicSigmaFilter (void)
void ClearSelectionDisplay (void)
bool Display (void)
void DisplayAllData (void)
void DisplayAxes (bool On)
void DisplayContours (bool On)
void DisplayHistogram (bool On)
void DisplaySelectedSubset (void)
void DisplaySurfaces (bool On)
void DisplayWires (bool On)
void EnableCameraInfo (bool On)
void EnableHighlitBox (bool On)
void EnableHighlitCross (bool On)
void EnableHighlitEllipse (bool On)
void EnablePlotDisplay (bool On)
void EnableSelectionBox (bool On)
void EnableZPlot (bool On)
void GoInvisible (void)
const char* HandleCommand (void* Details, const char* MessagePtr)
bool HandleKeyDown (int Flags, float LocationX, float LocationY, char KeyCharacter)
bool HandleTimer (float DeltaSecs)
bool Initialise (void)
void InitGL (void)
void MouseDown (int Flags, float LocationX, float LocationY)
void MouseDragged (int Flags, float LocationX, float LocationY)
bool MouseMoved (int Flags, float LocationX, float LocationY)
void MouseUp (void)
bool NewFromSelection (void)
bool NewFromXCollapse (void)
bool NewFromYCollapse (void)
bool NewFromZCollapse (void)
bool OpenFile (const char* FileName)
bool OpenLutFile (const char* FileName)
bool OpenSecondaryFile (const char* FileName)
void OtherMouseDown (int Flags, float LocationX, float LocationY)
void RequestHighlightData (void)
void ResetOrientation (void)
void ResizeGL (int Height, int Width)
void RightMouseDown (int Flags, float LocationX, float LocationY)
void ScrollWheel (int Flags, float WheelDelta, float LocationX, float LocationY)
void SetColoursNegative (void)
void SetDisplayMax (float DisplayMax)
void SetDisplayMin (float DisplayMin)
void SetFigaroDefaultColours (void)
void SetHighlitArea (float Xc,float Yc,float Height,float Width,float Theta)
void SetLowClipping (bool On)
void SetRequestFunctionCallback (DSCallbackRoutine CallBackRoutine,void* ClientData)
void SetScalingPercentile (float Percentile)
bool SetScalingType (const char* Type)
void SetSkycatDefaultColours (void)
void SetSquarePixels (bool On)
void SetSurfaceByCubes (bool ByCubes)
void SnapToFaceOn (void)
void UseGrayScale (void)
void UsePixelCoordinates (bool On)
The structure passed to the routine specified in a call to SetRequestFunctionCallback():
typedef struct DSCallbackDetails {
DSCallbackCode Request;
HighlitAreaType HighlitAreaInPixels;
HighlitOptionType HighlitOption;
GUIFeedbackType GUIFeedback;
const char* StringValue;
void* CommandDetails;
bool BooleanValue;
int FirstInteger;
int SecondInteger;
} DSCallbackDetails;
The possible codes that can be specified as the callback code - in the Request field of a DSCallbackDetails structure:
typedef enum {
DS_REDISPLAY,
DS_SHOW_HIGHLIT_GUI,
DS_SET_CURRENT_CONTEXT,
DS_HIGHLIT_AREA_CHANGED,
DS_HIGHLIT_OPTION_CHANGED,
DS_GUI_UPDATE,
DS_UPDATE_DATA_STRING,
DS_SET_ERROR_STRING,
DS_SEND_SOCKET_REPLY,
DS_RESIZE_WINDOW,
DS_CHANGE_SCALE
} DSCallbackCode;
The system-dependent layer is responsible for:
- Creating the DisplaySupervisor in the first place (or just having a static DisplaySupervisor instance) and initialising it.
- Setting up the overall GUI, including the menus, the control panels for the scale and selection area, and the area used by the OpenGL code in the system-independent layer.
- Passing on all mouse event and keyclicks made in the OpenGL display area to the DisplaySupervisor, calling routines such as MouseUp(), MouseMoved(), HandleKeyDown(), etc.
- Handling the scale control and highlit selection panels, and the various menu items, calling DisplaySupervisor routines such as DisplayAxes(), EnableSelectionBox() etc in response to GUI events involving these.
- Calling the DisplaySupervisor's Display() routine whenever the content of the OpenGL area has to be updated.
- Calling the DisplaySupervisor's HandleTimer() routine at regular intervals.
- Maintaining a read on a socket and calling the DisplaySupervisor's HandleCommand() routine whenever a string is read from it.
- Passing the DisplaySupervisor's
SetRequestFunctionCallback() routine the address of a C
routine that can be called when the DisplaySupervisor wants
the system-dependent layer to do something, such as update
the GUI or redraw the OpenGL area. And responding to calls
to the routine from the DisplaySupervisor.
The following lists need to be fleshed out in much greater detail, but they may give some sort of idea of the details of the interface to the DisplaySupervisor.
DisplaySupervisor routines to be called by the system-dependent layer.
void Animate (bool On)
bool BasicSigmaFilter (void)
void ClearSelectionDisplay (void)
bool Display (void)
void DisplayAllData (void)
void DisplayAxes (bool On)
void DisplayContours (bool On)
void DisplayHistogram (bool On)
void DisplaySelectedSubset (void)
void DisplaySurfaces (bool On)
void DisplayWires (bool On)
void EnableCameraInfo (bool On)
void EnableHighlitBox (bool On)
void EnableHighlitCross (bool On)
void EnableHighlitEllipse (bool On)
void EnablePlotDisplay (bool On)
void EnableSelectionBox (bool On)
void EnableZPlot (bool On)
void GoInvisible (void)
const char* HandleCommand (void* Details, const char* MessagePtr)
bool HandleKeyDown (int Flags, float LocationX, float LocationY, char KeyCharacter)
bool HandleTimer (float DeltaSecs)
bool Initialise (void)
void InitGL (void)
void MouseDown (int Flags, float LocationX, float LocationY)
void MouseDragged (int Flags, float LocationX, float LocationY)
bool MouseMoved (int Flags, float LocationX, float LocationY)
void MouseUp (void)
bool NewFromSelection (void)
bool NewFromXCollapse (void)
bool NewFromYCollapse (void)
bool NewFromZCollapse (void)
bool OpenFile (const char* FileName)
bool OpenLutFile (const char* FileName)
bool OpenSecondaryFile (const char* FileName)
void OtherMouseDown (int Flags, float LocationX, float LocationY)
void RequestHighlightData (void)
void ResetOrientation (void)
void ResizeGL (int Height, int Width)
void RightMouseDown (int Flags, float LocationX, float LocationY)
void ScrollWheel (int Flags, float WheelDelta, float LocationX, float LocationY)
void SetColoursNegative (void)
void SetDisplayMax (float DisplayMax)
void SetDisplayMin (float DisplayMin)
void SetFigaroDefaultColours (void)
void SetHighlitArea (float Xc,float Yc,float Height,float Width,float Theta)
void SetLowClipping (bool On)
void SetRequestFunctionCallback (DSCallbackRoutine CallBackRoutine,void* ClientData)
void SetScalingPercentile (float Percentile)
bool SetScalingType (const char* Type)
void SetSkycatDefaultColours (void)
void SetSquarePixels (bool On)
void SetSurfaceByCubes (bool ByCubes)
void SnapToFaceOn (void)
void UseGrayScale (void)
void UsePixelCoordinates (bool On)
The structure passed to the routine specified in a call to SetRequestFunctionCallback():
typedef struct DSCallbackDetails {
DSCallbackCode Request;
HighlitAreaType HighlitAreaInPixels;
HighlitOptionType HighlitOption;
GUIFeedbackType GUIFeedback;
const char* StringValue;
void* CommandDetails;
bool BooleanValue;
int FirstInteger;
int SecondInteger;
} DSCallbackDetails;
The possible codes that can be specified as the callback code - in the Request field of a DSCallbackDetails structure:
typedef enum {
DS_REDISPLAY,
DS_SHOW_HIGHLIT_GUI,
DS_SET_CURRENT_CONTEXT,
DS_HIGHLIT_AREA_CHANGED,
DS_HIGHLIT_OPTION_CHANGED,
DS_GUI_UPDATE,
DS_UPDATE_DATA_STRING,
DS_SET_ERROR_STRING,
DS_SEND_SOCKET_REPLY,
DS_RESIZE_WINDOW,
DS_CHANGE_SCALE
} DSCallbackCode;