waypoint Class Reference

The waypoint JavaScript global object. More...

Public Slots

String add (String &parentGroup, String &instanceName, int x, int y)
 Add a waypoint to the Node View. More...
 
bool deleteWaypoint (String &qualifiedName)
 Delete a single waypoint. More...
 
bool linkOutportToWaypoint (String &nodeQualifiedName, int outPortId, String &wpQualifiedName)
 Link an output port from a node to a waypoint. More...
 
bool linkWaypointToWaypoint (String &srcQualifiedName, String &dstQualifiedName)
 Link a waypoint to another waypoint. More...
 
bool linkWaypointToInport (String &wpQualifiedName, String &nodeQualifiedName, int inPortId, bool insertMode=false)
 Link a waypoint to an input port. More...
 
StringList getAllWaypointsAbove (String &nodeQualifiedName, int inPortId)
 Retrieve all the waypoints found along the cable of the specified node input port. More...
 
StringList getAllWaypointsBelow (String &nodeQualifiedName, int outPortId)
 Retrieve all the waypoints found along the cable tree under the specified node output port. More...
 
StringList getWaypointsInGroup (String &groupQualifiedName)
 Retrieve the waypoint list for the specified group. More...
 
bool unlinkParent (String &wpQualifiedName)
 Unlink the waypoint from its parent node or waypoint. More...
 
bool unlinkChildInport (String &wpQualifiedName, String &nodeQualifiedName, int inPortId)
 Unlink the child input port from the waypoint. More...
 
bool unlinkChildNode (String &wpQualifiedName, String &nodeQualifiedName)
 Unlink the destination node from the waypoint source. More...
 
bool unlinkChildWaypoint (String &wpQualifiedName, String &childWpQualifiedName)
 Unlink the child waypoint from the specified waypoint. More...
 
bool unlinkAllChildren (String &wpQualifiedName)
 Unlink all children node and children waypoints from the specified waypoint. More...
 
QScriptValue childInports (String &wpQualifiedName)
 Retrieve the list of children ports directly connected to the specified waypoint. More...
 
StringList childNodes (String &wpQualifiedName)
 Retrieve the list of children port nodes directly connected to the specified waypoint. More...
 
StringList childWaypoints (String &wpQualifiedName)
 Retrieve the list of children waypoints. More...
 
StringList childWaypoints (String &nodeQualifiedName, int outPortId)
 Retrieve the list of waypoints directly linked to the specified node output port. More...
 
String parentWaypoint (String &wpQualifiedName)
 Get parent waypoint path. More...
 
String parentWaypoint (String &nodeQualifiedName, int inPortId)
 Retrieve the waypoint above a node port, linked to the specified input port. More...
 
String parentNode (String &wpQualifiedName)
 Get parent node path, if applicable. More...
 
int parentOutport (String &wpQualifiedName)
 Get parent outport index, if applicable. More...
 
void setCoord (String &qualifiedName, int x, int y)
 Set the position of a waypoint in the Node View. More...
 
int coordX (String &qualifiedName)
 Returns an integer indicating the X position of a waypoint in the Node View. More...
 
int coordY (String &qualifiedName)
 Returns an integer indicating the X position of a waypoint in the Node View. More...
 

Detailed Description

The waypoint JavaScript global object.

Waypoints are graphical objects used in the Node View to control the path of a cable linking modules together. With waypoint methods, it is possible to Add, link, remove, move and get position of any waypoint. The naming convention for waypoints is highly similar to naming convention for nodes. The qualified name of a waypoint is the concatenation of its parent group qualified name and its instance name, e.g. "Top/MyFirstGroup/MyWaypointName".

waypoint.add("Top", "MyWaypoint1",-110, 10);
waypoint.add("Top", "MyWaypoint2",-110, 60);
waypoint.linkOutportToWaypoint("Top/Drawing",0,"Top/MyWaypoint1");
waypoint.linkWaypointToWaypoint("Top/MyWaypoint1","Top/MyWaypoint2");
waypoint.linkWaypointToInport("Top/MyWaypoint2","Top/Composite", 0, true);

Member Function Documentation

◆ add

String waypoint::add ( String &  parentGroup,
String &  instanceName,
int  x,
int  y 
)
slot

Add a waypoint to the Node View.

For an example usage of add, see the above Detailed Description.

Parameters
parentGroup: The path of the parent group node into which you want to add this waypoint.
instanceName: The suggested name of the waypoint you want to add.
x: The X position of the waypoint in the Node View.
y: The Y position of the waypoint in the Node View.
Returns
Returns the path to the newly added waypoint (possibly modified to enforce its uniqueness within the group).

◆ childInports

QScriptValue waypoint::childInports ( String &  wpQualifiedName)
slot

Retrieve the list of children ports directly connected to the specified waypoint.

Meant to be used in conjunction with waypoint.childNodes().

var childNodes = waypoint.childNodes("Top/waypoint_1");
var childInports = waypoint.childInports("Top/waypoint_1");
for(var i=0; i < childNodes.length; ++i)
MessageLog.trace("child name:" + childNodes[i] + " Inport:" + childInports[i]);
Parameters
wpQualifiedName: The path to the waypoint.
Returns
Returns an array of index for each child port or an empty array if none is found.

◆ childNodes

StringList waypoint::childNodes ( String &  wpQualifiedName)
slot

Retrieve the list of children port nodes directly connected to the specified waypoint.

Meant to be used in conjunction with waypoint.childInports().

var childNodes = waypoint.childNodes("Top/waypoint_1");
var childInports = waypoint.childInports("Top/waypoint_1");
for(var i=0; i < childNodes.length; ++i)
MessageLog.trace("child name:" + childNodes[i] + " Inport:" + childInports[i]);
Parameters
wpQualifiedName: The path to the waypoint.
Returns
Returns an array of strings for each child port node or an empty array if none is found.

◆ childWaypoints [1/2]

StringList waypoint::childWaypoints ( String &  wpQualifiedName)
slot

Retrieve the list of children waypoints.

var childWps = waypoint.childWaypoints("Top/waypoint_1");
MessageLog.trace(childWps);
Parameters
wpQualifiedName: The path to the waypoint.
Returns
Returns an array of strings for each child waypoint or an empty array if none is found.

◆ childWaypoints [2/2]

StringList waypoint::childWaypoints ( String &  nodeQualifiedName,
int  outPortId 
)
slot

Retrieve the list of waypoints directly linked to the specified node output port.

var childWps = waypoint.childWaypoints("Top/composite", 0);
MessageLog.trace(childWps);
Parameters
nodeQualifiedName: The path of the node.
outPortId: The out port from which waypoints are linked. This value is between 0 and the number of node out ports, minus one.
Returns
Returns an array of waypoint qualified names linked to the specified out port or an empty array if non-applicable.

◆ coordX

int waypoint::coordX ( String &  qualifiedName)
slot

Returns an integer indicating the X position of a waypoint in the Node View.

The example below takes the path of a waypoint, uses coordX to retrieve it's X coordinate in the Node View, then moves it to the right by 50 units.

function shiftWaypoint( exWaypoint )
{
var x = waypoint.coordX(exWaypoint);
var y = waypoint.coordY(exWaypoint);
x += 50;
waypoint.setCoord(exWaypoint,x,y);
}
Parameters
qualifiedName: The path of the waypoint.
Returns
Returns an integer indicating the X position of a waypoint in the Node View.

◆ coordY

int waypoint::coordY ( String &  qualifiedName)
slot

Returns an integer indicating the X position of a waypoint in the Node View.

The example below takes the path of a waypoint, uses coordY to retrieve it's X coordinate in the Node View, then moves it to the down by 50 units.

function shiftWaypoint( exWaypoint )
{
var x = waypoint.coordX(exWaypoint);
var y = waypoint.coordY(exWaypoint);
y += 50;
waypoint.setCoord(exWaypoint,x,y);
}
Parameters
qualifiedName: The path of the waypoint.
Returns
Returns an integer indicating the Y position of a waypoint in the Node View.

◆ deleteWaypoint

bool waypoint::deleteWaypoint ( String &  qualifiedName)
slot

Delete a single waypoint.

The following example deletes the currently selected waypoint. Existing links will bypass the deleted waypoint.

Parameters
qualifiedName: The path of the waypoint.
Returns
Returns true if successful.

◆ getAllWaypointsAbove

StringList waypoint::getAllWaypointsAbove ( String &  nodeQualifiedName,
int  inPortId 
)
slot

Retrieve all the waypoints found along the cable of the specified node input port.

Parameters
nodeQualifiedName: The path of the node.
inPortId: The in port from which the waypoint path starts. This value is between 0 and the number of node in ports, minus one.
Returns
Returns an array of waypoint qualified names found along the cable, ordered from closest to farthest.

◆ getAllWaypointsBelow

StringList waypoint::getAllWaypointsBelow ( String &  nodeQualifiedName,
int  outPortId 
)
slot

Retrieve all the waypoints found along the cable tree under the specified node output port.

Parameters
nodeQualifiedName: The path of the node.
outPortId: The out port from which waypoints are linked. This value is between 0 and the number of node out ports, minus one.
Returns
Returns an array of waypoint qualified names found in the waypoint tree linked to the specified out port or an empty array if non-applicable.

◆ getWaypointsInGroup

StringList waypoint::getWaypointsInGroup ( String &  groupQualifiedName)
slot

Retrieve the waypoint list for the specified group.

var groupWps = waypoint.getWaypointsInGroup("Top");
MessageLog.trace(groupWps);
Parameters
groupQualifiedName: The path of the group.
Returns
Returns an array of waypoint qualified names.

◆ linkOutportToWaypoint

bool waypoint::linkOutportToWaypoint ( String &  nodeQualifiedName,
int  outPortId,
String &  wpQualifiedName 
)
slot

Link an output port from a node to a waypoint.

waypoint.add("Top", "MyWaypoint1",-110, 10);
waypoint.linkOutportToWaypoint("Top/Drawing",0,"Top/MyWaypoint1");
Parameters
nodeQualifiedName: The path of the node whose output port you want to link to a destination waypoint.
outPortId: The port that you want to link to the input port on the destination waypoint. This value is between 0 and the results of the numberOfOutputPorts() method, minus one.
wpQualifiedName: The path of the waypoint you want to link to the source node.
Returns
Returns true if successful.

◆ linkWaypointToInport

bool waypoint::linkWaypointToInport ( String &  wpQualifiedName,
String &  nodeQualifiedName,
int  inPortId,
bool  insertMode = false 
)
slot

Link a waypoint to an input port.

waypoint.add("Top", "MyWaypoint1",-110, 10);
waypoint.linkWaypointToInport("Top/MyWaypoint1","Top/Composite", 0, true);
Parameters
wpQualifiedName: The path of the source waypoint you want to link from.
nodeQualifiedName: The path of the destination node you want to link to.
inPortId: The port on the destination node that you want to link to the waypoint source. This value is between 0 and the results of the numberOfInputPorts() method, minus one.
insertMode: This flag allows to either insert a new port on the destination node (true) or link to an existing port (false) if one exists at the specified index.
Returns
Returns true if successful.

◆ linkWaypointToWaypoint

bool waypoint::linkWaypointToWaypoint ( String &  srcQualifiedName,
String &  dstQualifiedName 
)
slot

Link a waypoint to another waypoint.

waypoint.add("Top", "MyWaypoint1",-110, 10);
waypoint.add("Top", "MyWaypoint2",-110, 60);
waypoint.linkWaypointToWaypoint("Top/MyWaypoint1","Top/MyWaypoint2");
Parameters
srcQualifiedName: The path of the source waypoint you want to link from.
dstQualifiedName: The path of the destination waypoint you want to link to.
Returns
Returns true if successful.

◆ parentNode

String waypoint::parentNode ( String &  wpQualifiedName)
slot

Get parent node path, if applicable.

Parameters
wpQualifiedName: The path to the waypoint.
Returns
Returns a string containing the parent node path or an empty string if non-applicable.

◆ parentOutport

int waypoint::parentOutport ( String &  wpQualifiedName)
slot

Get parent outport index, if applicable.

Parameters
wpQualifiedName: The path to the waypoint.
Returns
Returns an int containing the parent port index or -1 if non-applicable.

◆ parentWaypoint [1/2]

String waypoint::parentWaypoint ( String &  wpQualifiedName)
slot

Get parent waypoint path.

var parentWp = waypoint.parentWaypoint("Top/waypoint_1");
MessageLog.trace(parentWp);
Parameters
wpQualifiedName: The path to the waypoint.
Returns
Returns a string containing the parent waypoint path or an empty string if non-applicable.

◆ parentWaypoint [2/2]

String waypoint::parentWaypoint ( String &  nodeQualifiedName,
int  inPortId 
)
slot

Retrieve the waypoint above a node port, linked to the specified input port.

var parentWp = waypoint.parentWaypoint("Top/composite", 0);
MessageLog.trace(parentWp);
Parameters
nodeQualifiedName: The path of the node.
inPortId: The in port to which a waypoint is linked. This value is between 0 and the number of node in ports, minus one.
Returns
Returns a string containing the waypoint qualified name or an empty string if non-applicable.

◆ setCoord

void waypoint::setCoord ( String &  qualifiedName,
int  x,
int  y 
)
slot

Set the position of a waypoint in the Node View.

The example below takes the path of a waypoint and then shifts its position 50 units to the right, and down in the node view.

function shiftWaypoint(exWaypoint)
{
var x = waypoint.coordX(exWaypoint);
var y = waypoint.coordY(exWaypoint);
x += 50;
y += 50;
waypoint.setCoord(exWaypoint,x,y);
}
Parameters
qualifiedName: The path of the waypoint.
x: The X position of the waypoint in the Node View.
y: The Y position of the waypoint in the Node View.
Returns
Returns true if successful.

◆ unlinkAllChildren

bool waypoint::unlinkAllChildren ( String &  wpQualifiedName)
slot

Unlink all children node and children waypoints from the specified waypoint.

This method will also disconnect all destination ports below the waypoint.

waypoint.unlinkAllChildren("Top/waypoint_1");
Parameters
wpQualifiedName: The parent waypoint.
Returns
Returns true if successful.

◆ unlinkChildInport

bool waypoint::unlinkChildInport ( String &  wpQualifiedName,
String &  nodeQualifiedName,
int  inPortId 
)
slot

Unlink the child input port from the waypoint.

waypoint.unlinkChildInport("Top/waypoint_1", "Top/Composite", 1);
Parameters
wpQualifiedName: The path of the waypoint.
nodeQualifiedName: The path to the destination node.
inPortId: The index of the port to unlink.
Returns
Returns true if successful.

◆ unlinkChildNode

bool waypoint::unlinkChildNode ( String &  wpQualifiedName,
String &  nodeQualifiedName 
)
slot

Unlink the destination node from the waypoint source.

waypoint.unlinkChildNode("Top/waypoint_1", "Top/Composite_1");
Parameters
wpQualifiedName: The path of the waypoint.
nodeQualifiedName: The path to the destination node.
Returns
Returns true if successful.

◆ unlinkChildWaypoint

bool waypoint::unlinkChildWaypoint ( String &  wpQualifiedName,
String &  childWpQualifiedName 
)
slot

Unlink the child waypoint from the specified waypoint.

This method will also disconnect all destination ports below the child waypoint.

waypoint.unlinkChildWaypoint("Top/waypoint_1","Top/waypoint_2");
Parameters
wpQualifiedName: The parent waypoint.
childWpQualifiedName: The child waypoint to unlink.
Returns
Returns true if successful.

◆ unlinkParent

bool waypoint::unlinkParent ( String &  wpQualifiedName)
slot

Unlink the waypoint from its parent node or waypoint.

waypoint.unlinkParent("Top/waypoint_1");
Parameters
wpQualifiedName: The path of the waypoint.
Returns
Returns true if successful.