OpenCOVER
coVR3DTransRotInteractor.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef _CO_VR_3D_TRANSROT_INTERACTOR_H
9#define _CO_VR_3D_TRANSROT_INTERACTOR_H
10
12#include <net/tokenbuffer_serializer.h>
14#include <net/tokenbuffer.h>
15namespace opencover
16{
17
19{
20
21private:
22 bool _rotateOnly = false, _translateOnly = false;
23 osg::Matrix _interMat_o, _oldHandMat;
24 osg::Matrix _invOldHandMat_o;
25 osg::Matrix _oldInteractorXformMat_o;
26
27 osg::Geometry *createLine(osg::Vec3 pos1, osg::Vec3 pos2, osg::Vec4 c);
28 osg::ref_ptr<osg::MatrixTransform> axisTransform;
29 osg::ref_ptr<osg::MatrixTransform> xrTransform;
30 osg::ref_ptr<osg::MatrixTransform> yrTransform;
31 osg::ref_ptr<osg::MatrixTransform> zrTransform;
32 osg::ref_ptr<osg::MatrixTransform> xlTransform;
33 osg::ref_ptr<osg::MatrixTransform> ylTransform;
34 osg::ref_ptr<osg::MatrixTransform> zlTransform;
35 osg::ref_ptr<osg::Geode> sphereGeode;
36 osg::ref_ptr<osg::Geode> rotateGeode;
37 osg::ref_ptr<osg::Geode> translateGeode;
38
39 float _distance = 0;
40 osg::Vec3 _diff;
41
42protected:
43 virtual void createGeometry() override;
44 void updateSharedState() override;
46public:
47 coVR3DTransRotInteractor(osg::Matrix m, float s, coInteraction::InteractionType type, const char *iconName, const char *interactorName, coInteraction::InteractionPriority priority);
48
49 // delete scene graph
51
52 // start the interaction (grab pointer, set selected hl, store dcsmat)
53 virtual void startInteraction() override;
54 virtual void doInteraction() override;
55
56 virtual void updateTransform(osg::Matrix m);
57
58 const osg::Matrix &getMatrix() const
59 {
60 return _interMat_o;
61 }
62 void setShared(bool state) override;
63};
64}
65#endif
Definition: ARToolKit.h:33
Definition: coVRIntersectionInteractor.h:56
Definition: coVR3DTransRotInteractor.h:19
void updateSharedState() override
reimplement in derived class for updating value of m_sharedState
virtual void updateTransform(osg::Matrix m)
coVR3DTransRotInteractor(osg::Matrix m, float s, coInteraction::InteractionType type, const char *iconName, const char *interactorName, coInteraction::InteractionPriority priority)
const osg::Matrix & getMatrix() const
Definition: coVR3DTransRotInteractor.h:58
virtual void startInteraction() override
virtual void doInteraction() override
vrb::SharedState< osg::Matrix > SharedMatrix
Definition: coVR3DTransRotInteractor.h:45
virtual void createGeometry() override
void setShared(bool state) override
make state shared among partners in a collaborative session