NutsnBolts
0.1.0
An extension library for Coin
|
Class for managing user-based viewer navigation. More...
#include <NutsnBolts/navigation/NbNavigationSystem.h>
Public Types | |
enum | TransitionType { INITIAL , STACK , SWITCH , FINISH , ABORT } |
Public Member Functions | |
NbNavigationSystem (SbName name) | |
~NbNavigationSystem (void) | |
void | addMode (NbNavigationMode *mode) |
void | addModeChangeCallback (NbNavigationModeChangeCB *cb, void *closure) |
void | addModeTransition (NbNavigationMode *mode, TransitionType type, const SoEvent *trigger=NULL, const SoEvent *condition=NULL) |
void | addModeTransition (NbNavigationMode *mode1, NbNavigationMode *mode2, TransitionType type, const SoEvent *trigger, const SoEvent *condition=NULL) |
NbNavigationSystem * | clone (void) const |
NbNavigationMode * | getCurrentMode (void) const |
SbName | getCurrentModeName (void) const |
NbNavigationMode * | getMode (SbName name) const |
SbName | getName (void) const |
NbNavigationControl * | getNavigationControl (void) const |
SbBool | processEvent (const SoEvent *event) |
void | removeModeChangeCallback (NbNavigationModeChangeCB *cb, void *closure) |
void | setCamera (SoCamera *camera) |
void | setSceneGraph (SoNode *scenegraph) |
void | setViewport (const SbViewportRegion &viewport) |
void | viewAll (void) |
void | viewPart (SoNode *node, const SbVec3f &in, const SbVec3f &up) |
void | viewPart (SoPath *path, const SbVec3f &in, const SbVec3f &up) |
Static Public Member Functions | |
static void | cleanClass (void) |
static NbNavigationSystem * | createByName (SbName name) |
static NbNavigationSystem * | getByName (SbName name) |
static void | initClass (void) |
static SbBool | isRegistered (NbNavigationSystem *system) |
static SbBool | registerSystem (NbNavigationSystem *system) |
static SbBool | unregisterSystem (NbNavigationSystem *system) |
Protected Member Functions | |
void | invokeModeChangeCallbacks (void) |
Related Symbols | |
(Note that these are not member symbols.) | |
void | NbNavigationModeChangeCB (void *closure, NbNavigationSystem *system) |
Class for managing user-based viewer navigation.
Container class for navigation systems.
This enum defines the types of mode transitions supported by the NbNavigationSystem class.
NbNavigationSystem::NbNavigationSystem | ( | SbName | name | ) |
Constructor. The name argument is the name of the system, the name it will be registered under with NbSceneManager::registerSystem().
NbNavigationSystem::~NbNavigationSystem | ( | void | ) |
Destructor.
void NbNavigationSystem::addMode | ( | NbNavigationMode * | mode | ) |
Adds a submode to a navigation system.
void NbNavigationSystem::addModeChangeCallback | ( | NbNavigationModeChangeCB * | cb, |
void * | closure ) |
Adds a callback that will be called each time the navigation system switches navigation mode. Intended usage for this is for the application to switch mouse cursor representation and similar things.
void NbNavigationSystem::addModeTransition | ( | NbNavigationMode * | mode, |
TransitionType | type, | ||
const SoEvent * | trigger = NULL, | ||
const SoEvent * | condition = NULL ) |
Adds a mode transition.
void NbNavigationSystem::addModeTransition | ( | NbNavigationMode * | mode1, |
NbNavigationMode * | mode2, | ||
TransitionType | type, | ||
const SoEvent * | trigger, | ||
const SoEvent * | condition = NULL ) |
Adds a mode transition.
|
static |
This function cleans up after the NbNavigationSystem class.
NbNavigationSystem * NbNavigationSystem::clone | ( | void | ) | const |
This method creates a clone of this navigation system. Only the mode network setup is copied - callback lists are not.
|
static |
This function returns a distinct copy of the navigation system defined by the given name, or NULL if no such navigation system has been
|
static |
This function returns the navigation system that has been registered under the given name. NULL is returned if no such system has been registered.
NbNavigationMode * NbNavigationSystem::getCurrentMode | ( | void | ) | const |
Returns the object for the current submode.
SbName NbNavigationSystem::getCurrentModeName | ( | void | ) | const |
Returns the name of the current submode.
NbNavigationMode * NbNavigationSystem::getMode | ( | SbName | name | ) | const |
Returns the submode with the given name.
NULL is returned if no mode with the given name exists in the system.
SbName NbNavigationSystem::getName | ( | void | ) | const |
Returns the name of the navigation system.
NbNavigationControl * NbNavigationSystem::getNavigationControl | ( | void | ) | const |
Returns the navigation control class used by the navigation systems.
|
static |
Initializes the built-in navigation systems.
|
protected |
Invokes all the mode change callbacks.
|
static |
This function returns whether or not this particular navigation system instance is in the register.
SbBool NbNavigationSystem::processEvent | ( | const SoEvent * | event | ) |
Processes an event. Returns TRUE if a mode used the event, and FALSE if the event didn't result in anything.
|
static |
This function registers a navigation system object so it can later be fetched by name through NbNavigationSystem::getByName().
Registered navigation systems can be enabled for an NbSceneManager through use of an NbViewerNavigationMode node in the scene graph.
void NbNavigationSystem::removeModeChangeCallback | ( | NbNavigationModeChangeCB * | cb, |
void * | closure ) |
Removes a callback set with addModeChangeCallback().
void NbNavigationSystem::setCamera | ( | SoCamera * | camera | ) |
Sets the pointer to the camera that the navigation system should manipulate.
void NbNavigationSystem::setViewport | ( | const SbViewportRegion & | vp | ) |
Sets the viewport region information needed for interpreting mouse events correctly.
|
static |
This function unregisters a navigation system from the dictionary.
void NbNavigationSystem::viewAll | ( | void | ) |
Repositions the camera so that the complete model gets in the view.
void NbNavigationSystem::viewPart | ( | SoNode * | node, |
const SbVec3f & | in, | ||
const SbVec3f & | up ) |
This method finds the first path to node and invokes the path-based viewPart() instead. It's just a convenience function for avoiding to have to find the path yourself.
void NbNavigationSystem::viewPart | ( | SoPath * | path, |
const SbVec3f & | in, | ||
const SbVec3f & | up ) |
This method places the camera so that it has the best view possible of the part path points to, given the in-vector and up-vector constraints.
|
related |
This function type defines the signature the NbNavigationSystem mode change callbacks must use.