Window3D

(created by Chris)
 
 

Register
Purpose:  This function registers the Window3D with the GUI.  Basically, it is the GUI's way of notifying the window of its logical window id and passing  a handle to the GUI.
Input:       id        The id of the window.
                 g         Pointer to the GUI that contains this Window3D object.
Output:    None.
Precon:    None.
Postcon:  The id field of Window3D contains the memory address of where the parent GUI is located in main memory.
 

Init
Purpose:  This function initializes lighting and other basic GL-state for the window.
Input:      None.
Output:    None.
Precon:    None.
Postcon:  None.
 

ClearScreen
Purpose:  This function hides the crosshairs and mesh object.
Input:      None.
Output:    None.
Precon:    None.
Postcon:  None.
 

ResetView
Purpose:  This function resets the view in the window so that the entire Mesh Object is visible and is positioned and oriented in its initial pose.  Also, sets a flag which indicates that the crosshairs should be displayed during the draw function.
Input:      None.
Output:    None.
Precon:    None.
Postcon:  None.
 

draw
Purpose:  This function displays everything in the window which includes the Mesh Object, the crosshairs, and any samples in the sample list which have not yet been applied to the voxel data structure.
Input:       None.
Output:    None.
Precon:    None.
Postcon:  None.
 

handle
Purpose:  This function handles events from input devices.   The manner in which an event is handeled is determined by the type of event and the GlobalState's Toolbar Mode.  If the event was a keyboard input event, the input is ignored.  If the event was a mouse press event, the action which follows is determined by the toolbar mode as follows.

               Toolbar Mode            Action
                --------------------------------------------------------------------------
                    0  CrossHairs        Left-Push:                reposition crosshairs
                    1  Navigation        Left-Push:               enter rotate mode
                                                 Middle-Push:           enter pan mode
                                                 Right-Push:             enter zoom mode
                                                 Left-Release:          exit rotate mode
                                                 Middle-Release:      exit pan mode
                                                 Right-Release:        exit zoom mode
                    2  Polygon            Do nothing.
                    3  PointLine          Left-Push:               add voxel to voxel list
                                                 Drag & Left down:  add voxel to voxel list

While in rotate mode, drag events cause everything displayed in the window to rotate.
While in pan mode, drag events cause everything displayed in the window to pan.
While in zoom mode, drag events cause everything displayed in the window to enlarge or shrink.

Input:       None.
Output:    None.
Precon:    None.
Postcon:  None.
 

UpdateMesh
Purpose:  This function updates the mesh in the window.
Input:      None.
Output:    None.
Precon:    None.
Postcon:  None.
 

Accept
Purpose:  This function traverses the current list of samples which are yet to be relabeled in the voxel data structure, and tells the voxel data structure to relabel the voxels with the current labeling color.
Input:      None.
Output:    None.
Precon:    None.
Postcon:  The list of samples which are yet to be relabel in the voxel data structure is empty (i.e. num_samps_used = 0).