00001 #ifndef COIN_SONODEKITLISTPART_H
00002 #define COIN_SONODEKITLISTPART_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/nodes/SoSubNode.h>
00028 #include <Inventor/lists/SoTypeList.h>
00029 #include <Inventor/fields/SoSFNode.h>
00030 #include <Inventor/fields/SoSFName.h>
00031 #include <Inventor/fields/SoMFName.h>
00032
00033 class SoGroup;
00034
00035
00036 class COIN_DLL_API SoNodeKitListPart : public SoNode {
00037 typedef SoNode inherited;
00038
00039 SO_NODE_HEADER(SoNodeKitListPart);
00040
00041 public:
00042 static void initClass(void);
00043 SoNodeKitListPart(void);
00044
00045 SoType getContainerType(void) const;
00046 void setContainerType(SoType newContainerType);
00047 const SoTypeList & getChildTypes(void) const;
00048 void addChildType(SoType typeToAdd);
00049 SbBool isTypePermitted(SoType typeToCheck) const;
00050 SbBool isChildPermitted(const SoNode * child) const;
00051 void containerSet(const char * fieldDataString);
00052 void lockTypes(void);
00053 SbBool isTypeLocked(void) const;
00054 void addChild(SoNode * child);
00055 void insertChild(SoNode * child, int childIndex);
00056 SoNode * getChild(int index) const;
00057 int findChild(SoNode * child) const;
00058 int getNumChildren(void) const;
00059 void removeChild(int index);
00060 void removeChild(SoNode * child);
00061 void replaceChild(int index, SoNode * newChild);
00062 void replaceChild(SoNode * oldChild, SoNode * newChild);
00063 virtual SbBool affectsState(void) const;
00064 virtual void doAction(SoAction * action);
00065 virtual void callback(SoCallbackAction * action);
00066 virtual void GLRender(SoGLRenderAction * action);
00067 virtual void getBoundingBox(SoGetBoundingBoxAction * action);
00068 virtual void getMatrix(SoGetMatrixAction * action);
00069 virtual void handleEvent(SoHandleEventAction * action);
00070 virtual void pick(SoPickAction * action);
00071 virtual void search(SoSearchAction * action);
00072 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
00073 virtual SoChildList * getChildren(void) const;
00074
00075 protected:
00076 virtual ~SoNodeKitListPart();
00077
00078 SoGroup * getContainerNode(void);
00079 virtual SbBool readInstance(SoInput * in, unsigned short flags);
00080 virtual void copyContents(const SoFieldContainer * fromFC,
00081 SbBool copyConnections);
00082 SoChildList * children;
00083
00084 private:
00085 void syncInternalData(void);
00086
00087 SoSFNode containerNode;
00088 SoSFName containerTypeName;
00089 SoMFName childTypeNames;
00090
00091 SbBool typelistlocked;
00092 SoTypeList allowedtypes;
00093
00094 SbBool canCreateDefaultChild(void) const;
00095 SoNode * createAndAddDefaultChild(void);
00096 SoType getDefaultChildType(void) const;
00097
00098 friend class SoBaseKit;
00099 };
00100
00101 #endif // !COIN_SONODEKITLISTPART_H