|ScriptNode (XnNodeHandle hNode=NULL)|
|ScriptNode (const NodeWrapper &other)|
|XnStatus||Create (Context &context, const XnChar *strFormat)|
|const XnChar *||GetSupportedFormat ()|
|XnStatus||LoadScriptFromFile (const XnChar *strFileName)|
|XnStatus||LoadScriptFromString (const XnChar *strScript)|
|XnStatus||Run (EnumerationErrors *pErrors)|
Purpose: The ScriptNode object loads an XML script from a file or string, and then runs the XML script to build a production graph. It also references every node created from that script, so it wouldn't be destroyed.
A typical usage of a script node is:
- Create the script node, using the Create() method.
- Load XML script from file or string, using LoadScriptFromFile() or LoadScriptFromString().
- Execute the script, using Run().
All production nodes in the production graph use reference count to determine their life time, but if an application executed a script, it can't know upfront which nodes will be created by this script, and so, can't take reference to them, so those nodes might be destroyed immediately. The script node, apart from executing the script, also keeps reference to all the nodes created by the script. This means that if the script node is destroyed, every production node that was created by the script, and is unreferenced by the application will also be destroyed. For this reason, it is recommended for application using XML scripts to keep a reference to the script node as long as they keep a reference to the context itself.
A single ScriptNode object is responsible for building the entire production graph, irrespective of however many node definitions there are in the XML script and how many production nodes are created.
For additional information about XML scripts, see Xml Scripts.
Constructor & Destructor Documentation
|xn::ScriptNode::ScriptNode||(||XnNodeHandle||hNode = ||)||
[in] hNode Node handle
|xn::ScriptNode::ScriptNode||(||const NodeWrapper &||other||)||
Member Function Documentation
|const XnChar* xn::ScriptNode::GetSupportedFormat||(||)||
|XnStatus xn::ScriptNode::LoadScriptFromFile||(||const XnChar *||strFileName||)||
Loads an XML script file into the ScriptNode object.
[in] strFileName Name of file containing an XML script.
|XnStatus xn::ScriptNode::LoadScriptFromString||(||const XnChar *||strScript||)||
Loads an XML script string into the ScriptNode object.
[in] strScript String containing an XML script.
Runs the ScriptNode object's XML script to build a production graph.
[out] pErrors List of enumeration errors produced during method execution.
The documentation for this class was generated from the following file:
Generated on Wed May 16 2012 10:16:07 for OpenNI 1.5.4 by 220.127.116.11