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