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

#include <SimplygonSDK.h>

Inheritance diagram for SimplygonSDK::IArray:
SimplygonSDK::IObject SimplygonSDK::IValueArray SimplygonSDK::IBoolArray SimplygonSDK::ICharArray SimplygonSDK::IDoubleArray SimplygonSDK::IFloatArray SimplygonSDK::IIntArray SimplygonSDK::ILongArray SimplygonSDK::IRealArray SimplygonSDK::IRidArray SimplygonSDK::IShortArray SimplygonSDK::IStringArray SimplygonSDK::IUnsignedCharArray SimplygonSDK::IUnsignedIntArray SimplygonSDK::IUnsignedLongArray SimplygonSDK::IUnsignedShortArray

Public Member Functions

virtual void AppendArray (IArray *source)=0
 
virtual SGDEPRECATED void AppendTuples (IArray *source)=0
 
virtual void Clear ()=0
 
virtual int CompareTuples (IArray *otherArray, rid tuple_id, rid other_tuple_id)=0
 
virtual void CopyRange (IArray *source_array, rid start_dest_id, rid start_src_id, unsigned int count)=0
 
virtual void CopyTuple (IArray *sourceArray, rid dest_id, rid src_id)=0
 
virtual void DeepCopy (IArray *source)=0
 
virtual void ExtractTuples (IArray *dest, rid start, unsigned int count)=0
 
virtual rstring GetAlternativeName ()=0
 
virtual rid GetBaseType ()=0
 
virtual const char * GetClass ()
 
virtual unsigned int GetItemCount ()=0
 
virtual rid GetMaxItemId ()=0
 
virtual rid GetMaxTupleId ()=0
 
virtual unsigned int GetTupleCount ()=0
 
virtual unsigned int GetTupleSize ()=0
 
virtual void IndexedCopy (IArray *source, IRidArray *idtable, rid startId)=0
 
virtual bool IsA (const char *type) const
 
virtual bool IsEmpty ()=0
 
virtual CountedPointer< IArrayNewCopy (bool copy_data)=0
 
virtual CountedPointer< IArrayNewPackedCopy (IRidArray *index_array)=0
 
virtual void SetAlternativeName (const char *value)=0
 
virtual void SetItemCount (unsigned int count)=0
 
virtual void SetTupleCount (unsigned int tuplecount)=0
 
virtual void SetTupleSize (unsigned int newsize)=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 IArraySafeCast (IObject *ptr)
 
- Static Public Member Functions inherited from SimplygonSDK::IObject
static bool IsClassA (const char *type)
 
static IObjectSafeCast (IObject *ptr)
 

Detailed Description

IArray is the base class for the array objects. The object contains a dynamically allocated list of tuples of the same length, which can be specified before the list is filled with values.

Definition at line 1809 of file SimplygonSDK.h.

Member Function Documentation

◆ AppendArray()

virtual void SimplygonSDK::IArray::AppendArray ( IArray source)
pure virtual

Appends an array to this array. The array must be a descendant of ReValueArray. For best performance, append arrays of the same basic type.

Parameters
sourcethe array to append to this array Value cannot be equal to null.

◆ AppendTuples()

virtual SGDEPRECATED void SimplygonSDK::IArray::AppendTuples ( IArray source)
pure virtual
Deprecated:
Method is marked as deprecated and will be removed in future version. Use AppendArray() instead. Use AppendArray instead of this method.
Parameters
sourcethe array to append to this array. Value cannot be equal to null.

◆ Clear()

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

Clears the array and sets the tuple count to 0. Tuple size and name remains the same though.

◆ CompareTuples()

virtual int SimplygonSDK::IArray::CompareTuples ( IArray otherArray,
rid  tuple_id,
rid  other_tuple_id 
)
pure virtual

CompareTuples compares a tuple in this array with a tuple in another array

Parameters
otherArraythe other array to compare with Value cannot be equal to null.
tuple_idthe tuple from this array to use for comparison Value cannot be less than 0. Value cannot be greater than the value returned by GetMaxTupleId().
other_tuple_idthe tuple from the other array to use for comparison Value cannot be less than 0.
Returns
0 if the tuples are identical, 1 if an element in this array tuple in ascending order is larger and -1 if smaller

◆ CopyRange()

virtual void SimplygonSDK::IArray::CopyRange ( IArray source_array,
rid  start_dest_id,
rid  start_src_id,
unsigned int  count 
)
pure virtual

CopyRange copies a range of tuples from a source array into this array. The arrays must have the same tuple size and base type. This array must be resized to hold the tuples before copying. The basetypes are listed in SimplygonSDK::BaseTypes.

Parameters
source_arraythe source array 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::IArray::CopyTuple ( IArray sourceArray,
rid  dest_id,
rid  src_id 
)
pure virtual

CopyTuple copies one tuple in a source array to a tuple in this array. Both the dest_id and the source_id must exist in the arrays. This array can be used as the source array to copy within the array.

Parameters
sourceArraythe source array to copy from Value cannot be equal to null.
dest_idthe tuple index in this array to copy into Value cannot be less than 0. Value cannot be greater than the value returned by GetMaxTupleId().
src_idthe tuple index in the source array to copy from Value cannot be less than 0.

◆ DeepCopy()

virtual void SimplygonSDK::IArray::DeepCopy ( IArray source)
pure virtual

Copies data from another array. The arrays must have the same underlying data types.

Parameters
sourcethe source array to copy from Value cannot be equal to null.

◆ ExtractTuples()

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

Extracts tuples from the array. Note that the destination array must have the same classtype and have the same tuple size as the source array. (If both arrays are decendants of ReValueArray, they can be of different types, but the conversion is slow).

Parameters
destthe array that will store the extracted tuples Value cannot be equal to null.
startthis array tuple index where the extraction starts Value cannot be less than 0. Value cannot be greater than the value returned by GetMaxTupleId().
countthe number of tuples to extract Value cannot be greater than INT_MAX.

◆ GetAlternativeName()

virtual rstring SimplygonSDK::IArray::GetAlternativeName ( )
pure virtual

Get the AlternativeName, which can be used by users to set an alternative name to the array, when used as field data or in a collection.

Returns
the alternative name

◆ GetBaseType()

virtual rid SimplygonSDK::IArray::GetBaseType ( )
pure virtual

GetBaseType() returns the id of the basic type that the array is based on The ids are listed in the BaseTypes enumeration.

Returns
the id of the array type

◆ GetClass()

◆ GetItemCount()

virtual unsigned int SimplygonSDK::IArray::GetItemCount ( )
pure virtual

Returns the number of items in the array Warning! Do not confuse this count with the count of tuples, they are only the same if TupleSize is equal to one, i.e. when the tuples are exactly one component each.

Returns
the number of items in the array.

◆ GetMaxItemId()

virtual rid SimplygonSDK::IArray::GetMaxItemId ( )
pure virtual

Returns the id of the last item that is in the array. The id returned is equal to (ItemCount - 1). Warning! Do not confuse this id with the id of a tuple, they are only the same if TupleSize is equal to one, i.e. when the tuples are exactly one component each.

Returns
the max item id.

◆ GetMaxTupleId()

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

Returns the id of the tuple last in the list. If the array is empty, the value is unspecified. Note: GetMaxTupleId() always returns (GetTupleCount()-1) as a signed id

Returns
the id of the tuple last in the list

◆ GetTupleCount()

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

Returns the number of tuples in the list.

Returns
the tuple count

◆ GetTupleSize()

virtual unsigned int SimplygonSDK::IArray::GetTupleSize ( )
pure virtual

Used to get the tuple size.

Returns
the tuple size

◆ IndexedCopy()

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

Copies tuples from a source array through an id table. The id table dictates the order in which the tuples are to be copied to this array. 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 array. The id table is assumed to have a tuple size of 1. The source array and this array must have the same underlying data type, and have the same tuple size. The array must be large enough to hold the copied data.

Parameters
sourceis the array from which to copy tuples Value cannot be equal to null.
idtableis the array with the tuple indices to copy Value cannot be equal to null.
startIdis the first tuple that will receive the copied values

◆ IsA()

virtual bool SimplygonSDK::IArray::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.

Reimplemented in SimplygonSDK::IUnsignedShortArray, SimplygonSDK::IUnsignedLongArray, SimplygonSDK::IUnsignedIntArray, SimplygonSDK::IUnsignedCharArray, SimplygonSDK::IShortArray, SimplygonSDK::IRidArray, SimplygonSDK::IRealArray, SimplygonSDK::ILongArray, SimplygonSDK::IIntArray, SimplygonSDK::IFloatArray, SimplygonSDK::IDoubleArray, SimplygonSDK::ICharArray, SimplygonSDK::IBoolArray, SimplygonSDK::IStringArray, and SimplygonSDK::IValueArray.

◆ IsClassA()

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

The IsClassA function returns true if IArray 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 1830 of file SimplygonSDK.h.

◆ IsEmpty()

virtual bool SimplygonSDK::IArray::IsEmpty ( )
pure virtual

Returns true if the list is empty.

Returns
true if empty

◆ NewCopy()

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

Creates a new array with the same underlying data type, size and tuple settings as this array. To also copy the actual data, set copy_data to true.

Parameters
copy_dataIf set, duplicate all the data. If cleared, return an empty array of the same type.
Returns
the new copy of the array

◆ NewPackedCopy()

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

Like NewCopy, NewPackedCopy creates an array with the same underlying data and tuple settings as the source array. 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 array, and with the ids of a specific tuples within the new copy of the array.

Parameters
index_arraythe optional array that will receive the indices of the remapped tuples.
Returns
a new array with the same properties as this array but only with its unique values

◆ SafeCast()

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

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

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

Definition at line 1843 of file SimplygonSDK.h.

◆ SetAlternativeName()

virtual void SimplygonSDK::IArray::SetAlternativeName ( const char *  value)
pure virtual

Set the AlternativeName, which can be used by users to set an alternative name to the array, when used as field data or in a collection.

Parameters
valuethe new alternative name

◆ SetItemCount()

virtual void SimplygonSDK::IArray::SetItemCount ( unsigned int  count)
pure virtual

Resizes the list of items to the exact count specified. Warning! Do not confuse this count with the count of tuples, they are only the same if TupleSize is equal to 1, i.e. when the tuples are exactly one component each. Also note that the item count should be a multiple of TupleSize. Note that the total number of items cannot exceed INT_MAX.

Parameters
countthe new number of items. Value cannot be greater than INT_MAX.

◆ SetTupleCount()

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

Resizes the list to the specified tuple count. If the list is enlarged, the new tuples will contain unspecified data. Note that the item count equals TupleCount multiplied by TupleSize and that the total number of items cannot exceed INT_MAX.

Parameters
tuplecountthe new tuple count Value cannot be greater than INT_MAX.

◆ SetTupleSize()

virtual void SimplygonSDK::IArray::SetTupleSize ( unsigned int  newsize)
pure virtual

Used to set the tuple size. Warning! Only use SetTupleSize before filling the list with values, as any added data in the array will be trashed.

Parameters
newsizethe new tuple size Value cannot be less than 1. Value cannot be greater than 1024.

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