NutsnBolts
0.1.0
An extension library for Coin
|
Abstract base class for implementing a navigation submode. More...
#include <NutsnBolts/navigation/NbNavigationMode.h>
Public Member Functions | |
NbNavigationMode (SbName modename) | |
virtual | ~NbNavigationMode (void) |
virtual void | abort (const SoEvent *event, const NbNavigationControl *ctrl) |
virtual NbNavigationMode * | clone (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 SoNode * | getSceneGraph (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 |
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.
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.
|
virtual |
Destructor.
|
virtual |
This method is invoked when the mode is aborted. The event passed to this method has already been handed to handleEvent as well.
|
virtual |
Invoked when a mode is completed. The event object passed to this method has already been handed to handleEvent as well.
NbNavigation1DInputValueFunc * NbNavigationMode::get1DValueFunc | ( | void ** | closureptr = NULL | ) | const |
|
protected |
Returns the current pointer position in normalized coordinates.
|
protected |
Returns the current pointer position in the viewport.
|
protected |
Returns the initial pointer position in normalized coordinates.
|
protected |
Returns the initial pointer position in the viewport, from when the navigation submode was started.
SbName NbNavigationMode::getModeName | ( | void | ) | const |
Returns the name of the mode, given to the constructor.
|
protected |
Returns the previous pointer position in normalized coordinates.
|
protected |
Returns the previous points position in the viewport.
|
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.
|
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.
|
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.
|
static |
Static class initializer.
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.
void NbNavigationMode::set1DValueFunc | ( | NbNavigation1DInputValueFunc * | func, |
void * | closure ) |