00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef COIN_SOTRACKBALLDRAGGER_H
00021 #define COIN_SOTRACKBALLDRAGGER_H
00022
00023 #include <Inventor/draggers/SoDragger.h>
00024 #include <Inventor/fields/SoSFRotation.h>
00025 #include <Inventor/fields/SoSFVec3f.h>
00026 #include <Inventor/SbVec2f.h>
00027 #include <Inventor/SbTime.h>
00028
00029 class SoSensor;
00030 class SoFieldSensor;
00031 class SbSphereProjector;
00032 class SbCylinderProjector;
00033 class SbLineProjector;
00034 class SoTimerSensor;
00035
00036 class COIN_DLL_API SoTrackballDragger : public SoDragger {
00037 typedef SoDragger inherited;
00038
00039 SO_KIT_HEADER(SoTrackballDragger);
00040
00041 SO_KIT_CATALOG_ENTRY_HEADER(XRotator);
00042 SO_KIT_CATALOG_ENTRY_HEADER(XRotatorActive);
00043 SO_KIT_CATALOG_ENTRY_HEADER(XRotatorSwitch);
00044 SO_KIT_CATALOG_ENTRY_HEADER(YRotator);
00045 SO_KIT_CATALOG_ENTRY_HEADER(YRotatorActive);
00046 SO_KIT_CATALOG_ENTRY_HEADER(YRotatorSwitch);
00047 SO_KIT_CATALOG_ENTRY_HEADER(ZRotator);
00048 SO_KIT_CATALOG_ENTRY_HEADER(ZRotatorActive);
00049 SO_KIT_CATALOG_ENTRY_HEADER(ZRotatorSwitch);
00050 SO_KIT_CATALOG_ENTRY_HEADER(antiSquish);
00051 SO_KIT_CATALOG_ENTRY_HEADER(rotator);
00052 SO_KIT_CATALOG_ENTRY_HEADER(rotatorActive);
00053 SO_KIT_CATALOG_ENTRY_HEADER(rotatorSwitch);
00054 SO_KIT_CATALOG_ENTRY_HEADER(surroundScale);
00055 SO_KIT_CATALOG_ENTRY_HEADER(userAxis);
00056 SO_KIT_CATALOG_ENTRY_HEADER(userAxisActive);
00057 SO_KIT_CATALOG_ENTRY_HEADER(userAxisRotation);
00058 SO_KIT_CATALOG_ENTRY_HEADER(userAxisSwitch);
00059 SO_KIT_CATALOG_ENTRY_HEADER(userRotator);
00060 SO_KIT_CATALOG_ENTRY_HEADER(userRotatorActive);
00061 SO_KIT_CATALOG_ENTRY_HEADER(userRotatorSwitch);
00062
00063
00064 public:
00065 static void initClass(void);
00066 SoTrackballDragger(void);
00067
00068 SoSFRotation rotation;
00069 SoSFVec3f scaleFactor;
00070
00071 SbBool isAnimationEnabled(void);
00072 void setAnimationEnabled(SbBool newval);
00073
00074 protected:
00075 ~SoTrackballDragger();
00076 virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
00077 virtual void setDefaultOnNonWritingFields(void);
00078
00079 void dragStart(void);
00080 void drag(void);
00081 void dragFinish(void);
00082 void setAllPartsActive(SbBool onoroff);
00083
00084 static void startCB(void * f, SoDragger * d);
00085 static void motionCB(void * f, SoDragger * d);
00086 static void finishCB(void * f, SoDragger * d);
00087 static void metaKeyChangeCB(void * f, SoDragger * d);
00088 static void fieldSensorCB(void * f, SoSensor * s);
00089 static void valueChangedCB(void * f, SoDragger * d);
00090
00091 SoFieldSensor * rotFieldSensor;
00092 SoFieldSensor * scaleFieldSensor;
00093
00094 private:
00095 SoNode * getNodeFieldNode(const char *fieldname);
00096 void updateUserAxisSwitches(const SbBool setactive = FALSE);
00097 static void timerSensorCB(void *, SoSensor *);
00098
00099 class SoTrackballDraggerP * pimpl;
00100 friend class SoTrackballDraggerP;
00101 };
00102
00103 #endif // !COIN_SOTRACKBALLDRAGGER_H