Context Class Reference

The Context class represents the current frame soft rendering context. This class is the base class for the rendering context from which ports, attributes and rendering parameters can be fetched. An instance of this class is directly accessible in the scripting environment. More...

Public Slots

Ports
InputPort input (int idx=0) const
 retrieve specific input port More...
 
OutputPort output (int idx=0) const
 Retrieve specific output port. More...
 
Attributes
SCR_AttributeWrapper * attribute (const String &name)
 Retrieve a specific attribute in the current context. This method is supplied as an utility function that will parse every module in search of specified attribute. More...
 
SCR_AttributeWrapper * attribute (const String &name, const QVariant &defAttr)
 Retrieve a specific attribute in the current context. This method is supplied as an utility function that will parse every module in search of specified attribute. More...
 
SCR_AttributeWrapper * attribute (const String &name, QObject defAttr)
 Retrieve a specific attribute in the current context This method is supplied as an utility function that will parse every module in search of specified attribute. More...
 
SCR_AttributeWrapper * localAttribute (const String &name)
 Retrieve a specific local attribute in current scripting module. This method will only search the local module if it does export its attributes. More...
 
SCR_AttributeWrapper * localAttribute (const String &name, const QVariant &defAttr)
 Retrieve a specific local attribute in current scripting module. This method will only search the local module if it does export its attributes. More...
 
SCR_AttributeWrapper * localAttribute (const String &name, QObject defAttr)
 Retrieve a specific local attribute in current scripting module. This method will only search the local module if it does export its attributes. More...
 
Modules
Module module (const int idx=0)
 Retrieve a specific module in the current rendering context. Attributes can be fetched from the module. Such an approach is faster if you know which module you want to get attributes from. More...
 
Module module (const String &name)
 Retrieve a specific module in the current rendering context. Attributes can be fetched from the module. Such an approach is faster if you know which module you want to get attributes from. More...
 
QList< QObject * > modules ()
 Retrieve all modules. More...
 
QList< QObject * > modules (const String &typeName)
 Retrieve all modules of specific type name. More...
 
void passThrough ()
 Copy input image directly to output port without modifications. This function is called per default when user script is empty. More...
 
Matrices
Matrix4x4 viewMatrix ()
 Retrieve camera view matrix at the current frame. More...
 
Matrix4x4 viewMatrixAt (double frame)
 Retrieve camera view matrix at specified frame. More...
 
Matrix4x4 perspectiveMatrix ()
 Retrieve camera perspective matrix at the current frame. More...
 

Properties

double designFieldChartX
 Current frame number. More...
 
double designFieldChartY
 Current frame number. More...
 
double designFieldChartZ
 Current frame number. More...
 
double designAspectRatio
 Current frame number. More...
 
double currentFrame
 Current frame number. More...
 
int resX
 Width of image. More...
 
int resY
 Height of image. More...
 
int nInputs
 Number of inputs. More...
 
int nOutputs
 Number of outputs. More...
 
int nModules
 Number of modules. More...
 

Detailed Description

The Context class represents the current frame soft rendering context. This class is the base class for the rendering context from which ports, attributes and rendering parameters can be fetched. An instance of this class is directly accessible in the scripting environment.

// Retrieve context properties
// Retrieve input port
if( Context.nInput > 0 )
{
}

Member Function Documentation

◆ attribute [1/3]

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

Retrieve a specific attribute in the current context. This method is supplied as an utility function that will parse every module in search of specified attribute.

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

◆ attribute [2/3]

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

Retrieve a specific attribute in the current context. This method is supplied as an utility function that will parse every module in search of specified attribute.

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* Context::attribute ( const String &  name,
QObject  defAttr 
)
slot

Retrieve a specific attribute in the current context This method is supplied as an utility function that will parse every module in search of specified attribute.

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

◆ input

InputPort Context::input ( int  idx = 0) const
slot

retrieve specific input port

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

◆ localAttribute [1/3]

SCR_AttributeWrapper* Context::localAttribute ( const String &  name)
slot

Retrieve a specific local attribute in current scripting module. This method will only search the local module if it does export its attributes.

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

◆ localAttribute [2/3]

SCR_AttributeWrapper* Context::localAttribute ( const String &  name,
const QVariant &  defAttr 
)
slot

Retrieve a specific local attribute in current scripting module. This method will only search the local module if it does export its attributes.

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

◆ localAttribute [3/3]

SCR_AttributeWrapper* Context::localAttribute ( const String &  name,
QObject  defAttr 
)
slot

Retrieve a specific local attribute in current scripting module. This method will only search the local module if it does export its attributes.

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

◆ module [1/2]

Module Context::module ( const int  idx = 0)
slot

Retrieve a specific module in the current rendering context. Attributes can be fetched from the module. Such an approach is faster if you know which module you want to get attributes from.

Parameters
idxIndex of the module
Returns
Module

◆ module [2/2]

Module Context::module ( const String &  name)
slot

Retrieve a specific module in the current rendering context. Attributes can be fetched from the module. Such an approach is faster if you know which module you want to get attributes from.

Parameters
nameName of the module
Returns
Module

◆ modules [1/2]

QList<QObject *> Context::modules ( )
slot

Retrieve all modules.

Returns
QList of modules

◆ modules [2/2]

QList<QObject *> Context::modules ( const String &  typeName)
slot

Retrieve all modules of specific type name.

Parameters
typeNameType name of modules
Returns
QList of modules

◆ output

OutputPort Context::output ( int  idx = 0) const
slot

Retrieve specific output port.

Parameters
idxIndex of port [ 0, nOutput - 1 ]
Returns
OutputPort

◆ passThrough

void Context::passThrough ( )
slot

Copy input image directly to output port without modifications. This function is called per default when user script is empty.

◆ perspectiveMatrix

Matrix4x4 Context::perspectiveMatrix ( )
slot

Retrieve camera perspective matrix at the current frame.

Returns
Matrix4x4

◆ viewMatrix

Matrix4x4 Context::viewMatrix ( )
slot

Retrieve camera view matrix at the current frame.

Returns
Matrix4x4

◆ viewMatrixAt

Matrix4x4 Context::viewMatrixAt ( double  frame)
slot

Retrieve camera view matrix at specified frame.

Parameters
frameFrame number
Returns
Matrix4x4

Property Documentation

◆ currentFrame

double Context::currentFrame
read

Current frame number.

◆ designAspectRatio

double Context::designAspectRatio
read

Current frame number.

◆ designFieldChartX

double Context::designFieldChartX
read

Current frame number.

◆ designFieldChartY

double Context::designFieldChartY
read

Current frame number.

◆ designFieldChartZ

double Context::designFieldChartZ
read

Current frame number.

◆ nInputs

int Context::nInputs
read

Number of inputs.

◆ nModules

int Context::nModules
read

Number of modules.

◆ nOutputs

int Context::nOutputs
read

Number of outputs.

◆ resX

int Context::resX
read

Width of image.

◆ resY

int Context::resY
read

Height of image.