Open Inventor Reference
SoFieldData Class 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>

List of all members.

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, SbBool 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 SbNamegetFieldName (int index) const
 Returns name of field with given index.
SoFieldgetField (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)
SbBool read (SoInput *in, SoFieldContainer *object, SbBool errorOnUnknownField, SbBool &notBuiltIn) const
 Reads into fields according to SoInput.
SbBool read (SoInput *in, SoFieldContainer *object, const SbName &fieldName, SbBool &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.
SbBool 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)
SbBool readFieldDescriptions (SoInput *in, SoFieldContainer *object, int numDescriptionsExpected) const
 Read field type information.
void writeFieldDescriptions (SoOutput *out, const SoFieldContainer *object) const
 Write field type information.

Detailed Description

(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 86 of file SoFieldData.h.


Constructor & Destructor Documentation

SoFieldData::SoFieldData ( ) [inline]

Definition at line 89 of file SoFieldData.h.

SoFieldData::SoFieldData ( const SoFieldData )
SoFieldData::SoFieldData ( const SoFieldData )
SoFieldData::SoFieldData ( int  numFields) [inline]

Definition at line 96 of file SoFieldData.h.

SoFieldData::~SoFieldData ( )

Member Function Documentation

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::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
int SoFieldData::getNumFields ( ) const [inline]

Definition at line 116 of file SoFieldData.h.

SbBool SoFieldData::isSame ( const SoFieldContainer c1,
const SoFieldContainer c2 
) const
void SoFieldData::overlay ( SoFieldContainer to,
const SoFieldContainer from,
SbBool  copyConnections 
) const

If copyConnections is TRUE, any connections to the fields are copied as well

SbBool SoFieldData::read ( SoInput in,
SoFieldContainer object,
const SbName fieldName,
SbBool 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.

SbBool SoFieldData::read ( SoInput in,
SoFieldContainer object,
SbBool  errorOnUnknownField,
SbBool 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.

SbBool 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

The documentation for this class was generated from the following file: