

/** @file PlyExporter.h
 * Declares the exporter class to write a scene to a Polygon Library (ply)
 */
#ifndef AI_PLYEXPORTER_H_INC
#define AI_PLYEXPORTER_H_INC

#include <sstream>

struct aiScene;
struct aiNode;
struct aiMesh;

namespace Assimp {

// ------------------------------------------------------------------------------------------------
/** Helper class to export a given scene to a Stanford Ply file. */
// ------------------------------------------------------------------------------------------------
class PlyExporter {
public:
    /// The class constructor for a specific scene to export
    PlyExporter(const char* filename, const aiScene* pScene, bool binary = false);
    /// The class destructor, empty.
    ~PlyExporter();

public:
    /// public string-streams to write all output into:
    std::ostringstream mOutput;

private:
    void WriteMeshVerts(const aiMesh* m, unsigned int components);
    void WriteMeshIndices(const aiMesh* m, unsigned int ofs);
    void WriteMeshVertsBinary(const aiMesh* m, unsigned int components);
    void WriteMeshIndicesBinary(const aiMesh* m, unsigned int offset);

private:
    const std::string filename;  // tHE FILENAME
    const std::string endl;      // obviously, this endl() doesn't flush() the stream

private:
    PlyExporter( const PlyExporter & );
    PlyExporter &operator = ( const PlyExporter & );
};

} // Namespace Assimp

#endif // AI_PLYEXPORTER_H_INC
