Skip to content
On this page

class FieldData

FieldData represents multiple fields of data. Each field is implemented as an ValueArray object, that has a unique name, and can have complex components (such as scalars, vectors, quaternions, tensors or matrices). All fields are assumed to be of the same length. IFieldData can be seen as an array with complex tuples, where the component can be of different types.

Properties

PropertyDescription
NameThe name of the FieldData object. (Inherited from Object)
TupleCountResizes/Gets the list to the specified tuple count. If the list is enlarged, the new tuples will contain unspecified data.

Methods

MethodDescription
AddBaseTypeFieldAdds a field based on a base type. Only ValueArray objects are allowed. The created and added object is returned.
AddFieldAdds a field. The field must have a unique name set.
AddObserverAdds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
AddTupleCountAdds a number of tuples to the current tuple count.
AppendTuplesAppends another field data object to this object. The fields are allowed to be setup differently, but then comes at a significant performance penalty. If fields in the other field data object is missing in this object, these will be added, and the items in the old tuples will be set to 0.
ClearClears all tuples from the fields. The fields, however, are not removed.
CopyCombine3TuplesCopyCombine3Tuples combines the data from three tuples into a destination tuple. The call works like CombineTuples, but there is three source tuples, and two alpha values. the destination will be weighted by the values: alpha_3 = 1-(alpha_1 + alpha_2) dest = src_1*alpha_1 + src_2*alpha_2 + src_3*alpha_3 This field data object can be used as the source field data object to copy within the object.
CopyCombineTuplesCopyCombineTuples() combines the data from two tuples into a destination tuple. This field data object can be used as the source field data object to copy within the object.
CopyRangeCopyRange() copies a range of tuples from a source field object into this field object. The field objects must have the same field setup. This field object must be resized to hold the tuples before copying.
CopyTupleCopyTuple() copies one tuple to another. Both the dest_id and the source_id must exist in the array. This field data object can be used as the source field data object to copy within the object.
DeepCopyCopies the field setup and data from another object. To only copy the setup, set copy_data to false.
ExtractTuplesExtracts a range of tuples from this object. The receiving object is assumed to have exactly the same data fields as this object.
GetClassGet the name of the FieldData class. (Inherited from Object)
GetFieldRetrieves a field. If the field was not found, null is returned.
GetFieldCountReturns the number of fields in the field data object. The ids of the fields range from 0 through (GetFieldCount()-1).
GetFieldWithHandleReturns the field associated with the specified handle.
GetFieldWithIdRetrieves a field from its index in the field data.
GetFirstFieldHandleReturns the handle of the first field, or null if no fields are added to the object.
GetMaxFieldIdReturns the id of the field with the highest id. NOTE! If no fields exist in the field data object, the return is undefined.
GetMaxTupleIdReturns the id of the last tuple in the array. If the array is empty, the value is undefined.
GetNextFieldHandleReturns the next handle, or null if no more fields exist in the object.
IndexedCombineWorks like IndexedCopy, but uses two consecutive ids in the idtable, and a blend value from the blendtable. The idtable contains (idtable_cnt*2) indices and blendtable contains idtable_cnt blend values. Does the blend: dest = src1*(1-blend) + src2*blend The FieldData must have enough tuples to hold the new data.
IndexedCombine3Works like IndexedCombine(), but with three ids that are combined through two blend values in the blendtable. The idtable contains (idtable_cnt*3) indices and blendtable contains (idtable_cnt*2) blend values. Does the blend: dest = src1*blend1 + src2*blend2 + src3*(1-(blend1+blend2)) The FieldData must have enough tuples to hold the new data.
IndexedCopyCopies tuples from a source field data object through an id table. The id table dictates the order in which the tuples are to be copied. E.g. If the first item in the id table has the value 14, then the tuple with id 14 in the source array will be copied to the first tuple in this array. Note! All ids in the id table must be valid ids of tuples in the source field data object. The id table is assumed to have a tuple size of 1. The source and this field data object must have the same underlying data fields, of the same type and the same tuple sizes. The FieldData must have enough tuples to hold the new data.
IsAReturns true if FieldData is a or is a descendant of the class named as the type parameter. (Inherited from Object)
IsEmptyReturns 1 if no tuples exist in the field data.
IsNullReturns true if the FieldData object is invalid. (Inherited from Object)
IsSameObjectAsReturns true if the FieldData object is valid. (Inherited from Object)
IsSetupIdenticalToCompares the field setup of this field data object to another field data object. If the setups are not identical, false is returned. Note! IsSetupIdenticalTo will return false even if the same fields exist in both field data objects, but are not in the same order.
NewCopyCreates another field data object with the same field setup. To also copy the data to the new object, set copy_data to true.
NewPackedCopyLike NewCopy, NewPackedCopy creates a field data object with the same underlying data and tuple settings as the source field data object. However, NewPackedCopy only copies unique tuples, and if the index_array parameter is set, this index array will contain the same number of tuples as the source field data object, and with the ids of a specific tuples within the new copy of the field data object.
NonNullReturns true if the FieldData object is valid. (Inherited from Object)
PrintInfoPrints the content/info of the FieldData object to the log. (Inherited from Object)
RemoveAllFieldsClears all fields from the object. Releases all data in the object.
RemoveFieldRemoves a field. Removing a field causes the remaining fields to be remapped to new ids. Note that the field must exist. If not, the method will return error. To remove a field that may not exist, use SafeRemoveField.
RemoveObserverRemoves a previously added observer object. (Inherited from Object)
SafeRemoveFieldRemoves a field. Removing a field causes the remaining fields to be remapped to new ids.

Static methods

MethodDescription
IsClassAReturns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
SafeCastSafeCast makes sure the input object is of a class that can be cast into spFieldData, and if this is the case, returns the object cast into spFieldData. (Inherited from Object)

Properties details

Name

The name of the FieldData object. (Inherited from Object)

TupleCount

Resizes/Gets the list to the specified tuple count. If the list is enlarged, the new tuples will contain unspecified data.

Methods details

AddBaseTypeField

Adds a field based on a base type. Only ValueArray objects are allowed. The created and added object is returned.

AddField

Adds a field. The field must have a unique name set.

AddObserver

Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)

AddTupleCount

Adds a number of tuples to the current tuple count.

AppendTuples

Appends another field data object to this object. The fields are allowed to be setup differently, but then comes at a significant performance penalty. If fields in the other field data object is missing in this object, these will be added, and the items in the old tuples will be set to 0.

Clear

Clears all tuples from the fields. The fields, however, are not removed.

CopyCombine3Tuples

CopyCombine3Tuples combines the data from three tuples into a destination tuple. The call works like CombineTuples, but there is three source tuples, and two alpha values. the destination will be weighted by the values: alpha_3 = 1-(alpha_1 + alpha_2) dest = src_1*alpha_1 + src_2*alpha_2 + src_3*alpha_3 This field data object can be used as the source field data object to copy within the object.

CopyCombineTuples

CopyCombineTuples() combines the data from two tuples into a destination tuple. This field data object can be used as the source field data object to copy within the object.

CopyRange

CopyRange() copies a range of tuples from a source field object into this field object. The field objects must have the same field setup. This field object must be resized to hold the tuples before copying.

CopyTuple

CopyTuple() copies one tuple to another. Both the dest_id and the source_id must exist in the array. This field data object can be used as the source field data object to copy within the object.

DeepCopy

Copies the field setup and data from another object. To only copy the setup, set copy_data to false.

ExtractTuples

Extracts a range of tuples from this object. The receiving object is assumed to have exactly the same data fields as this object.

GetClass

Get the name of the FieldData class. (Inherited from Object)

GetField

Retrieves a field. If the field was not found, null is returned.

GetFieldCount

Returns the number of fields in the field data object. The ids of the fields range from 0 through (GetFieldCount()-1).

GetFieldWithHandle

Returns the field associated with the specified handle.

GetFieldWithId

Retrieves a field from its index in the field data.

GetFirstFieldHandle

Returns the handle of the first field, or null if no fields are added to the object.

GetMaxFieldId

Returns the id of the field with the highest id. NOTE! If no fields exist in the field data object, the return is undefined.

GetMaxTupleId

Returns the id of the last tuple in the array. If the array is empty, the value is undefined.

GetNextFieldHandle

Returns the next handle, or null if no more fields exist in the object.

IndexedCombine

Works like IndexedCopy, but uses two consecutive ids in the idtable, and a blend value from the blendtable. The idtable contains (idtable_cnt*2) indices and blendtable contains idtable_cnt blend values. Does the blend: dest = src1*(1-blend) + src2*blend The FieldData must have enough tuples to hold the new data.

IndexedCombine3

Works like IndexedCombine(), but with three ids that are combined through two blend values in the blendtable. The idtable contains (idtable_cnt*3) indices and blendtable contains (idtable_cnt*2) blend values. Does the blend: dest = src1*blend1 + src2*blend2 + src3*(1-(blend1+blend2)) The FieldData must have enough tuples to hold the new data.

IndexedCopy

Copies tuples from a source field data object through an id table. The id table dictates the order in which the tuples are to be copied. E.g. If the first item in the id table has the value 14, then the tuple with id 14 in the source array will be copied to the first tuple in this array. Note! All ids in the id table must be valid ids of tuples in the source field data object. The id table is assumed to have a tuple size of 1. The source and this field data object must have the same underlying data fields, of the same type and the same tuple sizes. The FieldData must have enough tuples to hold the new data.

IsA

Returns true if FieldData is a or is a descendant of the class named as the type parameter. (Inherited from Object)

IsEmpty

Returns 1 if no tuples exist in the field data.

IsNull

Returns true if the FieldData object is invalid. (Inherited from Object)

IsSameObjectAs

Returns true if the FieldData object is valid. (Inherited from Object)

IsSetupIdenticalTo

Compares the field setup of this field data object to another field data object. If the setups are not identical, false is returned. Note! IsSetupIdenticalTo will return false even if the same fields exist in both field data objects, but are not in the same order.

NewCopy

Creates another field data object with the same field setup. To also copy the data to the new object, set copy_data to true.

NewPackedCopy

Like NewCopy, NewPackedCopy creates a field data object with the same underlying data and tuple settings as the source field data object. However, NewPackedCopy only copies unique tuples, and if the index_array parameter is set, this index array will contain the same number of tuples as the source field data object, and with the ids of a specific tuples within the new copy of the field data object.

NonNull

Returns true if the FieldData object is valid. (Inherited from Object)

PrintInfo

Prints the content/info of the FieldData object to the log. (Inherited from Object)

RemoveAllFields

Clears all fields from the object. Releases all data in the object.

RemoveField

Removes a field. Removing a field causes the remaining fields to be remapped to new ids. Note that the field must exist. If not, the method will return error. To remove a field that may not exist, use SafeRemoveField.

RemoveObserver

Removes a previously added observer object. (Inherited from Object)

SafeRemoveField

Removes a field. Removing a field causes the remaining fields to be remapped to new ids.

Static methods details

IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)

SafeCast

SafeCast makes sure the input object is of a class that can be cast into spFieldData, and if this is the case, returns the object cast into spFieldData. (Inherited from Object)