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
00049
00050
00051
00052
00053
00055
00056
00057 #ifndef _SO_SPOT_LIGHT_MANIP_
00058 #define _SO_SPOT_LIGHT_MANIP_
00059
00060 #include <Inventor/SbLinear.h>
00061 #include <Inventor/draggers/SoDragger.h>
00062 #include <Inventor/nodes/SoSpotLight.h>
00063 #include <Inventor/sensors/SoFieldSensor.h>
00064
00065
00162 class SoSpotLightManip : public SoSpotLight
00163 {
00164 SO_NODE_HEADER(SoSpotLightManip);
00165
00166 public:
00170 SoSpotLightManip();
00171
00178 SoDragger *getDragger();
00179
00198 SbBool replaceNode( SoPath *p );
00199
00200
00218 SbBool replaceManip(SoPath *p, SoSpotLight *newOne ) const;
00219
00220 private:
00221
00222
00223
00224
00225
00226
00227 virtual void doAction( SoAction *action );
00228 virtual void callback( SoCallbackAction *action );
00229 virtual void GLRender( SoGLRenderAction *action );
00230 virtual void getBoundingBox( SoGetBoundingBoxAction *action );
00231 virtual void getMatrix(SoGetMatrixAction *action );
00232 virtual void handleEvent( SoHandleEventAction *action );
00233 virtual void pick( SoPickAction *action );
00234 virtual void search( SoSearchAction *action );
00235 virtual void write( SoWriteAction *action );
00236
00237 private:
00238
00239 static void initClass();
00240 static void exitClass();
00241
00242 virtual SoChildList *getChildren() const;
00243 virtual bool isGroup() { return true; }
00244
00245
00246 virtual void internalRemoveChild( int index );
00247 virtual void internalRemoveChild( SoNode *child) { internalRemoveChild(internalFindChild(child)); }
00248 virtual void internalRemoveAllChildren();
00249 virtual void internalAddChild( SoNode *child );
00250 virtual int internalFindChild( const SoNode *child ) const;
00251 virtual void internalInsertChild( SoNode *child, int newChildIndex );
00252 virtual SoNode *internalGetChild( int index) const { return (*children)[index]; }
00253 virtual void internalReplaceChild( int index, SoNode *newChild);
00254 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { internalReplaceChild(internalFindChild(oldChild),newChild); }
00255
00256 private:
00257
00258
00259 virtual void copyContents(const SoFieldContainer *fromFC,
00260 SbBool copyConnections);
00261
00262 static void transferFieldValues( const SoSpotLight *from,
00263 SoSpotLight *to);
00264
00265 SoFieldSensor *locationFieldSensor;
00266 SoFieldSensor *directionFieldSensor;
00267 SoFieldSensor *angleFieldSensor;
00268 SoFieldSensor *colorFieldSensor;
00269 static void fieldSensorCB(void *, SoSensor *);
00270 static void valueChangedCB(void *,SoDragger *);
00271
00272 void setDragger( SoDragger *newDragger );
00273
00274 SoChildList *children;
00275 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00276 virtual SbBool readChildren(SoInput *in);
00277
00278 virtual ~SoSpotLightManip();
00279
00280 private:
00281 int getNumChildren() const { return (children->getLength()); }
00282 };
00283
00284 #endif
00285
00286