VRUT::Navigation::NavigationStyleVD2Specific Class Reference

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

#include <navigation.h>

Inheritance diagram for VRUT::Navigation::NavigationStyleVD2Specific:

NavigationStyleInterface

List of all members.

Public Member Functions

 NavigationStyleVD2Specific (const MODULE_ID &_id, const wxString &_name, Navigation *navigation)
void getAndFixButtonValues (const wxCommandEvent &evt)
void registerButtons ()
bool isAnyButtonSelected () const
void buttonEvent ()
void updateParams (const wxCommandEvent &evt)
 Updates the module specific registered parameters.
void keyStyle (wxKeyEvent &evt)
 VD2 key style.
void mouseStyle (wxMouseEvent &evt)
 VD2 mouse style.

Public Attributes

bool centerPickOperationStarted
 Are we picking a rotation center?

Private Attributes

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


Detailed Description

Type for VD2 specific variables needed for a proper emulation.

Definition at line 446 of file navigation.h.


Constructor & Destructor Documentation

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

Definition at line 2500 of file navigation.cpp.

02501 : NavigationStyleInterface(wxT("Virtual Design 2"))
02502 {
02503        this->navigation = navigation;
02504        centerPickOperationStarted = false;
02505 }


Member Function Documentation

void VRUT::Navigation::NavigationStyleVD2Specific::getAndFixButtonValues ( const wxCommandEvent &  evt  )  [inline, virtual]

Implements NavigationStyleInterface.

Definition at line 454 of file navigation.h.

00454 {}

void VRUT::Navigation::NavigationStyleVD2Specific::registerButtons (  )  [inline, virtual]

Implements NavigationStyleInterface.

Definition at line 455 of file navigation.h.

00455 {}

bool VRUT::Navigation::NavigationStyleVD2Specific::isAnyButtonSelected (  )  const [inline]

Definition at line 456 of file navigation.h.

00456 {};

void VRUT::Navigation::NavigationStyleVD2Specific::buttonEvent (  )  [inline, virtual]

Implements NavigationStyleInterface.

Definition at line 457 of file navigation.h.

00457 {}

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

Updates the module specific registered parameters.

Implements NavigationStyleInterface.

Definition at line 459 of file navigation.h.

00459 {}

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

VD2 key style.

Implements NavigationStyleInterface.

Definition at line 2507 of file navigation.cpp.

02508 {
02509        if (int(navigation->windowID) == evt.GetId() && evt.GetEventType() == wxEVT_KEY_UP)
02510        {
02511               if (evt.GetUnicodeKey() == wxChar(L'V'))
02512               {
02513                      LOG(wxT("Pick the new pivot"));
02514                      centerPickOperationStarted = true;
02515               }
02516 
02517               switch (evt.GetKeyCode())
02518               {
02519               case WXK_SPACE:
02520                      {
02521                             wxCommandEvent fsEvt = Event::GET_EVT_RENDER_FULLSCREEN_TOGGLE(navigation->windowID);
02522                             navigation->PostToKernel(fsEvt);
02523                      }
02524                      break;
02525               case WXK_ESCAPE:
02526                      {
02527                             wxCommandEvent fsEvt = Event::GET_EVT_RENDER_FULLSCREEN_SET(navigation->windowID, false);
02528                             navigation->PostToKernel(fsEvt);
02529                      }
02530                      break;
02531               }
02532        }
02533 }

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

VD2 mouse style.

Implements NavigationStyleInterface.

Definition at line 2535 of file navigation.cpp.

02536 {
02537        NODE_ID cameraID = navigation->getCameraID();
02538        Scene * scene = navigation->GetSceneMgr()->GetScene(navigation->getSceneID());
02539        const SceneNode * camNode = scene->GetNode(cameraID);
02540        Camera * camera = (Camera *)(const_cast<SceneNode *>(camNode));
02541 
02542        if (evt.LeftDClick() && !evt.Moving())
02543        {
02544               navigation->select(scene, camera, evt);
02545        }
02546 
02547        if (centerPickOperationStarted && evt.LeftIsDown())
02548        {
02549               navigation->pickScenePivot(scene, camera, cameraID, evt);
02550               navigation->translateCameraCenterToSelection(scene, camera, cameraID, evt);
02551               centerPickOperationStarted = false;
02552        }
02553 
02554        navigation->mouseDelta = wxPoint(evt.GetPosition().x - navigation->lastPos.x, evt.GetPosition().y - navigation->lastPos.y);
02555 
02556        PLANE p;
02557        p = p.FromPointNorm(camera->GetWorldTransMatrix()->ExtractTranslation(), camera->GetView().Normalize());
02558        float speedModifier = fabs(p.DotCoord(navigation->scenePivot) * 0.01f); //If we are getting near to the scene pivot it get smaller
02559 
02560        if (evt.Dragging() && evt.MiddleIsDown())
02561        {
02562               navigation->zoom(scene, camera, cameraID, navigation->mouseDelta.y, navigation->zoomspeed * speedModifier);
02563        }
02564        else if (evt.Dragging() && evt.RightIsDown())
02565        {
02566               navigation->pan(scene, camera, cameraID, navigation->mouseDelta, navigation->panspeed * speedModifier);
02567        }
02568        else if (evt.Dragging() && evt.LeftIsDown())
02569        {
02570               navigation->rotate(scene, camera, cameraID, evt.GetPosition(), navigation->mouseDelta, false, false, true);
02571        }
02572        else
02573               evt.Skip();
02574 
02575        navigation->lastPos = evt.GetPosition();
02576 }


Member Data Documentation

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

Definition at line 449 of file navigation.h.

Are we picking a rotation center?

Definition at line 452 of file navigation.h.


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

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