#include <navigation.h>

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 | |
| Navigation * | navigation |
| C++ does not allow the embedded class to see its surrounding class, so we need this pointer. | |
Definition at line 446 of file navigation.h.
| 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 }
| void VRUT::Navigation::NavigationStyleVD2Specific::getAndFixButtonValues | ( | const wxCommandEvent & | evt | ) | [inline, virtual] |
| void VRUT::Navigation::NavigationStyleVD2Specific::registerButtons | ( | ) | [inline, virtual] |
| bool VRUT::Navigation::NavigationStyleVD2Specific::isAnyButtonSelected | ( | ) | const [inline] |
| void VRUT::Navigation::NavigationStyleVD2Specific::buttonEvent | ( | ) | [inline, virtual] |
| 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.
| 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 }
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.
1.5.5