MeVisLab Scripting Reference
MLABField Class Reference

Inherits QObject.

Inherited by MLABBoolField, MLABEngineOutputField, MLABEnumField, MLABImageField, MLABMatrixField, MLABMLBaseField, MLABNumberField, MLABSoNodeField, MLABStringField, MLABTriggerField, and MLABVectorField.

Public Slots

bool isInventorField ()
 
bool isMLField ()
 
Scripting access.
QString getType () const
 
QString getName () const
 
virtual QString stringValue ()
 
virtual void setStringValue (const QString &)
 
QString truncatedStringValue (int maxChars=80)
 
virtual QString stringValueForProfiling ()
 
virtual void touch ()
 
MLABFieldOwnerowner ()
 
MLABFieldconnectedField ()
 
MLABFieldinputField ()
 
bool isConnected ()
 
bool isConnectedToFieldInSameNetwork ()
 
int outputCount ()
 
MLABFieldoutputField (int index)
 
QList< MLABField * > outputFields ()
 
bool connectFrom (MLABField *field)
 
void disconnect ()
 
void disconnectOutputs ()
 
void disconnectAll ()
 
bool connectFromUndoable (MLABField *field)
 
void disconnectUndoable ()
 
void disconnectOutputsUndoable ()
 
void disconnectAllUndoable ()
 
virtual bool isConnectionPossible (MLABField *field)
 
bool isConnectionInSameNetworkPossible (MLABField *field)
 
bool isInSameNetwork (MLABField *field)
 
virtual QString toolTipInfo ()
 
void setPriority (int aPriority)
 
int priority ()
 
void setProxy (bool flag)
 
bool isProxy ()
 
void setComment (const QString &comment)
 
QString comment ()
 
void setTitle (const QString &title)
 
QString title ()
 
QString fullName () const
 
bool isHidden ()
 
void setHidden (bool flag)
 
bool isIgnored ()
 
void setIgnored (bool flag)
 
bool isInterfaceField ()
 
bool isParameterField ()
 
bool isInput ()
 
bool isOutput ()
 
bool isInOut ()
 
QString infoString ()
 
bool isPersistent () const
 
bool isEditable () const
 
bool triggersLoading () const
 
void setTriggersLoading (bool flag)
 

Detailed Description

Base class of all Fields in MLAB.

The MLABField is used standalone by macro modules and to wrap Inventor or ML Fields A field normally has a MLABFieldOwner which is a MLABModule in the current implementation. To get a field of a module, use the field() method of MLABModule. There are common stringValue() and setStringValue() methods in this base class and specialized set/get methods in the derived class:

The name of the field is given in the "name" property:

ctx.field("somefield").name

or alternatively

ctx.field("somefield").getName()

The class name of the field can be read by using the "type" property:

ctx.field("somefield").type

or alternatively

ctx.field("somefield").getType()

All fields that have a value implement a "value" property, which can be accessed via Scripting for read/write access:

Read access:

ctx.field("somefield").value

Write access:

ctx.field("someIntField").value = 42
ctx.field("someStringField").value = "Test"

The "value" property is always of the typical type of the field, thus a string field returns a string, while an int field returns an integer. Type conversion is done automatically by QT.

Field types include:

Member Function Documentation

QString MLABField::comment ( )
slot

Returns the comment string.

MLABField* MLABField::connectedField ( )
slot

Returns the input connection of this field (connected field, NULL if none), alias for inputField().

In this case, this field is the destination of a connection.

bool MLABField::connectFrom ( MLABField field)
slot

Connects to given field (if already connected, automatically disconnects old connection) and returns whether this operation was successful.

bool MLABField::connectFromUndoable ( MLABField field)
slot

Connects/disconnects undoable.

void MLABField::disconnect ( )
slot

Disconnects input.

void MLABField::disconnectAll ( )
slot

Disconnects the input and all output fields.

void MLABField::disconnectOutputs ( )
slot

Disconnects all outputs.

QString MLABField::fullName ( ) const
slot

Returns the full name for debugging. This is the name of the owner (if existing) with the name of the field.

QString MLABField::getName ( ) const
inlineslot

Returns the name of the field. You can also use the name property.

QString MLABField::getType ( ) const
inlineslot

Returns the type of the field (e.g., String, Integer, Float).

QString MLABField::infoString ( )
slot

Returns an info string (for printing).

MLABField* MLABField::inputField ( )
slot

Returns the input connection of this field (connected field, NULL if none), alias for connectedField().

In this case, this field is the destination of a connection.

bool MLABField::isConnected ( )
slot

Returns whether the field has an input connection.

bool MLABField::isConnectedToFieldInSameNetwork ( )
slot

Returns whether the field is connected to another field in the same network.

Returns true if connected to at least one field in the same network.

bool MLABField::isConnectionInSameNetworkPossible ( MLABField field)
slot

Returns whether a connection between the fields is possible using isConnectionPossible() and if the fields are in the same network.

virtual bool MLABField::isConnectionPossible ( MLABField field)
virtualslot

Returns whether a connection between the fields is possible (taking into account the input/output type and not regarding the networks the fields are in).

NOTE: even if this method tries to be accurate, it may return true and connectFrom is still not possible. This is due to the fact that not all Inventor fields can be connected with each other and this can only be detected when trying to connect the fields.

Reimplemented in MLABEngineOutputField.

bool MLABField::isEditable ( ) const
inlineslot

Returns whether the field is editable in the GUI (can be overridden in self-defined panels).

bool MLABField::isHidden ( )
slot

Returns whether the field is hidden.

bool MLABField::isIgnored ( )
slot

Returns whether this field is ignored. This is only used with Inventor fields.

bool MLABField::isInOut ( )
inlineslot

Returns whether this field is marked as an input/output (parameter) field.

bool MLABField::isInput ( )
inlineslot

Returns whether this field is marked as an input field.

Mark field as input only, as output only or as InOut: a newly created field is InOut. mainly these flags are used to avoid wrong drag/drop connections!

bool MLABField::isInSameNetwork ( MLABField field)
slot

Returns whether the field is in the same network as the given field.

bool MLABField::isInterfaceField ( )
inlineslot

Returns whether this is a macro module's interface field.

bool MLABField::isInventorField ( )
slot

Returns whether this is an Inventor field.

bool MLABField::isMLField ( )
slot

Returns whether this is an ML field.

bool MLABField::isOutput ( )
inlineslot

Returns whether this field is marked as an output field.

bool MLABField::isParameterField ( )
inlineslot

Returns whether this is a parameter field.

bool MLABField::isPersistent ( ) const
inlineslot

Returns whether the field is persistent, i.e. if its values is saved together with the module.

bool MLABField::isProxy ( )
inlineslot

Returns whether a field is a used as a proxy on a macro module's interface.

int MLABField::outputCount ( )
slot

Returns the number of connected fields where this field is the source.

MLABField* MLABField::outputField ( int  index)
slot

Returns the output field at the given index, the number of available fields is given via outputCount().

QList<MLABField*> MLABField::outputFields ( )
slot

Returns the list of fields that are connected from this field.

MLABFieldOwner* MLABField::owner ( )
slot

Returns the owner of the field (may be NULL).

int MLABField::priority ( )
slot

Returns the priority.

void MLABField::setComment ( const QString &  comment)
slot

Sets a comment string for the field.

void MLABField::setHidden ( bool  flag)
slot

Sets the hidden state of this field.

void MLABField::setIgnored ( bool  flag)
slot

Sets the ignore flag which only has an effect on Inventor fields.

void MLABField::setPriority ( int  aPriority)
slot

Sets a priority, used for displayWindowsNow (use 0 for immediate GUI update).

void MLABField::setProxy ( bool  flag)
inlineslot

Sets whether a field is used as a proxy on a macro module's interface.

void MLABField::setTitle ( const QString &  title)
slot

Sets a default GUI title.

void MLABField::setTriggersLoading ( bool  flag)
inlineslot

Sets whether this field triggers full loading of a lazy loading module if touched.

virtual QString MLABField::stringValue ( )
virtualslot

Returns the value of the field as a string value.

Reimplemented in MLABMLBaseField, MLABSoNodeField, MLABEngineOutputField, and MLABTriggerField.

virtual QString MLABField::stringValueForProfiling ( )
virtualslot

Returns the string value used for profiling, default returns the string value.

NOTE: be careful on how you re-implement this method in subclasses, since we don't want the profiling to cause side effects, e.g. changing the state of an ML image.

Reimplemented in MLABImageField, MLABMLBaseField, MLABSoNodeField, and MLABTriggerField.

QString MLABField::title ( )
slot

Returns the default GUI title.

virtual QString MLABField::toolTipInfo ( )
virtualslot

Returns an info string for the tool tip.

virtual void MLABField::touch ( )
virtualslot

Forces a notify to all observers without changing the value of the field.

Reimplemented in MLABImageField, and MLABMLBaseField.

bool MLABField::triggersLoading ( ) const
inlineslot

Returns whether this field triggers full loading of a lazy loading module if touched.

QString MLABField::truncatedStringValue ( int  maxChars = 80)
slot

Truncates the string value. It truncates the stringValue() if it is longer than the given number of chars and appends "...".