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