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