Coin: SoNodekitCatalog.h Source File

| Coin3D is Free Software, published under the BSD 3-clause license. | https://coin3d.github.io https://www.kongsberg.com/en/kogt/

SoNodekitCatalog.h
1#ifndef COIN_SONODEKITCATALOG_H
2#define COIN_SONODEKITCATALOG_H
3
4/**************************************************************************\
5 * Copyright (c) Kongsberg Oil & Gas Technologies AS
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * Neither the name of the copyright holder nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34\**************************************************************************/
35
36#include <Inventor/SoType.h>
37#include <Inventor/lists/SbList.h>
38
39class SbName;
40
41
42#define SO_CATALOG_NAME_NOT_FOUND -1
43
44
45 class COIN_DLL_API SoNodekitCatalog {
46public:
47 static void initClass(void);
48
49 SoNodekitCatalog(void);
50 ~SoNodekitCatalog();
51
52 int getNumEntries(void) const;
53 int getPartNumber(const SbName & name) const;
54 const SbName & getName(int part) const;
55
56 SoType getType(int part) const;
57 SoType getType(const SbName & name) const;
58 SoType getDefaultType(int part) const;
59 SoType getDefaultType(const SbName & name) const;
60 SbBool isNullByDefault(int part) const;
61 SbBool isNullByDefault(const SbName & name) const;
62
63 SbBool isLeaf(int part) const;
64 SbBool isLeaf(const SbName & name) const;
65 const SbName & getParentName(int part) const;
66 const SbName & getParentName(const SbName & name) const;
67 int getParentPartNumber(int part) const;
68 int getParentPartNumber(const SbName & name) const;
69 const SbName & getRightSiblingName(int part) const;
70 const SbName & getRightSiblingName(const SbName & name) const;
71 int getRightSiblingPartNumber(int part) const;
72 int getRightSiblingPartNumber(const SbName & name) const;
73
74 SbBool isList(int part) const;
75 SbBool isList(const SbName & name) const;
76 SoType getListContainerType(int part) const;
77 SoType getListContainerType(const SbName & name) const;
78 const SoTypeList & getListItemTypes(int part) const;
79 const SoTypeList & getListItemTypes(const SbName & name) const;
80
81 SbBool isPublic(int part) const;
82 SbBool isPublic(const SbName & name) const;
83
84 SoNodekitCatalog * clone(SoType type) const;
85
86 SbBool addEntry(const SbName & name, SoType type, SoType defaulttype,
87 SbBool isdefaultnull, const SbName & parent,
88 const SbName & rightsibling, SbBool islist,
89 SoType listcontainertype, SoType listitemtype,
90 SbBool ispublic);
91 void addListItemType(int part, SoType type);
92 void addListItemType(const SbName & name, SoType type);
93
94 void narrowTypes(const SbName & name, SoType newtype, SoType newdefaulttype);
95 void setNullByDefault(const SbName & name, SbBool nullbydefault);
96
97 SbBool recursiveSearch(int part, const SbName & name,
98 SoTypeList * checked) const;
99
100 void printCheck(void) const;
101
102private:
103 SbBool hasEntry(const SbName & name) const;
104 SbBool hasListItemType(const SbName & name, SoType type) const;
105 SbBool reallyAddEntry(class CatalogItem * newitem);
106
107 int getPartNumber(const SbList<class CatalogItem *> & l,
108 const SbName & name) const;
109 void addListItemType(const SbList<class CatalogItem *> & l,
110 int part, SoType type);
111 SbBool addListItemType(const SbList<class CatalogItem *> & l,
112 const SbName & name, SoType type);
113
114 SbList<class CatalogItem *> items;
115 SbList<class CatalogItem *> delayeditems;
116};
117
118#endif // !COIN_SONODEKITCATALOG_H
SbList
The SbList class is a template container class for lists.
Definition SbList.h:70
SbName
The SbName class stores strings by reference.
Definition SbName.h:40
SoNodekitCatalog::isPublic
SbBool isPublic(int part) const
Definition SoNodekitCatalog.cpp:423
SoNodekitCatalog::getNumEntries
int getNumEntries(void) const
Definition SoNodekitCatalog.cpp:106
SoNodekitCatalog::getRightSiblingName
const SbName & getRightSiblingName(int part) const
Definition SoNodekitCatalog.cpp:294
SoNodekitCatalog::SoNodekitCatalog
SoNodekitCatalog(void)
Definition SoNodekitCatalog.cpp:86
SoNodekitCatalog::addEntry
SbBool addEntry(const SbName &name, SoType type, SoType defaulttype, SbBool isdefaultnull, const SbName &parent, const SbName &rightsibling, SbBool islist, SoType listcontainertype, SoType listitemtype, SbBool ispublic)
Definition SoNodekitCatalog.cpp:489
SoNodekitCatalog::getDefaultType
SoType getDefaultType(int part) const
Definition SoNodekitCatalog.cpp:162
SoNodekitCatalog::clone
SoNodekitCatalog * clone(SoType type) const
Definition SoNodekitCatalog.cpp:447
SoNodekitCatalog::getType
SoType getType(int part) const
Definition SoNodekitCatalog.cpp:140
SoNodekitCatalog::getName
const SbName & getName(int part) const
Definition SoNodekitCatalog.cpp:127
SoNodekitCatalog::isNullByDefault
SbBool isNullByDefault(int part) const
Definition SoNodekitCatalog.cpp:185
SoNodekitCatalog::printCheck
void printCheck(void) const
Definition SoNodekitCatalog.cpp:756
SoNodekitCatalog::getListItemTypes
const SoTypeList & getListItemTypes(int part) const
Definition SoNodekitCatalog.cpp:396
SoNodekitCatalog::addListItemType
void addListItemType(int part, SoType type)
Definition SoNodekitCatalog.cpp:635
SoNodekitCatalog::getParentName
const SbName & getParentName(int part) const
Definition SoNodekitCatalog.cpp:245
SoNodekitCatalog::recursiveSearch
SbBool recursiveSearch(int part, const SbName &name, SoTypeList *checked) const
Definition SoNodekitCatalog.cpp:719
SoNodekitCatalog::narrowTypes
void narrowTypes(const SbName &name, SoType newtype, SoType newdefaulttype)
Definition SoNodekitCatalog.cpp:673
SoNodekitCatalog::isList
SbBool isList(int part) const
Definition SoNodekitCatalog.cpp:345
SoNodekitCatalog::initClass
static void initClass(void)
Definition SoNodekitCatalog.cpp:79
SoNodekitCatalog::getRightSiblingPartNumber
int getRightSiblingPartNumber(int part) const
Definition SoNodekitCatalog.cpp:320
SoNodekitCatalog::setNullByDefault
void setNullByDefault(const SbName &name, SbBool nullbydefault)
Definition SoNodekitCatalog.cpp:700
SoNodekitCatalog::getParentPartNumber
int getParentPartNumber(int part) const
Definition SoNodekitCatalog.cpp:269
SoNodekitCatalog::getListContainerType
SoType getListContainerType(int part) const
Definition SoNodekitCatalog.cpp:369
SoNodekitCatalog::isLeaf
SbBool isLeaf(int part) const
Definition SoNodekitCatalog.cpp:216
SoNodekitCatalog::getPartNumber
int getPartNumber(const SbName &name) const
Definition SoNodekitCatalog.cpp:117
SoTypeList
The SoTypeList class is a container class for arrays of SoType objects.
Definition SoTypeList.h:39
SoType
The SoType class is the basis for the runtime type system in Coin.
Definition SoType.h:59