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