Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
CMaterials Class Reference

CMaterials stores scene materials. CMaterials::CreateNewMaterial allows to create a material and insert it in the list. More...

Detailed Description

CMaterials stores scene materials. CMaterials::CreateNewMaterial allows to create a material and insert it in the list.

Note
The data is internally stored in a hash table

#include <3DMaterial.h>

Inheritance diagram for CMaterials:

Public Member Functions

void SetScene (C3DScene *scene)
 
C3DSceneGetScene () const
 
CGuidMgrGetGuidMgr () const
 The scene that own the materials.
 
virtual void Serialize (CXArchive &ar)
 If scene is defined then guidMgr is the scene guidMgr. The material list handles scene materials. Otherwise it can be a private material list, related to something else (renderer...)
 
HashPos GetFirst () const
 if matclass = MATERIAL_CLASS_UNDEFINED, return all type of materials, otherwise return materials of the given class
 
void GetNext (HashPos &pos, MaterialID &id, C3DMaterial *&mat) const
 
unsigned int GetMaterials (C3DMaterialArray &mats, bool resetArray=true, MATERIAL_CLASS matclass=MATERIAL_CLASS_UNDEFINED) const
 if defined matclass should be the same than the one use in GetFirstMaterial
 
unsigned int GetMaterials (C3DMaterialArray &mats, MapType maptype, bool checkIfBitmapExist, bool resetArray=true) const
 
unsigned int GetCount (MATERIAL_CLASS matclass=MATERIAL_CLASS_UNDEFINED) const
 
C3DMaterialCreateNewMaterial (MATERIAL_CLASS materialClass)
 Create and add a new material of the specified material class.
 
C3DMaterialCreateNewMaterial (MaterialID &refid, MATERIAL_CLASS materialClass)
 Create and add a new material of the specified material class with the provided refid. If refid is alreaday used, a new material id is assigned which is returned in refid.
 
MaterialID AddNewMaterial (C3DMaterial *mat)
 Add the new material which has not been assigned to any materials. Return its MaterialId definitive which will be the same as the one defined if possible.
 
C3DMaterialSetDefaultMaterial (C3DStandardMaterial *defaultMat=NULL)
 Return the default material. defaultMat is optional and can define specific color properties.
 
bool RemoveMaterial (MaterialID refID, bool deleteIt=true)
 
bool ReplaceMaterial (C3DMaterial *newMat, bool deletePrevious=true)
 Replace an existing material with newMat->GetMaterialID() by the newMat provided material. If this MaterialID does not exist, then newMat is simply added to the materials. When deletePrevious = false, the old material is removed from the materials list and it is not deleted. NewMat is supposed to not be attached to any existing materials list.
 
void CopyMaterials (const CMaterials &refmaterials, unsigned int flags=MATERIAL_COPY_KEEP_ID|MATERIAL_COPY_REMOVE_ALL, const C3DScene *dstScene=NULL, const CMaterialHashMap *hash=NULL)
 
C3DMaterialFind (const C3DMaterial &material, bool sameName) const
 Find a material that have similar properties and optionally the same name.
 
C3DMaterialFindByID (MaterialID refID, bool createIfMissing=false) const
 Find the material that have the given MaterialID. Return NULL if none is found. (no material is created, even with DEFAULT_MATERIAL)
 
C3DMaterialFindByName (const CXString &name) const
 Find the first material with the given name (beware: there can be several different materials with the same name).
 
unsigned int IsGenerateUVWNeeded (MaterialID matid=MATERIAL_UNDEFINED, MapType type=MAPTYPE_UNDEFINED) const
 If matid == MATERIAL_UNDEFINED, it returns the number of materials that have a projection that requires UVW generation. If matid != MATERIAL_UNDEFINED it returns 1 if the specified material requires UVW generationrequired.
 
unsigned int CreateMissingUVWBackChannels (const CGeomInfo *info, MaterialID matid=MATERIAL_UNDEFINED, MapType type=MAPTYPE_UNDEFINED, CHANNEL_PROPERTIES channelTagFlag=CHANNEL_NONE) const
 
unsigned int FilterByText (const CXString &filter, bool matchCase, C3DMaterialIDArray &matids, bool resetHash)
 Advanced search: find all materials that match the given text. Return the number of element in matids.
 
void AdjustPaths (const CXString &targetPath, bool relativePathAllowed)
 Make internal filenames used by materials relative to provided path.
 
void RemoveAll ()
 

Friends

void C3DMaterial::HashRemove ()
 
void C3DMaterial::HashInsert ()
 

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