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