Open Inventor Reference
SoNodekitCatalog Class Reference

Nodekit catalog class. More...

#include <Inventor/nodekits/SoNodekitCatalog.h>

Public Member Functions

int getNumEntries () const
 Returns number of entries in the catalog.
 
int getPartNumber (const SbName &theName) const
 Given the name of a part, returns its part number in the catalog.
 
const SbNamegetName (int thePartNumber) const
 Given the part number of a part, returns its name in the catalog.
 
SoType getType (int thePartNumber) const
 
SoType getType (const SbName &theName) const
 
SoType getDefaultType (int thePartNumber) const
 
SoType getDefaultType (const SbName &theName) const
 
bool isNullByDefault (int thePartNumber) const
 
bool isNullByDefault (const SbName &theName) const
 
bool isLeaf (int thePartNumber) const
 
bool isLeaf (const SbName &theName) const
 
const SbNamegetParentName (int thePartNumber) const
 
const SbNamegetParentName (const SbName &theName) const
 
int getParentPartNumber (int thePartNumber) const
 
int getParentPartNumber (const SbName &theName) const
 
const SbNamegetRightSiblingName (int thePartNumber) const
 
const SbNamegetRightSiblingName (const SbName &theName) const
 
int getRightSiblingPartNumber (int thePartNumber) const
 
int getRightSiblingPartNumber (const SbName &theName) const
 
bool isList (int thePartNumber) const
 
bool isList (const SbName &theName) const
 
SoType getListContainerType (int thePartNumber) const
 
SoType getListContainerType (const SbName &theName) const
 
const SoTypeListgetListItemTypes (int thePartNumber) const
 
const SoTypeListgetListItemTypes (const SbName &theName) const
 
bool isPublic (int thePartNumber) const
 
bool isPublic (const SbName &theName) const
 
 SoNodekitCatalog ()
 Catalogs are only constructed, destructed, cloned or added to
by subclasses of SoBaseKit.
 
 ~SoNodekitCatalog ()
 Destructor.
 
SoNodekitCatalogclone (SoType typeOfThis) const
 Make a new identical copy, but you must give the node type for 'this' (where 'this' is the top level node in the template )
 
bool addEntry (const SbName &theName, SoType theType, SoType theDefaultType, bool theNullByDefault, const SbName &theParentName, const SbName &theRightSiblingName, bool theListPart, SoType theListContainerType, SoType theListItemType, bool thePublicPart)
 Adding entries.
 
void addListItemType (int thePartNumber, SoType typeToAdd)
 For adding to the set of node types allowed beneath a list...
 
void addListItemType (const SbName &theName, SoType typeToAdd)
 
void narrowTypes (const SbName &theName, SoType newType, SoType newDefaultType)
 For changing the type and defaultType of an entry.
 
void setNullByDefault (const SbName &theName, bool newNullByDefault)
 
bool recursiveSearch (int partNumber, const SbName &nameToFind, SoTypeList *typesChecked) const
 used by SoNodekitParts to search through catalogs.
 
void printCheck () const
 prints the contents of this catalog
 

Static Public Member Functions

static void initClass ()
 Initializes this object.
 

Detailed Description

This class describes the parts and structure of a nodekit. Each class of nodekit has one SoNodekitCatalog (a static variable for the class). Internally, the catalog contains one entry for each "part" in the nodekit's structure. Users can query the catalog for information about each entry in the catalog. This information can be obtained either by part name (an SbName unique for the part within the catalog) or by part number (an index into an array of parts).

Note that, although the catalog for a nodekit class may contain many entries, each instance of that class is not initially created with all of these parts intact. Rather, each instance of the class has its own parts list which keeps track of which parts the user has created. The nodekit uses the catalog as a guide in creating new nodes as its descendants; the standard addChild(), removeChild() and other SoGroup methods are protected, so that users must create descendants indirectly by asking the nodekit to get and/or set the different "parts" in the catalog.

The first entry in any SoNodekitCatalog corresponds to the nodekit itself. Its partName is "this" and its partNumber is 0. All other parts in the catalog are described relative to "this."

See Also
SoAppearanceKit, SoBaseKit, SoCameraKit, SoLightKit, SoNodeKit, SoNodeKitDetail, SoNodeKitListPart, SoNodeKitPath, SoSceneKit, SoSeparatorKit, SoShapeKit, SoWrapperKit

Definition at line 185 of file SoNodekitCatalog.h.

Constructor & Destructor Documentation

◆ SoNodekitCatalog()

SoNodekitCatalog::SoNodekitCatalog ( )

This should be accomplished using the macros provided in SoSubKit.h Constructor

Referenced by clone().

◆ ~SoNodekitCatalog()

SoNodekitCatalog::~SoNodekitCatalog ( )

Member Function Documentation

◆ addEntry()

bool SoNodekitCatalog::addEntry ( const SbName & theName,
SoType theType,
SoType theDefaultType,
bool theNullByDefault,
const SbName & theParentName,
const SbName & theRightSiblingName,
bool theListPart,
SoType theListContainerType,
SoType theListItemType,
bool thePublicPart )

◆ addListItemType() [1/2]

void SoNodekitCatalog::addListItemType ( const SbName & theName,
SoType typeToAdd )

◆ addListItemType() [2/2]

void SoNodekitCatalog::addListItemType ( int thePartNumber,
SoType typeToAdd )

◆ clone()

SoNodekitCatalog * SoNodekitCatalog::clone ( SoType typeOfThis) const

References SoNodekitCatalog().

◆ getDefaultType() [1/2]

SoType SoNodekitCatalog::getDefaultType ( const SbName & theName) const

◆ getDefaultType() [2/2]

SoType SoNodekitCatalog::getDefaultType ( int thePartNumber) const

◆ getListContainerType() [1/2]

SoType SoNodekitCatalog::getListContainerType ( const SbName & theName) const

◆ getListContainerType() [2/2]

SoType SoNodekitCatalog::getListContainerType ( int thePartNumber) const

◆ getListItemTypes() [1/2]

const SoTypeList & SoNodekitCatalog::getListItemTypes ( const SbName & theName) const

◆ getListItemTypes() [2/2]

const SoTypeList & SoNodekitCatalog::getListItemTypes ( int thePartNumber) const

◆ getName()

const SbName & SoNodekitCatalog::getName ( int thePartNumber) const

◆ getNumEntries()

int SoNodekitCatalog::getNumEntries ( ) const
inline

Definition at line 193 of file SoNodekitCatalog.h.

◆ getParentName() [1/2]

const SbName & SoNodekitCatalog::getParentName ( const SbName & theName) const

◆ getParentName() [2/2]

const SbName & SoNodekitCatalog::getParentName ( int thePartNumber) const

◆ getParentPartNumber() [1/2]

int SoNodekitCatalog::getParentPartNumber ( const SbName & theName) const

◆ getParentPartNumber() [2/2]

int SoNodekitCatalog::getParentPartNumber ( int thePartNumber) const

◆ getPartNumber()

int SoNodekitCatalog::getPartNumber ( const SbName & theName) const

◆ getRightSiblingName() [1/2]

const SbName & SoNodekitCatalog::getRightSiblingName ( const SbName & theName) const

◆ getRightSiblingName() [2/2]

const SbName & SoNodekitCatalog::getRightSiblingName ( int thePartNumber) const

◆ getRightSiblingPartNumber() [1/2]

int SoNodekitCatalog::getRightSiblingPartNumber ( const SbName & theName) const

◆ getRightSiblingPartNumber() [2/2]

int SoNodekitCatalog::getRightSiblingPartNumber ( int thePartNumber) const

◆ getType() [1/2]

SoType SoNodekitCatalog::getType ( const SbName & theName) const

◆ getType() [2/2]

SoType SoNodekitCatalog::getType ( int thePartNumber) const

◆ initClass()

static void SoNodekitCatalog::initClass ( )
static

◆ isLeaf() [1/2]

bool SoNodekitCatalog::isLeaf ( const SbName & theName) const

◆ isLeaf() [2/2]

bool SoNodekitCatalog::isLeaf ( int thePartNumber) const

◆ isList() [1/2]

bool SoNodekitCatalog::isList ( const SbName & theName) const

◆ isList() [2/2]

bool SoNodekitCatalog::isList ( int thePartNumber) const

◆ isNullByDefault() [1/2]

bool SoNodekitCatalog::isNullByDefault ( const SbName & theName) const

◆ isNullByDefault() [2/2]

bool SoNodekitCatalog::isNullByDefault ( int thePartNumber) const

◆ isPublic() [1/2]

bool SoNodekitCatalog::isPublic ( const SbName & theName) const

References SoEXTENDER.

◆ isPublic() [2/2]

bool SoNodekitCatalog::isPublic ( int thePartNumber) const

◆ narrowTypes()

void SoNodekitCatalog::narrowTypes ( const SbName & theName,
SoType newType,
SoType newDefaultType )

The new types must be subclasses of the types already existing in the entry.
For example, in SoShapeKit, the part "shape" has type SoShape and default type SoSphere. Any shape node is acceptable, but be default a sphere will be built. Well, when creating the SoVertexShapeKit class, a call of: narrowTypes( "shape", SoVertexShape::getClassTypeId(), SoFaceSet::getClassTypeId()) might be used. This would reflect the fact that: Only vertext shapes may be put in the "shape" part, not just any shape. And also, by default, a faceSet will be built, not a sphere.

◆ printCheck()

void SoNodekitCatalog::printCheck ( ) const

◆ recursiveSearch()

bool SoNodekitCatalog::recursiveSearch ( int partNumber,
const SbName & nameToFind,
SoTypeList * typesChecked ) const

recursively search a given part for 'name to find' in the templates of that entry and its descendants

◆ setNullByDefault()

void SoNodekitCatalog::setNullByDefault ( const SbName & theName,
bool newNullByDefault )

References SoINTERNAL.


The documentation for this class was generated from the following file: