00001 #ifndef COIN_SONODEKITCATALOG_H
00002 #define COIN_SONODEKITCATALOG_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/SoType.h>
00028 #include <Inventor/lists/SbList.h>
00029
00030 class SbName;
00031
00032
00033 #define SO_CATALOG_NAME_NOT_FOUND -1
00034
00035
00036 class COIN_DLL_API SoNodekitCatalog {
00037 public:
00038 static void initClass(void);
00039
00040 SoNodekitCatalog(void);
00041 ~SoNodekitCatalog();
00042
00043 int getNumEntries(void) const;
00044 int getPartNumber(const SbName & name) const;
00045 const SbName & getName(int part) const;
00046
00047 SoType getType(int part) const;
00048 SoType getType(const SbName & name) const;
00049 SoType getDefaultType(int part) const;
00050 SoType getDefaultType(const SbName & name) const;
00051 SbBool isNullByDefault(int part) const;
00052 SbBool isNullByDefault(const SbName & name) const;
00053
00054 SbBool isLeaf(int part) const;
00055 SbBool isLeaf(const SbName & name) const;
00056 const SbName & getParentName(int part) const;
00057 const SbName & getParentName(const SbName & name) const;
00058 int getParentPartNumber(int part) const;
00059 int getParentPartNumber(const SbName & name) const;
00060 const SbName & getRightSiblingName(int part) const;
00061 const SbName & getRightSiblingName(const SbName & name) const;
00062 int getRightSiblingPartNumber(int part) const;
00063 int getRightSiblingPartNumber(const SbName & name) const;
00064
00065 SbBool isList(int part) const;
00066 SbBool isList(const SbName & name) const;
00067 SoType getListContainerType(int part) const;
00068 SoType getListContainerType(const SbName & name) const;
00069 const SoTypeList & getListItemTypes(int part) const;
00070 const SoTypeList & getListItemTypes(const SbName & name) const;
00071
00072 SbBool isPublic(int part) const;
00073 SbBool isPublic(const SbName & name) const;
00074
00075 SoNodekitCatalog * clone(SoType type) const;
00076
00077 SbBool addEntry(const SbName & name, SoType type, SoType defaulttype,
00078 SbBool isdefaultnull, const SbName & parent,
00079 const SbName & rightsibling, SbBool islist,
00080 SoType listcontainertype, SoType listitemtype,
00081 SbBool ispublic);
00082 void addListItemType(int part, SoType type);
00083 void addListItemType(const SbName & name, SoType type);
00084
00085 void narrowTypes(const SbName & name, SoType newtype, SoType newdefaulttype);
00086 void setNullByDefault(const SbName & name, SbBool nullbydefault);
00087
00088 SbBool recursiveSearch(int part, const SbName & name,
00089 SoTypeList * checked) const;
00090
00091 void printCheck(void) const;
00092
00093 private:
00094 SbBool reallyAddEntry(class CatalogItem * newitem);
00095
00096 int getPartNumber(const SbList<class CatalogItem *> & l,
00097 const SbName & name) const;
00098 void addListItemType(const SbList<class CatalogItem *> & l,
00099 int part, SoType type);
00100 SbBool addListItemType(const SbList<class CatalogItem *> & l,
00101 const SbName & name, SoType type);
00102
00103 SbList<class CatalogItem *> items;
00104 SbList<class CatalogItem *> delayeditems;
00105 };
00106
00107 #endif // !COIN_SONODEKITCATALOG_H