NutsnBolts  0.1.0
An extension library for Coin
Loading...
Searching...
No Matches
NbNavigationMode Class Referenceabstract

Abstract base class for implementing a navigation submode. More...

#include <NutsnBolts/navigation/NbNavigationMode.h>

Inheritance diagram for NbNavigationMode:
NbCenterMode NbIdleMode NbOrthoCenterMode NbPanMode NbPickMode NbPitchMode NbRollMode NbRotateMode NbYawMode NbZoomMode

Public Member Functions

 NbNavigationMode (SbName modename)
 
virtual ~NbNavigationMode (void)
 
virtual void abort (const SoEvent *event, const NbNavigationControl *ctrl)
 
virtual NbNavigationModeclone (void) const =0
 
virtual void finish (const SoEvent *event, const NbNavigationControl *ctrl)
 
NbNavigation1DInputValueFunc * get1DValueFunc (void **closureptr=NULL) const
 
NbNavigation2DInputValueFunc * get2DValueFunc (void **closureptr=NULL) const
 
NbNavigation3DInputValueFunc * get3DValueFunc (void **closureptr=NULL) const
 
SbName getModeName (void) const
 
virtual SoNodegetSceneGraph (void)
 
virtual SoType getTypeId (void) const
 
virtual SbBool handleEvent (const SoEvent *event, const NbNavigationControl *ctrl)=0
 
virtual void init (const SoEvent *event, const NbNavigationControl *ctrl)
 
SbBool isAborted (void) const
 
SbBool isFinished (void) const
 
SbBool processEvent (const SoEvent *event, const NbNavigationControl *ctrl)
 
void set1DValueFunc (NbNavigation1DInputValueFunc *func, void *closure)
 
void set2DValueFunc (NbNavigation2DInputValueFunc *func, void *closure)
 
void set3DValueFunc (NbNavigation3DInputValueFunc *func, void *closure)
 

Static Public Member Functions

static float getAbsMouseCenterPixelDistance (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static float getAbsMouseMovePixelDistance (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static SoType getClassTypeId (void)
 
static float getMouseCenterAngle (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static float getMouseCenterHorizontalPixelDistance (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static float getMouseCenterVerticalPixelDistance (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static float getMouseMoveAngle (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static float getMouseMoveCenterAngle (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static float getMouseMoveHorizontalNormalizedDistance (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static float getMouseMoveHorizontalPixelDistance (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static float getMouseMoveVerticalNormalizedDistance (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static float getMouseMoveVerticalPixelDistance (void *closure, const NbNavigationMode *mode, const NbNavigationControl *ctrl)
 
static void initClass (void)
 

Static Public Attributes

static SoType classTypeId = SoType::badType()
 

Protected Member Functions

void abort (void)
 
void finish (void)
 
float get1DValue (const NbNavigationControl *ctrl) const
 
SbVec2f get2DValue (const NbNavigationControl *ctrl) const
 
SbVec3f get3DValue (const NbNavigationControl *ctrl) const
 
SbVec2f getCurrentNormalizedPosition (const NbNavigationControl *ctrl) const
 
SbVec2s getCurrentPosition (void) const
 
SbVec2f getInitialNormalizedPosition (const NbNavigationControl *ctrl) const
 
SbVec2s getInitialPosition (void) const
 
SbVec2f getPreviousNormalizedPosition (const NbNavigationControl *ctrl) const
 
SbVec2s getPreviousPosition (void) const
 

Detailed Description

Abstract base class for implementing a navigation submode.

This class is internal and should mostly be of interest for developers planning on implementing their own navigation systems with new navigation submodes.

It is abstract. The handleEvent method needs to be reimplemented by subclasses.

Constructor & Destructor Documentation

◆ NbNavigationMode()

NbNavigationMode::NbNavigationMode ( SbName modename)

Constructor. The modename argument is the name of the mode. It is often useful to create multiple instances of the same mode but with different names in a navigation system.

◆ ~NbNavigationMode()

NbNavigationMode::~NbNavigationMode ( void )
virtual

Destructor.

Member Function Documentation

◆ abort()

void NbNavigationMode::abort ( const SoEvent * event,
const NbNavigationControl * ctrl )
virtual

This method is invoked when the mode is aborted. The event passed to this method has already been handed to handleEvent as well.

See also
handleEvent, init(), finish()

◆ finish()

void NbNavigationMode::finish ( const SoEvent * event,
const NbNavigationControl * ctrl )
virtual

Invoked when a mode is completed. The event object passed to this method has already been handed to handleEvent as well.

See also
handleEvent, init(), abort()

◆ get1DValueFunc()

NbNavigation1DInputValueFunc * NbNavigationMode::get1DValueFunc ( void ** closureptr = NULL) const
See also
set1DValueFunc, get2DValueFunc, get3DValueFunc

◆ getCurrentNormalizedPosition()

SbVec2f NbNavigationMode::getCurrentNormalizedPosition ( const NbNavigationControl * ctrl) const
protected

Returns the current pointer position in normalized coordinates.

See also
getCurrentPosition, getInitialNormalizedPosition, getPreviousNormalizedPosition

◆ getCurrentPosition()

SbVec2s NbNavigationMode::getCurrentPosition ( void ) const
protected

Returns the current pointer position in the viewport.

See also
getInitialPosition, getPreviousPosition, getCurrentNormalizedPosition

◆ getInitialNormalizedPosition()

SbVec2f NbNavigationMode::getInitialNormalizedPosition ( const NbNavigationControl * ctrl) const
protected

Returns the initial pointer position in normalized coordinates.

See also
getInitialPosition, getPreviousNormalizedPosition, getCurrentNormalizedPosition

◆ getInitialPosition()

SbVec2s NbNavigationMode::getInitialPosition ( void ) const
protected

Returns the initial pointer position in the viewport, from when the navigation submode was started.

See also
getPreviousPosition, getCurrentPosition, getInitialNormalizedPosition

◆ getModeName()

SbName NbNavigationMode::getModeName ( void ) const

Returns the name of the mode, given to the constructor.

◆ getPreviousNormalizedPosition()

SbVec2f NbNavigationMode::getPreviousNormalizedPosition ( const NbNavigationControl * ctrl) const
protected

Returns the previous pointer position in normalized coordinates.

See also
getPreviousPosition, getInitialNormalizedPosition, getCurrentNormalizedPosition

◆ getPreviousPosition()

SbVec2s NbNavigationMode::getPreviousPosition ( void ) const
protected

Returns the previous points position in the viewport.

See also
getInitialPosition, getCurrentPosition, getPreviousNormalizedPosition

◆ getSceneGraph()

SoNode * NbNavigationMode::getSceneGraph ( void )
virtual

Not implemented yet.

This function should return a visualization scene graph in case the navigation submode also includes visualization hints for the 3D display.

◆ handleEvent()

SbBool NbNavigationMode::handleEvent ( const SoEvent * event,
const NbNavigationControl * ctrl )
pure virtual

Virtual abstract method that should be overridden to implement the navigation submode.

All events passed through the system while this mode is active are passed to this method, including the events that cause init(), abort(), and finish() event transitions.

Implemented in NbCenterMode, NbIdleMode, NbOrthoCenterMode, NbPanMode, NbPickMode, NbPitchMode, NbRollMode, NbRotateMode, NbYawMode, and NbZoomMode.

◆ init()

void NbNavigationMode::init ( const SoEvent * event,
const NbNavigationControl * ctrl )
virtual

Invoked when a mode is started/initialized. It is passed the event that triggered the mode change, or NULL in the case of being the default mode.

This method is called just before handleEvent is called with the exact same event object.

If overriding this event, control should still be passed down to this method.

See also
handleEvent, abort(), finish()

◆ initClass()

void NbNavigationMode::initClass ( void )
static

Static class initializer.

◆ processEvent()

SbBool NbNavigationMode::processEvent ( const SoEvent * event,
const NbNavigationControl * ctrl )

This is the entry point for events coming from the NbNavigationSystem. Some initial information is gathered before the event is passed on to the virtual, abstract handleEvent method.

See also
handleEvent

◆ set1DValueFunc()

void NbNavigationMode::set1DValueFunc ( NbNavigation1DInputValueFunc * func,
void * closure )
See also
get1DValueFunc, set2DValueFunc, set3DValueFunc

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