![]() |
http://www.sim.no http://www.coin3d.org |
The SoNodekitCatalog class is a container for nodekit layouts. More...
#include <Inventor/nodekits/SoNodekitCatalog.h>
Public Member Functions | |
SoNodekitCatalog (void) | |
~SoNodekitCatalog () | |
int | getNumEntries (void) const |
int | getPartNumber (const SbName &name) const |
const SbName & | getName (int part) const |
SoType | getType (int part) const |
SoType | getType (const SbName &name) const |
SoType | getDefaultType (int part) const |
SoType | getDefaultType (const SbName &name) const |
SbBool | isNullByDefault (int part) const |
SbBool | isNullByDefault (const SbName &name) const |
SbBool | isLeaf (int part) const |
SbBool | isLeaf (const SbName &name) const |
const SbName & | getParentName (int part) const |
const SbName & | getParentName (const SbName &name) const |
int | getParentPartNumber (int part) const |
int | getParentPartNumber (const SbName &name) const |
const SbName & | getRightSiblingName (int part) const |
const SbName & | getRightSiblingName (const SbName &name) const |
int | getRightSiblingPartNumber (int part) const |
int | getRightSiblingPartNumber (const SbName &name) const |
SbBool | isList (int part) const |
SbBool | isList (const SbName &name) const |
SoType | getListContainerType (int part) const |
SoType | getListContainerType (const SbName &name) const |
const SoTypeList & | getListItemTypes (int part) const |
const SoTypeList & | getListItemTypes (const SbName &name) const |
SbBool | isPublic (int part) const |
SbBool | isPublic (const SbName &name) const |
SoNodekitCatalog * | clone (SoType type) const |
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) |
void | addListItemType (int part, SoType type) |
void | addListItemType (const SbName &name, SoType type) |
void | narrowTypes (const SbName &name, SoType newtype, SoType newdefaulttype) |
void | setNullByDefault (const SbName &name, SbBool nullbydefault) |
SbBool | recursiveSearch (int part, const SbName &name, SoTypeList *checked) const |
void | printCheck (void) const |
Static Public Member Functions | |
static void | initClass (void) |
The SoNodekitCatalog class is a container for nodekit layouts.
Nodekits store all their hierarchical layout information and part information in instances of this class.
SoNodekitCatalog::SoNodekitCatalog | ( | void | ) |
Constructor.
Referenced by clone(), and recursiveSearch().
SoNodekitCatalog::~SoNodekitCatalog | ( | ) |
Destructor.
|
static |
Initialization of static variables.
int SoNodekitCatalog::getNumEntries | ( | void | ) | const |
Returns total number of entries in the catalog.
Referenced by addEntry(), SoBaseKit::createFieldList(), getDefaultType(), getListContainerType(), getListItemTypes(), getName(), getParentName(), getParentPartNumber(), getRightSiblingName(), getRightSiblingPartNumber(), getType(), isLeaf(), isList(), isPublic(), printCheck(), SoBaseKit::printSubDiagram(), SoBaseKit::printTable(), and recursiveSearch().
int SoNodekitCatalog::getPartNumber | ( | const SbName & | name | ) | const |
Returns part number in catalog with name. If no part exists with name, returns SO_CATALOG_NAME_NOT_FOUND
.
References getPartNumber().
Referenced by addEntry(), SoBaseKit::countMyFields(), SoBaseKit::forceChildDrivenWriteRefs(), getDefaultType(), getListContainerType(), getListItemTypes(), getParentName(), getParentPartNumber(), getParentPartNumber(), getPartNumber(), getRightSiblingName(), getRightSiblingPartNumber(), getRightSiblingPartNumber(), getType(), isLeaf(), isList(), isNullByDefault(), isPublic(), narrowTypes(), SoBaseKit::printSubDiagram(), and setNullByDefault().
const SbName & SoNodekitCatalog::getName | ( | int | part | ) | const |
Given the part number, return name of that part.
References getNumEntries().
Referenced by SoBaseKit::createFieldList(), SoBaseKit::getPartString(), SoBaseKit::printSubDiagram(), SoBaseKit::printTable(), recursiveSearch(), SoInteractionKit::setAnySurrogatePath(), and SoBaseKit::setPart().
SoType SoNodekitCatalog::getType | ( | int | part | ) | const |
Given the part number, return type.
References getNumEntries().
Referenced by getType(), SoBaseKit::printSubDiagram(), SoBaseKit::printTable(), recursiveSearch(), and SoBaseKit::setPart().
Given the part name, return type.
References getPartNumber(), and getType().
SoType SoNodekitCatalog::getDefaultType | ( | int | part | ) | const |
Given part number, return default type of part.
References getNumEntries().
Referenced by getDefaultType(), and SoBaseKit::printTable().
Given part name, return default type of part.
References getDefaultType(), and getPartNumber().
SbBool SoNodekitCatalog::isNullByDefault | ( | int | part | ) | const |
Returns TRUE
if the part is empty by default, otherwise FALSE
.
Referenced by SoBaseKit::createDefaultParts(), isNullByDefault(), and SoBaseKit::setDefaultOnNonWritingFields().
SbBool SoNodekitCatalog::isNullByDefault | ( | const SbName & | name | ) | const |
Returns TRUE
if part name is empty by default, otherwise FALSE
.
References getPartNumber(), and isNullByDefault().
SbBool SoNodekitCatalog::isLeaf | ( | int | part | ) | const |
Returns TRUE
if the part is not a parent for any other parts in the nodekit catalog.
References getNumEntries().
Referenced by SoBaseKit::createPathToAnyPart(), SoBaseKit::getAnyPart(), SoBaseKit::getPartString(), isLeaf(), SoBaseKit::readInstance(), SoInteractionKit::setAnySurrogatePath(), SoBaseKit::setDefaultOnNonWritingFields(), and SoInteractionKit::setDefaultOnNonWritingFields().
SbBool SoNodekitCatalog::isLeaf | ( | const SbName & | name | ) | const |
Returns TRUE
if the part name is not a parent for any other parts in the nodekit catalog.
References getPartNumber(), and isLeaf().
const SbName & SoNodekitCatalog::getParentName | ( | int | part | ) | const |
Returns name of parent of part. If part doesn't have a parent, the empty string is returned.
References getNumEntries().
Referenced by getParentName(), and SoBaseKit::printSubDiagram().
Returns name of parent of the part. If name doesn't have a parent, the empty string is returned.
References getParentName(), and getPartNumber().
int SoNodekitCatalog::getParentPartNumber | ( | int | part | ) | const |
Returns part number of given part's parent. If part doesn't have a parent, SO_CATALOG_NAME_NOT_FOUND is returned.
References getNumEntries(), and getPartNumber().
Referenced by getParentPartNumber(), SoInteractionKit::setAnySurrogatePath(), and SoBaseKit::setPart().
int SoNodekitCatalog::getParentPartNumber | ( | const SbName & | name | ) | const |
Returns part number of given part's parent. If name doesn't have a parent, SO_CATALOG_NAME_NOT_FOUND is returned.
References getParentPartNumber(), and getPartNumber().
const SbName & SoNodekitCatalog::getRightSiblingName | ( | int | part | ) | const |
Returns name of right sibling of part. Returns the empty string if part doesn't have a right sibling.
References getNumEntries().
Referenced by getRightSiblingName().
Returns name of sibling of the part. Returns the empty string if name doesn't have a right sibling.
References getPartNumber(), and getRightSiblingName().
int SoNodekitCatalog::getRightSiblingPartNumber | ( | int | part | ) | const |
Returns part number of given part's sibling. Returns SO_CATALOG_NAME_NOT_FOUND if part doesn't have a right sibling.
References getNumEntries(), and getPartNumber().
Referenced by getRightSiblingPartNumber().
int SoNodekitCatalog::getRightSiblingPartNumber | ( | const SbName & | name | ) | const |
Returns part number of given part's right sibling. Returns SO_CATALOG_NAME_NOT_FOUND if part doesn't have a right sibling.
References getPartNumber(), and getRightSiblingPartNumber().
SbBool SoNodekitCatalog::isList | ( | int | part | ) | const |
Returns TRUE
if the given part is a list container.
References getNumEntries().
Referenced by isList(), and SoBaseKit::printTable().
SbBool SoNodekitCatalog::isList | ( | const SbName & | name | ) | const |
Returns TRUE
if the given part is a list container.
References getPartNumber(), and isList().
SoType SoNodekitCatalog::getListContainerType | ( | int | part | ) | const |
Returns type of list container (SoGroup, SoSeparator, SoSwitch, etc) which part is.
References getNumEntries().
Referenced by getListContainerType().
Returns type of list container (SoGroup, SoSeparator, SoSwitch, etc) which the named part is.
References getListContainerType(), and getPartNumber().
const SoTypeList & SoNodekitCatalog::getListItemTypes | ( | int | part | ) | const |
Returns list of node types which are allowed to be children of the list container part.
References getNumEntries().
Referenced by getListItemTypes(), and SoBaseKit::printTable().
const SoTypeList & SoNodekitCatalog::getListItemTypes | ( | const SbName & | name | ) | const |
Returns list of node types which are allowed to be children of the named list container part.
References getListItemTypes(), and getPartNumber().
SbBool SoNodekitCatalog::isPublic | ( | int | part | ) | const |
Returns TRUE
if part is visible and publicly available for queries and modifications, FALSE
if part is hidden.
References getNumEntries().
Referenced by SoBaseKit::createPathToAnyPart(), SoBaseKit::getAnyPart(), isPublic(), SoBaseKit::printTable(), SoBaseKit::setAnyPart(), and SoInteractionKit::setAnySurrogatePath().
SbBool SoNodekitCatalog::isPublic | ( | const SbName & | name | ) | const |
Returns TRUE
if the part is visible and publicly available for queries and modifications, FALSE
if it is hidden.
References getPartNumber(), and isPublic().
SoNodekitCatalog * SoNodekitCatalog::clone | ( | SoType | type | ) | const |
Return a clone of this catalog. type will be used to set the type and defaulttype values of the toplevel this
entry.
References SbList< Type >::append(), and SoNodekitCatalog().
SbBool SoNodekitCatalog::addEntry | ( | const SbName & | name, |
SoType | type, | ||
SoType | defaulttype, | ||
SbBool | isdefaultnull, | ||
const SbName & | parentname, | ||
const SbName & | rightsiblingname, | ||
SbBool | islist, | ||
SoType | listcontainertype, | ||
SoType | listitemtype, | ||
SbBool | ispublic ) |
Add a new entry to the catalog. Returns TRUE
if add was ok.
References SoTypeList::append(), SoType::badType(), getNumEntries(), getPartNumber(), SbName::getString(), and SoDebugError::postInfo().
void SoNodekitCatalog::addListItemType | ( | int | part, |
SoType | type ) |
Add another allowable type for the given part. part must of course be a list container item.
References addListItemType().
Referenced by addListItemType(), and addListItemType().
Add another allowable type for the name part. The part must of course be a list container.
References addListItemType(), SbName::getString(), and SoDebugError::post().
Set the type and default type of a part to be subtypes of the old types. Useful for "narrowing" the specification of a nodekit which inherits the catalog of a more generic nodekit superclass.
References getPartNumber(), and SoType::isDerivedFrom().
void SoNodekitCatalog::setNullByDefault | ( | const SbName & | name, |
SbBool | nullbydefault ) |
Change whether or not the part with the given name is created by default.
References getPartNumber().
SbBool SoNodekitCatalog::recursiveSearch | ( | int | part, |
const SbName & | name, | ||
SoTypeList * | checked ) const |
Recursively search part number in catalog for the name part.
The checked SoTypeList is just used as a placeholder to remember which nodekit class catalogs have already been scanned (or are being scanned) during the recursion. You should normally just pass in an empty list.
References SoTypeList::append(), SoType::createInstance(), SoTypeList::find(), getName(), SoBaseKit::getNodekitCatalog(), getNumEntries(), getType(), SoType::isDerivedFrom(), recursiveSearch(), SoBase::ref(), SoNodekitCatalog(), and SoBase::unref().
Referenced by recursiveSearch().
void SoNodekitCatalog::printCheck | ( | void | ) | const |
Lists all catalog parts, which is useful for debugging.
References SoType::badType(), SbPList::getLength(), SoType::getName(), getNumEntries(), and SbName::getString().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Thu Jan 16 2025 for Coin by Doxygen. 1.13.2