HDK
|
#include <COP_Signature.h>
Public Member Functions | |
COP_Signature () | |
same as COP_Signature("default", "Default") More... | |
COP_Signature (const UT_StringHolder &name, const UT_StringHolder &label) | |
Constructs a new signature with the given name and label. More... | |
COP_Signature (const UT_StringHolder &name, const UT_StringHolder &label, int inputs, int outputs) | |
COP_Signature (const UT_StringHolder &name, const UT_StringHolder &label, const UT_StringRef &input_list, const UT_StringRef &output_list) | |
int | getInputConversionCost (const UT_Array< COP_Type > &inputs, bool abort_on_impossible=false) const |
void | setNumberOfInputs (int inputs) |
void | setNumberOfOutputs (int outputs) |
void | setInput (int input, COP_Type type) |
Sets the type of an input. More... | |
void | setOutput (int output, COP_Type type) |
Sets the type of an output;. More... | |
int | getNumberOfInputs () const |
Returns the number of inputs. More... | |
int | getNumberOfOutputs () const |
Returns the number of outputs. More... | |
COP_Type | getInputType (int index) const |
Get type of the input at the specified index. More... | |
COP_Type | getOutputType (int index) const |
Get type of the output at the specified index. More... | |
bool | inputsMatchOutputs (int i_start=0, int o_start=0) const |
const UT_StringHolder & | getName () const |
Returns the internal name of this signature. More... | |
const UT_StringHolder & | getLabel () const |
Returns the English label for this signature. More... | |
void | setName (const UT_StringHolder &name) |
Changes name of this signature. More... | |
void | setLabel (const UT_StringHolder &label) |
Changes label for this signature. More... | |
void | removeInput (int index) |
Removes the input at the given index. More... | |
void | removeOutput (int index) |
Removes the output at the given index. More... | |
UT_StringHolder | format () const |
Protected Attributes | |
UT_Array< COP_Type > | myInputTypes |
List of input types for this signature. More... | |
UT_Array< COP_Type > | myOutputTypes |
List of output types for this signature. More... | |
UT_StringHolder | myName |
The signature's internal name. More... | |
UT_StringHolder | myLabel |
The signature's label. More... | |
Friends | |
class | COP_OperatorInfo |
Signature for a node. Signature consists of a name (internal and label), and lists of types for the inputs and outputs. The number of inputs and outputs is independent of this and set by the verb min/max Inputs/Outputs and the current state of the GUI. If not enough types are specified the last one is repeated for any extra inputs and outputs. This helps with making signatures reusable between different verbs.
Definition at line 59 of file COP_Signature.h.
|
inline |
same as COP_Signature("default", "Default")
Definition at line 63 of file COP_Signature.h.
COP_Signature::COP_Signature | ( | const UT_StringHolder & | name, |
const UT_StringHolder & | label | ||
) |
Constructs a new signature with the given name and label.
COP_Signature::COP_Signature | ( | const UT_StringHolder & | name, |
const UT_StringHolder & | label, | ||
int | inputs, | ||
int | outputs | ||
) |
Constructs a new signature with the given name, label, and number of inputs and outputs.
COP_Signature::COP_Signature | ( | const UT_StringHolder & | name, |
const UT_StringHolder & | label, | ||
const UT_StringRef & | input_list, | ||
const UT_StringRef & | output_list | ||
) |
Constructs a new signature with the given name, label, and lists of inputs and outputs. A character in a list corresponds to an input or output. Its type can be one of the following: i: COP_TYPE_INT m: COP_TYPE_METADATA f/1: COP_TYPE_FLOAT u/2: COP_TYPE_VECTOR2 v/3: COP_TYPE_VECTOR p/4: COP_TYPE_VECTOR4 g: COP_TYPE_GEO
UT_StringHolder COP_Signature::format | ( | ) | const |
int COP_Signature::getInputConversionCost | ( | const UT_Array< COP_Type > & | inputs, |
bool | abort_on_impossible = false |
||
) | const |
Returns the cost of converting all inputs of this signature into types from the array. If abort_on_impossible is true, returns -1 if one of the inputs is not convertible.
Get type of the input at the specified index.
|
inline |
Returns the English label for this signature.
Definition at line 132 of file COP_Signature.h.
|
inline |
Returns the internal name of this signature.
Definition at line 130 of file COP_Signature.h.
int COP_Signature::getNumberOfInputs | ( | ) | const |
Returns the number of inputs.
int COP_Signature::getNumberOfOutputs | ( | ) | const |
Returns the number of outputs.
Get type of the output at the specified index.
Returns true if inputs (starting at i_start) are convertible from the outputs (starting at o_start). That is, false is returned if
|
inline |
Changes label for this signature.
Definition at line 136 of file COP_Signature.h.
|
inline |
Changes name of this signature.
Definition at line 134 of file COP_Signature.h.
Sets the number of inputs for this signature. If the current size is not zero, the last entry is duplicated to fill array.
Sets the number of outputs for this signature. If the current size is not zero, the last entry is duplicated to fill array.
|
friend |
Definition at line 155 of file COP_Signature.h.
List of input types for this signature.
Definition at line 147 of file COP_Signature.h.
|
protected |
The signature's label.
Definition at line 153 of file COP_Signature.h.
|
protected |
The signature's internal name.
Definition at line 151 of file COP_Signature.h.
List of output types for this signature.
Definition at line 149 of file COP_Signature.h.