OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coVR2DTransInteractor.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_2D_TRANS_INTERACTOR_H
9 #define _CO_VR_2D_TRANS_INTERACTOR_H
10 
11 #include <osg/Vec3>
12 #include <osg/MatrixTransform>
14 #include "coPlane.h"
15 
16 namespace opencover
17 {
18 
19 // selectable cylinder which can be positioned on a plane
20 // cylinder and plane are positioned in object coordinates
21 
22 class PLUGIN_UTILEXPORT coVR2DTransInteractor : public coVRIntersectionInteractor, public coPlane
23 {
24 
25 private:
26  osg::Vec3 _diff;
27 
28 protected:
29  virtual void createGeometry();
30 
31 public:
32  // position and normal on object coordinates
33  // size in world coordinates (mm)
34  coVR2DTransInteractor(osg::Vec3 pos, osg::Vec3 normal, float size, coInteraction::InteractionType type, const char *iconName, const char *interactorName, enum coInteraction::InteractionPriority priority);
35 
36  virtual ~coVR2DTransInteractor();
37 
38  void startInteraction();
39 
40  void doInteraction();
41 
42  // stop the interaction
43  // implemented in base class void stopInteraction();
44 
45  // set a new position,normal
46  void updateTransform(osg::Vec3 pos, osg::Vec3 normal);
47 
48  osg::Vec3 getPosition()
49  {
50  return moveTransform->getMatrix().getTrans();
51  };
52 };
53 }
54 #endif
Definition: coVR2DTransInteractor.h:22
Definition: coPlane.h:17
Definition: coVRIntersectionInteractor.h:55
osg::Vec3 getPosition()
Definition: coVR2DTransInteractor.h:48