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>

Public Member Functions

 SoFieldData ()
 Constructor. More...
 
 SoFieldData (const SoFieldData &)
 Copy constructors. More...
 
 SoFieldData (const SoFieldData *)
 
 SoFieldData (int numFields)
 Constructor that takes number of fields as a hint. More...
 
 ~SoFieldData ()
 Destructor. More...
 
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. More...
 
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). More...
 
int getNumFields () const
 Returns number of fields. More...
 
const SbNamegetFieldName (int index) const
 Returns name of field with given index. More...
 
SoFieldgetField (const SoFieldContainer *object, int index) const
 Returns pointer to field with given index within given object instance. More...
 
int getIndex (const SoFieldContainer *fc, const SoField *field) const
 Returns index of field, given the field and the instance it is in. More...
 
void addEnumValue (const char *typeName, const char *valName, int val)
 Enum name/value mechanism. More...
 
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. More...
 
void addRemovedFieldName (const SbString &name)
 Adds the given name as a removed field. (MEVIS only) More...
 
bool read (SoInput *in, SoFieldContainer *object, bool errorOnUnknownField, bool &notBuiltIn) const
 Reads into fields according to SoInput. More...
 
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. More...
 
void write (SoOutput *out, const SoFieldContainer *object) const
 Writes all fields of object according to SoOutput. More...
 
void copy (const SoFieldData *from)
 Copies all fields from given field data into this one, creating new fields for them. More...
 
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) More...
 
bool readFieldDescriptions (SoInput *in, SoFieldContainer *object, int numDescriptionsExpected) const
 Read field type information. More...
 
void writeFieldDescriptions (SoOutput *out, const SoFieldContainer *object) const
 Write field type information. More...
 

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

Constructor & Destructor Documentation

◆ SoFieldData() [1/4]

SoFieldData::SoFieldData ( )
inline

Definition at line 91 of file SoFieldData.h.

◆ SoFieldData() [2/4]

SoFieldData::SoFieldData ( const SoFieldData )

◆ SoFieldData() [3/4]

SoFieldData::SoFieldData ( const SoFieldData )

◆ SoFieldData() [4/4]

SoFieldData::SoFieldData ( int  numFields)
inline

Definition at line 98 of file SoFieldData.h.

◆ ~SoFieldData()

SoFieldData::~SoFieldData ( )

Member Function Documentation

◆ addEnumValue()

void SoFieldData::addEnumValue ( const char *  typeName,
const char *  valName,
int  val 
)

◆ addField()

void SoFieldData::addField ( SoFieldContainer defObject,
const char *  fieldName,
const SoField field 
)

This is used to define fields of a FieldContainer (node or engine) class.

◆ addRemovedFieldName()

void SoFieldData::addRemovedFieldName ( const SbString name)

◆ copy()

void SoFieldData::copy ( const SoFieldData from)

◆ getEnumData()

void SoFieldData::getEnumData ( const char *  typeName,
int &  num,
int *&  vals,
SbName *&  names 
)

◆ getField()

SoField* SoFieldData::getField ( const SoFieldContainer object,
int  index 
) const

◆ getFieldName()

const SbName& SoFieldData::getFieldName ( int  index) const

◆ getIndex()

int SoFieldData::getIndex ( const SoFieldContainer fc,
const SoField field 
) const

◆ getNumFields()

int SoFieldData::getNumFields ( ) const
inline

Definition at line 118 of file SoFieldData.h.

◆ getRemovedFieldNames()

const std::vector<SbString>& SoFieldData::getRemovedFieldNames ( ) const
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.

◆ isSame()

bool SoFieldData::isSame ( const SoFieldContainer c1,
const SoFieldContainer c2 
) const

◆ overlay()

void SoFieldData::overlay ( SoFieldContainer to,
const SoFieldContainer from,
bool  copyConnections 
) const

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

◆ read() [1/2]

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.

◆ read() [2/2]

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.

◆ readFieldDescriptions()

bool SoFieldData::readFieldDescriptions ( SoInput in,
SoFieldContainer object,
int  numDescriptionsExpected 
) const

◆ write()

void SoFieldData::write ( SoOutput out,
const SoFieldContainer object 
) const

◆ writeFieldDescriptions()

void SoFieldData::writeFieldDescriptions ( SoOutput out,
const SoFieldContainer object 
) const

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