NutsnBolts  0.1.0
An extension library for Coin
Loading...
Searching...
No Matches
NbNavigationSystem Class Reference

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)
 
NbNavigationSystemclone (void) const
 
NbNavigationModegetCurrentMode (void) const
 
SbName getCurrentModeName (void) const
 
NbNavigationModegetMode (SbName name) const
 
SbName getName (void) const
 
NbNavigationControlgetNavigationControl (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 NbNavigationSystemcreateByName (SbName name)
 
static NbNavigationSystemgetByName (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)
 

Detailed Description

Class for managing user-based viewer navigation.

Container class for navigation systems.

Member Enumeration Documentation

◆ TransitionType

This enum defines the types of mode transitions supported by the NbNavigationSystem class.

Constructor & Destructor Documentation

◆ NbNavigationSystem()

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::~NbNavigationSystem ( void )

Destructor.

Member Function Documentation

◆ addMode()

void NbNavigationSystem::addMode ( NbNavigationMode * mode)

Adds a submode to a navigation system.

◆ addModeChangeCallback()

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.

See also
removeModeChangeCallback, getCurrentModeName

◆ addModeTransition() [1/2]

void NbNavigationSystem::addModeTransition ( NbNavigationMode * mode,
TransitionType type,
const SoEvent * trigger = NULL,
const SoEvent * condition = NULL )

Adds a mode transition.

◆ addModeTransition() [2/2]

void NbNavigationSystem::addModeTransition ( NbNavigationMode * mode1,
NbNavigationMode * mode2,
TransitionType type,
const SoEvent * trigger,
const SoEvent * condition = NULL )

Adds a mode transition.

◆ cleanClass()

void NbNavigationSystem::cleanClass ( void )
static

This function cleans up after the NbNavigationSystem class.

See also
NbNavigationSystem::initClass

◆ clone()

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.

◆ createByName()

NbNavigationSystem * NbNavigationSystem::createByName ( SbName name)
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

◆ getByName()

NbNavigationSystem * NbNavigationSystem::getByName ( SbName name)
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.

See also
NbNavigationSystem::registerSystem, NbNavigationSystem::unregisterSystem

◆ getCurrentMode()

NbNavigationMode * NbNavigationSystem::getCurrentMode ( void ) const

Returns the object for the current submode.

◆ getCurrentModeName()

SbName NbNavigationSystem::getCurrentModeName ( void ) const

Returns the name of the current submode.

◆ getMode()

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.

◆ getName()

SbName NbNavigationSystem::getName ( void ) const

Returns the name of the navigation system.

◆ getNavigationControl()

NbNavigationControl * NbNavigationSystem::getNavigationControl ( void ) const

Returns the navigation control class used by the navigation systems.

◆ initClass()

void NbNavigationSystem::initClass ( void )
static

Initializes the built-in navigation systems.

See also
NbNavigationSystem::cleanClass

◆ invokeModeChangeCallbacks()

void NbNavigationSystem::invokeModeChangeCallbacks ( void )
protected

Invokes all the mode change callbacks.

See also
addModeChangeCallback, removeModeChangeCallback

◆ isRegistered()

SbBool NbNavigationSystem::isRegistered ( NbNavigationSystem * system)
static

This function returns whether or not this particular navigation system instance is in the register.

◆ processEvent()

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.

◆ registerSystem()

SbBool NbNavigationSystem::registerSystem ( NbNavigationSystem * system)
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.

See also
NbNavigationSystem::unregisterSystem, NbNavigationSystem::getByName

◆ removeModeChangeCallback()

void NbNavigationSystem::removeModeChangeCallback ( NbNavigationModeChangeCB * cb,
void * closure )

Removes a callback set with addModeChangeCallback().

See also
addModeChangeCallback

◆ setCamera()

void NbNavigationSystem::setCamera ( SoCamera * camera)

Sets the pointer to the camera that the navigation system should manipulate.

◆ setViewport()

void NbNavigationSystem::setViewport ( const SbViewportRegion & vp)

Sets the viewport region information needed for interpreting mouse events correctly.

◆ unregisterSystem()

SbBool NbNavigationSystem::unregisterSystem ( NbNavigationSystem * system)
static

This function unregisters a navigation system from the dictionary.

See also
NbNavigationSystem::registerSystem, NbNavigationSystem::getByName

◆ viewAll()

void NbNavigationSystem::viewAll ( void )

Repositions the camera so that the complete model gets in the view.

◆ viewPart() [1/2]

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.

See also
viewPart

◆ viewPart() [2/2]

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.

Friends And Related Symbol Documentation

◆ NbNavigationModeChangeCB()

void NbNavigationModeChangeCB ( void * closure,
NbNavigationSystem * system )
related

This function type defines the signature the NbNavigationSystem mode change callbacks must use.

See also
NbNavigationSystem::addModeChangeCallback, NbNavigationSystem::removeModeChangeCallback

The documentation for this class was generated from the following files: