/*
 * $Id: objwriter.h,v 1.16 2008-06-06 20:02:36 kybav1 Exp $
 *
 * Description  : One line description of file.
 * Author       : Antonin Misek <antonin.misek@skoda-auto.cz>
 * 
 * Purpose      :
 *     Long description of what the file is for.
 */


#ifndef __OBJWRITER__H__
#define __OBJWRITER__H__

#include "scene.h"
#include "textwriter.h"

namespace VRUT
{
	///Class for writing OBJ files
	class OBJWriter
	{
	private:
		///Input stream
		wxBufferedOutputStream * outputStream;
		///Scene container to be built
		Scene * scene;
		
		void WriteFaceIndice(TextWriter &textWriter, size_t indiceV, size_t indiceT, size_t indiceN, bool writeTex, bool writeNorm);
		void WriteLineIndice(TextWriter &textWriter, size_t indiceV, size_t indiceT, bool writeTex);

	public:
		///Class constructor
		///\param[in] _outputStream Stream to write data to
		///\param[in] _scene Scene to asve
		OBJWriter(wxBufferedOutputStream * _outputStream, Scene * _scene);
		///Class destructor
		~OBJWriter();

		///Write OBJ stream
		void Write(const NODE_ID rootID);
	};
}

#endif

