00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef COIN_SOVRMLDRAGSENSOR_H
00025 #define COIN_SOVRMLDRAGSENSOR_H
00026
00027 #include <Inventor/nodes/SoSubNode.h>
00028 #include <Inventor/VRMLnodes/SoVRMLSensor.h>
00029 #include <Inventor/fields/SoSFVec3f.h>
00030 #include <Inventor/SbVec2s.h>
00031 #include <Inventor/SbVec2f.h>
00032 #include <Inventor/SbMatrix.h>
00033 #include <Inventor/SbViewVolume.h>
00034
00035 class SbMatrix;
00036
00037 class COIN_DLL_API SoVRMLDragSensor : public SoVRMLSensor {
00038 typedef SoVRMLSensor inherited;
00039
00040 SO_NODE_ABSTRACT_HEADER(SoVRMLDragSensor);
00041
00042 public:
00043 SoSFVec3f trackPoint_changed;
00044 SoSFBool autoOffset;
00045
00046
00047 virtual void handleEvent(SoHandleEventAction * action);
00048 static void initClass(void);
00049
00050 protected:
00051
00052 virtual SbBool dragStart(void) = 0;
00053 virtual void drag(void) = 0;
00054 virtual void dragFinish(void) = 0;
00055
00056 SoVRMLDragSensor(void);
00057 virtual ~SoVRMLDragSensor();
00058
00059 const SbVec3f & getLocalStartingPoint(void) const;
00060 const SbMatrix & getLocalToWorldMatrix(void) const;
00061 const SbMatrix & getWorldToLocalMatrix(void) const;
00062 const SbViewVolume & getViewVolume(void) const;
00063 const SbVec2f & getNormalizedLocaterPosition(void) const;
00064
00065 private:
00066
00067 SbVec3f hitpt;
00068 SbMatrix obj2world;
00069 SbMatrix world2obj;
00070 SbVec2s mousepos;
00071 SbVec2f normpos;
00072 SbViewVolume viewvolume;
00073 };
00074
00075 #endif // ! COIN_SOVRMLDRAGSENSOR_H