Related Scripting Object: CustomOperator
The CustomOperator object represents a custom operator (ie., a scripted or compiled operator) in the scene graph. More...
#include <xsi_customoperator.h>
Inheritance diagram for CustomOperator:

Public Member Functions |
|
| CustomOperator () | |
| ~CustomOperator () | |
| CustomOperator (const CRef &in_ref) | |
| CustomOperator (const CustomOperator &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| CustomOperator & | operator= (const CustomOperator &in_obj) |
| CustomOperator & | operator= (const CRef &in_ref) |
| CString | GetFileName (void) const |
| CStatus | PutFileName (const CString &in_str) |
| CString | GetLanguage (void) const |
| CString | GetCode (void) const |
| CStatus | PutCode (const CString &code) |
| LONG | GetDebug (void) const |
| CStatus | PutDebug (LONG debug) |
| bool | GetAlwaysEvaluate (void) const |
| CStatus | PutAlwaysEvaluate (bool val) |
| CStatus | AddParameter (const CRef &in_paramdef, Parameter &io_parameter) |
| CStatus | RemoveParameter (const Parameter &in_param) |
| CRef | AddInputPort (const CRef &obj, const CString &name=CString(), LONG group=-1, LONG insertat=-1, LONG flags=0, CStatus *pst=0) |
| CRef | AddOutputPort (const CRef &obj, const CString &name=CString(), LONG group=-1, LONG insertat=-1, LONG flags=0, CStatus *pst=0) |
| CRefArray | AddIOPort (const CRef &obj, const CString &name=CString(), LONG group=-1, LONG insertat=-1, LONG flags=0, CStatus *pst=0) |
| CRef | AddPortGroup (const CString &name, LONG groupmin=1, LONG groupmax=1, const CString &filterid=CString(), const CString &pickprompt=CString(), LONG flags=0, CStatus *pst=0) |
| CStatus | Validate () |
| CRef | AddInputPortByClassID (siClassID in_TargetClassID, const CString &in_strPortName=CString(), LONG in_PortGroup=-1, LONG in_InsertAt=0, LONG in_flags=0) |
| CRef | AddOutputPortByClassID (siClassID in_TargetClassID, const CString &in_strPortName=CString(), LONG in_PortGroup=-1, LONG in_InsertAt=0, LONG in_flags=0) |
| CRefArray | AddIOPortByClassID (siClassID in_TargetClassID, const CString &in_strPortName=CString(), LONG in_PortGroup=-1, LONG in_InsertAt=0, LONG in_flags=0) |
| CustomOperator | ( | ) |
Default constructor.
| ~CustomOperator | ( | ) |
Default destructor.
| CustomOperator | ( | const CRef & | in_ref | ) |
Constructor.
| in_ref | constant reference object. |
| CustomOperator | ( | const CustomOperator & | in_obj | ) |
Copy constructor.
| in_obj | constant class object. |
| bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
| in_ClassID | class type. |
Reimplemented from Operator.
| siClassID GetClassID | ( | ) | const [virtual] |
Returns the type of the API class.
Reimplemented from Operator.
| CustomOperator& operator= | ( | const CustomOperator & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
| in_obj | constant class object. |
| CustomOperator& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
| in_ref | constant class object. |
Reimplemented from Operator.
| CString GetFileName | ( | void | ) | const |
Returns the filename of the script or module containing the implementation of the custom operator.
Sets the filename of the script or module containing the implementation of the custom operator.
| in_str | The filename of the implementation script or module in a CString. |
| CString GetLanguage | ( | void | ) | const |
Returns the API type used by the implementation of the custom operator.
COM, CPP, VBScript, JScript, PerlScript or Python| CString GetCode | ( | void | ) | const |
Returns the script code used by the custom operator implementation.
Empty string for compiled operators
Sets the script code used by the custom operator implementation.
| code | A string containing the script code. |
CStatus::Fail for compiled operators
| LONG GetDebug | ( | void | ) | const |
Returns non zero value if the custom operator is in debug mode.
| CStatus PutDebug | ( | LONG | debug | ) |
Sets the debug mode of the operator. Pass a non zero value to set the operator in Debug mode. The operator list sends a message to the history log each time request data, notify and update are called.
| debug | 0 to disable messages; anything other LONG to enable them |
| bool GetAlwaysEvaluate | ( | void | ) | const |
Returns true if the custom operator will call Update on each notify.
| CStatus PutAlwaysEvaluate | ( | bool | val | ) |
Sets the operator to call Update on each time change.
| val | True to force the operator to evaluate on each time change. |
Adds a new custom parameter to the custom operator object.
| in_paramdef | The parameter definition (created via Factory::CreateParamDef) | |
| io_parameter | Returns the new Parameter object. |
CStatus::Fail failure
Removes the specified custom parameter from the custom operator.
| in_param | Parameter to remove. |
CStatus::Fail failure
| CRef AddInputPort | ( | const CRef & | obj, | |
| const CString & | name = CString(), |
|||
| LONG | group = -1, |
|||
| LONG | insertat = -1, |
|||
| LONG | flags = 0, |
|||
| CStatus * | pst = 0 |
|||
| ) |
Adds an input port to the operator. The port is assumed to be return. The group will be automatically assigned if not specified.
| obj | The object to be connected to the port | |
| name | Name for the port. | |
| group | The index of the group to add port. | |
| insertat | Not implemented | |
| flags | A mask of input port flags described by siOptionalInputPort (see siPortFlags). |
| pst | The returned status code (CStatus::OK for success). |
| CRef AddOutputPort | ( | const CRef & | obj, | |
| const CString & | name = CString(), |
|||
| LONG | group = -1, |
|||
| LONG | insertat = -1, |
|||
| LONG | flags = 0, |
|||
| CStatus * | pst = 0 |
|||
| ) |
Adds an output port to the operator. The port is assumed to be return. The group will be automatically assigned if not specified.
| obj | The object to be connected to the port | |
| name | Name for the port. | |
| group | The index of the group to add port. | |
| insertat | Not implemented | |
| flags | A mask of output port flags described by siCreatedOutputPort (see siPortFlags). |
| pst | The returned status code (CStatus::OK for success). |
| CRefArray AddIOPort | ( | const CRef & | obj, | |
| const CString & | name = CString(), |
|||
| LONG | group = -1, |
|||
| LONG | insertat = -1, |
|||
| LONG | flags = 0, |
|||
| CStatus * | pst = 0 |
|||
| ) |
Adds an input/output port to the operator. The port is assumed to be return. The group will be automatically assigned if not specified.
| obj | The object to be connected to the port | |
| name | Name for the port. The output port name is prefixed with Out and the input port with In. | |
| group | The index of the group to add port. | |
| insertat | Not implemented | |
| flags | A mask of port flags described by siOptionalInputPort + siCreatedOutputPort (see siPortFlags). |
| pst | The returned status code (CStatus::OK for success). |
| CRef AddPortGroup | ( | const CString & | name, | |
| LONG | groupmin = 1, |
|||
| LONG | groupmax = 1, |
|||
| const CString & | filterid = CString(), |
|||
| const CString & | pickprompt = CString(), |
|||
| LONG | flags = 0, |
|||
| CStatus * | pst = 0 |
|||
| ) |
Adds a port group to operator. If the operator has branch group support then the filter must also match the group as well as the allowed components; otherwise groups will be rejected when Operator::Connect is called.
| name | Name of the port group. | |
| groupmin | Minimum number of objects required for a connection. | |
| groupmax | Maximum number of objects allowed to be connected. | |
| filterid | The filter string id, this is the same name used to look up filters. | |
| pickprompt | String to show user during picking session | |
| flags | Port flags (see siPortFlags). |
| pst | The returned status code (CStatus::OK for success). |
| CStatus Validate | ( | ) |
Tests whether the operator contains a valid port definition and syntactically correct code. Note: This method is not implemented for Self-Installed Custom Operators.
CStatus::Fail failure
| CRef AddInputPortByClassID | ( | siClassID | in_TargetClassID, | |
| const CString & | in_strPortName = CString(), |
|||
| LONG | in_PortGroup = -1, |
|||
| LONG | in_InsertAt = 0, |
|||
| LONG | in_flags = 0 |
|||
| ) |
Adds an input port to the operator. This function makes it possible to define a connection to a custom operator by specifying the type of object it needs to connect to, rather than providing an existing object.
This is for use in advanced operators, where the port may be optional and dynamically connected after the Operator is instantiated. Each port defined in this way must be in its own PortGroup so that the connection can be established through Operator::ConnectToGroup.
For example, if an operator supports an optional connection to a ClusterProperty, the CustomOperator::AddInputPort function forces the existence of a ClusterProperty at the time of the operator definition, even if the operator is not meant to connect to a ClusterProperty until some later time. This function avoids the need for any ClusterProperty to actually exist in the scene.
| in_TargetClassID | The type of object that can connect to this object, for example siKinematicStateID, siClusterPropertyID, siParameterID or siPrimitiveID. | |
| in_strPortName | The name of the port. If empty a name is automatically generated. | |
| in_PortGroup | Index of the port group that will contain the new port | |
| in_InsertAt | Not implemented | |
| in_flags | Mask of port group flags from the siPortFlags enum |
| CRef AddOutputPortByClassID | ( | siClassID | in_TargetClassID, | |
| const CString & | in_strPortName = CString(), |
|||
| LONG | in_PortGroup = -1, |
|||
| LONG | in_InsertAt = 0, |
|||
| LONG | in_flags = 0 |
|||
| ) |
Adds an OutputPort to the custom operator. This function makes it possible to define a connection to a custom operator by specifying the type of object it will connect to, rather than providing an actual existing object as is the case with CustomOperator::AddOutputPort. This is for use in advanced operators, where the port may be optional and dynamically connected after the operator is instantiated.
| in_TargetClassID | The type of object that can connect to this object, for example siKinematicStateID, siClusterPropertyID, siParameterID or siPrimitiveID. | |
| in_strPortName | The name of the port. If empty a name is automatically generated. | |
| in_PortGroup | Index of the port group that will contain the new port | |
| in_InsertAt | Not implemented | |
| in_flags | Mask of port group flags from the siPortFlags enum |
| CRefArray AddIOPortByClassID | ( | siClassID | in_TargetClassID, | |
| const CString & | in_strPortName = CString(), |
|||
| LONG | in_PortGroup = -1, |
|||
| LONG | in_InsertAt = 0, |
|||
| LONG | in_flags = 0 |
|||
| ) |
Adds an InputPort and an OutputPort to the custom operator. This function makes it possible to define a connection to a custom operator by specifying the type of object it needs to connect to, rather than providing an actual existing object as is the case with CustomOperator::AddIOPort. This is for use in advanced operators, where the port may be optional and dynamically connected after the operator is instantiated.
| in_TargetClassID | The type of object that can connect to this object, for example siKinematicStateID, siClusterPropertyID, siParameterID or siPrimitiveID. | |
| in_strPortName | The name of the port. If empty a name is automatically generated. | |
| in_PortGroup | Index of the port group that will contain the new port | |
| in_InsertAt | Not implemented | |
| in_flags | Mask of port group flags from the siPortFlags enum |