other versions
- wheezy-backports 3.1.4~abc9f50-3~bpo70+1
- jessie 3.1.4~abc9f50-7
SoField(3) | Coin | SoField(3) |
NAME¶
SoField - The SoField class is the top-level abstract base class for fields. Fields is the mechanism used throughout Coin for encapsulating basic data types to detect changes made to them, and to provide conversion, import and export facilities.SYNOPSIS¶
#include <Inventor/fields/SoField.h> Inherited by SoMField, and SoSField.Public Types¶
enum FieldType { NORMAL_FIELD = 0, EVENTIN_FIELD, EVENTOUT_FIELD, EXPOSED_FIELD }
Public Member Functions¶
virtual ~SoField ()
Static Public Member Functions¶
static void initClass (void)
Protected Member Functions¶
SoField (void)
Detailed Description¶
The SoField class is the top-level abstract base class for fields. Fields is the mechanism used throughout Coin for encapsulating basic data types to detect changes made to them, and to provide conversion, import and export facilities.- •
- Fields can be connected to other fields. This makes it for instance possible to have 'self-updating' scenes, ie you can set up scenes where entities automatically react to changes in other entities. This also provides a necessary mechanism for having 'auto-animating' scenes, as it is possible to connect any field to the global field named realTime, providing a wall-clock timer.
- •
- When connecting fields to each other, Coin has built-in mechanisms for automatically converting between different field types.
- •
- Fields provide persistance for scenegraph import (and export) operations. This includes animating entities, so animations can be stored within ordinary Inventor format files.
- •
- Fields provides features for introspection: they have a type-system, just like for nodes and actions, they are named, and it is also possible to find out which node, engine or other entity owns a field.
- •
- Fields can hold multiple values. Multi-value fields comes with a much higher level interface abstraction than standard C/C++ arrays.
SoFieldContainer,
SoFieldData
Constructor & Destructor Documentation¶
SoField::~SoField () [virtual]¶
Destructor. Disconnects ourself from any connected field or engine before we disconnect all auditors on the field.SoField::SoField (void) [protected]¶
This is the base constructor for field classes. It takes care of doing the common parts of data initialization in fields.Member Function Documentation¶
void SoField::initClass (void) [static]¶
Internal method called upon initialization of the library (from SoDB::init()) to set up the type system. Reimplemented in SoMField, SoSFImage, SoSFEngine, SoSFNode, SoMFPath, SoMFColor, SoMFColorRGBA, SoMFVec2d, SoMFVec2f, SoMFVec2i32, SoMFVec4b, SoMFVec4d, SoMFVec4f, SoMFVec4i32, SoMFVec4s, SoMFVec4ub, SoMFVec4ui32, SoMFVec4us, SoSFPath, SoMFVec2b, SoMFVec2s, SoMFVec3b, SoMFVec3d, SoMFVec3f, SoMFVec3i32, SoMFVec3s, SoSFTrigger, SoMFBool, SoMFDouble, SoMFEngine, SoMFFloat, SoMFInt32, SoMFNode, SoMFShort, SoMFUInt32, SoMFUShort, SoSFImage3, SoMFMatrix, SoMFName, SoMFPlane, SoMFRotation, SoMFString, SoMFTime, SoSFBox2d, SoSFBox2f, SoSFBox2i32, SoSFBox2s, SoSFBox3d, SoSFBox3f, SoSFBox3i32, SoSFBox3s, SoSFColor, SoSFColorRGBA, SoSFEnum, SoSFMatrix, SoSFName, SoSFPlane, SoSFRotation, SoSFString, SoSFTime, SoSFVec2b, SoSFVec2d, SoSFVec2f, SoSFVec2i32, SoSFVec2s, SoSFVec3b, SoSFVec3d, SoSFVec3f, SoSFVec3i32, SoSFVec3s, SoSFVec4b, SoSFVec4d, SoSFVec4f, SoSFVec4i32, SoSFVec4s, SoSFVec4ub, SoSFVec4ui32, SoSFVec4us, SoMFEnum, SoSFBool, SoSFDouble, SoSFFloat, SoSFInt32, SoSFShort, SoSFUInt32, SoSFUShort, SoMFBitMask, SoSFBitMask, and SoSField.void SoField::initClasses (void) [static]¶
Initialize all the field classes.void SoField::setIgnored (SbBoolignore)¶
Sets the flag which indicates whether or not the field should be ignored during certain operations. The effect of this flag depends on what type of field it is used on, and the type of the node which includes the field. This flag is represented in Inventor files by a ~ behind the field name. The flag is in other words persistent. See Also:isIgnored()
SbBool SoField::isIgnored (void) const¶
Returns the ignore flag. See Also:setIgnored()
void SoField::setDefault (SbBooldef)¶
Set whether or not this field should be marked as containing a default value. See Also:isDefault()
SbBool SoField::isDefault (void) const¶
Check if the field contains its default value. Fields which has their default value intact will normally not be included in the output when writing scene graphs out to a file, for instance. See Also:setDefault()
SoType SoField::getTypeId (void) const [pure virtual]¶
Returns the type identification instance which uniquely identifies the Coin field class the object belongs to. See Also:getClassTypeId(), SoType
SoType SoField::getClassTypeId (void) [static]¶
Returns a unique type identifier for this field class. See Also:getTypeId(), SoType
SbBool SoField::isOfType (const SoTypetype) const¶
Check if this instance is of a derived type or is the same type as the one given with the type parameter.void SoField::enableConnection (SbBoolflag)¶
This sets a flag value which indicates whether or not the set up connection should be considered active. For as long as the 'enable connection' flag is FALSE, no value propagation will be done from any connected source field, engine or interpolator into this field. If the connection is first disabled and then enabled again, the field will automatically be synchronized with any master field, engine or interpolator. See Also:isConnectionEnabled()
SbBool SoField::isConnectionEnabled (void) const¶
Return the current status of the connection enabled flag. See Also:enableConnection()
SbBool SoField::connectFrom (SoEngineOutput *master, SbBoolnotnotify = FALSE, SbBoolappend = FALSE)¶
Connects this field as a slave to master. This means that the value of this field will be automatically updated when master is changed (as long as the connection also is enabled). If this field had any master-relationships beforehand, these are all broken up if append is FALSE. Call with notnotify if you want to avoid the initial notification of connected auditors (a.k.a. slaves). Function will return TRUE unless:- •
- If the field output connected from is of a different type from the engine output field-type connected to, a field converter is inserted. For some combinations of fields no such conversion is possible, and we'll return FALSE.
- •
- If this field is already connected to the master, we will return FALSE.
enableConnection(),
isConnectionEnabled(), isConnectedFromField()
getConnectedField(), appendConnection(SoEngineOutput *)
SbBool SoField::appendConnection (SoEngineOutput *master, SbBoolnotnotify = FALSE)¶
Connect ourself as slave to another object, while still keeping the other connections currently in place. See Also:connectFrom()
void SoField::disconnect (SoEngineOutput *master)¶
Disconnect this field as a slave from master.SbBool SoField::isConnectedFromEngine (void) const¶
Returns TRUE if we're connected from an engine. See Also:isConnected(),
isConnectedFromField()
connectFrom(SoEngineOutput *)
SbBool SoField::getConnectedEngine (SoEngineOutput *&master) const¶
Returns TRUE if we are connected as a slave to at least one engine. master will be set to the source of the last engine connection made. See Also:isConnectedFromEngine(),
connectFrom(SoEngineOutput *)
appendConnection(SoEngineOutput *)
SbBool SoField::connectFrom (SoField *master, SbBoolnotnotify = FALSE, SbBoolappend = FALSE)¶
Connects this field as a slave to master. This means that the value of this field will be automatically updated when master is changed (as long as the connection also is enabled). If this field had any connections to master fields beforehand, these are all broken up if append is FALSE. Call with notnotify if you want to avoid the initial notification of connected auditors (a.k.a. slaves). Function will return TRUE unless:- •
- If the field connected from has a different type from the field connected to, a field converter is inserted. For some combinations of fields no such conversion is possible, and we'll return FALSE.
- •
- If this field is already connected to the master, we will return FALSE.
enableConnection(),
isConnectionEnabled(), isConnectedFromField()
getConnectedField(), appendConnection(SoField *)
SbBool SoField::appendConnection (SoField *master, SbBoolnotnotify = FALSE)¶
Connect ourself as slave to another object, while still keeping the other connections currently in place. See Also:connectFrom()
void SoField::disconnect (SoField *master)¶
Disconnect this field as a slave from master.SbBool SoField::isConnectedFromField (void) const¶
Returns TRUE if we're a slave of at least one field. See Also:isConnected(),
isConnectedFromEngine()
connectFrom(SoField *)
SbBool SoField::getConnectedField (SoField *&master) const¶
Returns TRUE if we are connected as a slave to at least one other field. master will be set to the source field in the last field connection made. See Also:isConnectedFromField(),
connectFrom(SoField *),
appendConnection(SoField *)
int SoField::getNumConnections (void) const¶
Returns number of fields this field is a slave of. See Also:getConnections()
int SoField::getForwardConnections (SoFieldList &slavelist) const¶
Appends all the fields which are auditing this field in slavelist, and returns the number of fields which are our slaves.int SoField::getConnections (SoFieldList &masterlist) const¶
Returns number of masters this field is connected to, and places pointers to all of them into masterlist. Note that we replace the contents of masterlist, i.e. we're not appending new data. See Also:getNumConnections()
void SoField::disconnect (void)¶
Disconnect all connections from this field as a slave to master fields or engine outputs.SbBool SoField::isConnected (void) const¶
Returns TRUE if we're connected from another field, engine or interpolator. See Also:isConnectedFromField(),
isConnectedFromEngine()
connectFrom()
void SoField::setContainer (SoFieldContainer *cont)¶
Let the field know to which container it belongs. See Also:getContainer(),
SoFieldContainer
SoFieldContainer * SoField::getContainer (void) const¶
Returns the SoFieldContainer object 'owning' this field. See Also:SoFieldContainer,
setContainer()
SbBool SoField::set (const char *valuestring)¶
Set the field's value through the given valuestring. The format of the string must adhere to the ASCII format used in Coin data format files. Only the value should be specified - not the name of the field. FALSE is returned if the field value is invalid for the field type and can't be parsed in any sensible way. See Also:get()
void SoField::get (SbString &valuestring)¶
Returns the field's value as an ASCII string in the export data format for Inventor files. See Also:set()
SbBool SoField::shouldWrite (void) const¶
Returns TRUE if it is necessary to write the field when dumping a scene graph. This needs to be done if the field is not default (it has been changed from its default value), if it's ignored, or if it's connected from another field or engine.void SoField::touch (void) [virtual]¶
Notify the field as well as the field's owner / container that it has been changed. Touching a field which is part of any component (engine or node) in a scene graph will lead to a forced redraw. This is useful if you have been doing several updates to the field wrapped in a pair of enableNotify() calls to notify the field's auditors that its value has changed. See Also:setValue(), enableNotify()
void SoField::startNotify (void) [virtual]¶
Trigger a notification sequence. At the end of a notification sequence, all 'immediate' sensors (i.e. sensors set up with a zero priority) are triggered. Reimplemented in SoSFTrigger.void SoField::notify (SoNotList *nlist) [virtual]¶
Notify auditors that this field has changed. Reimplemented in SoSFTrigger, SoMFPath, and SoSFPath.SbBool SoField::enableNotify (SbBoolon)¶
This method sets whether notification will be propagated on changing the value of the field. The old value of the setting is returned. See Also:isNotifyEnabled()
SbBool SoField::isNotifyEnabled (void) const¶
This method returns whether notification of changes to the field value are propagated to the auditors. See Also:enableNotify()
void SoField::addAuditor (void *f, SoNotRec::Typetype)¶
Add an auditor to the list. All auditors will be notified whenever this field changes its value(s).void SoField::removeAuditor (void *f, SoNotRec::Typetype)¶
Remove an auditor from the list.int SoField::operator== (const SoField &f) const¶
Checks for equality. Returns 0 if the fields are of different type or the field's value(s) are not equal.int SoField::operator!= (const SoField &f) const¶
Returns TRUE if the fields are of different type or has different value.void SoField::connectionStatusChanged (intnumconnections) [virtual]¶
Called whenever another slave attaches or detaches itself to us. numconnections is the difference in number of connections made (i.e. if stuff is disconnected, numconnections will be a negative number). The default method is empty. Override in subclasses if you want do something special on connections/deconnections.SbBool SoField::isReadOnly (void) const¶
Returns TRUE if this field should not be written into at the moment the method is called. This method is used internally in Coin during notification and evaluation processes, and should normally not be of interest to the application programmer.SbBool SoField::isSame (const SoField &f) const [pure virtual]¶
Check for equal type and value(s). Implemented in SoSFEngine, SoSFNode, SoMFPath, SoSFImage, SoSFPath, SoSFTrigger, SoMFEngine, SoMFNode, SoSFImage3, SoMFColor, SoMFColorRGBA, SoMFMatrix, SoMFName, SoMFPlane, SoMFRotation, SoMFString, SoMFTime, SoMFVec2b, SoMFVec2d, SoMFVec2f, SoMFVec2i32, SoMFVec2s, SoMFVec3b, SoMFVec3d, SoMFVec3f, SoMFVec3i32, SoMFVec3s, SoMFVec4b, SoMFVec4d, SoMFVec4f, SoMFVec4i32, SoMFVec4s, SoMFVec4ub, SoMFVec4ui32, SoMFVec4us, SoSFBox2d, SoSFBox2f, SoSFBox2i32, SoSFBox2s, SoSFBox3d, SoSFBox3f, SoSFBox3i32, SoSFBox3s, SoSFColor, SoSFColorRGBA, SoSFEnum, SoSFMatrix, SoSFName, SoSFPlane, SoSFRotation, SoSFString, SoSFTime, SoSFVec2b, SoSFVec2d, SoSFVec2f, SoSFVec2i32, SoSFVec2s, SoSFVec3b, SoSFVec3d, SoSFVec3f, SoSFVec3i32, SoSFVec3s, SoSFVec4b, SoSFVec4d, SoSFVec4f, SoSFVec4i32, SoSFVec4s, SoSFVec4ub, SoSFVec4ui32, SoSFVec4us, SoMFBool, SoMFDouble, SoMFEnum, SoMFFloat, SoMFInt32, SoMFShort, SoMFUInt32, SoMFUShort, SoSFBool, SoSFDouble, SoSFFloat, SoSFInt32, SoSFShort, SoSFUInt32, SoSFUShort, SoMFBitMask, and SoSFBitMask.void SoField::copyFrom (const SoField &f) [pure virtual]¶
Copy value(s) from f into this field. f must be of the same type as this field. Implemented in SoSFEngine, SoSFNode, SoMFPath, SoSFImage, SoSFPath, SoSFTrigger, SoMFEngine, SoMFNode, SoSFImage3, SoMFColor, SoMFColorRGBA, SoMFMatrix, SoMFName, SoMFPlane, SoMFRotation, SoMFString, SoMFTime, SoMFVec2b, SoMFVec2d, SoMFVec2f, SoMFVec2i32, SoMFVec2s, SoMFVec3b, SoMFVec3d, SoMFVec3f, SoMFVec3i32, SoMFVec3s, SoMFVec4b, SoMFVec4d, SoMFVec4f, SoMFVec4i32, SoMFVec4s, SoMFVec4ub, SoMFVec4ui32, SoMFVec4us, SoSFBox2d, SoSFBox2f, SoSFBox2i32, SoSFBox2s, SoSFBox3d, SoSFBox3f, SoSFBox3i32, SoSFBox3s, SoSFColor, SoSFColorRGBA, SoSFEnum, SoSFMatrix, SoSFName, SoSFPlane, SoSFRotation, SoSFString, SoSFTime, SoSFVec2b, SoSFVec2d, SoSFVec2f, SoSFVec2i32, SoSFVec2s, SoSFVec3b, SoSFVec3d, SoSFVec3f, SoSFVec3i32, SoSFVec3s, SoSFVec4b, SoSFVec4d, SoSFVec4f, SoSFVec4i32, SoSFVec4s, SoSFVec4ub, SoSFVec4ui32, SoSFVec4us, SoMFBool, SoMFDouble, SoMFEnum, SoMFFloat, SoMFInt32, SoMFShort, SoMFUInt32, SoMFUShort, SoSFBool, SoSFDouble, SoSFFloat, SoSFInt32, SoSFShort, SoSFUInt32, SoSFUShort, SoMFBitMask, and SoSFBitMask.void SoField::fixCopy (SbBoolcopyconnections) [virtual]¶
This method is internally called after SoField::copyFrom() during scene graph copies, and should do the operations necessary for fixing up the field instance after it has gotten a new value. The default method in the SoField superclass does nothing. The application programmer should normally not need to consider this method, unless he constructs a complex field type which contains new references to container instances (i.e. nodes or engines). Overriding this method is then necessary to update the reference pointers, as they could have been duplicated during the copy operation. Reimplemented in SoSFEngine, SoSFNode, SoMFPath, SoSFPath, SoMFEngine, and SoMFNode.SbBool SoField::referencesCopy (void) const [virtual]¶
Returns TRUE if this field has references to any containers in the scene graph which are also duplicated during the copy operation. Note that this method only is valid to call during copy operations. See also the note about the relevance of the fixCopy() method for application programmers, as it is applicable on this method aswell. Reimplemented in SoSFEngine, SoSFNode, SoMFPath, SoSFPath, SoMFEngine, and SoMFNode.void SoField::copyConnection (const SoField *fromfield)¶
If fromfield contains a connection to another field, make this field also use the same connection.SbBool SoField::read (SoInput *in, const SbName &name) [virtual]¶
Reads and sets the value of this field from the given SoInput instance. Returns FALSE if the field value can not be parsed from the input. The second argument is the field's context-specific name, which is typically its unique identifier in its field container. See Also:set(), write()
void SoField::write (SoOutput *out, const SbName &name) const [virtual]¶
Write the value of the field to the given SoOutput instance (which can be either a memory buffer or a file, in ASCII or in binary format). See Also:get(), read(),
SoOutput
void SoField::countWriteRefs (SoOutput *out) const [virtual]¶
This method is called during the first pass of write operations, to count the number of write references to this field and to 'forward' the reference counting operation to the field containers we're connected to.void SoField::setFieldType (inttype)¶
Set type of this field. The possible values for type is: 0 for ordinary fields, 1 for eventIn fields, 2 for eventOut fields, 3 for internal fields, 4 for VRML2 exposedField fields. There are also enum values in SoField.h.int SoField::getFieldType (void) const¶
Return the type of this field. See Also:setFieldType()
SbBool SoField::getDirty (void) const¶
Do we need re-evaluation?void SoField::setDirty (SbBooldirty)¶
Mark field for re-evaluation (upon next read operation), but do not trigger a notification.void SoField::evaluate (void) const [inline]¶
Re-evaluates the value of this field any time a getValue() call is made and the field is marked dirty. This is done in this way to gain the advantages of having lazy evaluation.void SoField::valueChanged (SbBoolresetdefault = TRUE) [protected]¶
This method is always called whenever the field's value has been changed by direct invocation of setValue() or some such. You should never call this method from anywhere in the code where the field value is being set through an evaluation of its connections. If resetdefault is TRUE, the flag marking whether or not the field has its default value will be set to FALSE. The method will also notify any auditors that the field's value has changed.void SoField::evaluateConnection (void) const [protected], [virtual]¶
If we're connected to a field/engine/interpolator, copy the value from the master source.SbBool SoField::readValue (SoInput *in) [protected], [pure virtual]¶
Read field value(s).void SoField::writeValue (SoOutput *out) const [protected], [pure virtual]¶
Write field value(s).SbBool SoField::readConnection (SoInput *in) [protected], [virtual]¶
Read the master field of a field-to-field connection (and its field container). If input parsing is successful, this field will be connected as a slave to the master field. Note that this slave field will not be marked as 'dirty' upon connection, i.e. it will retain its value until the first update of the master field is made after the connection was set up. This to be in conformance with how the Inventor Mentor specifies how field connections should be imported (see page 270).void SoField::writeConnection (SoOutput *out) const [protected], [virtual]¶
Write out information about this field's connection.SbBool SoField::isDestructing (void) const [protected]¶
Can be used to check if a field is being destructed.SoNotRec SoField::createNotRec (SoBase *cont) [protected], [virtual]¶
Reimplemented in SoMField.Author¶
Generated automatically by Doxygen for Coin from the source code.Sat Oct 12 2013 | Version 4.0.0a |