Simplygon C++ API  8.3.34600.0
SimplygonSDK::ITable Class Referenceabstract

#include <SimplygonSDK.h>

Inheritance diagram for SimplygonSDK::ITable:
SimplygonSDK::IObject SimplygonSDK::IMaterialTable SimplygonSDK::ISceneBoneTable SimplygonSDK::ISelectionSetTable SimplygonSDK::ITextureTable

Public Member Functions

virtual rid AddItem (IObject *item)=0
 
virtual void Clear ()=0
 
virtual void Copy (ITable *src)=0
 
virtual CountedPointer< IObjectFindItem (const char *name)=0
 
virtual rid FindItemId (const char *name)=0
 
virtual const char * GetClass ()
 
virtual CountedPointer< IObjectGetItem (rid id)=0
 
virtual unsigned int GetItemsCount ()=0
 
virtual bool IsA (const char *type) const
 
virtual void RemoveItem (rid id)=0
 
virtual void SetItem (rid id, IObject *item)=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 ITableSafeCast (IObject *ptr)
 
- Static Public Member Functions inherited from SimplygonSDK::IObject
static bool IsClassA (const char *type)
 
static IObjectSafeCast (IObject *ptr)
 

Detailed Description

ITable is the base class for tables objects, where items are added into an id-indexed array of objects.

Definition at line 6850 of file SimplygonSDK.h.

Member Function Documentation

◆ AddItem()

virtual rid SimplygonSDK::ITable::AddItem ( IObject item)
pure virtual

Adds an item to the table. The returned value is the id of the item within the table, which can be used to retrieve the item using GetItem().

Parameters
itemis the item that is to be added to the table
Returns
the id of the added item in the table

◆ Clear()

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

Clears the table, and removes all items. If AddItem is called after Clear, the item ids will start over from 0

◆ Copy()

virtual void SimplygonSDK::ITable::Copy ( ITable src)
pure virtual

Clears the current table and copies the items from a source table.

Parameters
srcthe table to copy

◆ FindItem()

virtual CountedPointer<IObject> SimplygonSDK::ITable::FindItem ( const char *  name)
pure virtual

Finds a named item in the table. If multiple items have the same name, the first will be returned. If no item was found, the return will be NULL.

Parameters
nameis the string that is to be searched for
Returns
the matching object, or NULL if no match was found

◆ FindItemId()

virtual rid SimplygonSDK::ITable::FindItemId ( const char *  name)
pure virtual

Finds the id of an item in the table, using the name. If multiple items have the same name, the first will be returned. If no item was found, the return will be -1.

Parameters
nameis the string that is to be searched for
Returns
the id of the found object, or -1 if no match was found

◆ GetClass()

virtual const char* SimplygonSDK::ITable::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.

Reimplemented in SimplygonSDK::ITextureTable, SimplygonSDK::ISelectionSetTable, SimplygonSDK::ISceneBoneTable, and SimplygonSDK::IMaterialTable.

◆ GetItem()

virtual CountedPointer<IObject> SimplygonSDK::ITable::GetItem ( rid  id)
pure virtual

Returns the i:th item, using the id of the item

Parameters
idis the id of the requested object
Returns
the found object

◆ GetItemsCount()

virtual unsigned int SimplygonSDK::ITable::GetItemsCount ( )
pure virtual

Gets the number of item id:s in the table. If an item has been removed, using RemoveItem, the id is still counted in this method. GetIdsCount also equals the id that will be applied to the next item added to the table.

Returns
the itemcount of the table

◆ IsA()

virtual bool SimplygonSDK::ITable::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::ITextureTable, SimplygonSDK::ISelectionSetTable, SimplygonSDK::ISceneBoneTable, and SimplygonSDK::IMaterialTable.

◆ IsClassA()

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

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

◆ RemoveItem()

virtual void SimplygonSDK::ITable::RemoveItem ( rid  id)
pure virtual

Removes an item, and invalidates the id. The id will not point at a valid item, until Clear is called and new items are added up until the id.

Parameters
idthe id of the object that should be removed

◆ SafeCast()

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

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

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

Definition at line 6884 of file SimplygonSDK.h.

◆ SetItem()

virtual void SimplygonSDK::ITable::SetItem ( rid  id,
IObject item 
)
pure virtual

Sets an item in the table. The id must exist in the table.

Parameters
idis the id that is to be set
itemis the object set to the id

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