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.
In addition, any cut planes that have been defined or samples that are
visible are reset and no changes are made to the voxel data structure.
Input:
None.
Output: None.
Precon: None.
Postcon: Any cut planes
are made invalid (plane.valid = -1) and all (spray paint) samples are reset
(num_samps_used = 0. )
draw
Purpose: This function displays
everything in the window which includes the Mesh Object, the crosshairs,
any samples in the sample list which have not yet been applied to the voxel
data structure, and the cut plane if one has been specified and not accepted
yet.
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 Paint3D
Left-Push:
ignored
Drag & Left down: add voxel to voxel list
Right-Push:
cut planes point set
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.
While in paint 3D mode, left drag
events creates spray paint editing, and right click events cause the appropriate
cut plane point to be set, or are ignored if 2 are already set.
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 (spray paint editing function,) and tells the voxel data
structure to relabel the voxels with the current labeling color.
In addition, all visible and valid segmentation on one side of a valid
cut plane are relabelled.
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)
Plane is invalid ( plane.valid = -1 )
DrawCutPlane
Purpose: This function displays
the cutplane that was defined by the user in CutPlanes Mode
Input:
None.
Output: GLQUAD
rendering of the CutPlane.
Precon: plane.valid=1.
Postcon: None.