8#ifndef COVR_NAVIGATION_MANAGER_H
9#define COVR_NAVIGATION_MANAGER_H
24#include <util/common.h>
40#include <osg/MatrixTransform>
41#include <osg/Geometry>
45class coNavInteraction;
46class coMouseButtonInteraction;
47class coRelativeInputInteraction;
48class coButtonMenuItem;
63 ui::Button* navMenuButton =
nullptr;
131 return navMode != NavNone;
139 return isViewerPosRotation;
143 isViewerPosRotation = b;
215 float getPhi(
float relCoord1,
float width1);
217 float getPhiZHori(
float x2,
float x1,
float y2,
float widthY,
float widthX);
218 float getPhiZVerti(
float y2,
float y1,
float x2,
float widthX,
float widthY);
219 void makeRotate(
float heading,
float pitch,
float roll,
int headingBool,
int pitchBool,
int rollBool);
223 rotationPoint =
false;
227 rotationAxis =
false;
231 return rotationPoint;
246 guiTranslateFactor = f;
254 int mouseNavButtonRotate, mouseNavButtonScale, mouseNavButtonTranslate;
256 double menuButtonStartTime;
257 double menuButtonQuitInterval;
260 bool ignoreCollision;
263 std::list<coVRNavigationProvider*> navigationProviders;
267 bool shiftEnabled, shiftMouseNav;
268 bool isViewerPosRotation;
271 osg::Matrix invBaseMatrix;
272 osg::Matrix oldInvBaseMatrix;
273 osg::Node *oldFloorNode =
nullptr;
274 osg::Matrix oldFloorMatrix;
275 osg::NodePath oldNodePath;
278 float currentVelocity;
280 osg::Matrix old_mat, old_dcs_mat;
281 osg::Matrix old_xform_mat;
283 osg::Vec3 startHandPos;
284 osg::Vec3 startHandDir;
285 osg::Vec3 handPos, oldHandPos;
286 osg::Vec3 handDir, oldHandDir;
287 osg::Vec3 transformVec;
288 osg::Vec3 rotationVec;
290 bool rotationPointVisible;
292 float guiTranslateFactor;
294 float actScaleFactor;
296 float x0, y0, relx0, rely0;
297 float oldRotx, newRotx, oldRoty, newRoty;
298 float modifiedVSize, modifiedHSize, yValViewer, yValObject;
299 float transXRel, transYRel, transZRel;
300 float originX, originY;
304 osg::Node *oldSelectedNode_;
306 float oldDcsScaleFactor;
308 osg::Vec3 currentLeftPos;
309 osg::Vec3 currentRightPos;
310 osg::Vec3 oldLeftPos;
311 osg::Vec3 oldRightPos;
314 int jsZeroPosX, jsZeroPosY, jsOffsetX, jsOffsetY, jsXmax, jsYmax, jsXmin, jsYmin;
317 bool visensoJoystick;
343 bool m_restrict =
false;
346 bool animationWasRunning=
false;
349 osg::Node *oldShowNamesNode_ =
nullptr;
353 ui::Menu *navMenu_ =
nullptr;
354 ui::Action *m_viewAll=
nullptr, *m_resetView=
nullptr;
355 ui::Group *navModes_ =
nullptr;
356 ui::ButtonGroup *navGroup_ =
nullptr;
357 ui::Button *noNavButton_=
nullptr;
358 ui::Button *xformButton_=
nullptr, *scaleButton_=
nullptr, *flyButton_=
nullptr, *walkButton_=
nullptr, *driveButton_=
nullptr;
359 ui::Button *xformRotButton_=
nullptr, *xformTransButton_=
nullptr, *selectButton_=
nullptr, *showNameButton_=
nullptr;
360 ui::Button *selectInteractButton_=
nullptr;
361 ui::Button *measureButton_=
nullptr, *traverseInteractorButton_=
nullptr;
362 ui::Button *collisionButton_=
nullptr, *snapButton_=
nullptr;
363 ui::Slider *driveSpeedSlider_=
nullptr;
364 ui::Action *scaleUpAction_=
nullptr, *scaleDownAction_=
nullptr;
365 ui::Slider *scaleSlider_=
nullptr;
366 ui::Action *centerViewButton =
nullptr;
367 ui::Action *printObjectTransform =
nullptr;
368 osg::Vec3 rotPointVec;
369 osg::ref_ptr<osg::MatrixTransform> rotPoint;
371 std::vector<coMeasurement *> measurements;
373 void initInteractionDevice();
375 void initHandDeviceGeometry();
382 osg::Vec3 getCenter()
const;
384 osg::Vec3 mouseNavCenter;
double OSGVRUIEXPORT mod(double a, double b)
Definition: ARToolKit.h:33
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coVRLabel.h:52
Definition: coVRNavigationManager.h:58
virtual void setEnabled(bool enabled)
std::string getName()
Definition: coVRNavigationManager.h:64
coVRNavigationProvider(const std::string name, coVRPlugin *plugin)
bool isEnabled()
Definition: coVRNavigationManager.h:66
coVRPlugin * plugin
Definition: coVRNavigationManager.h:62
int ID
Definition: coVRNavigationManager.h:66
virtual ~coVRNavigationProvider()
Definition: coVRNavigationManager.h:74
bool mouseNav()
Definition: coVRNavigationManager.h:133
float snappingDegrees() const
bool getRotationAxisAcitve()
Definition: coVRNavigationManager.h:233
NavMode
Definition: coVRNavigationManager.h:80
@ XForm
Definition: coVRNavigationManager.h:83
@ Measure
Definition: coVRNavigationManager.h:93
@ Glide
Definition: coVRNavigationManager.h:86
@ Fly
Definition: coVRNavigationManager.h:85
@ Walk
Definition: coVRNavigationManager.h:87
@ TraverseInteractors
Definition: coVRNavigationManager.h:91
@ Menu
Definition: coVRNavigationManager.h:92
@ XFormRotate
Definition: coVRNavigationManager.h:89
@ SelectInteract
Definition: coVRNavigationManager.h:95
@ ShowName
Definition: coVRNavigationManager.h:88
@ Select
Definition: coVRNavigationManager.h:94
@ NavNone
Definition: coVRNavigationManager.h:82
@ Scale
Definition: coVRNavigationManager.h:84
@ XFormTranslate
Definition: coVRNavigationManager.h:90
void enableDegreeSnapping(bool enable, float degree)
void toggleInteractors(bool state)
void processHotKeys(int keymask)
osg::Vec3 getRotationPoint()
Definition: coVRNavigationManager.h:239
void toggleShowName(bool state)
bool getCollision()
Definition: coVRNavigationManager.h:112
void setTranslateFactor(float f)
Definition: coVRNavigationManager.h:244
void enableSnapping(bool enable)
void registerNavigationProvider(coVRNavigationProvider *)
float AnalogX
Definition: coVRNavigationManager.h:99
void saveCurrentBaseMatAsOldBaseMat()
bool isNavigationEnabled()
Definition: coVRNavigationManager.h:129
bool avoidCollision(osg::Vec3 &glideVec)
void unregisterNavigationProvider(coVRNavigationProvider *)
void setRotationPoint(float x, float y, float z, float size=1.f)
void enableViewerPosRotation(bool b)
Definition: coVRNavigationManager.h:141
void doGuiTranslate(float x, float y, float z)
float getPhiZHori(float x2, float x1, float y2, float widthY, float widthX)
bool isViewerPosRotationEnabled()
Definition: coVRNavigationManager.h:137
void toggleCollide(bool state)
void updateHandMat(osg::Matrix &mat)
static coVRNavigationManager * instance()
void toggleSelectInteract(bool state)
osg::Vec3 applySpeedFactor(osg::Vec3 vec) const
double speedFactor(double delta) const
bool keyEvent(int type, int keySym, int mod)
void makeRotate(float heading, float pitch, float roll, int headingBool, int pitchBool, int rollBool)
void startSelectInteract()
float getPhi(float relCoord1, float width1)
void setNavMode(std::string navMode)
void highlightSelectedNode(osg::Node *selectedNode)
NavMode getMode()
Definition: coVRNavigationManager.h:124
void setRotationAxis(float x, float y, float z)
void disableRotationAxis()
Definition: coVRNavigationManager.h:225
void setDriveSpeed(float speed)
void getHandWorldPosition(float *, float *, float *)
float getStepSize() const
void setRotationPointVisible(bool visible)
void stopSelectInteract(bool mouse)
void doGuiRotate(float x, float y, float z)
bool isDegreeSnapping() const
bool getRotationPointActive()
Definition: coVRNavigationManager.h:229
void setStepSize(float stepsize)
void doGuiScale(float scale)
ui::ButtonGroup * navGroup() const
float getPhiZVerti(float y2, float y1, float x2, float widthX, float widthY)
void disableRotationPoint()
Definition: coVRNavigationManager.h:221
void setMenuMode(bool state)
void setNavMode(NavMode mode, bool updateGroup=true)
make sure to clean up properly in the plugin's dtor
Definition: coVRPlugin.h:73
Definition: coButtonMenuItem.h:31
Definition: coMouseButtonInteraction.h:21
Definition: coNavInteraction.h:19
Definition: coRelativeInputInteraction.h:18
Definition: coRowMenu.h:37