00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef COIN_SOTABPLANEDRAGGER_H
00021 #define COIN_SOTABPLANEDRAGGER_H
00022
00023 #include <Inventor/draggers/SoDragger.h>
00024 #include <Inventor/fields/SoSFVec3f.h>
00025
00026 class SoSensor;
00027 class SoFieldSensor;
00028 class SbLineProjector;
00029 class SbPlaneProjector;
00030
00031
00032 class COIN_DLL_API SoTabPlaneDragger : public SoDragger {
00033 typedef SoDragger inherited;
00034
00035 SO_KIT_HEADER(SoTabPlaneDragger);
00036
00037 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleCoords);
00038 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab0);
00039 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab1);
00040 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab2);
00041 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab3);
00042 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleCoords);
00043 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab0);
00044 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab1);
00045 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab2);
00046 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab3);
00047 SO_KIT_CATALOG_ENTRY_HEADER(planeSwitch);
00048 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabHints);
00049 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterial);
00050 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterialBinding);
00051 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormal);
00052 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormalBinding);
00053 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabs);
00054 SO_KIT_CATALOG_ENTRY_HEADER(translator);
00055
00056
00057 public:
00058 static void initClass(void);
00059 SoTabPlaneDragger(void);
00060
00061 SoSFVec3f translation;
00062 SoSFVec3f scaleFactor;
00063
00064 void adjustScaleTabSize(void);
00065
00066 protected:
00067
00068 ~SoTabPlaneDragger();
00069
00070 virtual void GLRender(SoGLRenderAction * action);
00071
00072 virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
00073 virtual void setDefaultOnNonWritingFields(void);
00074
00075 void reallyAdjustScaleTabSize(SoGLRenderAction * action);
00076
00077 void getXYScreenLengths(SbVec2f & lengths, const SbMatrix & localtoscreen,
00078 const SbVec2s & winsize);
00079
00080 void dragStart(void);
00081 void drag(void);
00082 void dragFinish(void);
00083
00084
00085
00086
00087
00088
00089 private:
00090
00091
00092 static void startCB(void * f, SoDragger * d);
00093 static void motionCB(void * f, SoDragger * d);
00094 static void finishCB(void * f, SoDragger * d);
00095 static void metaKeyChangeCB(void * f, SoDragger * d);
00096 static void fieldSensorCB(void * f, SoSensor * s);
00097 static void valueChangedCB(void * f, SoDragger * d);
00098
00099 void createPrivateParts(void);
00100 SoNode *getNodeFieldNode(const char *fieldname);
00101
00102 SoFieldSensor * scaleFieldSensor;
00103 SoFieldSensor * translFieldSensor;
00104 SbLineProjector *lineProj;
00105 SbPlaneProjector *planeProj;
00106 int whatkind;
00107 int constraintState;
00108 float prevsizex;
00109 float prevsizey;
00110 SbBool adjustTabs;
00111 SbVec3f worldRestartPt;
00112 SbVec3f scaleCenter;
00113 };
00114
00115 #endif // !COIN_SOTABPLANEDRAGGER_H