ScriptModule
Properties | List of all members
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...

#include <ScriptInterface.h>

Inheritance diagram for Context:
Inheritance graph
[legend]
Collaboration diagram for Context:
Collaboration graph
[legend]

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

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
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
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
InputPort Context::input ( int  idx = 0) const
slot

retrieve specific input port

Parameters
idxIndex of port [ 0, nInput - 1 ]
Returns
InputPort
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
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
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 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 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
QList<QObject *> Context::modules ( )
slot

Retrieve all modules.

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

Retrieve all modules of specific type name.

Parameters
typeNameType name of modules
Returns
QList of modules
OutputPort Context::output ( int  idx = 0) const
slot

Retrieve specific output port.

Parameters
idxIndex of port [ 0, nOutput - 1 ]
Returns
OutputPort
void Context::passThrough ( )
slot

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

Matrix4x4 Context::perspectiveMatrix ( )
slot

Retrieve camera perspective matrix at the current frame.

Returns
Matrix4x4
Matrix4x4 Context::viewMatrix ( )
slot

Retrieve camera view matrix at the current frame.

Returns
Matrix4x4
Matrix4x4 Context::viewMatrixAt ( double  frame)
slot

Retrieve camera view matrix at specified frame.

Parameters
frameFrame number
Returns
Matrix4x4

Property Documentation

double Context::currentFrame
readprivate

Current frame number.

double Context::designAspectRatio
readprivate

Current frame number.

double Context::designFieldChartX
readprivate

Current frame number.

double Context::designFieldChartY
readprivate

Current frame number.

double Context::designFieldChartZ
readprivate

Current frame number.

int Context::nInputs
readprivate

Number of inputs.

int Context::nModules
readprivate

Number of modules.

int Context::nOutputs
readprivate

Number of outputs.

int Context::resX
readprivate

Width of image.

int Context::resY
readprivate

Height of image.


The documentation for this class was generated from the following file: