Module Class Reference

The JavaScript class to get information about nodes. Obtain it from the Context global object. More...

Public Slots

Ports
InputPort input (int idx=0)
 retrieve specific input port More...
 
Attributes
SCR_AttributeWrapper * attribute (const String &name)
 Retrieve attribute of specific name in current module. More...
 
SCR_AttributeWrapper * attribute (const String &name, const QVariant &defAttr)
 Retrieve attribute of specific name in current module. More...
 
SCR_AttributeWrapper * attribute (const String &name, QObject defAttr)
 Retrieve attribute of specific name in current module. More...
 

Properties

int nInputs
 Number of inputs. More...
 
String type
 Type name of current module. More...
 
String name
 Name of current module. More...
 
int id
 Id of current module. More...
 

Detailed Description

The JavaScript class to get information about nodes. Obtain it from the Context global object.

Refers to a specific module linked in the current rendering context. If a module exports its attributes, it is possible to fetch them using methods from this class. Modules can be accessed through the Context.

// Fetch attribute by its name, value is set to 'undefined' if not found
attr1 = module.attribute( "name" );
// Fetch attribute by its name, value is set to Point3d if not found
attr2 = module.attribute( "name", new Point3d() );

Member Function Documentation

◆ attribute [1/3]

SCR_AttributeWrapper* Module::attribute ( const String &  name)
slot

Retrieve attribute of specific name in current module.

Parameters
nameName of attribute
Returns
Attribute, or null if not found

◆ attribute [2/3]

SCR_AttributeWrapper* Module::attribute ( const String &  name,
const QVariant &  defAttr 
)
slot

Retrieve attribute of specific name in current module.

Parameters
nameName of attribute
defAttrDefault value for attribute if not found
Returns
Attribute, or Attribute linking to defAttr if not found

◆ attribute [3/3]

SCR_AttributeWrapper* Module::attribute ( const String &  name,
QObject  defAttr 
)
slot

Retrieve attribute of specific name in current module.

Parameters
nameName of attribute
defAttrDefault value for attribute if not found
Returns
Attribute, or Attribute linking to defAttr if not found

◆ input

InputPort Module::input ( int  idx = 0)
slot

retrieve specific input port

Parameters
idxIndex of port [ 0, nInput - 1 ]
Returns
InputPort

Property Documentation

◆ id

int Module::id
read

Id of current module.

◆ name

String Module::name
read

Name of current module.

◆ nInputs

int Module::nInputs
read

Number of inputs.

◆ type

String Module::type
read

Type name of current module.