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

#include <SimplygonSDK.h>

Inheritance diagram for SimplygonSDK::IMaterialTable:
SimplygonSDK::ITable SimplygonSDK::IObject

Public Member Functions

virtual rid AddMaterial (IMaterial *material)=0
 
virtual void ChangeTexturePrefixPath (const char *current_path_prefix, const char *new_path_prefix)=0
 
virtual CountedPointer< IMaterialFindIdenticalMaterial (IMaterial *mat)=0
 
virtual rid FindIdenticalMaterialId (IMaterial *mat)=0
 
virtual CountedPointer< IRidArrayFindIdenticalMaterialIds (IMaterial *mat)=0
 
virtual CountedPointer< IMaterialFindMaterial (const char *name)=0
 
virtual rid FindMaterialId (const char *name)=0
 
virtual const char * GetClass ()
 
virtual CountedPointer< IMaterialGetMaterial (rid id)=0
 
virtual unsigned int GetMaterialsCount ()=0
 
virtual bool IsA (const char *type) const
 
virtual void RemoveMaterial (rid id)=0
 
virtual void SetMaterial (rid id, IMaterial *material)=0
 
- Public Member Functions inherited from SimplygonSDK::ITable
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 CountedPointer< IObjectGetItem (rid id)=0
 
virtual unsigned int GetItemsCount ()=0
 
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 IMaterialTableSafeCast (IObject *ptr)
 
- Static Public Member Functions inherited from SimplygonSDK::ITable
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

IMaterialTable keeps information on materials used while rendering.

Definition at line 7162 of file SimplygonSDK.h.

Member Function Documentation

◆ AddMaterial()

virtual rid SimplygonSDK::IMaterialTable::AddMaterial ( IMaterial material)
pure virtual

Adds a material to the table. The returned value is the id of the material within the table.

Parameters
materialthe material to add into the table
Returns
the material id of the material in the table

◆ ChangeTexturePrefixPath()

virtual void SimplygonSDK::IMaterialTable::ChangeTexturePrefixPath ( const char *  current_path_prefix,
const char *  new_path_prefix 
)
pure virtual

Changes the prefix path (drive, directory) of all matching texture paths in all the materials in the table, with the new one. This method is useful when external textures are placed in a specific folder, which needs to be moved

Parameters
current_path_prefixthe current prefix path, either relative or absolute
new_path_prefixthe new prefix path

◆ FindIdenticalMaterial()

virtual CountedPointer<IMaterial> SimplygonSDK::IMaterialTable::FindIdenticalMaterial ( IMaterial mat)
pure virtual

Finds a material in the table that is setup identical to the specified material.

Parameters
matthe material setup to look for
Returns
the material, if found, NULL otherwise

◆ FindIdenticalMaterialId()

virtual rid SimplygonSDK::IMaterialTable::FindIdenticalMaterialId ( IMaterial mat)
pure virtual

Finds the id of a material in the table that is setup identical to the specified material.

Parameters
matthe material setup to look for
Returns
the material id if found, -1 otherwise

◆ FindIdenticalMaterialIds()

virtual CountedPointer<IRidArray> SimplygonSDK::IMaterialTable::FindIdenticalMaterialIds ( IMaterial mat)
pure virtual

Finds the materials in the table that are setup identical to the specified material.

Parameters
matthe material setup to look for
Returns
the an array material ids if found, NULL otherwise

◆ FindMaterial()

virtual CountedPointer<IMaterial> SimplygonSDK::IMaterialTable::FindMaterial ( const char *  name)
pure virtual

Finds a material in the table, using the material name. If multiple materials have the same name, the first will be returned. If the material was not found, the return will be NULL.

Parameters
namethe material name to look for
Returns
the material, if found, NULL otherwise

◆ FindMaterialId()

virtual rid SimplygonSDK::IMaterialTable::FindMaterialId ( const char *  name)
pure virtual

Finds the id of a material in the table, using the material name. If multiple materials have the same name, the first will be returned. If the material was not found, the return will be -1.

Parameters
namethe material name to look for
Returns
the material id if found, -1 otherwise

◆ GetClass()

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

◆ GetMaterial()

virtual CountedPointer<IMaterial> SimplygonSDK::IMaterialTable::GetMaterial ( rid  id)
pure virtual

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

Parameters
idthe id of the material in the table
Returns
the the material in the table

◆ GetMaterialsCount()

virtual unsigned int SimplygonSDK::IMaterialTable::GetMaterialsCount ( )
pure virtual

Returns the number of materials in the table

◆ IsA()

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

◆ IsClassA()

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

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

◆ RemoveMaterial()

virtual void SimplygonSDK::IMaterialTable::RemoveMaterial ( rid  id)
pure virtual

Removes a material. If GetMaterial is called with the material id, the value returned will be NULL.

Parameters
idthe id of the material in the table

◆ SafeCast()

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

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

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

Definition at line 7196 of file SimplygonSDK.h.

◆ SetMaterial()

virtual void SimplygonSDK::IMaterialTable::SetMaterial ( rid  id,
IMaterial material 
)
pure virtual

Sets a material in the table.

Parameters
idthe id of the material in the table
materialthe material to set into the table

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