#include <glscene.h>
Public Member Functions | |
| GLScene () | |
| void | setInitCmds (QPtrList< CmdInstance > *cmds) |
| void | setDisplayCmds (QPtrList< CmdInstance > *cmds) |
| void | execInitCmds (bool disableProjectionMods=false, bool disableViewports=false, bool origStateAsIdentity=false) const |
| void | execDisplayCmds (bool disableProjectionMods=false, bool disableViewports=false, bool origStateAsIdentity=false) const |
| void | setStepModeEnabled (bool enable) |
| bool | stepModeIsEnabled () const |
| void | setStepModePos (uint pos) |
| uint | getStepModePos () const |
| bool | autoGLEndEnabled () const |
| void | setAutoGLEndEnabled (bool enable) |
Private Member Functions | |
| void | execCmdIntanceList (QPtrList< CmdInstance > *cmdInstances, bool useStepper, bool origStateAsIdentity, bool disableProjectionMods, bool disableViewports) const |
Private Attributes | |
| QPtrList< CmdInstance > * | initCmds |
| QPtrList< CmdInstance > * | displayCmds |
| bool | stepMode |
| uint | stepModePos |
| bool | autoGLEnd |
A single scene instance is designed to be shared upon multiple viewers, such as GLWorldViewer and GLScreenViewer.
The scene is drawn using a list of initialzation commmands and a list of display commands, both of which need to be executed.
It also provides a facility for stepping through commands - like a debug mode.
|
|
>Constructor. This will initialize the object's members to the following
|
|
|
|
|
||||||||||||||||||||||||
|
Execute the commands from one of the scene's command instance lists, which is either initialization or display, set by cmdInstances. The useStepper parameter specifies whether or not the stepper position affects which commands to execute. This should only be used for the display commands, not the initialization ones.
The origStateAsIdentity indicates that whenever a glLoadIdentity() call is made, then the actual matrix that is to be loaded is the original one, before any commands are / were executed, for either the model view or project matrices. The parameter disableProjectionMods, it allows you to prevent modifications to the projection matrix. This is useful for implementing a viewer that DRAWS the projection, rather that actually executing it. As for the parameter disableViewports, it allows you to prevent viewports to be created. Again, this is useful for implementing a viewer that does not support them, such as a global world viewer. Note: If cmdInstances = 0, then this method will return without doing anything. Note: To fulfill the requirements of this second parameter (when it is enabled), each command instance is checked to see if its name is an exact match to the string GL_VIEWPORT_NAME ("glViewport"). Obviously if it is, then the command is ignored. Note: This method PURPOSELY does not save and restore the current matrix, nor OpenGL attributes. This allows information about the final state to be gathered by callers. Hence, when calling this method, you must look after the state YOURSELF. See also GLScene::setAutoGLEndEnabled |
|
||||||||||||||||
|
Execute the display commands part of the scene. Please see GLScene::execCmdIntanceList() for details. |
|
||||||||||||||||
|
Execute the initialization commands part of the scene. Please see GLScene::execCmdIntanceList() for details. |
|
|
|
|
|
The automatic glEnd() OpenGL call is needed to keep OpenGL working in the case where glBegin is called but has not been followed through with a glEnd call. This happens for example, when in stepper mode and you have stepped past a glBegin but not yet to its glEnd call yet. It fixes the display and ALSO the ability to get the matrix values. Note: This does NOT call GLScene::exec(). That is to be done by the viewer. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.2