00001 #ifndef COIN_SOANTISQUISH_H
00002 #define COIN_SOANTISQUISH_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/nodes/SoSubNode.h>
00028 #include <Inventor/nodes/SoTransformation.h>
00029 #include <Inventor/fields/SoSFEnum.h>
00030 #include <Inventor/fields/SoSFBool.h>
00031 #include <Inventor/SbMatrix.h>
00032
00033 class COIN_DLL_API SoAntiSquish : public SoTransformation {
00034 typedef SoTransformation inherited;
00035
00036 SO_NODE_HEADER(SoAntiSquish);
00037
00038 public:
00039 static void initClass(void);
00040 SoAntiSquish(void);
00041
00042 enum Sizing {
00043 X, Y, Z, AVERAGE_DIMENSION, BIGGEST_DIMENSION, SMALLEST_DIMENSION,
00044 LONGEST_DIAGONAL
00045 };
00046
00047 SoSFEnum sizing;
00048 SoSFBool recalcAlways;
00049
00050 void recalc(void);
00051 virtual void doAction(SoAction * action);
00052
00053 protected:
00054 virtual ~SoAntiSquish();
00055
00056 virtual void callback(SoCallbackAction * action);
00057 virtual void GLRender(SoGLRenderAction * action);
00058 virtual void getBoundingBox(SoGetBoundingBoxAction * action);
00059 virtual void getMatrix(SoGetMatrixAction * action);
00060 virtual void pick(SoPickAction * action);
00061
00062 SbMatrix getUnsquishingMatrix(const SbMatrix & squishedmatrix,
00063 const SbBool calcinverse,
00064 SbMatrix & getinverse);
00065 private:
00066 SbMatrix unsquishedmatrix, inversematrix;
00067 SbBool matrixvalid, inversevalid;
00068 };
00069
00070 #endif // !COIN_SOANTISQUISH_H