MLABField Class Reference
[Fields]

Baseclass of all Fields in MLAB. More...

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

List of all members.

Public Slots

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


Detailed Description

Baseclass 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]

get comment

MLABField* MLABField::connectedField (  )  [slot]

get input connection of this field (connected field, null if none)

bool MLABField::connectFrom ( MLABField field  )  [slot]

connect to given field (if already connected, automatically disconnects old connection)

bool MLABField::connectFromUndoable ( MLABField field  )  [slot]

connect/disconnect undoable

void MLABField::disconnect (  )  [slot]

disconnect input

void MLABField::disconnectAll (  )  [slot]

disconnect input + outputs

void MLABField::disconnectOutputs (  )  [slot]

disconnect outputs

QString MLABField::fullName (  )  const [slot]

get full name for debugging

QString MLABField::getName (  )  const [inline, slot]

get the name of the field, you can also use the name property

QString MLABField::getType (  )  const [inline, slot]

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

QString MLABField::infoString (  )  [slot]

get info string (for printing)

bool MLABField::isConnected (  )  [slot]

has input connection?

bool MLABField::isConnectedToFieldInSameNetwork (  )  [slot]

is the field 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 if a connection between the fields is possible using isConnectionPossible() and if the fields are in the same network

virtual bool MLABField::isConnectionPossible ( MLABField field  )  [virtual, slot]

returns if 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 [inline, slot]

returns if the field is editable in the GUI (can be overriden in self-defined panels)

bool MLABField::isHidden (  )  [slot]

is hidden?

bool MLABField::isIgnored (  )  [slot]

is field ignored? (is only used in Inventor)

bool MLABField::isInput (  )  [inline, slot]

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::isInterfaceField (  )  [inline, slot]

is a macro module interface field?

bool MLABField::isInventorField (  )  [slot]

is a inventor field?

bool MLABField::isMLField (  )  [slot]

check if it is an ML field

bool MLABField::isParameterField (  )  [inline, slot]

is a parameter field?

bool MLABField::isPersistent (  )  const [inline, slot]

returns if the field is persistent, i.e. if it values is saved together with the module.

int MLABField::outputCount (  )  [slot]

get number of output connected fields

MLABField* MLABField::outputField ( int  index  )  [slot]

get the i'th output field, number of available fields is given via outputCount()

MLABFieldOwner* MLABField::owner (  )  [slot]

get owner (may be null)

int MLABField::priority (  )  [slot]

get the priority

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

set comment

void MLABField::setHidden ( bool  flag  )  [slot]

set hidden flag

void MLABField::setIgnored ( bool  flag  )  [slot]

set ignore flag (only has an effect on Inventor fields)

void MLABField::setPriority ( int  aPriority  )  [slot]

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

void MLABField::setProxy ( bool  flag  )  [inline, slot]

proxy flag for macro modules

virtual void MLABField::setStringValue ( const QString &   )  [inline, virtual, slot]

virtual QString MLABField::stringValue (  )  [virtual, slot]

get string value

Reimplemented in MLABEngineOutputField, MLABMLBaseField, MLABSoNodeField, and MLABTriggerField.

virtual QString MLABField::toolTipInfo (  )  [virtual, slot]

info for the tooltip

virtual void MLABField::touch (  )  [virtual, slot]

force a notify to all observers without changing value of field

Reimplemented in MLABImageField, and MLABMLBaseField.

bool MLABField::triggersLoading (  )  const [inline, slot]

check/set if this field triggers full loading of a lazy loading module if touched

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

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


Generated on Sat Sep 3 18:38:02 2011 for MeVisLab Scripting Reference by  doxygen 1.5.8