#include <navigation.h>

Public Member Functions | |
| NavigationStyleCinema4DSpecific (const MODULE_ID &_id, const wxString &_name, Navigation *navigation) | |
| Constructor. | |
| void | selectionClick (wxMouseEvent &evt, Scene *scene, Camera *camera) |
| scenePivot selection | |
| void | getAndFixButtonValues (const wxCommandEvent &evt) |
| Update other Cinema4D buttons' value. | |
| void | updateParams (const wxCommandEvent &evt) |
| Updates the module specific registered parameters. | |
| void | registerButtons () |
| Register Cinema4D buttons into gui. | |
| void | buttonEvent () |
| Method for handling stateless buttons. | |
| void | keyStyle (wxKeyEvent &evt) |
| Cinema4D key style. | |
| void | mouseStyle (wxMouseEvent &evt) |
| Cinema4D mouse style. | |
Public Attributes | |
| bool | ctrlDown |
| Is the control key down? | |
| bool | wasDragging |
| Used to determine if the left button click should select an object. | |
| ParameterIdentificatorList | navigationButtonsInfo |
| List of paramIDs for Cinema4D navigation buttons. | |
| ParameterIdentificatorList::iterator | panButtonIter |
| Convenience iterator for the Cinema4D pan button. | |
| ParameterIdentificatorList::iterator | zoomButtonIter |
| Convenience iterator for the Cinema4D zoom button. | |
| ParameterIdentificatorList::iterator | rotateButtonIter |
| Convenience iterator for the Cinema4D rotate button. | |
Private Attributes | |
| Navigation * | navigation |
| C++ does not allow the embedded class to see its surrounding class, so we need this pointer. | |
Definition at line 263 of file navigation.h.
| Navigation::NavigationStyleCinema4DSpecific::NavigationStyleCinema4DSpecific | ( | const MODULE_ID & | _id, | |
| const wxString & | _name, | |||
| Navigation * | navigation | |||
| ) |
Constructor.
Definition at line 1639 of file navigation.cpp.
01640 : NavigationStyleInterface(wxT("Cinema4D")) 01641 { 01642 this->navigation = navigation; 01643 01644 panButtonIter = navigationButtonsInfo.insert(navigationButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("panCinema4D"), _id),1))); 01645 zoomButtonIter = navigationButtonsInfo.insert(navigationButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("zoomCinema4D"), _id),0))); 01646 rotateButtonIter = navigationButtonsInfo.insert(navigationButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("rotateCinema4D"), _id),0))); 01647 01648 ctrlDown = false; 01649 wasDragging = false; 01650 }
| void Navigation::NavigationStyleCinema4DSpecific::selectionClick | ( | wxMouseEvent & | evt, | |
| Scene * | scene, | |||
| Camera * | camera | |||
| ) |
scenePivot selection
Definition at line 1712 of file navigation.cpp.
01713 { 01714 if (evt.Dragging()) 01715 { 01716 wasDragging = true; 01717 } 01718 else if (evt.LeftUp() && !wasDragging) 01719 { 01720 navigation->select(scene, camera, evt); 01721 const SceneNode *node = scene->GetNode(navigation->selectedObject); 01722 if (node) 01723 { 01724 navigation->scenePivot = node->GetWorldTransMatrix()->ExtractTranslation(); 01725 } 01726 else 01727 { 01728 navigation->scenePivotWasSet = false; 01729 } 01730 } 01731 else if (evt.LeftUp() && wasDragging) 01732 { 01733 wasDragging = false; 01734 } 01735 }
| void Navigation::NavigationStyleCinema4DSpecific::getAndFixButtonValues | ( | const wxCommandEvent & | evt | ) | [virtual] |
Update other Cinema4D buttons' value.
Implements NavigationStyleInterface.
Definition at line 1652 of file navigation.cpp.
01653 { 01654 navigation->clearButtonValuesConditional(evt, navigationButtonsInfo); 01655 navigation->getAndFixButtonValues(evt, navigationButtonsInfo); 01656 }
| void VRUT::Navigation::NavigationStyleCinema4DSpecific::updateParams | ( | const wxCommandEvent & | evt | ) | [inline, virtual] |
Updates the module specific registered parameters.
Implements NavigationStyleInterface.
Definition at line 287 of file navigation.h.
| void Navigation::NavigationStyleCinema4DSpecific::registerButtons | ( | ) | [virtual] |
Register Cinema4D buttons into gui.
Implements NavigationStyleInterface.
Definition at line 1658 of file navigation.cpp.
01659 { 01660 navigation->registerButtonList(navigationButtonsInfo); 01661 }
| void Navigation::NavigationStyleCinema4DSpecific::buttonEvent | ( | ) | [virtual] |
Method for handling stateless buttons.
Implements NavigationStyleInterface.
Definition at line 1663 of file navigation.cpp.
| void Navigation::NavigationStyleCinema4DSpecific::keyStyle | ( | wxKeyEvent & | evt | ) | [virtual] |
Cinema4D key style.
Implements NavigationStyleInterface.
Definition at line 1668 of file navigation.cpp.
01669 { 01670 if (int(navigation->windowID) == evt.GetId() && evt.GetEventType() == wxEVT_KEY_DOWN) 01671 { 01672 switch (evt.GetKeyCode()) 01673 { 01674 case WXK_NUMPAD1: 01675 { 01676 navigation->clearButtonValues(navigationButtonsInfo); 01677 panButtonIter->paramValue = 1; 01678 } 01679 break; 01680 case WXK_NUMPAD2: 01681 { 01682 navigation->clearButtonValues(navigationButtonsInfo); 01683 zoomButtonIter->paramValue = 1; 01684 } 01685 break; 01686 case WXK_NUMPAD3: 01687 { 01688 navigation->clearButtonValues(navigationButtonsInfo); 01689 rotateButtonIter->paramValue = 1; 01690 } 01691 break; 01692 case WXK_CONTROL: 01693 { 01694 ctrlDown = true; 01695 } 01696 break; 01697 } 01698 } 01699 else if (int(navigation->windowID) == evt.GetId() && evt.GetEventType() == wxEVT_KEY_UP) 01700 { 01701 switch (evt.GetKeyCode()) 01702 { 01703 case WXK_CONTROL: 01704 { 01705 ctrlDown = false; 01706 } 01707 break; 01708 } 01709 } 01710 }
| void Navigation::NavigationStyleCinema4DSpecific::mouseStyle | ( | wxMouseEvent & | evt | ) | [virtual] |
Cinema4D mouse style.
Try to sync with kernel so no redundant param updates occur
Implements NavigationStyleInterface.
Definition at line 1737 of file navigation.cpp.
01738 { 01739 NODE_ID cameraID = navigation->getCameraID(); 01740 Scene * scene = navigation->GetSceneMgr()->GetScene(navigation->getSceneID()); 01741 const SceneNode * camNode = scene->GetNode(cameraID); 01742 Camera * camera = (Camera *)(const_cast<SceneNode *>(camNode)); 01743 01744 selectionClick(evt, scene, camera); 01745 01746 navigation->mouseDelta = wxPoint(evt.GetPosition().x - navigation->lastPos.x, evt.GetPosition().y - navigation->lastPos.y); 01747 01748 if (evt.GetEventType() == wxEVT_MOUSEWHEEL) 01749 { 01750 navigation->zoom(scene, camera, cameraID, -evt.GetWheelRotation(), navigation->zoomspeed); 01751 } 01752 01753 if (panButtonIter->paramValue) 01754 { 01755 if (evt.Dragging() && (evt.LeftIsDown() || evt.MiddleIsDown())) 01756 { 01757 navigation->pan(scene, camera, cameraID, navigation->mouseDelta, navigation->panspeed); 01758 } 01759 else if (evt.Dragging() && evt.RightIsDown()) 01760 { 01761 navigation->zoom(scene, camera, cameraID, -navigation->mouseDelta.x, navigation->zoomspeed); 01762 } 01763 } 01764 else if (zoomButtonIter->paramValue) 01765 { 01766 if (evt.Dragging() && (evt.LeftIsDown() || evt.MiddleIsDown())) 01767 { 01768 navigation->zoom(scene, camera, cameraID, -navigation->mouseDelta.x, navigation->zoomspeed); 01769 } 01770 else if (evt.Dragging() && evt.RightIsDown()) 01771 { 01772 navigation->fovChangeOperationStarted = true; 01773 01774 float previousFov = navigation->fov; 01775 navigation->fov -= navigation->mouseDelta.x; 01776 if (navigation->fov > 180.0f) 01777 navigation->fov = 180.0f; 01778 if (navigation->fov < 0.0f) 01779 navigation->fov = 0.0f; 01780 01781 wxCommandEvent camEvt = Event::GET_EVT_SCENE_CAM_PROJECTION_SET(navigation->getSceneID(), navigation->getCameraID(), 0, 0, navigation->nearPlane, navigation->farPlane, navigation->fov); 01782 navigation->PostToKernel(camEvt, true); 01784 if (previousFov != navigation->fov) 01785 navigation->WaitForEvent(Event::EVT_SCENE_CAM_PROJECTION_CHANGED, 100, int(navigation->getSceneID()), int(navigation->getCameraID())); 01786 } 01787 } 01788 else if (rotateButtonIter->paramValue) 01789 { 01790 if (!ctrlDown) 01791 { 01792 if (evt.Dragging() && (evt.LeftIsDown() || evt.MiddleIsDown())) 01793 { 01794 navigation->rotate(scene, camera, cameraID, evt.GetPosition(), navigation->mouseDelta, false, true, true); 01795 } 01796 else if (evt.Dragging() && evt.RightIsDown()) 01797 { 01798 navigation->roll(scene, camera, cameraID, -navigation->mouseDelta.x, navigation->rotspeed, true); 01799 } 01800 } 01801 else 01802 { 01803 if (evt.Dragging() && (evt.LeftIsDown() || evt.MiddleIsDown())) 01804 { 01805 navigation->turnHead(scene, camera, cameraID, navigation->mouseDelta, true); 01806 } 01807 else if (evt.Dragging() && evt.RightIsDown()) 01808 { 01809 navigation->roll(scene, camera, cameraID, -navigation->mouseDelta.x, navigation->rotspeed, false); 01810 } 01811 } 01812 } 01813 else 01814 evt.Skip(); 01815 01816 //update the fov param id only when the user releases the button 01817 if (navigation->fovChangeOperationStarted && !evt.RightIsDown()) 01818 { 01819 navigation->fovChangeOperationStarted = false; 01820 ReadLocker rLock(*camNode); 01821 wxCommandEvent ev1 = Event::GET_EVT_PARAM_SET_DO(navigation->fovParamID, wxString::Format(wxT("%g"), ((Camera *)camNode)->GetFOV())); 01822 navigation->PostToKernel(ev1); 01823 } 01824 01825 navigation->lastPos = evt.GetPosition(); 01826 }
C++ does not allow the embedded class to see its surrounding class, so we need this pointer.
Definition at line 266 of file navigation.h.
Used to determine if the left button click should select an object.
Definition at line 271 of file navigation.h.
| ParameterIdentificatorList::iterator VRUT::Navigation::NavigationStyleCinema4DSpecific::panButtonIter |
| ParameterIdentificatorList::iterator VRUT::Navigation::NavigationStyleCinema4DSpecific::zoomButtonIter |
| ParameterIdentificatorList::iterator VRUT::Navigation::NavigationStyleCinema4DSpecific::rotateButtonIter |
1.5.5