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
00151 class SoPointLightManip : public SoPointLight
00152 {
00153 SO_NODE_HEADER(SoPointLightManip);
00154
00155 public:
00159 SoPointLightManip();
00160
00167 SoDragger *getDragger();
00168
00169
00188 SbBool replaceNode( SoPath *p );
00189
00208 SbBool replaceManip(SoPath *p, SoPointLight *newOne ) const;
00209
00210 private:
00211
00212
00213
00214
00215
00216
00217 virtual void doAction( SoAction *action );
00218 virtual void callback( SoCallbackAction *action );
00219 virtual void GLRender( SoGLRenderAction *action );
00220 virtual void getBoundingBox( SoGetBoundingBoxAction *action );
00221 virtual void getMatrix(SoGetMatrixAction *action );
00222 virtual void handleEvent( SoHandleEventAction *action );
00223 virtual void pick( SoPickAction *action );
00224 virtual void search( SoSearchAction *action );
00225 virtual void write( SoWriteAction *action );
00226
00227 private:
00228 static void initClass();
00229 static void exitClass();
00230
00231 virtual SoChildList *getChildren() const;
00232 virtual bool isGroup() { return true; }
00233
00234
00235 virtual void internalRemoveChild( int index );
00236 virtual void internalRemoveChild( SoNode *child) { internalRemoveChild(internalFindChild(child)); }
00237 virtual void internalRemoveAllChildren();
00238 virtual void internalAddChild( SoNode *child );
00239 virtual int internalFindChild( const SoNode *child ) const;
00240 virtual void internalInsertChild( SoNode *child, int newChildIndex );
00241 virtual SoNode *internalGetChild( int index) const { return (*children)[index]; }
00242 virtual void internalReplaceChild( int index, SoNode *newChild);
00243 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { internalReplaceChild(internalFindChild(oldChild),newChild); }
00244
00245 private:
00246
00247
00248 virtual void copyContents(const SoFieldContainer *fromFC,
00249 SbBool copyConnections);
00250
00251 static void transferFieldValues( const SoPointLight *from,
00252 SoPointLight *to);
00253
00254 static void valueChangedCB(void *,SoDragger *);
00255
00256 SoFieldSensor *locationFieldSensor;
00257 SoFieldSensor *colorFieldSensor;
00258 static void fieldSensorCB(void *, SoSensor *);
00259
00260 void setDragger( SoDragger *newDragger );
00261
00262 SoChildList *children;
00263 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00264 virtual SbBool readChildren(SoInput *in);
00265
00266 virtual ~SoPointLightManip();
00267
00268 private:
00269 int getNumChildren() const { return (children->getLength()); }
00270 };
00271
00272 #endif
00273
00274