Simplygon C++ API  8.3.35800.0
SimplygonSDK::IFieldData Class Referenceabstract

#include <SimplygonSDK.h>

Inheritance diagram for SimplygonSDK::IFieldData:
SimplygonSDK::IObject

Public Member Functions

virtual CountedPointer< IValueArrayAddBaseTypeField (rid base_type, unsigned int tuple_size, const char *name)=0
 
virtual void AddField (IValueArray *field)=0
 
virtual void AddTupleCount (unsigned int tuplecount)=0
 
virtual void AppendTuples (IFieldData *other, bool add_missing_fields)=0
 
virtual void Clear ()=0
 
virtual void CopyCombine3Tuples (IFieldData *source, rid dest_id, rid src_id_1, rid src_id_2, rid src_id_3, real alpha_1, real alpha_2)=0
 
virtual void CopyCombineTuples (IFieldData *source, rid dest_id, rid src_id_1, rid src_id_2, real alpha)=0
 
virtual void CopyRange (IFieldData *source, rid start_dest_id, rid start_src_id, unsigned int count)=0
 
virtual void CopyTuple (IFieldData *source, rid dest_id, rid src_id)=0
 
virtual void DeepCopy (IFieldData *source, bool copy_data)=0
 
virtual void ExtractTuples (IFieldData *dest, rid start, unsigned int count)=0
 
virtual const char * GetClass ()
 
virtual CountedPointer< IValueArrayGetField (const char *name)=0
 
virtual unsigned int GetFieldCount ()=0
 
virtual CountedPointer< IValueArrayGetFieldWithHandle (rhandle hand)=0
 
virtual CountedPointer< IValueArrayGetFieldWithId (rid id)=0
 
virtual rhandle GetFirstFieldHandle ()=0
 
virtual rid GetMaxFieldId ()=0
 
virtual rid GetMaxTupleId ()=0
 
virtual rhandle GetNextFieldHandle (rhandle hand)=0
 
virtual unsigned int GetTupleCount ()=0
 
virtual void IndexedCombine (IFieldData *source, IRidArray *idtable, IRealArray *blendtable, rid startId)=0
 
virtual void IndexedCombine (IFieldData *source, rid *idtable_ridInputDataPtr, real *blendtable_realInputDataPtr, unsigned int idtable_cnt, rid startId)=0
 
virtual void IndexedCombine3 (IFieldData *source, IRidArray *idtable, IRealArray *blendtable, rid startId)=0
 
virtual void IndexedCombine3 (IFieldData *source, rid *idtable_ridInputDataPtr, real *blendtable_realInputDataPtr, unsigned int idtable_cnt, rid startId)=0
 
virtual void IndexedCopy (IFieldData *source, IRidArray *idtable, rid startId)=0
 
virtual void IndexedCopy (IFieldData *source, rid *idtable_ridInputDataPtr, unsigned int idtable_cnt, rid startId)=0
 
virtual bool IsA (const char *type) const
 
virtual int IsEmpty ()=0
 
virtual bool IsSetupIdenticalTo (IFieldData *other)=0
 
virtual CountedPointer< IFieldDataNewCopy (bool copy_data)=0
 
virtual CountedPointer< IFieldDataNewPackedCopy (IRidArray *index_array)=0
 
virtual void RemoveAllFields ()=0
 
virtual void RemoveField (const char *name)=0
 
virtual void SafeRemoveField (const char *name)=0
 
virtual void SetTupleCount (unsigned int tuplecount)=0
 
- Public Member Functions inherited from SimplygonSDK::IObject
virtual rid AddObserver (robserver *Observer, rid EventId)=0
 
virtual void AddRef ()=0
 
virtual rstring GetName ()=0
 
virtual void * GetUserComponentArea (rid userid)=0
 
virtual void PrintInfo ()=0
 
virtual void Release ()=0
 
virtual void RemoveObserver (rid ObserverId)=0
 
virtual void SetName (const char *Name)=0
 

Static Public Member Functions

static bool IsClassA (const char *type)
 
static IFieldDataSafeCast (IObject *ptr)
 
- Static Public Member Functions inherited from SimplygonSDK::IObject
static bool IsClassA (const char *type)
 
static IObjectSafeCast (IObject *ptr)
 

Detailed Description

IFieldData represents multiple fields of data. Each field is implemented as an IValueArray 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.

Definition at line 4639 of file SimplygonSDK.h.

Member Function Documentation

◆ AddBaseTypeField()

virtual CountedPointer<IValueArray> SimplygonSDK::IFieldData::AddBaseTypeField ( rid  base_type,
unsigned int  tuple_size,
const char *  name 
)
pure virtual

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

Parameters
base_typeshould be a base type listed in SimplygonSDK::BaseTypes
tuple_sizethe desired tuple size
namethe name of the new field
Returns
a pointer to the new field

◆ AddField()

virtual void SimplygonSDK::IFieldData::AddField ( IValueArray field)
pure virtual

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

Parameters
fieldthe array to add to the field data

◆ AddTupleCount()

virtual void SimplygonSDK::IFieldData::AddTupleCount ( unsigned int  tuplecount)
pure virtual

Adds a number of tuples to the current tuple count.

Parameters
tuplecountthe desired number of tuples to add. Note that the total TupleCount cannot exceed INT_MAX. Value cannot be less than 0. Value cannot be greater than INT_MAX.

◆ AppendTuples()

virtual void SimplygonSDK::IFieldData::AppendTuples ( IFieldData other,
bool  add_missing_fields 
)
pure virtual

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.

Parameters
otherthe field data object that is appended Value cannot be equal to null.
add_missing_fieldsif set to true, missing fields will be added to this field data object.

◆ Clear()

virtual void SimplygonSDK::IFieldData::Clear ( )
pure virtual

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

◆ CopyCombine3Tuples()

virtual void SimplygonSDK::IFieldData::CopyCombine3Tuples ( IFieldData source,
rid  dest_id,
rid  src_id_1,
rid  src_id_2,
rid  src_id_3,
real  alpha_1,
real  alpha_2 
)
pure virtual

CopyCombine3Tuples combines the data from three tuples into a destination tuple. The call works like CobineTuples, 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.

Parameters
sourcethe field data source to combine from
dest_idthe tuple index to put the combined results into in this field data
src_id_1the first tuple index to use for combining from the field data source
src_id_2the second tuple index to use for combining from the field data source
src_id_3the third tuple index to use for combining from the field data source
alpha_1the first interpolation value used for combining the source tuples
alpha_2the second interpolation value used for combining the source tuples

◆ CopyCombineTuples()

virtual void SimplygonSDK::IFieldData::CopyCombineTuples ( IFieldData source,
rid  dest_id,
rid  src_id_1,
rid  src_id_2,
real  alpha 
)
pure virtual

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.

Parameters
sourcethe field data source to combine from
dest_idthe tuple index to put the combined results into in this field data
src_id_1the first tuple index to use for combining from the field data source
src_id_2the second tuple index to use for combining from the field data source
alphathe interpolation value used for combining the source tuples

◆ CopyRange()

virtual void SimplygonSDK::IFieldData::CopyRange ( IFieldData source,
rid  start_dest_id,
rid  start_src_id,
unsigned int  count 
)
pure virtual

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.

Parameters
sourcethe source field object to copy from
start_dest_idthe first destination tuple id
start_src_idthe first source tuple id
countthe number of tuples to copy

◆ CopyTuple()

virtual void SimplygonSDK::IFieldData::CopyTuple ( IFieldData source,
rid  dest_id,
rid  src_id 
)
pure virtual

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.

Parameters
sourcethe source field data to copy from
dest_idthe tuple index to copy into in this field data
src_idthe tuple index to copy from in the source field data

◆ DeepCopy()

virtual void SimplygonSDK::IFieldData::DeepCopy ( IFieldData source,
bool  copy_data 
)
pure virtual

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

Parameters
sourcethe source array to copy from
copy_datatrue if the data should be copied along with the field data properties

◆ ExtractTuples()

virtual void SimplygonSDK::IFieldData::ExtractTuples ( IFieldData dest,
rid  start,
unsigned int  count 
)
pure virtual

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

Parameters
destthe destination object Value cannot be equal to null.
startthe id of the first tuple that is extracted
countthe number of tuples to extract

◆ GetClass()

virtual const char* SimplygonSDK::IFieldData::GetClass ( )
virtual

GetClass returns the name of the class of the object.

Returns
the name of the actual class of the object, as a const char string

Reimplemented from SimplygonSDK::IObject.

◆ GetField()

virtual CountedPointer<IValueArray> SimplygonSDK::IFieldData::GetField ( const char *  name)
pure virtual

Retrieves a field. If the field was not found, the return is NULL.

Parameters
namethe name of the field to fetch
Returns
the field if it exists, otherwise NULL

◆ GetFieldCount()

virtual unsigned int SimplygonSDK::IFieldData::GetFieldCount ( )
pure virtual

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

Returns
the number of fields in the field data object

◆ GetFieldWithHandle()

virtual CountedPointer<IValueArray> SimplygonSDK::IFieldData::GetFieldWithHandle ( rhandle  hand)
pure virtual

Returns the field associated with the specified handle.

Parameters
handthe handle to the requested field
Returns
the requested field

◆ GetFieldWithId()

virtual CountedPointer<IValueArray> SimplygonSDK::IFieldData::GetFieldWithId ( rid  id)
pure virtual

Retrieves a field from its index in the field data.

Parameters
idthe id of the field
Returns
the field if it exists, otherwise NULL

◆ GetFirstFieldHandle()

virtual rhandle SimplygonSDK::IFieldData::GetFirstFieldHandle ( )
pure virtual

Returns the handle of the first field. If no fields are added to the object, NULL is returned.

Returns
the handle of the first field

◆ GetMaxFieldId()

virtual rid SimplygonSDK::IFieldData::GetMaxFieldId ( )
pure virtual

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

Returns
the id of the field with the highest id

◆ GetMaxTupleId()

virtual rid SimplygonSDK::IFieldData::GetMaxTupleId ( )
pure virtual

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

Returns
the id of the last tuple in the array

◆ GetNextFieldHandle()

virtual rhandle SimplygonSDK::IFieldData::GetNextFieldHandle ( rhandle  hand)
pure virtual

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

Parameters
handthe current handle
Returns
the handle after the parameter handle

◆ GetTupleCount()

virtual unsigned int SimplygonSDK::IFieldData::GetTupleCount ( )
pure virtual

Returns the number of tuples.

Returns
the number of tuples in the field data

◆ IndexedCombine() [1/2]

virtual void SimplygonSDK::IFieldData::IndexedCombine ( IFieldData source,
IRidArray idtable,
IRealArray blendtable,
rid  startId 
)
pure virtual

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.

Parameters
sourcethe field data to combine from Value cannot be equal to null.
idtablearray containing the tuple indices to combine Value cannot be equal to null.
blendtablearray containing the blend weights Value cannot be equal to null.
startIdthe tuple to begin putting the combinations into

◆ IndexedCombine() [2/2]

virtual void SimplygonSDK::IFieldData::IndexedCombine ( IFieldData source,
rid idtable_ridInputDataPtr,
real blendtable_realInputDataPtr,
unsigned int  idtable_cnt,
rid  startId 
)
pure virtual

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.

Parameters
sourcethe field data to combine from Value cannot be equal to null.
idtable_ridInputDataPtrarray containing the tuple indices to combine Value cannot be equal to null.
blendtable_realInputDataPtrpointer to the blend weights Value cannot be equal to null.
idtable_cntthe number of indices to combine
startIdthe tuple to begin putting the combinations into

◆ IndexedCombine3() [1/2]

virtual void SimplygonSDK::IFieldData::IndexedCombine3 ( IFieldData source,
IRidArray idtable,
IRealArray blendtable,
rid  startId 
)
pure virtual

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.

Parameters
sourcethe field data to combine from Value cannot be equal to null.
idtablearray containing the tuple indices to combine Value cannot be equal to null.
blendtablearray containing the blend weights Value cannot be equal to null.
startIdthe tuple to begin putting the combinations into

◆ IndexedCombine3() [2/2]

virtual void SimplygonSDK::IFieldData::IndexedCombine3 ( IFieldData source,
rid idtable_ridInputDataPtr,
real blendtable_realInputDataPtr,
unsigned int  idtable_cnt,
rid  startId 
)
pure virtual

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.

Parameters
sourcethe field data to combine from Value cannot be equal to null.
idtable_ridInputDataPtrarray containing the tuple indices to combine Value cannot be equal to null.
blendtable_realInputDataPtrpointer to the blend weights Value cannot be equal to null.
idtable_cntthe number of sets of indices to combine
startIdthe tuple to begin putting the combinations into

◆ IndexedCopy() [1/2]

virtual void SimplygonSDK::IFieldData::IndexedCopy ( IFieldData source,
IRidArray idtable,
rid  startId 
)
pure virtual

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 underlaying data fields, of the same type and the same tuple sizes. The FieldData must have enough tuples to hold the new data.

Parameters
sourcethe source field data object to copy from Value cannot be equal to null.
idtablearray containing the tuple indices to copy Value cannot be equal to null.
startIdthe first tuple to begin copy into

◆ IndexedCopy() [2/2]

virtual void SimplygonSDK::IFieldData::IndexedCopy ( IFieldData source,
rid idtable_ridInputDataPtr,
unsigned int  idtable_cnt,
rid  startId 
)
pure virtual

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 underlaying data fields, of the same type and the same tuple sizes. The FieldData must have enough tuples to hold the new data.

Parameters
sourcethe source field data object to copy from Value cannot be equal to null.
idtable_ridInputDataPtrpointer to indices of tuples to copy Value cannot be equal to null.
idtable_cntthe number of indices to copy
startIdthe first tuple to begin copy into

◆ IsA()

virtual bool SimplygonSDK::IFieldData::IsA ( const char *  type) const
virtual

The IsA function returns true if the object is a or is a descendant of the class named as the type parameter

Parameters
typeis the name of the class to check if the object is, or is a descendant of
Returns
true if the object is of the specified class, false if not

Reimplemented from SimplygonSDK::IObject.

◆ IsClassA()

static bool SimplygonSDK::IFieldData::IsClassA ( const char *  type)
inlinestatic

The IsClassA function returns true if IFieldData is a or is a descendant of the class named as the type parameter

Parameters
typeis the name of the class to check if the class is, or is a descendant of
Returns
true if the class is of the specified class, false if not

Definition at line 4660 of file SimplygonSDK.h.

◆ IsEmpty()

virtual int SimplygonSDK::IFieldData::IsEmpty ( )
pure virtual

Returns 1 if no tuples exist in the field data.

Returns
1 if empty, else 0

◆ IsSetupIdenticalTo()

virtual bool SimplygonSDK::IFieldData::IsSetupIdenticalTo ( IFieldData other)
pure virtual

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.

Parameters
otherThe other field data object used for comparison
Returns
true if the field data objects are identical

◆ NewCopy()

virtual CountedPointer<IFieldData> SimplygonSDK::IFieldData::NewCopy ( bool  copy_data)
pure virtual

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

Parameters
copy_datatrue if data should be copied along with the field properties
Returns
A copy of this field data

◆ NewPackedCopy()

virtual CountedPointer<IFieldData> SimplygonSDK::IFieldData::NewPackedCopy ( IRidArray index_array)
pure virtual

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.

Parameters
index_arraywill contain indices to the new packed field data values
Returns
A packed copy of this field data

◆ RemoveAllFields()

virtual void SimplygonSDK::IFieldData::RemoveAllFields ( )
pure virtual

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

◆ RemoveField()

virtual void SimplygonSDK::IFieldData::RemoveField ( const char *  name)
pure virtual

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

Parameters
namethe name of the field

◆ SafeCast()

static IFieldData* SimplygonSDK::IFieldData::SafeCast ( IObject ptr)
inlinestatic

SafeCast makes sure the pointer is of a class that can be cast into a IFieldData pointer, and if this is possible, returns the cast pointer.

Parameters
ptris the pointer to be cast into a IFieldData pointer
Returns
a pointer to the IFieldData object, if the cast can be made, and a NULL pointer otherwise

Definition at line 4673 of file SimplygonSDK.h.

◆ SafeRemoveField()

virtual void SimplygonSDK::IFieldData::SafeRemoveField ( const char *  name)
pure virtual

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

Parameters
namethe name of the field

◆ SetTupleCount()

virtual void SimplygonSDK::IFieldData::SetTupleCount ( unsigned int  tuplecount)
pure virtual

Resizes the list to the specified tuplecount. If the list is enlarged, the new tuples will contain unspecified data.

Parameters
tuplecountthe desired tuple count Value cannot be less than 0. Value cannot be greater than INT_MAX.

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