Harmony
Scripting Interface Documentation
selection Class Reference

The selection JavaScript global object. Retrieve information about the nodes or columns that are selected. More...

Public Slots

int numberOfNodesSelected ()
 returns the number of modules that are selected. More...
 
String selectedNode (int i)
 returns the path of the selected node More...
 
int numberOfColumnsSelected ()
 returns a value for the number of columns selected in the xsheet. More...
 
String selectedColumn (int i)
 returns the ith column selected in the xsheet. More...
 
bool clearSelection ()
 Clear the selection. More...
 
bool addNodeToSelection (String node)
 Add a node to the selection. More...
 
bool removeNodeFromSelection (String node)
 Remove a node from the selection. More...
 
bool addColumnToSelection (String column)
 Add a column to the selection. More...
 
bool addDrawingColumnToSelection (String columnName)
 Adds the drawing column and it's associated read node to the selection. More...
 
bool extendSelectionWithColumn (String columnName)
 Adds the column to the selection. If the column is a drawing column, also adds the associated read node to the selection. More...
 
void setSelectionFrameRange (int start, int length)
 Sets the selection frame range. More...
 
bool isSelectionRange ()
 Return true if the selection has a range. More...
 
int startFrame ()
 Return the selected start frame. More...
 
int numberOfFrames ()
 Return the number of selected frame. More...
 
void selectAll ()
 selects all nodes and all columns in the scene More...
 
QScriptValue selectedNodes ()
 return an Array of all selected nodes. More...
 
QScriptValue subSelectionForNode (String &node)
 sub selection - obtains the ID of all the sub selection for the provided node. More...
 
bool addSubSelectionForNode (String &node, QScriptValue &subSelection)
 sub selection - select a set of ID from the sub selection More...
 
bool clearSubSelectionForNode (String &vnode)
 clear all subselection on a given node. More...
 

Public Member Functions

 selection (QObject *parent, char *name)
 

Detailed Description

The selection JavaScript global object. Retrieve information about the nodes or columns that are selected.

function dumpSelectedColumn()
{
// The numberOfCellColumnsSelected function loops to check all of the selected columns and determine their frame values.
// The selectedCellColumn function prints the name of the selected column to the shell and
// then loops through the values in the column to print them as well.
var ncol = selection.numberOfCellColumnsSelected();
var nframe = frame.numberOf();
var i;
for (i = 0; i < ncol; ++i)
{
var f;
var c = selection.selectedCellColumn(i);
System.println("Column " + c);
for (f = 1; f <= nframe; ++f)
{
var value = column.getEntry(c, 1, f);
var keyframe = column.isKeyFrame(c, 1, f);
if (keyframe) value += " (keyframe)";
System.println(" " + f + ": " + value);
}
}
}

Constructor & Destructor Documentation

◆ selection()

selection::selection ( QObject *  parent,
char *  name 
)

Member Function Documentation

◆ addColumnToSelection

bool selection::addColumnToSelection ( String  column)
slot

Add a column to the selection.

returns whether columns was located and successfully added to the selection

Parameters
columnname of column

◆ addDrawingColumnToSelection

bool selection::addDrawingColumnToSelection ( String  columnName)
slot

Adds the drawing column and it's associated read node to the selection.

Parameters
columnNamedisplayed name of column

◆ addNodeToSelection

bool selection::addNodeToSelection ( String  node)
slot

Add a node to the selection.

returns whether node was located and successfully added to the selection

Parameters
nodename of node

◆ addSubSelectionForNode

bool selection::addSubSelectionForNode ( String &  node,
QScriptValue &  subSelection 
)
slot

sub selection - select a set of ID from the sub selection

◆ clearSelection

bool selection::clearSelection ( )
slot

Clear the selection.

◆ clearSubSelectionForNode

bool selection::clearSubSelectionForNode ( String &  vnode)
slot

clear all subselection on a given node.

◆ extendSelectionWithColumn

bool selection::extendSelectionWithColumn ( String  columnName)
slot

Adds the column to the selection. If the column is a drawing column, also adds the associated read node to the selection.

Parameters
columnNamedisplayed name of column

◆ isSelectionRange

bool selection::isSelectionRange ( )
slot

Return true if the selection has a range.

◆ numberOfColumnsSelected

int selection::numberOfColumnsSelected ( )
slot

returns a value for the number of columns selected in the xsheet.

◆ numberOfFrames

int selection::numberOfFrames ( )
slot

Return the number of selected frame.

◆ numberOfNodesSelected

int selection::numberOfNodesSelected ( )
slot

returns the number of modules that are selected.

◆ removeNodeFromSelection

bool selection::removeNodeFromSelection ( String  node)
slot

Remove a node from the selection.

returns whether node was located and successfully removed from the selection

Parameters
nodename of node

◆ selectAll

void selection::selectAll ( )
slot

selects all nodes and all columns in the scene

◆ selectedColumn

String selection::selectedColumn ( int  i)
slot

returns the ith column selected in the xsheet.

◆ selectedNode

String selection::selectedNode ( int  i)
slot

returns the path of the selected node

◆ selectedNodes

QScriptValue selection::selectedNodes ( )
slot

return an Array of all selected nodes.

◆ setSelectionFrameRange

void selection::setSelectionFrameRange ( int  start,
int  length 
)
slot

Sets the selection frame range.

Parameters
startbeginning frame
lengthnb of frames selected

◆ startFrame

int selection::startFrame ( )
slot

Return the selected start frame.

◆ subSelectionForNode

QScriptValue selection::subSelectionForNode ( String &  node)
slot

sub selection - obtains the ID of all the sub selection for the provided node.

Parameters
nodename of node
Returns
an Array of all the ID of for the selected node.