OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coVR3DRotCenterInteractor.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_ROT_CENTER_INTERACTOR_H
9 #define _CO_VR_3D_ROT_CENTER_INTERACTOR_H
10 
12 #include <osg/Matrix>
13 #include <osg/Vec3>
14 // selectable cone which rotates according to hand around its origin
15 // it can be places (not interactive) with pos
16 // the cone is modeled in the origin (along z axis)
17 
18 namespace opencover
19 {
20 
22 {
23 private:
24  osg::Vec3 p_;
25  osg::Matrix m_, invOldHandMat_, startMat_, frameDiffMat_;
26  void createGeometry();
27 
28 public:
29  // mat: 4x4 matrix, but it's position is ignored and replaced by pos
30  // pos: position in object coordinates
31  coVR3DRotCenterInteractor(osg::Matrix mat, osg::Vec3 pos, float s, coInteraction::InteractionType type, const char *iconName, const char *interactorName, coInteraction::InteractionPriority priority = Medium);
32 
33  virtual ~coVR3DRotCenterInteractor();
34 
35  virtual void doInteraction();
36  virtual void startInteraction();
37  virtual void stopInteraction();
38 
39  // set a new position
40  void updateTransform(osg::Matrix mat, osg::Vec3 pos);
41  void updatePosition(osg::Vec3 pos);
42 
43  // return the current position
44  osg::Matrix getMatrix()
45  {
46  return m_;
47  }
48  osg::Vec3 getPosition()
49  {
50  return p_;
51  }
52  osg::Matrix getFrameDiffMatrix()
53  {
54  return frameDiffMat_;
55  }
56 };
57 
58 }
59 #endif
osg::Matrix getFrameDiffMatrix()
Definition: coVR3DRotCenterInteractor.h:52
osg::Vec3 getPosition()
Definition: coVR3DRotCenterInteractor.h:48
osg::Matrix getMatrix()
Definition: coVR3DRotCenterInteractor.h:44
Definition: coVRIntersectionInteractor.h:55
Definition: coVR3DRotCenterInteractor.h:21