VRUT::Navigation::NavigationStyleCortonaSpecific Class Reference

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

#include <navigation.h>

Inheritance diagram for VRUT::Navigation::NavigationStyleCortonaSpecific:

NavigationStyleInterface

List of all members.

Public Member Functions

 NavigationStyleCortonaSpecific (const MODULE_ID &_id, const wxString &_name, Navigation *navigation)
 Constructor.
void getAndFixButtonValues (const wxCommandEvent &evt)
 Update other Cortona buttons' value.
void registerButtons ()
 Register Cortona buttons into gui.
void updateParams (const wxCommandEvent &evt)
 Updates the module specific registered parameters.
void buttonEvent ()
 Method for handling stateless buttons.
void keyStyle (wxKeyEvent &evt)
 Cortona key style.
void mouseStyle (wxMouseEvent &evt)
 Cortona mouse style.
wxPoint getMouseDelta (const wxMouseEvent &evt) const
 Gets the difference between the current mouse coordinates and the mouseOperationOrigin coordinates.

Public Attributes

Parameter::ParameterIdentificator avatarHeightParamID
 Height of the avatar param identificator
ParameterIdentificatorList modeButtonsInfo
 List of paramIDs for Cortona mode buttons.
ParameterIdentificatorList walkButtonsInfo
 List of paramIDs for Cortona walk buttons.
ParameterIdentificatorList flyButtonsInfo
 List of paramIDs for Cortona fly buttons.
ParameterIdentificatorList studyButtonsInfo
 List of paramIDs for Cortona study buttons.
ParameterIdentificatorList otherButtonsInfo
 List of paramIDs for other Cortona buttons.
ParameterIdentificatorList::iterator walkButtonIter
 Convenience iterator for the Cortona walk button.
ParameterIdentificatorList::iterator flyButtonIter
 Convenience iterator for the Cortona fly button.
ParameterIdentificatorList::iterator studyButtonIter
 Convenience iterator for the Cortona study button.
ParameterIdentificatorList::iterator planWalkButtonIter
 Convenience iterator for the Cortona plan walk button.
ParameterIdentificatorList::iterator panWalkButtonIter
 Convenience iterator for the Cortona pan walk button.
ParameterIdentificatorList::iterator turnWalkButtonIter
 Convenience iterator for the Cortona turn walk button.
ParameterIdentificatorList::iterator planFlyButtonIter
 Convenience iterator for the Cortona plan fly button.
ParameterIdentificatorList::iterator panFlyButtonIter
 Convenience iterator for the Cortona pan fly button.
ParameterIdentificatorList::iterator turnFlyButtonIter
 Convenience iterator for the Cortona turn fly button.
ParameterIdentificatorList::iterator rollFlyButtonIter
 Convenience iterator for the Cortona roll fly button.
ParameterIdentificatorList::iterator planStudyButtonIter
 Convenience iterator for the Cortona plan study button.
ParameterIdentificatorList::iterator panStudyButtonIter
 Convenience iterator for the Cortona pan study button.
ParameterIdentificatorList::iterator turnStudyButtonIter
 Convenience iterator for the Cortona turn study button.
ParameterIdentificatorList::iterator rollStudyButtonIter
 Convenience iterator for the Cortona roll study button.
ParameterIdentificatorList::iterator fitAllInButtonIter
 Convenience iterator for the Cortona fit all in button.
ParameterIdentificatorList::iterator goToButtonIter
 Convenience iterator for the Cortona go to button.
ParameterIdentificatorList::iterator alignButtonIter
 Convenience iterator for the Cortona align button.
bool operationStarted
 True if the cortona navigation operation was started.
bool gotoOperationStarted
 True if the cortona goto operation was started.
bool altDown
 True if alt is down, false otherwise.
bool spaceDown
 True if space is down, false otherwise.
wxPoint mouseOperationOrigin
 Point in mouse coordinates where the operation started.
float speedCompensation
 Cortona delta coordinates are far bigger than the delta coords used by catia, so this variable accommodates this difference.
float avatarHeight
 Height of the avatar.
float maxStepHeight
 Maximum height of a step which the avatar is able to climb.

Private Attributes

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


Detailed Description

Type for Cortona specific variables needed for a proper emulation.

Definition at line 171 of file navigation.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 1430 of file navigation.cpp.

01431 : NavigationStyleInterface(wxT("Cortona")),
01432 avatarHeightParamID(_name, wxT("avatarHeightCortona"), _id)
01433 {
01434        this->navigation = navigation;
01435 
01436        avatarHeight = 10.0f;
01437        maxStepHeight = 5.0f;
01438        wxCommandEvent paramEvt = Event::GET_EVT_PARAM_SET_DO(avatarHeightParamID, wxString::Format(wxT("%g"),avatarHeight), true);
01439        navigation->PostToKernel(paramEvt);
01440 
01441        walkButtonIter = modeButtonsInfo.insert(modeButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("walkCortona"), _id),1)));
01442        flyButtonIter = modeButtonsInfo.insert(modeButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("flyCortona"), _id),0)));
01443        studyButtonIter = modeButtonsInfo.insert(modeButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("studyCortona"), _id),0)));
01444 
01445        planWalkButtonIter = walkButtonsInfo.insert(walkButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("planWalkCortona"), _id),1)));
01446        panWalkButtonIter = walkButtonsInfo.insert(walkButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("panWalkCortona"), _id),0)));
01447        turnWalkButtonIter = walkButtonsInfo.insert(walkButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("turnWalkCortona"), _id),0)));
01448 
01449        planFlyButtonIter = flyButtonsInfo.insert(flyButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("planFlyCortona"), _id),1)));
01450        panFlyButtonIter = flyButtonsInfo.insert(flyButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("panFlyCortona"), _id),0)));
01451        turnFlyButtonIter = flyButtonsInfo.insert(flyButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("turnFlyCortona"), _id),0)));
01452        rollFlyButtonIter = flyButtonsInfo.insert(flyButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("rollFlyCortona"), _id),0)));
01453 
01454        planStudyButtonIter = studyButtonsInfo.insert(studyButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("planStudyCortona"), _id),0)));
01455        panStudyButtonIter = studyButtonsInfo.insert(studyButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("panStudyCortona"), _id),0)));
01456        turnStudyButtonIter = studyButtonsInfo.insert(studyButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("turnStudyCortona"), _id),1)));
01457        rollStudyButtonIter = studyButtonsInfo.insert(studyButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("rollStudyCortona"), _id),0)));
01458 
01459        fitAllInButtonIter = otherButtonsInfo.insert(otherButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("fitAllInCortona"), _id),0)));
01460        goToButtonIter = otherButtonsInfo.insert(otherButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("goToCortona"), _id),0)));
01461        alignButtonIter = otherButtonsInfo.insert(otherButtonsInfo.begin(), ParameterIdentificatorList::value_type(NavigationOperationPair(Parameter::ParameterIdentificator(_name, wxT("alignCortona"), _id),0)));
01462 
01463        operationStarted = false;
01464        gotoOperationStarted = false;
01465        altDown = false;
01466        spaceDown = false;
01467        speedCompensation = 0.01f;
01468 
01469 }


Member Function Documentation

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

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

Register Cortona buttons into gui.

Implements NavigationStyleInterface.

Definition at line 1493 of file navigation.cpp.

01494 {
01495        navigation->registerTextControl(avatarHeightParamID, wxString::Format(wxT("%g"), avatarHeight));
01496 
01497        navigation->registerButtonList(modeButtonsInfo);
01498 
01499        if (walkButtonIter->paramValue)
01500        {
01501               navigation->registerButtonList(walkButtonsInfo);
01502        }
01503        else if (flyButtonIter->paramValue)
01504        {
01505               navigation->registerButtonList(flyButtonsInfo);
01506        }
01507        else if (studyButtonIter->paramValue)
01508        {
01509               navigation->registerButtonList(studyButtonsInfo);
01510        }
01511        navigation->registerButtonList(otherButtonsInfo);
01512 }

void Navigation::NavigationStyleCortonaSpecific::updateParams ( const wxCommandEvent &  evt  )  [virtual]

Updates the module specific registered parameters.

Implements NavigationStyleInterface.

Definition at line 1488 of file navigation.cpp.

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

Method for handling stateless buttons.

Implements NavigationStyleInterface.

Definition at line 1514 of file navigation.cpp.

01515 {
01516        if (fitAllInButtonIter->paramValue)
01517        {
01518               NODE_ID cameraID = navigation->getCameraID();
01519               Scene * scene = navigation->GetSceneMgr()->GetScene(navigation->getSceneID());
01520               scene->Fit(cameraID);
01521               fitAllInButtonIter->paramValue = 0;
01522        }
01523        if (goToButtonIter->paramValue)
01524        {
01525               gotoOperationStarted = true;
01526               goToButtonIter->paramValue = 0;
01527        }
01528        if (alignButtonIter->paramValue)
01529        {
01530               navigation->removePitch();
01531               alignButtonIter->paramValue = 0;
01532        }
01533 }

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

Cortona key style.

Implements NavigationStyleInterface.

Definition at line 1542 of file navigation.cpp.

01543 {
01544        if (int(navigation->windowID) == evt.GetId() && evt.GetEventType() == wxEVT_KEY_DOWN)
01545        {
01546               switch (evt.GetKeyCode())
01547               {
01548               case WXK_ALT: //Alt key is used in cortona, but in vrut, the alt key accesses the applicaction menu which causes interruption in navigation
01549                      {
01550                             altDown = true;
01551                      }
01552                      break;
01553               case WXK_SPACE:
01554                      {
01555                             spaceDown = true;
01556                      }
01557                      break;
01558               }
01559        }
01560        else if (int(navigation->windowID) == evt.GetId() && evt.GetEventType() == wxEVT_KEY_UP)
01561        {
01562               int cortonaWalk = walkButtonIter->paramValue;
01563               int cortonaFly = flyButtonIter->paramValue;
01564               int cortonaStudy = studyButtonIter->paramValue;
01565 
01566               switch (evt.GetKeyCode())
01567               {
01568               case WXK_ALT:
01569                      altDown = false;
01570                      break;
01571               case WXK_SPACE:
01572                      spaceDown = false;
01573                      break;
01574               }
01575 
01576               switch (evt.GetKeyCode())
01577               {
01578               case WXK_ALT:
01579               case WXK_SPACE:
01580                      if (cortonaWalk)
01581                      {
01582                             navigation->clearButtonValues(walkButtonsInfo);
01583                             planWalkButtonIter->paramValue = 1;
01584                      }
01585                      else if (cortonaFly)
01586                      {
01587                             navigation->clearButtonValues(flyButtonsInfo);
01588                             planFlyButtonIter->paramValue = 1;
01589                      }
01590                      else if (cortonaStudy)
01591                      {
01592                             navigation->clearButtonValues(studyButtonsInfo);
01593                             turnStudyButtonIter->paramValue = 1;
01594                      }
01595                      break;
01596               }
01597        }
01598 }

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

Cortona mouse style.

Implements NavigationStyleInterface.

Definition at line 1600 of file navigation.cpp.

01601 {
01602        NODE_ID cameraID = navigation->getCameraID();
01603        Scene * scene = navigation->GetSceneMgr()->GetScene(navigation->getSceneID());
01604        const SceneNode * camNode = scene->GetNode(cameraID);
01605        Camera * camera = (Camera *)(const_cast<SceneNode *>(camNode));
01606 
01607        navigation->mouseDelta = getMouseDelta(evt);
01608 
01609        if (evt.LeftIsDown())
01610        {
01611               if (gotoOperationStarted)
01612               {
01613                      navigation->translateCameraCenterToSelection(scene, camera, cameraID, evt);
01614                      gotoOperationStarted = false;
01615               }
01616               if (!operationStarted)
01617               {
01618                      mouseOperationOrigin = evt.GetPosition();
01619                      navigation->mouseDelta = getMouseDelta(evt);
01620                      navigation->lowMouseEventTimeout();
01621                      operationStarted = true;
01622               }
01623        }
01624        else
01625        {
01626               if (operationStarted)
01627               {
01628                      operationStarted = false;
01629                      navigation->highMouseEventTimeout();
01630               }
01631               evt.Skip();
01632        }
01633 }

wxPoint Navigation::NavigationStyleCortonaSpecific::getMouseDelta ( const wxMouseEvent &  evt  )  const

Gets the difference between the current mouse coordinates and the mouseOperationOrigin coordinates.

Definition at line 1535 of file navigation.cpp.

01536 {
01537        return wxPoint(
01538               evt.GetPosition().x - mouseOperationOrigin.x,
01539               evt.GetPosition().y - mouseOperationOrigin.y);
01540 }


Member Data Documentation

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

Definition at line 174 of file navigation.h.

Height of the avatar param identificator

Definition at line 177 of file navigation.h.

List of paramIDs for Cortona mode buttons.

Definition at line 179 of file navigation.h.

List of paramIDs for Cortona walk buttons.

Definition at line 181 of file navigation.h.

List of paramIDs for Cortona fly buttons.

Definition at line 183 of file navigation.h.

List of paramIDs for Cortona study buttons.

Definition at line 185 of file navigation.h.

List of paramIDs for other Cortona buttons.

Definition at line 187 of file navigation.h.

Convenience iterator for the Cortona walk button.

Definition at line 190 of file navigation.h.

Convenience iterator for the Cortona fly button.

Definition at line 192 of file navigation.h.

Convenience iterator for the Cortona study button.

Definition at line 194 of file navigation.h.

Convenience iterator for the Cortona plan walk button.

Definition at line 197 of file navigation.h.

Convenience iterator for the Cortona pan walk button.

Definition at line 199 of file navigation.h.

Convenience iterator for the Cortona turn walk button.

Definition at line 201 of file navigation.h.

Convenience iterator for the Cortona plan fly button.

Definition at line 204 of file navigation.h.

Convenience iterator for the Cortona pan fly button.

Definition at line 206 of file navigation.h.

Convenience iterator for the Cortona turn fly button.

Definition at line 208 of file navigation.h.

Convenience iterator for the Cortona roll fly button.

Definition at line 210 of file navigation.h.

Convenience iterator for the Cortona plan study button.

Definition at line 213 of file navigation.h.

Convenience iterator for the Cortona pan study button.

Definition at line 215 of file navigation.h.

Convenience iterator for the Cortona turn study button.

Definition at line 217 of file navigation.h.

Convenience iterator for the Cortona roll study button.

Definition at line 219 of file navigation.h.

Convenience iterator for the Cortona fit all in button.

Definition at line 222 of file navigation.h.

Convenience iterator for the Cortona go to button.

Definition at line 224 of file navigation.h.

Convenience iterator for the Cortona align button.

Definition at line 226 of file navigation.h.

True if the cortona navigation operation was started.

Definition at line 229 of file navigation.h.

True if the cortona goto operation was started.

Definition at line 231 of file navigation.h.

True if alt is down, false otherwise.

Definition at line 233 of file navigation.h.

True if space is down, false otherwise.

Definition at line 235 of file navigation.h.

Point in mouse coordinates where the operation started.

Definition at line 237 of file navigation.h.

Cortona delta coordinates are far bigger than the delta coords used by catia, so this variable accommodates this difference.

Definition at line 239 of file navigation.h.

Height of the avatar.

Definition at line 241 of file navigation.h.

Maximum height of a step which the avatar is able to climb.

Definition at line 243 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