VRUT::Navigation::NavigationStyleDeltaViewSpecific Class Reference

Type for DeltaView specific variables needed for a proper emulation. More...

#include <navigation.h>

Inheritance diagram for VRUT::Navigation::NavigationStyleDeltaViewSpecific:

NavigationStyleInterface

List of all members.

Public Member Functions

 NavigationStyleDeltaViewSpecific (const MODULE_ID &_id, const wxString &_name, Navigation *navigation)
 Constructor.
void getAndFixButtonValues (const wxCommandEvent &evt)
 Update other DeltaView buttons' value.
void updateParams (const wxCommandEvent &evt)
 Updates the module specific registered parameters.
void registerButtons ()
 Register DeltaView buttons into gui.
void buttonEvent ()
 Method for handling stateless buttons.
void keyStyle (wxKeyEvent &evt)
 DeltaView key style.
void mouseStyle (wxMouseEvent &evt)
 DeltaView mouse style.

Public Attributes

bool altDown
 Is the alt key being held down?
bool ctrlDown
 Is the ctrl key being held down?
bool shiftDown
 Is the shift key being held down?
bool axisAlignedRotateOperationStarted
 Are we rotating around an axis?
bool axisAlignedXaxis
 True if we rotate around the x axis, false if we rotate around the y axis.

Private Attributes

Navigationnavigation
 C++ does not allow the embedded class to see its surrounding class, so we need this pointer.


Detailed Description

Type for DeltaView specific variables needed for a proper emulation.

Definition at line 348 of file navigation.h.


Constructor & Destructor Documentation

Navigation::NavigationStyleDeltaViewSpecific::NavigationStyleDeltaViewSpecific ( const MODULE_ID _id,
const wxString &  _name,
Navigation navigation 
)

Constructor.

Definition at line 2057 of file navigation.cpp.

02058 : NavigationStyleInterface(wxT("DeltaView"))
02059 {
02060        this->navigation = navigation;
02061 
02062        altDown = false;
02063        ctrlDown = false;
02064        shiftDown = false;
02065        axisAlignedRotateOperationStarted = false;
02066        axisAlignedXaxis = false;
02067 }


Member Function Documentation

void Navigation::NavigationStyleDeltaViewSpecific::getAndFixButtonValues ( const wxCommandEvent &  evt  )  [virtual]

Update other DeltaView buttons' value.

Implements NavigationStyleInterface.

Definition at line 2069 of file navigation.cpp.

02070 {
02071 
02072 }

void VRUT::Navigation::NavigationStyleDeltaViewSpecific::updateParams ( const wxCommandEvent &  evt  )  [inline, virtual]

Updates the module specific registered parameters.

Implements NavigationStyleInterface.

Definition at line 368 of file navigation.h.

00368 {}

void Navigation::NavigationStyleDeltaViewSpecific::registerButtons (  )  [virtual]

Register DeltaView buttons into gui.

Implements NavigationStyleInterface.

Definition at line 2074 of file navigation.cpp.

02075 {
02076 
02077 }

void Navigation::NavigationStyleDeltaViewSpecific::buttonEvent (  )  [virtual]

Method for handling stateless buttons.

Implements NavigationStyleInterface.

Definition at line 2079 of file navigation.cpp.

02080 {
02081        
02082 }

void Navigation::NavigationStyleDeltaViewSpecific::keyStyle ( wxKeyEvent &  evt  )  [virtual]

DeltaView key style.

Implements NavigationStyleInterface.

Definition at line 2084 of file navigation.cpp.

02085 {
02086        if (int(navigation->windowID) == evt.GetId() && evt.GetEventType() == wxEVT_KEY_DOWN)
02087        {
02088               switch (evt.GetKeyCode())
02089               {
02090               case WXK_ALT:
02091                      {
02092                             altDown = true;
02093                      }
02094                      break;
02095               case WXK_CONTROL:
02096                      {
02097                             ctrlDown = true;
02098                      }
02099                      break;
02100               case WXK_SHIFT:
02101                      {
02102                             shiftDown = true;
02103                      }
02104                      break;
02105               }
02106        }
02107        else if (int(navigation->windowID) == evt.GetId() && evt.GetEventType() == wxEVT_KEY_UP)
02108        {
02109               switch (evt.GetKeyCode())
02110               {
02111               case WXK_ALT:
02112                      {
02113                             altDown = false;
02114                      }
02115                      break;
02116               case WXK_CONTROL:
02117                      {
02118                             ctrlDown = false;
02119                      }
02120                      break;
02121               case WXK_SHIFT:
02122                      {
02123                             shiftDown = false;
02124                      }
02125                      break;
02126               }
02127        }
02128 }

void Navigation::NavigationStyleDeltaViewSpecific::mouseStyle ( wxMouseEvent &  evt  )  [virtual]

DeltaView mouse style.

Implements NavigationStyleInterface.

Definition at line 2130 of file navigation.cpp.

02131 {
02132        NODE_ID cameraID = navigation->getCameraID();
02133        Scene * scene = navigation->GetSceneMgr()->GetScene(navigation->getSceneID());
02134        const SceneNode * camNode = scene->GetNode(cameraID);
02135        Camera * camera = (Camera *)(const_cast<SceneNode *>(camNode));
02136 
02137        navigation->mouseDelta = wxPoint(evt.GetPosition().x - navigation->lastPos.x, evt.GetPosition().y - navigation->lastPos.y);
02138 
02139        if (ctrlDown && !altDown && !shiftDown)
02140        {
02141               if (evt.Dragging())
02142               {
02143                      if (evt.LeftIsDown())
02144                      {
02145                             navigation->rotate(scene, camera, cameraID, evt.GetPosition(), navigation->mouseDelta, false, true, true);
02146                      }
02147                      else if (evt.MiddleIsDown())
02148                      {
02149                             navigation->pan(scene, camera, cameraID, navigation->mouseDelta, navigation->panspeed);
02150                      }
02151                      else if (evt.RightIsDown())
02152                      {
02153                             navigation->zoom(scene, camera, cameraID, -navigation->mouseDelta.y, navigation->zoomspeed);
02154                      }
02155               }
02156        }
02157 
02158        if (shiftDown && !ctrlDown && !altDown)
02159        {
02160               if (evt.RightIsDown())
02161               {
02162                      navigation->pickScenePivot(scene, camera, cameraID, evt);
02163               }
02164        }
02165 
02166        if (ctrlDown && altDown && !shiftDown)
02167        {
02168               if (evt.Dragging())
02169               {
02170                      if (!axisAlignedRotateOperationStarted)
02171                      {
02172                             axisAlignedRotateOperationStarted = true;
02173                             if (abs(navigation->mouseDelta.x) > abs(navigation->mouseDelta.y))
02174                             {
02175                                    axisAlignedXaxis = true;
02176                             }
02177                             else
02178                             {
02179                                    axisAlignedXaxis = false;
02180                             }
02181                      }
02182 
02183                      wxPoint axisAlignedDelta = wxPoint(axisAlignedXaxis ? navigation->mouseDelta.x : 0, axisAlignedXaxis ? 0 : navigation->mouseDelta.y);
02184                      
02185                      if (evt.LeftIsDown())
02186                      {
02187                             navigation->rotate(scene, camera, cameraID, evt.GetPosition(), axisAlignedDelta, false, true, true);
02188                      }
02189                      if (evt.RightIsDown()) //DeltaView uses middle button, but this triggers the wxWidgets About window.
02190                      {
02191                             navigation->pan(scene, camera, cameraID, axisAlignedDelta, navigation->panspeed);
02192                      }
02193               }
02194               else
02195               {
02196                      axisAlignedRotateOperationStarted = false;
02197               }
02198        }
02199 
02200        if (ctrlDown && !altDown && shiftDown)
02201        {
02202               if (evt.Dragging() && evt.LeftIsDown())
02203               {
02204                      navigation->turnHead(scene, camera, cameraID, navigation->mouseDelta, true); 
02205               }
02206        }
02207 
02208        if (!ctrlDown && altDown && !shiftDown)
02209        {
02210               if (evt.RightIsDown())
02211               {
02212                      scene->Fit(cameraID);
02213               }
02214        }
02215 
02216        navigation->lastPos = evt.GetPosition();
02217 }


Member Data Documentation

C++ does not allow the embedded class to see its surrounding class, so we need this pointer.

Definition at line 351 of file navigation.h.

Is the alt key being held down?

Definition at line 354 of file navigation.h.

Is the ctrl key being held down?

Definition at line 356 of file navigation.h.

Is the shift key being held down?

Definition at line 358 of file navigation.h.

Are we rotating around an axis?

Definition at line 360 of file navigation.h.

True if we rotate around the x axis, false if we rotate around the y axis.

Definition at line 362 of file navigation.h.


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

Generated on Tue Mar 10 14:41:48 2009 for VRUT by  doxygen 1.5.5