Assimp  v3.1.1 (June 2014)
Assimp::ColladaExporter Class Reference

Helper class to export a given scene to a Collada file. More...

Classes

struct  Material
 
struct  Property
 
struct  Surface
 

Public Member Functions

 ColladaExporter (const aiScene *pScene, IOSystem *pIOSystem, const std::string &path, const std::string &file)
 Constructor for a specific scene to export. More...
 
virtual ~ColladaExporter ()
 Destructor. More...
 

Public Attributes

std::stringstream mOutput
 Stringstream to write all output into. More...
 

Protected Types

enum  FloatDataType { FloatType_Vector, FloatType_TexCoord2, FloatType_TexCoord3, FloatType_Color }
 

Protected Member Functions

std::string GetMeshId (size_t pIndex) const
 Creates a mesh ID for the given mesh. More...
 
void PopTag ()
 Leaves an element, decreasing the indentation. More...
 
void PushTag ()
 Enters a new xml element, which increases the indentation. More...
 
void ReadMaterialSurface (Surface &poSurface, const aiMaterial *pSrcMat, aiTextureType pTexture, const char *pKey, size_t pType, size_t pIndex)
 Dammit C++ - y u no compile two-pass? No I have to add all methods below the struct definitions Reads a single surface entry from the given material keys. More...
 
void WriteAmbienttLight (const aiLight *const light)
 
void WriteCamera (size_t pIndex)
 
void WriteCamerasLibrary ()
 Writes the cameras library. More...
 
void WriteDirectionalLight (const aiLight *const light)
 
void WriteFile ()
 Starts writing the contents. More...
 
void WriteFloatArray (const std::string &pIdString, FloatDataType pType, const float *pData, size_t pElementCount)
 Writes a float array of the given type. More...
 
void WriteFloatEntry (const Property &pProperty, const std::string &pTypeName)
 Writes a scalar property. More...
 
void WriteGeometry (size_t pIndex)
 Writes the given mesh. More...
 
void WriteGeometryLibrary ()
 Writes the geometry library. More...
 
void WriteHeader ()
 Writes the asset header. More...
 
void WriteImageEntry (const Surface &pSurface, const std::string &pNameAdd)
 Writes an image entry for the given surface. More...
 
void WriteLight (size_t pIndex)
 
void WriteLightsLibrary ()
 Writes the cameras library. More...
 
void WriteMaterials ()
 Writes the material setup. More...
 
void WriteNode (const aiScene *scene, aiNode *pNode)
 Recursively writes the given node. More...
 
void WritePointLight (const aiLight *const light)
 
void WriteSceneLibrary ()
 Writes the scene library. More...
 
void WriteSpotLight (const aiLight *const light)
 
void WriteTextureColorEntry (const Surface &pSurface, const std::string &pTypeName, const std::string &pImageName)
 Writes a color-or-texture entry into an effect definition. More...
 
void WriteTextureParamEntry (const Surface &pSurface, const std::string &pTypeName, const std::string &pMatName)
 Writes the two parameters necessary for referencing a texture in an effect entry. More...
 
void WriteTextures ()
 Writes the embedded textures. More...
 

Protected Attributes

std::string endstr
 current line end string for simple stream insertion More...
 
std::vector< Materialmaterials
 
const std::string mFile
 Name of the file (without extension) where the scene will be exported. More...
 
IOSystemmIOSystem
 The IOSystem for output. More...
 
const std::string mPath
 Path of the directory where the scene will be exported. More...
 
const aiScenemScene
 The scene to be written. More...
 
bool mSceneOwned
 
std::string startstr
 current line start string, contains the current indentation for simple stream insertion More...
 
std::map< unsigned int, std::string > textures
 

Detailed Description

Helper class to export a given scene to a Collada file.

Just for my personal comfort when implementing it.

Member Enumeration Documentation

§ FloatDataType

Enumerator
FloatType_Vector 
FloatType_TexCoord2 
FloatType_TexCoord3 
FloatType_Color 

Constructor & Destructor Documentation

§ ColladaExporter()

ColladaExporter::ColladaExporter ( const aiScene pScene,
IOSystem pIOSystem,
const std::string &  path,
const std::string &  file 
)

Constructor for a specific scene to export.

§ ~ColladaExporter()

ColladaExporter::~ColladaExporter ( )
virtual

Destructor.

Member Function Documentation

§ GetMeshId()

std::string Assimp::ColladaExporter::GetMeshId ( size_t  pIndex) const
inlineprotected

Creates a mesh ID for the given mesh.

§ PopTag()

void Assimp::ColladaExporter::PopTag ( )
inlineprotected

Leaves an element, decreasing the indentation.

§ PushTag()

void Assimp::ColladaExporter::PushTag ( )
inlineprotected

Enters a new xml element, which increases the indentation.

§ ReadMaterialSurface()

void ColladaExporter::ReadMaterialSurface ( Surface poSurface,
const aiMaterial pSrcMat,
aiTextureType  pTexture,
const char *  pKey,
size_t  pType,
size_t  pIndex 
)
protected

Dammit C++ - y u no compile two-pass? No I have to add all methods below the struct definitions Reads a single surface entry from the given material keys.

§ WriteAmbienttLight()

void ColladaExporter::WriteAmbienttLight ( const aiLight *const  light)
protected

§ WriteCamera()

void ColladaExporter::WriteCamera ( size_t  pIndex)
protected

§ WriteCamerasLibrary()

void ColladaExporter::WriteCamerasLibrary ( )
protected

Writes the cameras library.

§ WriteDirectionalLight()

void ColladaExporter::WriteDirectionalLight ( const aiLight *const  light)
protected

§ WriteFile()

void ColladaExporter::WriteFile ( )
protected

Starts writing the contents.

§ WriteFloatArray()

void ColladaExporter::WriteFloatArray ( const std::string &  pIdString,
FloatDataType  pType,
const float *  pData,
size_t  pElementCount 
)
protected

Writes a float array of the given type.

§ WriteFloatEntry()

void ColladaExporter::WriteFloatEntry ( const Property pProperty,
const std::string &  pTypeName 
)
protected

Writes a scalar property.

§ WriteGeometry()

void ColladaExporter::WriteGeometry ( size_t  pIndex)
protected

Writes the given mesh.

§ WriteGeometryLibrary()

void ColladaExporter::WriteGeometryLibrary ( )
protected

Writes the geometry library.

§ WriteHeader()

void ColladaExporter::WriteHeader ( )
protected

Writes the asset header.

§ WriteImageEntry()

void ColladaExporter::WriteImageEntry ( const Surface pSurface,
const std::string &  pNameAdd 
)
protected

Writes an image entry for the given surface.

§ WriteLight()

void ColladaExporter::WriteLight ( size_t  pIndex)
protected

§ WriteLightsLibrary()

void ColladaExporter::WriteLightsLibrary ( )
protected

Writes the cameras library.

§ WriteMaterials()

void ColladaExporter::WriteMaterials ( )
protected

Writes the material setup.

collect all materials from the scene

§ WriteNode()

void ColladaExporter::WriteNode ( const aiScene scene,
aiNode pNode 
)
protected

Recursively writes the given node.

§ WritePointLight()

void ColladaExporter::WritePointLight ( const aiLight *const  light)
protected

§ WriteSceneLibrary()

void ColladaExporter::WriteSceneLibrary ( )
protected

Writes the scene library.

§ WriteSpotLight()

void ColladaExporter::WriteSpotLight ( const aiLight *const  light)
protected

§ WriteTextureColorEntry()

void ColladaExporter::WriteTextureColorEntry ( const Surface pSurface,
const std::string &  pTypeName,
const std::string &  pImageName 
)
protected

Writes a color-or-texture entry into an effect definition.

§ WriteTextureParamEntry()

void ColladaExporter::WriteTextureParamEntry ( const Surface pSurface,
const std::string &  pTypeName,
const std::string &  pMatName 
)
protected

Writes the two parameters necessary for referencing a texture in an effect entry.

§ WriteTextures()

void ColladaExporter::WriteTextures ( )
protected

Writes the embedded textures.

Member Data Documentation

§ endstr

std::string Assimp::ColladaExporter::endstr
protected

current line end string for simple stream insertion

§ materials

std::vector<Material> Assimp::ColladaExporter::materials
protected

§ mFile

const std::string Assimp::ColladaExporter::mFile
protected

Name of the file (without extension) where the scene will be exported.

§ mIOSystem

IOSystem* Assimp::ColladaExporter::mIOSystem
protected

The IOSystem for output.

§ mOutput

std::stringstream Assimp::ColladaExporter::mOutput

Stringstream to write all output into.

§ mPath

const std::string Assimp::ColladaExporter::mPath
protected

Path of the directory where the scene will be exported.

§ mScene

const aiScene* Assimp::ColladaExporter::mScene
protected

The scene to be written.

§ mSceneOwned

bool Assimp::ColladaExporter::mSceneOwned
protected

§ startstr

std::string Assimp::ColladaExporter::startstr
protected

current line start string, contains the current indentation for simple stream insertion

§ textures

std::map<unsigned int, std::string> Assimp::ColladaExporter::textures
protected

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