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

#include <SimplygonSDK.h>

Inheritance diagram for SimplygonSDK::IObjectCollection:
SimplygonSDK::IObject SimplygonSDK::IGeometryDataCollection SimplygonSDK::ISceneNodeCollection

Public Member Functions

virtual rhandle AddObject (IObject *obj)=0
 
virtual rhandle AddObjectSorted (IObject *obj, bool ascending)=0
 
virtual CountedPointer< IObjectFindObject (const char *name)=0
 
virtual const char * GetClass ()
 
virtual rhandle GetFirstItem ()=0
 
virtual rhandle GetItem (unsigned int index)=0
 
virtual CountedPointer< IObjectGetItemAsObject (unsigned int index)=0
 
virtual unsigned int GetItemCount ()=0
 
virtual CountedPointer< IObjectGetItemsObject (rhandle objhandle)=0
 
virtual rhandle GetNextItem (rhandle objhandle)=0
 
virtual bool IsA (const char *type) const
 
virtual bool IsItemInCollection (rhandle objhandle)=0
 
virtual bool IsObjectInCollection (IObject *pobj)=0
 
virtual void RemoveAllItems ()=0
 
virtual rhandle RemoveItem (rhandle objhandle)=0
 
virtual void RemoveObject (IObject *pobj)=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 IObjectCollectionSafeCast (IObject *ptr)
 
- Static Public Member Functions inherited from SimplygonSDK::IObject
static bool IsClassA (const char *type)
 
static IObjectSafeCast (IObject *ptr)
 

Detailed Description

IObjectCollection and its specializations handles a collection of IObjects. There are methods for adding, removing and iterating through the objects.

Definition at line 8117 of file SimplygonSDK.h.

Member Function Documentation

◆ AddObject()

virtual rhandle SimplygonSDK::IObjectCollection::AddObject ( IObject obj)
pure virtual

Adds an object to the collection. The handle refers to the object until the object is removed from the collection again.

Parameters
objis the object that is to be added to the collection
Returns
the handle of the added object in the collection

◆ AddObjectSorted()

virtual rhandle SimplygonSDK::IObjectCollection::AddObjectSorted ( IObject obj,
bool  ascending 
)
pure virtual

Adds an object to the collection, as AddObject, but sorts the object into the collection based on its name.

Parameters
objis the object that is to be added to the collection
ascendingdetermines the sorting order
Returns
the handle of the added object in the collection

◆ FindObject()

virtual CountedPointer<IObject> SimplygonSDK::IObjectCollection::FindObject ( const char *  name)
pure virtual

Finds a named object in the collection. The first object with this name is returned. The search is case-sensitive.

Parameters
nameis the name of an object in the collection
Returns
the object with the relevant name, or NULL if none is found

◆ GetClass()

virtual const char* SimplygonSDK::IObjectCollection::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::ISceneNodeCollection, and SimplygonSDK::IGeometryDataCollection.

◆ GetFirstItem()

virtual rhandle SimplygonSDK::IObjectCollection::GetFirstItem ( )
pure virtual

Returns the start of the collection. The handle returned refers to the first object in the collection. If the handle is NULL, then the collection is empty.

Returns
the first item in collection, or NULL if collection is empty

◆ GetItem()

virtual rhandle SimplygonSDK::IObjectCollection::GetItem ( unsigned int  index)
pure virtual

Returns the handle of the i:th item

Parameters
indexis the index of an object in the collection
Returns
the handle of the object with the relevant index

◆ GetItemAsObject()

virtual CountedPointer<IObject> SimplygonSDK::IObjectCollection::GetItemAsObject ( unsigned int  index)
pure virtual

Returns the object of the i:th item

Parameters
indexis the index of an object in the collection
Returns
the object with the relevant index

◆ GetItemCount()

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

Get the number of items in the collection.

Returns
the number of items in the collection

◆ GetItemsObject()

virtual CountedPointer<IObject> SimplygonSDK::IObjectCollection::GetItemsObject ( rhandle  objhandle)
pure virtual

Gets the object the handle is referring to.

Parameters
objhandleis the handle of an object in the collection
Returns
the object associated with the handle

◆ GetNextItem()

virtual rhandle SimplygonSDK::IObjectCollection::GetNextItem ( rhandle  objhandle)
pure virtual

Returns the handle to the next item in the collection. Use GetFirstItem and this method to step through the collection. If the return is NULL, the end of the collection has been reached.

Parameters
objhandleis the handle of an object i
Returns
the handle of the object i+1

◆ IsA()

virtual bool SimplygonSDK::IObjectCollection::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::ISceneNodeCollection, and SimplygonSDK::IGeometryDataCollection.

◆ IsClassA()

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

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

◆ IsItemInCollection()

virtual bool SimplygonSDK::IObjectCollection::IsItemInCollection ( rhandle  objhandle)
pure virtual

Returns true if the item is in the collection

Parameters
objhandleis the handle of an object to be checked for
Returns
true if the collection contains the object, false otherwise

◆ IsObjectInCollection()

virtual bool SimplygonSDK::IObjectCollection::IsObjectInCollection ( IObject pobj)
pure virtual

Returns true if the object is in the collection

Parameters
pobjis the object to be checked for
Returns
true if the collection contains pobj, false otherwise

◆ RemoveAllItems()

virtual void SimplygonSDK::IObjectCollection::RemoveAllItems ( )
pure virtual

Removes all items from the collection.

◆ RemoveItem()

virtual rhandle SimplygonSDK::IObjectCollection::RemoveItem ( rhandle  objhandle)
pure virtual

Removes an item from the collection. The handle returned is the first item after this item that is in the collection. If the return is NULL, the item was the last item in the collection. Warning! The handle is invalid after the removal of the object.

Parameters
objhandleis the handle of the object that is to be removed
Returns
the handle to the item following the removed one, or NULL if collection is now empty

◆ RemoveObject()

virtual void SimplygonSDK::IObjectCollection::RemoveObject ( IObject pobj)
pure virtual

Removes an object from the collection. Only the first occurance of the object is removed from the collection.

Parameters
pobjis the object that is to be removed

◆ SafeCast()

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

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

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

Definition at line 8151 of file SimplygonSDK.h.


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