RaySupreme Script API
 All Data Structures Functions Pages
Public Member Functions
NodeGraph Class Reference
Inheritance diagram for NodeGraph:
Node

Public Member Functions

NodelastNode (void)
 
NodeaddNode (string name)
 
NodeGraphaddSubGraph (void)
 
bool moveNode (Node *node, NodeGraph *dest)
 
bool moveNodeGraph (NodeGraph *graph, NodeGraph *dest)
 
NodeDescriptorListavailableNodeList (void)
 
ToolListavailableToolList (void)
 
NodeListnodeList (void)
 
bool contains (string uuid, bool recursive=true)
 
NodeListfindNodes (string uuid, bool recursive=true)
 
NodefindNode (int id, bool recursive=true)
 
NodefindNodeByName (name)
 
NodeGraphListfindNodeGraphsByName (string name)
 
bool removeNode (Node *)
 
ToolgetTool (string uuid)
 
MeshgetMesh (bool recursive=false)
 
Vector3boundingBoxSize (void)
 
Vector3boundingBox (int minMax)
 
void sortNodes (void)
 
void loadObjectTemplate (string templateId, int year=-1, string style="", string tag="", string adjectives="")
 
void loadMaterialTemplate (string templateId)
 
- Public Member Functions inherited from Node
string name (void)
 
void setName (string)
 
int id (void)
 
ParameterContainerparamContainer (void)
 
NodeGraphparentGraph (void)
 
NodeGraphrootGraph (void)
 
NodeGraphtoNodeGraph (void)
 
NodeDescriptordescriptor (void)
 
TerminalListterminalList (void)
 
Terminalterminal (string name)
 

Detailed Description

Represents a Node Container.

The NodeGraph class represents a container which holds a certain amount of Nodes and other NodeGraphs. In RaySupreme, a top level NodeGraph is an Object, it's sub Objects are represented by child NodeGraphs.

Member Function Documentation

Node* NodeGraph::addNode ( string  name)

Add a Node of the given path to the Graph.

Parameters
nameThe path of the Node to be added. You can get a list of available Nodes and their paths via the availableNodeList() function.
Returns
The newly created Node or null if the operation failed.
NodeGraph* NodeGraph::addSubGraph ( void  )

Add a Subgraph to this Graph.

Returns
The newly created NodeGraph, which is a sub-graph of this Graph.
NodeDescriptorList* NodeGraph::availableNodeList ( void  )

Returns a NodeDescriptorList of all available Node types (not actual nodes, use nodeList() for this).

Returns
The NodeDescriptorList of all possible Nodes this NodeGraph supports.
ToolList* NodeGraph::availableToolList ( void  )

Returns the list of Tools available / applicable for this NodeGraph.

Returns
List of Tools available for this NodeGraph.
Vector3* NodeGraph::boundingBox ( int  minMax)

Returns a vector with either the min values of the bounding box or the max values.

Parameters
minMaxIf 0, returns the minimum values of the bounding box, if 1, returns the maximum values.
Returns
A Vector3 containing either the minimum or maximum values of the bounding box.
Vector3* NodeGraph::boundingBoxSize ( void  )

Returns the size of the bounding box of the NodeGraph.

Returns
A Vector3 with it's values set to the size of the bounding box of the NodeGraph.
bool NodeGraph::contains ( string  uuid,
bool  recursive = true 
)

Returns true if this graph (or also it's sub-graphs if recursive is specified) contains a node with the given uuid or path.

Parameters
uuidThe uuid or path of the node.
recursiveIf true, the search will look recursively into all sub-graphs of this graph.
Returns
True if such a node exists in the Graph, false otherwise.
Node* NodeGraph::findNode ( int  id,
bool  recursive = true 
)

Finds the node of the given id, each node inside a graph has a unique id valid during it's lifetime. You can query this id using Node::id().

Parameters
recursiveIf true, the search will look recursively into all sub-graphs of this graph.
Returns
The Node found or null if not found.
Node* NodeGraph::findNodeByName ( name  )

Finds the Node of the given name inside this graph (and it's sub-graphs).

Returns
The Node found or null if not found.
NodeGraphList* NodeGraph::findNodeGraphsByName ( string  name)

Finds the NodeGraph of the given name inside this graph (and it's sub-graphs).

Returns
The Node found or null if not found.
NodeList* NodeGraph::findNodes ( string  uuid,
bool  recursive = true 
)

Returns a list of all nodes in this graph (or also it's sub-graphs if recursive is specified) which have a uuid or path of the given value. This way you can get a list of certain type of nodes inside this graph.

Parameters
uuidThe uuid or path of the node to search for.
recursiveIf true, the search will look recursively into all sub-graphs of this graph.
Returns
The list of nodes found.
Mesh* NodeGraph::getMesh ( bool  recursive = false)

Returns the mesh of this NodeGraph. If recursive is true, also searches all childs and returns the first found. If no MeshEditor node was found in the NodeGraph, this function will return null.

Parameters
recursiveDefines if the childs should be searched too, default value is false.
Returns
The found Mesh or null otherwise.
Tool* NodeGraph::getTool ( string  uuid)

Returns the Tool of the given uuid.

Parameters
uuidThe uuid of the tool.
Returns
The Tool found for the given uuid.
Node* NodeGraph::lastNode ( void  )

Returns the last node of this NodeGraph. For an object, this is always a Transform Node. For a Material Graph, this is an Material Node.

Returns
The last Node of the Graph.
void NodeGraph::loadMaterialTemplate ( string  templateId)

Loads the material template identified by templateId as a subgraph.

Parameters
templateIdThe templateId identifies the template to be loaded. It can either be it's uuid, name or alternative name.
yearOptionally defines the year the template has to support. -1 means the current year.
styleOptionally defines a style which the template should support.
tagOptionally defines a tag the template should support.
adjectivesOptionally defines the adjectives for the template (Not yet supported).
void NodeGraph::loadObjectTemplate ( string  templateId,
int  year = -1,
string  style = "",
string  tag = "",
string  adjectives = "" 
)

Loads the object template identified by templateId as a subgraph.

Parameters
templateIdThe templateId identifies the template to be loaded. It can either be it's uuid, name or alternative name.
yearOptionally defines the year the template has to support. -1 means the current year.
styleOptionally defines a style which the template should support.
tagOptionally defines a tag the template should support.
adjectivesOptionally defines the adjectives for the template (Not yet supported).
bool NodeGraph::moveNode ( Node node,
NodeGraph dest 
)

Moves the given Node contained in this NodeGraph to another NodeGraph.

Parameters
nodeThe Node to be moved.
destThe destination NodeGraph.
Returns
Returns true on success, false otherwise.
bool NodeGraph::moveNodeGraph ( NodeGraph graph,
NodeGraph dest 
)

Moves the given NodeGraph, a sub-graph of this NodeGraph to another NodeGraph.

Parameters
graphThe NodeGraph to be moved.
destThe destination NodeGraph.
Returns
Returns true on success, false otherwise.
NodeList* NodeGraph::nodeList ( void  )

Returns a list of all nodes inside this graph. Note that NodeGraphs are also returned as Node's, you will have to check via Node::toNodeGraph() if a certain node is a Node or actually a NodeGraph.

Returns
The list of available Nodes in this NodeGraph.
bool NodeGraph::removeNode ( Node )

Delete the given Node which has to be inside this graph. If the node represents a graph, all the content of the sub-graph will be deleted.

Returns
True if successful, or false otherwise.
void NodeGraph::sortNodes ( void  )

NodeGraphs in RaySupreme are structured based on the connections of the contained nodes. The last node of a Graph is most certainly always a transform. When adding nodes manually, this structure is not enforced. You can call sortNodes() to make the Graph sort it's nodes immediately.