Model3d Class Reference

The Model3d JavaScript class. More...

Public Slots

Matrix4x4 computeMatrix (String subnodeName)
 Returns a Matrix4x4 representing the transformations done up to and including the subnode in the parameter. More...
 
QScriptValue root ()
 Returns the root(s) of the 3d Model's tree structure. More...
 
QScriptValue children (String subnodeName)
 Returns an array of all of a subnode's children. More...
 
String parent (String subnodeName)
 Returns the name of a subnode's parent subnode. More...
 
QScriptValue graph ()
 Returns an array of objects representing the tree structure of the 3d Model. More...
 

Public Member Functions

 Model3d (String nodeName, double frame)
 Creates a new Model3d object. More...
 

Detailed Description

The Model3d JavaScript class.

A Model3d is used to get information about a 3d Model.

A 3d Model is represented in Harmony by a tree structure of Subnodes that each contain an element of the model. This tree can be seen in the 3D Graph View. A Model3d object can be used to retrieve information about this tree structure and about each of the Subnodes within the tree.

Constructor & Destructor Documentation

◆ Model3d()

Model3d::Model3d ( String  nodeName,
double  frame 
)

Creates a new Model3d object.

Parameters
nodeName: The name of the node corresponding to the 3d Model. This can also be a SubnodeTransformation node.
frame: The frame number.

Member Function Documentation

◆ children

QScriptValue Model3d::children ( String  subnodeName)
slot

Returns an array of all of a subnode's children.

A subnodes children are the subnodes one level below it in the tree structure.

Parameters
subnodeName: The subnode to get the children of.
Returns
An array of all of a subnode's children.

◆ computeMatrix

Matrix4x4 Model3d::computeMatrix ( String  subnodeName)
slot

Returns a Matrix4x4 representing the transformations done up to and including the subnode in the parameter.

Parameters
subnodeName: The name of the subnode to get the transformations of.
Returns
A Matrix4x4 representing transformations done on a subnode.

◆ graph

QScriptValue Model3d::graph ( )
slot

Returns an array of objects representing the tree structure of the 3d Model.

The array is filled with objects of the form { Name : "string", Children : [array of objects] } Where the Name is the name of the subnode, and Children is an array of objects of the same form as it (with a name and array of children). The returned array has 1 element for each of the root nodes.

For example, in the case of a very simple 3d Model, with one root subnode named "Root", that has 2 children, "Child1" and "Child2", this will return an array like this:

[ { Name : "Root", Children : [ { Name : "Child1", Children : [] }, { Name : "Child2", Children : [] } ] } ]
Returns
An array of objects representing the tree structure of the 3d Model.

◆ parent

String Model3d::parent ( String  subnodeName)
slot

Returns the name of a subnode's parent subnode.

A subnode's parent is the subnode one level above it in the tree structure.

Parameters
subnodeName: The subnode to get the parent of.
Returns
The name of a subnode's parent subnode.

◆ root

QScriptValue Model3d::root ( )
slot

Returns the root(s) of the 3d Model's tree structure.

Returns
An array of the highest level subnodes in a 3d Model.