Open Inventor Reference
|
The SoFieldData class holds data about fields of an object: the number of fields the object has, the names of the fields, and a pointer to a prototype instance of the field. More...
#include <Inventor/fields/SoFieldData.h>
Public Member Functions | |
SoFieldData () | |
Constructor. | |
SoFieldData (const SoFieldData &) | |
Copy constructors. | |
SoFieldData (const SoFieldData *) | |
SoFieldData (int numFields) | |
Constructor that takes number of fields as a hint. | |
~SoFieldData () | |
Destructor. | |
void | addField (SoFieldContainer *defObject, const char *fieldName, const SoField *field) |
Adds a field to current data, given default value object, name of field and pointer to field within default value object. | |
void | overlay (SoFieldContainer *to, const SoFieldContainer *from, bool copyConnections) const |
Copy values and flags of fields from one object to another (of the same type). | |
int | getNumFields () const |
Returns number of fields. | |
const SbName & | getFieldName (int index) const |
Returns name of field with given index. | |
SoField * | getField (const SoFieldContainer *object, int index) const |
Returns pointer to field with given index within given object instance. | |
int | getIndex (const SoFieldContainer *fc, const SoField *field) const |
Returns index of field, given the field and the instance it is in. | |
void | addEnumValue (const char *typeName, const char *valName, int val) |
Enum name/value mechanism. | |
void | getEnumData (const char *typeName, int &num, int *&vals, SbName *&names) |
const std::vector< SbString > & | getRemovedFieldNames () const |
Get access to the names of removed fields. | |
void | addRemovedFieldName (const SbString &name) |
Adds the given name as a removed field. (MEVIS only) | |
bool | read (SoInput *in, SoFieldContainer *object, bool errorOnUnknownField, bool ¬BuiltIn) const |
Reads into fields according to SoInput. | |
bool | read (SoInput *in, SoFieldContainer *object, const SbName &fieldName, bool &foundName) const |
This function is used when the field name has already been read, and just the value needs to be read in. | |
void | write (SoOutput *out, const SoFieldContainer *object) const |
Writes all fields of object according to SoOutput. | |
void | copy (const SoFieldData *from) |
Copies all fields from given field data into this one, creating new fields for them. | |
bool | isSame (const SoFieldContainer *c1, const SoFieldContainer *c2) const |
Returns TRUE if the values in the fields of one container are the same as those in another (of the same type) | |
bool | readFieldDescriptions (SoInput *in, SoFieldContainer *object, int numDescriptionsExpected) const |
Read field type information. | |
void | writeFieldDescriptions (SoOutput *out, const SoFieldContainer *object) const |
Write field type information. | |
(Typically, this prototype field is contained within a prototype instance of the node or engine.)
All objects of a given class share the same field data. Therefore, to get information about a particular field in a particular object instance, it is necessary to pass that instance to the appropriate method.
Definition at line 88 of file SoFieldData.h.
|
inline |
Definition at line 91 of file SoFieldData.h.
SoFieldData::SoFieldData | ( | const SoFieldData & | ) |
SoFieldData::SoFieldData | ( | const SoFieldData * | ) |
|
inline |
Definition at line 98 of file SoFieldData.h.
SoFieldData::~SoFieldData | ( | ) |
void SoFieldData::addEnumValue | ( | const char * | typeName, |
const char * | valName, | ||
int | val | ||
) |
void SoFieldData::addField | ( | SoFieldContainer * | defObject, |
const char * | fieldName, | ||
const SoField * | field | ||
) |
This is used to define fields of a FieldContainer (node or engine) class.
void SoFieldData::addRemovedFieldName | ( | const SbString & | name | ) |
void SoFieldData::copy | ( | const SoFieldData * | from | ) |
void SoFieldData::getEnumData | ( | const char * | typeName, |
int & | num, | ||
int *& | vals, | ||
SbName *& | names | ||
) |
SoField * SoFieldData::getField | ( | const SoFieldContainer * | object, |
int | index | ||
) | const |
const SbName & SoFieldData::getFieldName | ( | int | index | ) | const |
int SoFieldData::getIndex | ( | const SoFieldContainer * | fc, |
const SoField * | field | ||
) | const |
|
inline |
Definition at line 118 of file SoFieldData.h.
|
inline |
(MEVIS only) This can be used to avoid warnings when loading stored nodes which contain field values from fields that have been removed.
Definition at line 140 of file SoFieldData.h.
bool SoFieldData::isSame | ( | const SoFieldContainer * | c1, |
const SoFieldContainer * | c2 | ||
) | const |
void SoFieldData::overlay | ( | SoFieldContainer * | to, |
const SoFieldContainer * | from, | ||
bool | copyConnections | ||
) | const |
If copyConnections is TRUE, any connections to the fields are copied as well
bool SoFieldData::read | ( | SoInput * | in, |
SoFieldContainer * | object, | ||
bool | errorOnUnknownField, | ||
bool & | notBuiltIn | ||
) | const |
The third parameter indicates whether an unknown field should be reported as an error; this can be FALSE for nodes that have children. The last argument will be set to TRUE if a description of the fields (using the "inputs" or "fields" keywords) was read.
bool SoFieldData::read | ( | SoInput * | in, |
SoFieldContainer * | object, | ||
const SbName & | fieldName, | ||
bool & | foundName | ||
) | const |
It is used by the above read() method and to read in GlobalFields. It returns TRUE if there were no problems reading, and will return FALSE in 'foundName' if the given name is not the name of one of the fields in the fieldData.
bool SoFieldData::readFieldDescriptions | ( | SoInput * | in, |
SoFieldContainer * | object, | ||
int | numDescriptionsExpected | ||
) | const |
void SoFieldData::write | ( | SoOutput * | out, |
const SoFieldContainer * | object | ||
) | const |
void SoFieldData::writeFieldDescriptions | ( | SoOutput * | out, |
const SoFieldContainer * | object | ||
) | const |