OpenCOVER
coVR3DGizmo.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_GIZMO
9#define _CO_VR_3D_GIZMO
10
11#include <memory>
12#include <util/coExport.h>
14
15namespace opencover
16{
17class coVR3DGizmoType;
18
19class PLUGIN_UTILEXPORT coVR3DGizmo
20{
21public:
22 enum class GIZMO_TYPE{ROTATE, TRANSLATE, SCALE};
23 coVR3DGizmo(GIZMO_TYPE gizmptype, bool translate, bool rotate, bool scale, osg::Matrix m, float s, vrui::coInteraction::InteractionType type, const char *iconName, const char *interactorName, vrui::coInteraction::InteractionPriority priority);
25
26 GIZMO_TYPE getType(){return _type;}
28 void setGizmoTypes(bool translate, bool rotate, bool scale);
29
30private:
31 GIZMO_TYPE _type; // current type
32 std::unique_ptr<coVR3DGizmoType> _gizmo;
33 bool _translate;
34 bool _rotate;
35 bool _scale;
36
37public: //functions which are forewarded to gizmotype
38 void preFrame(){_gizmo->preFrame();}
39 void startInteraction(){_gizmo->startInteraction();}
40 void stopInteraction(){_gizmo->stopInteraction();}
41 void doInteraction(){_gizmo->doInteraction();}
42 bool wasStarted(){return _gizmo->wasStarted();}
43 bool wasStopped(){return _gizmo->wasStopped();}
44 bool isRunning(){return _gizmo->isRunning();}
45 void resetState(){_gizmo->resetState();}
46 vrui::coInteraction::InteractionState getState(){return _gizmo->getState();}
47 bool wasHit(){return _gizmo->wasHit();}
48 int isIntersected(){return _gizmo->isIntersected();}
49 void show(){_gizmo->show();}
50 void hide(){_gizmo->hide();}
51 void enableIntersection(){_gizmo->enableIntersection();}
52 void disableIntersection(){_gizmo->disableIntersection();}
53 bool isInitializedThroughSharedState(){return _gizmo->isInitializedThroughSharedState();}
54 void updateTransform(osg::Matrix m){_gizmo->updateTransform(m);}
55 osg::Vec3 getHitPos(){return _gizmo->getHitPos();}
56 //const osg::Matrix &getMatrix(){return _gizmo->getMatrix();} const
57 osg::Matrix getMatrix(){return _gizmo -> getMatrix();}
58 osg::Matrix getMoveMatrix_o()const{return _gizmo -> getMoveMatrix_o();}
59 osg::Matrix getMoveMatrix_w()const{return _gizmo -> getMoveMatrix_w();}
60
61};
62}
63#endif
Definition: ARToolKit.h:33
Definition: coVR3DGizmo.h:20
vrui::coInteraction::InteractionState getState()
Definition: coVR3DGizmo.h:46
bool wasHit()
Definition: coVR3DGizmo.h:47
osg::Vec3 getHitPos()
Definition: coVR3DGizmo.h:55
osg::Matrix getMoveMatrix_o() const
Definition: coVR3DGizmo.h:58
osg::Matrix getMoveMatrix_w() const
Definition: coVR3DGizmo.h:59
GIZMO_TYPE getType()
Definition: coVR3DGizmo.h:26
bool isRunning()
Definition: coVR3DGizmo.h:44
osg::Matrix getMatrix()
Definition: coVR3DGizmo.h:57
void updateTransform(osg::Matrix m)
Definition: coVR3DGizmo.h:54
void show()
Definition: coVR3DGizmo.h:49
void enableIntersection()
Definition: coVR3DGizmo.h:51
coVR3DGizmo(GIZMO_TYPE gizmptype, bool translate, bool rotate, bool scale, osg::Matrix m, float s, vrui::coInteraction::InteractionType type, const char *iconName, const char *interactorName, vrui::coInteraction::InteractionPriority priority)
bool isInitializedThroughSharedState()
Definition: coVR3DGizmo.h:53
bool wasStopped()
Definition: coVR3DGizmo.h:43
bool wasStarted()
Definition: coVR3DGizmo.h:42
void resetState()
Definition: coVR3DGizmo.h:45
void stopInteraction()
Definition: coVR3DGizmo.h:40
GIZMO_TYPE
Definition: coVR3DGizmo.h:22
int isIntersected()
Definition: coVR3DGizmo.h:48
void hide()
Definition: coVR3DGizmo.h:50
void disableIntersection()
Definition: coVR3DGizmo.h:52
void doInteraction()
Definition: coVR3DGizmo.h:41
void startInteraction()
Definition: coVR3DGizmo.h:39
void preFrame()
Definition: coVR3DGizmo.h:38
void setGizmoTypes(bool translate, bool rotate, bool scale)
InteractionState
Definition: coInteraction.h:23
InteractionType
Definition: coInteraction.h:45
InteractionPriority
Definition: coInteraction.h:34