00001 #ifndef COIN_SOINTERACTIONKIT_H
00002 #define COIN_SOINTERACTIONKIT_H
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 #include <Inventor/nodekits/SoSubKit.h>
00028 #include <Inventor/nodekits/SoBaseKit.h>
00029 #include <Inventor/fields/SoSFEnum.h>
00030
00031 #ifdef COIN_INTERNAL
00032 class SoFieldSensor;
00033 #else // !COIN_INTERNAL
00034
00035 #include <Inventor/sensors/SoFieldSensor.h>
00036 #endif // !COIN_INTERNAL
00037
00038 class SoSensor;
00039 class SoSeparator;
00040
00041 class COIN_DLL_API SoInteractionKit : public SoBaseKit {
00042 typedef SoBaseKit inherited;
00043
00044 SO_KIT_HEADER(SoInteractionKit);
00045
00046 SO_KIT_CATALOG_ENTRY_HEADER(geomSeparator);
00047 SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
00048
00049 public:
00050 SoSFEnum renderCaching;
00051 SoSFEnum boundingBoxCaching;
00052 SoSFEnum renderCulling;
00053 SoSFEnum pickCulling;
00054
00055 public:
00056 SoInteractionKit(void);
00057 static void initClass(void);
00058
00059 enum CacheEnabled { OFF, ON, AUTO };
00060
00061 virtual SbBool setPartAsPath(const SbName &partname,
00062 SoPath *path);
00063 virtual SbBool setPartAsDefault(const SbName &partname,
00064 SoNode *node,
00065 SbBool onlyifdefault = TRUE);
00066 virtual SbBool setPartAsDefault(const SbName &partname,
00067 const SbName &nodename,
00068 SbBool onlyifdefault = TRUE);
00069 SbBool isPathSurrogateInMySubgraph(const SoPath *path,
00070 SoPath *&pathToOwner,
00071 SbName &surrogatename,
00072 SoPath *&surrogatepath,
00073 SbBool fillargs = TRUE);
00074 SbBool isPathSurrogateInMySubgraph(const SoPath *path);
00075 static void setSwitchValue(SoNode *node, const int newVal);
00076 virtual SbBool setPart(const SbName & partname, SoNode * from);
00077
00078 protected:
00079 virtual ~SoInteractionKit();
00080 virtual void copyContents(const SoFieldContainer *fromFC,
00081 SbBool copyConnections);
00082
00083 virtual SbBool setPart(const int partNum, SoNode *node);
00084 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00085 static void readDefaultParts(const char *fileName,
00086 const char defaultBuffer[],
00087 int defBufSize);
00088 virtual SbBool setAnyPartAsDefault(const SbName &partname,
00089 SoNode *node,
00090 SbBool anypart = TRUE,
00091 SbBool onlyifdefault = TRUE);
00092 virtual SbBool setAnyPartAsDefault(const SbName &partname,
00093 const SbName &nodename,
00094 SbBool anypart = TRUE,
00095 SbBool onlyifdefault = TRUE);
00096 SbBool setAnySurrogatePath(const SbName &name,
00097 SoPath *path,
00098 SbBool leafcheck = FALSE,
00099 SbBool publiccheck = FALSE);
00100 virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
00101 virtual void setDefaultOnNonWritingFields();
00102
00103 SoFieldSensor *fieldSensor;
00104 static void fieldSensorCB(void *, SoSensor *);
00105 SoSeparator *oldTopSep;
00106
00107 void connectSeparatorFields( SoSeparator *dest, SbBool onOff );
00108
00109 private:
00110 class SoInteractionKitP * pimpl;
00111 friend class SoInteractionKitP;
00112 };
00113
00114 #endif // !COIN_SOINTERACTIONKIT_H