00001
00002
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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef _SO_TRANSFORM_MANIP_
00051 #define _SO_TRANSFORM_MANIP_
00052
00053 #include <Inventor/SbLinear.h>
00054 #include <Inventor/draggers/SoDragger.h>
00055 #include <Inventor/nodes/SoTransform.h>
00056 #include <Inventor/sensors/SoFieldSensor.h>
00057
00058 class SoGetBoundingBoxAction;
00059 class SoShaderProgram;
00060
00166 class SoTransformManip : public SoTransform
00167 {
00168 SO_NODE_HEADER(SoTransformManip);
00169
00170 public:
00171
00175 SoTransformManip();
00176
00183 SoDragger *getDragger();
00184
00203 SbBool replaceNode( SoPath *p );
00204
00222 SbBool replaceManip(SoPath *p, SoTransform *newOne ) const;
00223
00224 private:
00225
00226
00227
00228
00229
00230
00231 virtual void doAction( SoAction *action );
00232 virtual void callback( SoCallbackAction *action );
00233 virtual void GLRender( SoGLRenderAction *action );
00234 virtual void getBoundingBox( SoGetBoundingBoxAction *action );
00235 virtual void getMatrix(SoGetMatrixAction *action );
00236 virtual void handleEvent( SoHandleEventAction *action );
00237 virtual void pick( SoPickAction *action );
00238 virtual void search( SoSearchAction *action );
00239 virtual void write( SoWriteAction *action );
00240
00241 private:
00242 static void initClass();
00243 static void exitClass();
00244
00245 SB_THREAD_TLS_HEADER();
00246
00247 virtual SoChildList *getChildren() const;
00248 virtual bool isGroup() { return true; }
00249
00250
00251 virtual void internalRemoveChild( int index );
00252 virtual void internalRemoveChild( SoNode *child) { internalRemoveChild(internalFindChild(child)); }
00253 virtual void internalRemoveAllChildren();
00254 virtual void internalAddChild( SoNode *child );
00255 virtual int internalFindChild( const SoNode *child ) const;
00256 virtual void internalInsertChild( SoNode *child, int newChildIndex );
00257 virtual SoNode *internalGetChild( int index) const { return (*children)[index]; }
00258 virtual void internalReplaceChild( int index, SoNode *newChild);
00259 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { internalReplaceChild(internalFindChild(oldChild),newChild); }
00260
00261 private:
00262
00263
00264 virtual void copyContents(const SoFieldContainer *fromFC, SbBool copyConnections);
00265
00266 static void transferFieldValues( const SoTransform *from, SoTransform *to);
00267
00268 static void valueChangedCB(void *,SoDragger *);
00269
00270 SoFieldSensor *rotateFieldSensor;
00271 SoFieldSensor *translFieldSensor;
00272 SoFieldSensor *scaleFieldSensor;
00273 SoFieldSensor *centerFieldSensor;
00274 SoFieldSensor *scaleOrientFieldSensor;
00275 static void fieldSensorCB(void *, SoSensor *);
00276
00277 virtual void setDragger( SoDragger *newDragger );
00278
00279 SoChildList *children;
00280 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00281 virtual SbBool readChildren(SoInput *in);
00282
00283 virtual ~SoTransformManip();
00284
00285
00286 struct MTstruct {
00287 SoGetBoundingBoxAction *bboxAction;
00288 };
00289
00290 private:
00291 int getNumChildren() const { return (children->getLength()); }
00292
00293 SoShaderProgram* m_manipFragment;
00294 };
00295
00296 #endif
00297
00298