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
00164 class SoTransformManip : public SoTransform
00165 {
00166 SO_NODE_HEADER(SoTransformManip);
00167
00168 public:
00169
00173 SoTransformManip();
00174
00181 SoDragger *getDragger();
00182
00201 SbBool replaceNode( SoPath *p );
00202
00220 SbBool replaceManip(SoPath *p, SoTransform *newOne ) const;
00221
00222 private:
00223
00224
00225
00226
00227
00228
00229 virtual void doAction( SoAction *action );
00230 virtual void callback( SoCallbackAction *action );
00231 virtual void GLRender( SoGLRenderAction *action );
00232 virtual void getBoundingBox( SoGetBoundingBoxAction *action );
00233 virtual void getMatrix(SoGetMatrixAction *action );
00234 virtual void handleEvent( SoHandleEventAction *action );
00235 virtual void pick( SoPickAction *action );
00236 virtual void search( SoSearchAction *action );
00237 virtual void write( SoWriteAction *action );
00238
00239 private:
00240 static void initClass();
00241 static void exitClass();
00242
00243 SB_THREAD_TLS_HEADER();
00244
00245 virtual SoChildList *getChildren() const;
00246 virtual bool isGroup() { return true; }
00247
00248
00249 virtual void internalRemoveChild( int index );
00250 virtual void internalRemoveChild( SoNode *child) { internalRemoveChild(internalFindChild(child)); }
00251 virtual void internalRemoveAllChildren();
00252 virtual void internalAddChild( SoNode *child );
00253 virtual int internalFindChild( const SoNode *child ) const;
00254 virtual void internalInsertChild( SoNode *child, int newChildIndex );
00255 virtual SoNode *internalGetChild( int index) const { return (*children)[index]; }
00256 virtual void internalReplaceChild( int index, SoNode *newChild);
00257 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { internalReplaceChild(internalFindChild(oldChild),newChild); }
00258
00259
00260 virtual void copyContents(const SoFieldContainer *fromFC, SbBool copyConnections);
00261
00262 private:
00263
00264 static void transferFieldValues( const SoTransform *from, SoTransform *to);
00265
00266 static void valueChangedCB(void *,SoDragger *);
00267
00268 SoFieldSensor *rotateFieldSensor;
00269 SoFieldSensor *translFieldSensor;
00270 SoFieldSensor *scaleFieldSensor;
00271 SoFieldSensor *centerFieldSensor;
00272 SoFieldSensor *scaleOrientFieldSensor;
00273 static void fieldSensorCB(void *, SoSensor *);
00274
00275 virtual void setDragger( SoDragger *newDragger );
00276
00277 SoChildList *children;
00278 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00279 virtual SbBool readChildren(SoInput *in);
00280
00281 virtual ~SoTransformManip();
00282
00283
00284 struct MTstruct {
00285 SoGetBoundingBoxAction *bboxAction;
00286 };
00287
00288 private:
00289 int getNumChildren() const { return (children->getLength()); }
00290
00291 SoShaderProgram* m_manipFragment;
00292 };
00293
00294 #endif
00295
00296