SYNOPSIS
#include <Inventor/VRMLnodes/SoVRMLScript.h>
Inherits SoNode.
Public Member Functions
virtual SoType getTypeId (void) const
virtual void doAction (SoAction *action)
virtual void callback (SoCallbackAction *action)
virtual void GLRender (SoGLRenderAction *action)
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
virtual void pick (SoPickAction *action)
virtual void handleEvent (SoHandleEventAction *action)
virtual void write (SoWriteAction *action)
Static Public Member Functions
static void initClass (void)
static SoType getClassTypeId (void)
static void setScriptEvaluateCB (SoVRMLScriptEvaluateCB *cb, void *closure)
Public Attributes
SoMFString url
SoSFBool directOutput
SoSFBool mustEvaluate
Protected Member Functions
virtual void copyContents (const SoFieldContainer *from, SbBool copyconn)
virtual void notify (SoNotList *list)
Additional Inherited Members
Detailed Description
The SoVRMLScript class is used to control the scene using scripts.
The detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997). It is copyright The Web3D Consortium, and is used by permission of the Consortium:
Script { exposedField MFString url [] field SFBool directOutput FALSE field SFBool mustEvaluate FALSE # And any number of: eventIn eventType eventName field fieldType fieldName initialValue eventOut eventType eventName }.fi The Script node is used to program behaviour in a scene. Script nodes typically
- signify a change or user action;
- receive events from other nodes;
- contain a program module that performs some computation;
- effect change somewhere else in the scene by sending events.
Member Function Documentation
void SoVRMLScript::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.
SoType SoVRMLScript::getClassTypeId (void) [static]
This static method returns the SoType object associated with objects of this class.Reimplemented from SoNode.
SoType SoVRMLScript::getTypeId (void) const [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting.Usage example:
void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } }
For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.
For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.
Implements SoBase.
void SoVRMLScript::doAction (SoAction *action) [virtual]
This function performs the typical operation of a node for any action.Reimplemented from SoNode.
void SoVRMLScript::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.
void SoVRMLScript::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.
void SoVRMLScript::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.
void SoVRMLScript::pick (SoPickAction *action) [virtual]
Action method for SoPickAction.Does common processing for SoPickAction action instances.
Reimplemented from SoNode.
void SoVRMLScript::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.
void SoVRMLScript::write (SoWriteAction *action) [virtual]
Action method for SoWriteAction.Writes out a node object, and any connected nodes, engines etc, if necessary.
Reimplemented from SoNode.
void SoVRMLScript::setScriptEvaluateCB (SoVRMLScriptEvaluateCB *cb, void *closure) [static]
Sets the callback that will be called when the script needs to be evaluated.void SoVRMLScript::copyContents (const SoFieldContainer *from, SbBoolcopyconnections) [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 protected method that should be overridden by extension node / engine / dragger / whatever subclasses which needs to account for internal data that are not handled automatically.
For copying nodes from application code, you should not invoke this function directly, but rather call the SoNode::copy() function:
SoNode * mynewnode = templatenode->copy();
The same also goes for engines.
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.
void SoVRMLScript::notify (SoNotList *l) [protected], [virtual]
Notifies all auditors for this instance when changes are made.Reimplemented from SoNode.
Author
Generated automatically by Doxygen for Coin from the source code.