

#include <QCoreApplication>
#include <QDebug>
#include <QFile>
#include <QDebug>

#include "mesh2pov.h"

int main(int argc, char *argv[])
{
	QCoreApplication app(argc, argv);
	//qDebug("Hello from Qt 4!");
	
	
	//const MeshConverter& conv = Mesh2POV();
    const MeshConverter& conv = Stl2POV();//Obj2POV();
	
	QFile pre ("/home/sascha/dokumente/projectstrunk/qt/mesh2pov/pov/itokawa.pre.pov");
	//QFile in ("../data/itokawa_f0049152.txt");
	//QFile in ("../data/itokawa_f0196608.txt");
	//QFile in ("/home/sascha/dokumente/projectstrunk/qt/mesh2pov/data/ESA_Rosetta_OSIRIS_67P_SHAP2P.obj");
    //QFile in ("/tmp/tschuri.obj");
    QFile in ("/tmp/NefertitiHack3D.stl");

    if (in.open(QIODevice::ReadOnly))
	{

		//QFile out ("../generated/itokawa.pov");
		//QFile out ("/home/sascha/dokumente/projectstrunk/qt/mesh2pov/generated/67p.pov");
        QFile out ("/tmp/NefertitiHack3D.pov");
		if (out.open(QIODevice::WriteOnly | QIODevice::Text))
		{
			if (pre.open(QIODevice::ReadOnly | QIODevice::Text))
			{

				out.write(pre.readAll());
			}
			conv.convert(in, out);
		}
		else
			qDebug() << "outfile not opened";
		
	}
	else
		qDebug() << "infile not opened";
	
	return 0;
}

