Coin Logo http://www.sim.no
http://www.coin3d.org

SoNodekitCatalog.h
1 #ifndef COIN_SONODEKITCATALOG_H
2 #define COIN_SONODEKITCATALOG_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/SoType.h>
28 #include <Inventor/lists/SbList.h>
29 
30 class SbName;
31 
32 
33 #define SO_CATALOG_NAME_NOT_FOUND -1
34 
35 
36 class COIN_DLL_API SoNodekitCatalog {
37 public:
38  static void initClass(void);
39 
40  SoNodekitCatalog(void);
42 
43  int getNumEntries(void) const;
44  int getPartNumber(const SbName & name) const;
45  const SbName & getName(int part) const;
46 
47  SoType getType(int part) const;
48  SoType getType(const SbName & name) const;
49  SoType getDefaultType(int part) const;
50  SoType getDefaultType(const SbName & name) const;
51  SbBool isNullByDefault(int part) const;
52  SbBool isNullByDefault(const SbName & name) const;
53 
54  SbBool isLeaf(int part) const;
55  SbBool isLeaf(const SbName & name) const;
56  const SbName & getParentName(int part) const;
57  const SbName & getParentName(const SbName & name) const;
58  int getParentPartNumber(int part) const;
59  int getParentPartNumber(const SbName & name) const;
60  const SbName & getRightSiblingName(int part) const;
61  const SbName & getRightSiblingName(const SbName & name) const;
62  int getRightSiblingPartNumber(int part) const;
63  int getRightSiblingPartNumber(const SbName & name) const;
64 
65  SbBool isList(int part) const;
66  SbBool isList(const SbName & name) const;
67  SoType getListContainerType(int part) const;
68  SoType getListContainerType(const SbName & name) const;
69  const SoTypeList & getListItemTypes(int part) const;
70  const SoTypeList & getListItemTypes(const SbName & name) const;
71 
72  SbBool isPublic(int part) const;
73  SbBool isPublic(const SbName & name) const;
74 
75  SoNodekitCatalog * clone(SoType type) const;
76 
77  SbBool addEntry(const SbName & name, SoType type, SoType defaulttype,
78  SbBool isdefaultnull, const SbName & parent,
79  const SbName & rightsibling, SbBool islist,
80  SoType listcontainertype, SoType listitemtype,
81  SbBool ispublic);
82  void addListItemType(int part, SoType type);
83  void addListItemType(const SbName & name, SoType type);
84 
85  void narrowTypes(const SbName & name, SoType newtype, SoType newdefaulttype);
86  void setNullByDefault(const SbName & name, SbBool nullbydefault);
87 
88  SbBool recursiveSearch(int part, const SbName & name,
89  SoTypeList * checked) const;
90 
91  void printCheck(void) const;
92 
93 private:
94  SbBool hasEntry(const SbName & name) const;
95  SbBool hasListItemType(const SbName & name, SoType type) const;
96  SbBool reallyAddEntry(class CatalogItem * newitem);
97 
98  int getPartNumber(const SbList<class CatalogItem *> & l,
99  const SbName & name) const;
100  void addListItemType(const SbList<class CatalogItem *> & l,
101  int part, SoType type);
102  SbBool addListItemType(const SbList<class CatalogItem *> & l,
103  const SbName & name, SoType type);
104 
106  SbList<class CatalogItem *> delayeditems;
107 };
108 
109 #endif // !COIN_SONODEKITCATALOG_H
SoType::badType
static SoType badType(void)
Definition: SoType.cpp:664
SoNodekitCatalog
The SoNodekitCatalog class is a container for nodekit layouts.
Definition: SoNodekitCatalog.h:36
SoNodekitCatalog::addListItemType
void addListItemType(int part, SoType type)
Definition: SoNodekitCatalog.cpp:618
SbName
The SbName class stores strings by reference.
Definition: SbName.h:31
SoNodekitCatalog::isList
SbBool isList(int part) const
Definition: SoNodekitCatalog.cpp:328
SoNodekitCatalog::initClass
static void initClass(void)
Definition: SoNodekitCatalog.cpp:62
SoNodekitCatalog::getName
const SbName & getName(int part) const
Definition: SoNodekitCatalog.cpp:110
SoNodekitCatalog::recursiveSearch
SbBool recursiveSearch(int part, const SbName &name, SoTypeList *checked) const
Definition: SoNodekitCatalog.cpp:702
SoDebugError::post
static void post(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:314
SoNodekitCatalog::getRightSiblingName
const SbName & getRightSiblingName(int part) const
Definition: SoNodekitCatalog.cpp:277
SoNodekitCatalog::isNullByDefault
SbBool isNullByDefault(int part) const
Definition: SoNodekitCatalog.cpp:168
SoNodekitCatalog::setNullByDefault
void setNullByDefault(const SbName &name, SbBool nullbydefault)
Definition: SoNodekitCatalog.cpp:683
SoNodekitCatalog::getRightSiblingPartNumber
int getRightSiblingPartNumber(int part) const
Definition: SoNodekitCatalog.cpp:303
SoNodekitCatalog::getParentPartNumber
int getParentPartNumber(int part) const
Definition: SoNodekitCatalog.cpp:252
SoNodekitCatalog::~SoNodekitCatalog
~SoNodekitCatalog()
Definition: SoNodekitCatalog.cpp:76
SoNodekitCatalog::SoNodekitCatalog
SoNodekitCatalog(void)
Definition: SoNodekitCatalog.cpp:69
SbList::append
void append(const Type item)
Definition: SbList.h:98
SoTypeList::find
int find(const SoType type) const
Definition: SoTypeList.cpp:74
SoNodekitCatalog::getListContainerType
SoType getListContainerType(int part) const
Definition: SoNodekitCatalog.cpp:352
SoType::isDerivedFrom
SbBool isDerivedFrom(const SoType type) const
Definition: SoType.cpp:687
SbList::insert
void insert(const Type item, const int insertbefore)
Definition: SbList.h:109
SoBase::unref
void unref(void) const
Definition: SoBase.cpp:627
SoType
The SoType class is the basis for the run-time type system in Coin.
Definition: SoType.h:50
SbList< class CatalogItem * >
SbName::getString
const char * getString(void) const
Definition: SbName.cpp:278
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:334
SoNodekitCatalog::getParentName
const SbName & getParentName(int part) const
Definition: SoNodekitCatalog.cpp:228
SbList::getLength
int getLength(void) const
Definition: SbList.h:145
SoNodekitCatalog::isLeaf
SbBool isLeaf(int part) const
Definition: SoNodekitCatalog.cpp:199
SoNodekitCatalog::getType
SoType getType(int part) const
Definition: SoNodekitCatalog.cpp:123
SoNodekitCatalog::getListItemTypes
const SoTypeList & getListItemTypes(int part) const
Definition: SoNodekitCatalog.cpp:379
SoTypeList
The SoTypeList class is a container class for arrays of SoType objects.
Definition: SoTypeList.h:30
SoBase::ref
void ref(void) const
Definition: SoBase.cpp:574
SoNodekitCatalog::isPublic
SbBool isPublic(int part) const
Definition: SoNodekitCatalog.cpp:406
SoType::createInstance
void * createInstance(void) const
Definition: SoType.cpp:803
SbList::remove
void remove(const int index)
Definition: SbList.h:129
SoNodekitCatalog::getDefaultType
SoType getDefaultType(int part) const
Definition: SoNodekitCatalog.cpp:145
SoNodekitCatalog::narrowTypes
void narrowTypes(const SbName &name, SoType newtype, SoType newdefaulttype)
Definition: SoNodekitCatalog.cpp:656
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:472
SoNodekitCatalog::getPartNumber
int getPartNumber(const SbName &name) const
Definition: SoNodekitCatalog.cpp:100
SoBaseKit::getNodekitCatalog
virtual const SoNodekitCatalog * getNodekitCatalog(void) const
Definition: SoBaseKit.cpp:573
SbList::find
int find(const Type item) const
Definition: SbList.h:103
SoTypeList::append
void append(const SoType type)
Definition: SoTypeList.cpp:62
SoBaseKit
The SoBaseKit class is the toplevel superclass for nodekits.
Definition: SoBaseKit.h:57
SoNodekitCatalog::getNumEntries
int getNumEntries(void) const
Definition: SoNodekitCatalog.cpp:89
SoNodekitCatalog::printCheck
void printCheck(void) const
Definition: SoNodekitCatalog.cpp:739
SoNodekitCatalog::clone
SoNodekitCatalog * clone(SoType type) const
Definition: SoNodekitCatalog.cpp:430

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17