30class OutputConnectorField;
82 Field(
const std::string& name = std::string());
309 Field& operator=(
const Field&) {
return *
this; }
Strength
Enumeration type describing the strength of notifications.
@ CHANGED
Subject (i.e., the field) is notified and/or changed.
void setName(const std::string &name)
Sets the name of field. Should be called only once after or while construction.
virtual std::string getStringValue() const =0
size_t getNumDestinationFields()
Returns the number of destination fields that could receive notifications or value sets.
Field(const std::string &name=std::string())
Constructor: Creates a field with name.
static bool areNotificationsEnabledGlobally()
void attachField(Field *targetField, bool propagateValueOnConnect)
void detachFieldSensor(FieldSensor *sensor)
Detaches the field sensor sensor of this class instance in both directions.
FieldContainer * _fieldContainer
The owning field container.
MLint getCStringValueSize()
Returns the length of the character string of the string value of the field.
void setOutputOnly(bool outputOnly=true)
Marks this field as a pure output field that is only changed by its module.
Field * getDestinationField(size_t index)
Returns the destination field at index. Returns NULL if index is out of range.
void attachField(OutputConnectorField *targetField)
std::vector< Field * > _destinationFields
void copyCStringValue(char *valueBuffer, MLint bufferSize)
std::vector< Field * > _sourceFields
void attachField(BaseField *targetField)
size_t getNumSourceFields()
Returns the number of source fields that could send notifications or value sets.
std::string _name
The name of this field.
virtual ~Field()
Destructor: Destroys a field and removes all connection to fields and sensors.
void detachAllFields()
Disconnects all source and target fields of this instance in both directions.
static void enableNotificationsGlobally(bool flag)
void detachDestinationFields()
Disconnects all target fields of this instance in both directions.
static MLint & enableNotificationsCounterState()
virtual MLint isValidValue()
virtual void setStringValue(const std::string &value)=0
void detachField(Field *targetField)
Disconnects connections between the target field targetField and this instance.
bool isOutputOnly() const
Returns whether this field is marked as a pure output field.
void detachFieldSensors()
Detaches all field sensors of this class instance in both directions.
void detachSourceField(Field *field)
Removes a source field from this instance. If not found, then this call does nothing.
virtual void touch(FieldSensor::Strength strength=FieldSensor::CHANGED)
void detachSourceFields()
Disconnects all source fields of this instance in both directions.
FieldContainer * getFieldContainer() const
Returns the field container of the field (which may be NULL).
Field * getSourceField(size_t index)
Returns the source field at index. Returns NULL if index is out of range.
std::string getFullName() const
std::vector< FieldSensor * > _sensors
List of field sensors.
void attachSourceField(Field *field)
void detachFieldInternal(Field *field)
Only removes the given field from the destination list.
const std::string & getName() const
Returns the name of field.
virtual void setValueFromField(const Field &field)
friend class FieldContainer
void attachFieldSensor(FieldSensor *sensor)
Attaches a field sensor sensor of this class instance in both directions.
void attachField(NotifyField *targetField)
bool areNotificationsEnabled()
void attachField(SoNodeField *targetField)
void enableNotifications(bool flag)
static MLint _enableNotifications
Flag that disables the notification process of field (-sensors) globally.
#define MLEXPORT
Code it as import symbol if compiled elsewhere.
#define ML_ABSTRACT_ROOT_CLASS_HEADER(className)
MLEXPORT std::ostream & operator<<(std::ostream &s, const ml::Field &v)
Overloads the operator '<<' for stream output of Field objects.
Flags for internal usage.
unsigned int insideTouch
< Flag to suppress multiple notifications of fields, which otherwise could lead to endless loops.
unsigned int observersWereRemovedInsideTouch
< Flag that indicates that the sensor/destination fields lists contain NULL entries
unsigned int notifyAttachmentsFlag
< Flag to suppress the notification of connected fields and field sensors when field values are set.
unsigned int outputOnly
< Flag to mark this field as a pure output field (this is used by the MeVisLab IDE).