Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoBaseKit Class Reference

The SoBaseKit class is the toplevel superclass for nodekits. More...

#include <Inventor/nodekits/SoBaseKit.h>

Inheritance diagram for SoBaseKit::

SoNode SoFieldContainer SoBase SoAppearanceKit SoCameraKit SoInteractionKit SoLightKit SoSceneKit SoSeparatorKit SoDragger SoShapeKit SoWrapperKit SoCenterballDragger SoDirectionalLightDragger SoDragPointDragger SoHandleBoxDragger SoJackDragger SoPointLightDragger SoRotateCylindricalDragger SoRotateDiscDragger SoRotateSphericalDragger SoScale1Dragger SoScale2Dragger SoScale2UniformDragger SoScaleUniformDragger SoSpotLightDragger SoTabBoxDragger SoTabPlaneDragger SoTrackballDragger SoTransformBoxDragger SoTransformerDragger SoTranslate1Dragger SoTranslate2Dragger List of all members.

Public Methods

 SoBaseKit (void)
virtual const SoNodekitCataloggetNodekitCatalog (void) const
virtual SoNodegetPart (const SbName &partname, SbBool makeifneeded)
SbString getPartString (const SoBase *part)
virtual SoNodeKitPathcreatePathToPart (const SbName &partname, SbBool makeifneeded, const SoPath *pathtoextend=NULL)
virtual SbBool setPart (const SbName &partname, SoNode *from)
SbBool set (const char *namevaluepairliststring)
SbBool set (const char *partnamestring, const char *parameterstring)
virtual void doAction (SoAction *action)
virtual void callback (SoCallbackAction *action)
virtual void GLRender (SoGLRenderAction *action)
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
virtual void getMatrix (SoGetMatrixAction *action)
virtual void handleEvent (SoHandleEventAction *action)
virtual void rayPick (SoRayPickAction *action)
virtual void search (SoSearchAction *action)
virtual void write (SoWriteAction *action)
virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)
virtual SoChildListgetChildren (void) const
void printDiagram (void)
void printSubDiagram (const SbName &rootname, int level)
void printTable (void)
virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE)
SbBool forceChildDrivenWriteRefs (SoOutput *out)

Static Public Methods

void initClass (void)
const SoNodekitCataloggetClassNodekitCatalog (void)
SbBool isSearchingChildren (void)
void setSearchingChildren (const SbBool newval)
SoNodetypeCheck (const SbName &partname, const SoType &parttype, SoNode *node)

Protected Methods

virtual ~SoBaseKit ()
virtual SoNodeaddToCopyDict (void) const
virtual void copyContents (const SoFieldContainer *fromfc, SbBool copyconnections)
SoGroupgetContainerNode (const SbName &listname, SbBool makeifneeded=TRUE)
virtual SoNodegetAnyPart (const SbName &partname, SbBool makeifneeded, SbBool leafcheck=FALSE, SbBool publiccheck=FALSE)
virtual SoNodeKitPathcreatePathToAnyPart (const SbName &partname, SbBool makeifneeded, SbBool leafcheck=FALSE, SbBool publiccheck=FALSE, const SoPath *pathtoextend=NULL)
virtual SbBool setAnyPart (const SbName &partname, SoNode *from, SbBool anypart=TRUE)
void createNodekitPartsList (void)
void createFieldList (void)
virtual void createDefaultParts (void)
const SoNodekitParts * getNodekitPartsList (void) const
const SbList< SoSFNode *> & getCatalogInstances (void) const
void catalogError (void)
virtual SbBool setUpConnections (SbBool onoff, SbBool doitalways=FALSE)
virtual SbBool readInstance (SoInput *in, unsigned short flags)
virtual void setDefaultOnNonWritingFields (void)
void countMyFields (SoOutput *out)
virtual SbBool setPart (const int partNum, SoNode *node)

Static Protected Methods

const SoNodekitCatalog ** getClassNodekitCatalogPtr (void)

Protected Attributes

SoChildListchildren
SbBool connectionsSetUp

Detailed Description

The SoBaseKit class is the toplevel superclass for nodekits.

FIXME, write class doc:

If you as an application programmer is planning to write extensions in the form of e.g. new nodekit classes or new dragger classes, we recommend buying the book «The Inventor Toolmaker», ISBN 0-201-62493-1. This book was written by the original SGI Inventor designers and explains many of the underlying design ideas, aswell as having lots of hands-on examples on how to extend the Coin toolkit in ways that are true to the fundamental design ideas.


Constructor & Destructor Documentation

SoBaseKit::SoBaseKit void
 

Constructor.

SoBaseKit::~SoBaseKit [protected, virtual]
 

Destructor.


Member Function Documentation

void SoBaseKit::initClass void [static]
 

Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.

Reimplemented from SoNode.

Reimplemented in SoInteractionKit, SoSeparatorKit, SoShapeKit, SoWrapperKit, SoAppearanceKit, SoCameraKit, SoLightKit, SoSceneKit, SoDragger, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, and SoTranslate2Dragger.

const SoNodekitCatalog * SoBaseKit::getClassNodekitCatalog void [static]
 

Returns the nodekit catalog which defines the layout of this class' kit.

const SoNodekitCatalog * SoBaseKit::getNodekitCatalog void const [virtual]
 

Returns the nodekit catalog which defines the layout of this class' kit.

SoNode * SoBaseKit::getPart const SbName & partname,
SbBool makeifneeded
[virtual]
 

Returns a pointer to the node part with partname.

If the part is not in the nodekit's catalog, return NULL.

If the part is in the catalog, has not been made and makeifneeded is TRUE, construct the part and all it's parents, and return the node pointer. If the node part has not been made and makeifneeded is FALSE, return NULL.

FIXME: describe syntax for specifiying "paths". 19991205 mortene.

SbString SoBaseKit::getPartString const SoBase * part
 

FIXME: write function documentation

SoNodeKitPath * SoBaseKit::createPathToPart const SbName & partname,
SbBool makeifneeded,
const SoPath * pathtoextend = NULL
[virtual]
 

FIXME: write function documentation

SbBool SoBaseKit::setPart const SbName & partname,
SoNode * from
[virtual]
 

FIXME: write function documentation

Reimplemented in SoInteractionKit.

SbBool SoBaseKit::set const char * namevaluepairliststring
 

FIXME: write function documentation

SbBool SoBaseKit::set const char * partnamestring,
const char * parameterstring
 

FIXME: write function documentation

void SoBaseKit::doAction SoAction * action [virtual]
 

This function performs the typical operation of a node for any action.

Reimplemented from SoNode.

void SoBaseKit::callback SoCallbackAction * action [virtual]
 

Action method for SoCallbackAction.

Simply updates the state according to how the node behaves for the render action, so the application programmer can use the SoCallbackAction for extracting information about the scene graph.

Reimplemented from SoNode.

Reimplemented in SoDragger.

void SoBaseKit::GLRender SoGLRenderAction * action [virtual]
 

Action method for the SoGLRenderAction.

This is called during rendering traversals. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method.

Reimplemented from SoNode.

Reimplemented in SoDragger, and SoTabPlaneDragger.

void SoBaseKit::getBoundingBox SoGetBoundingBoxAction * action [virtual]
 

Action method for the SoGetBoundingBoxAction.

Calculates bounding box and center coordinates for node and modifies the values of the action to encompass the bounding box for this node and to shift the center point for the scene more towards the one for this node.

Nodes influencing how geometry nodes calculates their bounding box also overrides this method to change the relevant state variables.

Reimplemented from SoNode.

Reimplemented in SoDragger, and SoCenterballDragger.

void SoBaseKit::getMatrix SoGetMatrixAction * action [virtual]
 

Action method for SoGetMatrixAction.

Updates action by accumulating with the transformation matrix of this node (if any).

Reimplemented from SoNode.

Reimplemented in SoDragger, and SoCenterballDragger.

void SoBaseKit::handleEvent SoHandleEventAction * action [virtual]
 

Action method for SoHandleEventAction.

Inspects the event data from action, and processes it if it is something which this node should react to.

Nodes influencing relevant state variables for how event handling is done also overrides this method.

Reimplemented from SoNode.

Reimplemented in SoDragger.

void SoBaseKit::rayPick SoRayPickAction * action [virtual]
 

Action method for SoRayPickAction.

Checks the ray specification of the action and tests for intersection with the data of the node.

Nodes influencing relevant state variables for how picking is done also overrides this method.

Reimplemented from SoNode.

Reimplemented in SoDragger.

void SoBaseKit::search SoSearchAction * action [virtual]
 

Action method for SoSearchAction.

Compares the search criteria from the action to see if this node is a match. Searching is done by matching up all criteria set up in the SoSearchAction -- if any of the requested criteria is a miss, the search is not deemed successful for the node.

See also:
SoSearchAction

Reimplemented from SoNode.

Reimplemented in SoDragger.

void SoBaseKit::write SoWriteAction * action [virtual]
 

Action method for SoWriteAction.

Writes out a node object, and any connected nodes, engines etc, if necessary.

Reimplemented from SoNode.

Reimplemented in SoDragger.

void SoBaseKit::getPrimitiveCount SoGetPrimitiveCountAction * action [virtual]
 

Action method for the SoGetPrimitiveCountAction.

Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the action.

Nodes influencing how geometry nodes calculates their primitive count also overrides this method to change the relevant state variables.

Reimplemented from SoNode.

Reimplemented in SoDragger.

SoChildList * SoBaseKit::getChildren void const [virtual]
 

Returns list of children for this node.

Reimplemented from SoNode.

void SoBaseKit::printDiagram void
 

Print out the full nodekit catalog structure. Useful for debugging.

void SoBaseKit::printSubDiagram const SbName & rootname,
int level
 

Print out the nodekit catalog structure from rootname and downwards in the catalog tree, with indentation starting at level.

void SoBaseKit::printTable void
 

Write the complete nodekit catalog in table form.

void SoBaseKit::addWriteReference SoOutput * out,
SbBool isfromfield = FALSE
[virtual]
 

Overloaded from SoBase to make sure field connections into other field containers are also accounted for.

Reimplemented from SoFieldContainer.

SbBool SoBaseKit::forceChildDrivenWriteRefs SoOutput * out
 

Returns TRUE if kit should write. This happens if shouldWrite() returns TRUE, or if any of the children (recursively) should write.

SbBool SoBaseKit::isSearchingChildren void [static]
 

FIXME: write function documentation

void SoBaseKit::setSearchingChildren const SbBool newval [static]
 

FIXME: write function documentation

SoNode * SoBaseKit::typeCheck const SbName & partname,
const SoType & parttype,
SoNode * node
[static]
 

FIXME: write function documentation

const SoNodekitCatalog ** SoBaseKit::getClassNodekitCatalogPtr void [static, protected]
 

Returns the pointer to the pointer of the nodekit catalog for this class.

SoNode * SoBaseKit::addToCopyDict void const [protected, virtual]
 

Overloaded to also recurse on non-null part nodes.

Reimplemented from SoNode.

void SoBaseKit::copyContents const SoFieldContainer * fromfc,
SbBool copyconnections
[protected, virtual]
 

Makes a deep copy of all data of from into this instance, except external scenegraph references if copyconnections is FALSE.

This is the method that should be overridden by subclasses which needs to account for internal data that are not handled automatically.

Make sure that when you override the copyContents() method in your extension class that you also make it call upwards to it's parent superclass in the inheritance hierarchy, as copyContents() in for instance SoNode and SoFieldContainer does important work. It should go something like this:

  void
  MyCoinExtensionNode::copyContents(const SoFieldContainer * from,
                                    SbBool copyconnections)
  {
    // let parent superclasses do their thing (copy fields, copy
    // instance name, etc etc)
    SoNode::copyContents(from, copyconnections);

    // [..then copy internal data..]
  }

Reimplemented from SoNode.

Reimplemented in SoInteractionKit, SoRotateCylindricalDragger, and SoRotateSphericalDragger.

SoGroup * SoBaseKit::getContainerNode const SbName & listname,
SbBool makeifneeded = TRUE
[protected]
 

FIXME: write function documentation

SoNode * SoBaseKit::getAnyPart const SbName & partname,
SbBool makeifneeded,
SbBool leafcheck = FALSE,
SbBool publiccheck = FALSE
[protected, virtual]
 

FIXME: write function documentation

SoNodeKitPath * SoBaseKit::createPathToAnyPart const SbName & partname,
SbBool makeifneeded,
SbBool leafcheck = FALSE,
SbBool publiccheck = FALSE,
const SoPath * pathtoextend = NULL
[protected, virtual]
 

Return path with nested SoNodeKit instances down in the catalog hierarchy given by partname.

If the trailing part has not been made and makeifneeded is TRUE, make an instance of the part type and insert into the catalog, as done in setAnyPart().

If leafcheck is TRUE, ignore non-leaf catalog node entries. If publiccheck is TRUE, ignore private catalog entries.

pathtoextend is a path through the nodekit instance catalog hierarchy, where we should pick up and continue to create the path from where pathtoextend terminates. If pathtoextend is NULL, we simply start at the "this" toplevel node.

Returns NULL on failure, for any of the possible reasons described above (part ends in non-leaf or private catalog entry, part is not syntactically valid or refers to non-existing catalog entries).

SbBool SoBaseKit::setAnyPart const SbName & partname,
SoNode * from,
SbBool anypart = TRUE
[protected, virtual]
 

FIXME: write function documentation

void SoBaseKit::createNodekitPartsList void [protected]
 

Not part of the Coin API.

It is supposed to create the SoNodekitParts class instance. Since this class can only be used by SoBaseKit (all members are private, with SoBaseKit as friend), we decided to not support this class, and solve the problem of recording which parts are created in an alternative way.

void SoBaseKit::createFieldList void [protected]
 

Replaces the createNodekitPartsList() method.

Sets up the list of SoSFNode fields with node pointers to the instances in our catalog.

void SoBaseKit::createDefaultParts void [protected, virtual]
 

FIXME: write function documentation

const SoNodekitParts * SoBaseKit::getNodekitPartsList void const [protected]
 

In Open Inventor, this method returns a pointer to a private class. It will always return NULL in Coin.

See also:
createNodekitPartsList()

const SbList< SoSFNode *> & SoBaseKit::getCatalogInstances void const [protected]
 

For internal use only.

void SoBaseKit::catalogError void [protected]
 

Obsoleted from the API in Coin.

SbBool SoBaseKit::setUpConnections SbBool onoff,
SbBool doitalways = FALSE
[protected, virtual]
 

Sets up all internal connections for instances of this class.

(This method will usually not be of interest to the application programmer, unless you want to extend the library with new custom nodekits or dragger classes. If so, see the SoBaseKit class documentation.)

Reimplemented in SoInteractionKit, SoSeparatorKit, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, and SoTranslate2Dragger.

SbBool SoBaseKit::readInstance SoInput * in,
unsigned short flags
[protected, virtual]
 

This method is mainly intended for internal use during file import operations.

It reads a definition of an instance from the input stream in. The input stream state points to the start of a serialized / persistant representation of an instance of this class type.

TRUE or FALSE is returned, depending on if the instantiation and configuration of the new object of this class type went ok or not. The import process should be robust and handle corrupted input streams by returning FALSE.

flags is used internally during binary import when reading user extension nodes, group nodes or engines.

Reimplemented from SoNode.

Reimplemented in SoInteractionKit.

void SoBaseKit::setDefaultOnNonWritingFields void [protected, virtual]
 

(Be aware that this method is unlikely to be of interest to the application programmer who does not want to extend the library with new custom nodekits or draggers. If you indeed are writing extensions, see the information in the SoBaseKit class documentation.)

A virtual method that should call SoField::setDefault() with argument TRUE on part fields that should not be written upon scenegraph export operations.

This is typically done when:

  1. field value is NULL and part is NULL by default

  2. it is a leaf SoGroup or SoSeparator node with no children

  3. it is a leaf listpart with no children and a SoGroup or SoSeparator container

  4. it is a non-leaf part and it's of SoGroup type and all fields are at their default values

Subclasses should usually override this to do additional settings for new member fields. From the subclass, do remember to call "upwards" to your superclass' setDefaultOnNonWritingFields() method.

Reimplemented in SoInteractionKit, SoSeparatorKit, SoShapeKit, SoDragger, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, and SoTransformerDragger.

void SoBaseKit::countMyFields SoOutput * out [protected]
 

Reference count connections to nodes in the catalog.

SbBool SoBaseKit::setPart const int partNum,
SoNode * node
[protected, virtual]
 

Sets parts, updates nodekit scene graph, and makes sure graph is valid with respect to right siblings and parent. This method is virtual to enable subclasses to detect when a part changes value.

This method is not part of the original SGI Open Inventor API, but is an extension specific to Coin.

Reimplemented in SoInteractionKit.


Member Data Documentation

SoChildList * SoBaseKit::children [protected]
 

For internal use only.

SbBool SoBaseKit::connectionsSetUp [protected]
 

For internal use only.


The documentation for this class was generated from the following files:
Generated at Tue Mar 5 03:31:21 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001