Open CASCADE Technology
7.5.0
|
Material manager. Provides an interface for collecting all materials within the document before writing it into file, and for copying associated image files (textures) into sub-folder near by exported model. More...
#include <RWMesh_MaterialMap.hxx>
Public Member Functions | |
RWMesh_MaterialMap (const TCollection_AsciiString &theFile) | |
Main constructor. More... | |
virtual | ~RWMesh_MaterialMap () |
Destructor. More... | |
const XCAFPrs_Style & | DefaultStyle () const |
Return default material definition to be used for nodes with only color defined. More... | |
void | SetDefaultStyle (const XCAFPrs_Style &theStyle) |
Set default material definition to be used for nodes with only color defined. More... | |
TCollection_AsciiString | FindMaterial (const XCAFPrs_Style &theStyle) const |
Find already registered material. More... | |
virtual TCollection_AsciiString | AddMaterial (const XCAFPrs_Style &theStyle) |
Register material and return its name identifier. More... | |
virtual bool | CreateTextureFolder () |
Create texture folder "modelName/textures"; for example: MODEL: Path/ModelName.gltf IMAGES: Path/ModelName/textures/ Warning! Output folder is NOT cleared. More... | |
virtual bool | CopyTexture (TCollection_AsciiString &theResTexture, const Handle< Image_Texture > &theTexture, const TCollection_AsciiString &theKey) |
Copy and rename texture file to the new location. More... | |
virtual void | DefineMaterial (const XCAFPrs_Style &theStyle, const TCollection_AsciiString &theKey, const TCollection_AsciiString &theName)=0 |
Virtual method actually defining the material (e.g. export to the file). More... | |
bool | IsFailed () const |
Return failed flag. More... | |
Static Protected Member Functions | |
static bool | copyFileTo (const TCollection_AsciiString &theFileSrc, const TCollection_AsciiString &theFileDst) |
Copy file to another place. More... | |
Material manager. Provides an interface for collecting all materials within the document before writing it into file, and for copying associated image files (textures) into sub-folder near by exported model.
RWMesh_MaterialMap::RWMesh_MaterialMap | ( | const TCollection_AsciiString & | theFile | ) |
Main constructor.
|
virtual |
Destructor.
|
virtual |
Register material and return its name identifier.
Reimplemented in RWGltf_GltfMaterialMap.
|
staticprotected |
Copy file to another place.
|
virtual |
Copy and rename texture file to the new location.
theResTexture | [out] result texture file path (relative to the model) |
theTexture | [in] original texture |
theKey | [in] material key |
|
virtual |
Create texture folder "modelName/textures"; for example: MODEL: Path/ModelName.gltf IMAGES: Path/ModelName/textures/ Warning! Output folder is NOT cleared.
|
inline |
Return default material definition to be used for nodes with only color defined.
|
pure virtual |
Virtual method actually defining the material (e.g. export to the file).
Implemented in RWGltf_GltfMaterialMap.
|
inline |
Find already registered material.
|
inline |
Return failed flag.
|
inline |
Set default material definition to be used for nodes with only color defined.
|
protected |
default material definition to be used for nodes with only color defined
|
protected |
output glTF file path
|
protected |
output folder for glTF file
|
protected |
map of images failed to be copied
|
protected |
flag indicating failure
|
protected |
prefix for generated keys
|
protected |
flag indicating usage of material name as key
|
protected |
number of registered materials
|
protected |
output glTF file name without extension
|
protected |
map of processed styles
|
protected |
output folder for images (full path)
|
protected |
output folder for images (short path)