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_POINT_LIGHT_MANIP_
00051 #define _SO_POINT_LIGHT_MANIP_
00052
00053 #include <Inventor/SbLinear.h>
00054 #include <Inventor/draggers/SoDragger.h>
00055 #include <Inventor/nodes/SoPointLight.h>
00056 #include <Inventor/sensors/SoFieldSensor.h>
00057
00058
00148 class SoPointLightManip : public SoPointLight
00149 {
00150 SO_NODE_HEADER(SoPointLightManip);
00151
00152 public:
00156 SoPointLightManip();
00157
00164 SoDragger *getDragger();
00165
00166
00185 SbBool replaceNode( SoPath *p );
00186
00205 SbBool replaceManip(SoPath *p, SoPointLight *newOne ) const;
00206
00207 private:
00208
00209
00210
00211
00212
00213
00214 virtual void doAction( SoAction *action );
00215 virtual void callback( SoCallbackAction *action );
00216 virtual void GLRender( SoGLRenderAction *action );
00217 virtual void getBoundingBox( SoGetBoundingBoxAction *action );
00218 virtual void getMatrix(SoGetMatrixAction *action );
00219 virtual void handleEvent( SoHandleEventAction *action );
00220 virtual void pick( SoPickAction *action );
00221 virtual void search( SoSearchAction *action );
00222 virtual void write( SoWriteAction *action );
00223
00224 private:
00225 static void initClass();
00226 static void exitClass();
00227
00228 virtual SoChildList *getChildren() const;
00229 virtual bool isGroup() { return true; }
00230
00231
00232 virtual void internalRemoveChild( int index );
00233 virtual void internalRemoveChild( SoNode *child) { internalRemoveChild(internalFindChild(child)); }
00234 virtual void internalRemoveAllChildren();
00235 virtual void internalAddChild( SoNode *child );
00236 virtual int internalFindChild( const SoNode *child ) const;
00237 virtual void internalInsertChild( SoNode *child, int newChildIndex );
00238 virtual SoNode *internalGetChild( int index) const { return (*children)[index]; }
00239 virtual void internalReplaceChild( int index, SoNode *newChild);
00240 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { internalReplaceChild(internalFindChild(oldChild),newChild); }
00241
00242
00243 virtual void copyContents(const SoFieldContainer *fromFC,
00244 SbBool copyConnections);
00245
00246 private:
00247
00248 static void transferFieldValues( const SoPointLight *from,
00249 SoPointLight *to);
00250
00251 static void valueChangedCB(void *,SoDragger *);
00252
00253 SoFieldSensor *locationFieldSensor;
00254 SoFieldSensor *colorFieldSensor;
00255 static void fieldSensorCB(void *, SoSensor *);
00256
00257 void setDragger( SoDragger *newDragger );
00258
00259 SoChildList *children;
00260 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00261 virtual SbBool readChildren(SoInput *in);
00262
00263 virtual ~SoPointLightManip();
00264
00265 private:
00266 int getNumChildren() const { return (children->getLength()); }
00267 };
00268
00269 #endif
00270
00271