2008-01-30 09:31:04 +01:00
|
|
|
#ifndef EXPORTER_DAE_H
|
|
|
|
#define EXPORTER_DAE_H
|
2006-12-07 01:37:58 +01:00
|
|
|
|
2008-01-30 09:31:04 +01:00
|
|
|
#include <wrap/dae/xmldocumentmanaging.h>
|
|
|
|
#include <wrap/dae/colladaformat.h>
|
|
|
|
#include <wrap/dae/util_dae.h>
|
2006-12-07 01:37:58 +01:00
|
|
|
|
2008-01-30 09:31:04 +01:00
|
|
|
namespace vcg
|
2006-07-07 08:55:41 +02:00
|
|
|
{
|
2008-01-30 09:31:04 +01:00
|
|
|
namespace tri
|
|
|
|
{
|
|
|
|
namespace io
|
|
|
|
{
|
|
|
|
template<typename MESHMODEL>
|
|
|
|
class ExporterDAE
|
2006-11-06 06:29:40 +01:00
|
|
|
{
|
2008-01-30 09:31:04 +01:00
|
|
|
public:
|
|
|
|
static int Save(const MESHMODEL& model,const char* filename,const int mask,const QDomDocument* doc = NULL)
|
2006-11-06 06:29:40 +01:00
|
|
|
{
|
2008-01-30 09:31:04 +01:00
|
|
|
XMLDocumentWriter stream(filename);
|
|
|
|
if (stream.isReliable())
|
2006-11-06 06:29:40 +01:00
|
|
|
{
|
2008-01-30 09:31:04 +01:00
|
|
|
XMLDocument* document = Collada::DocumentManager::createColladaDocument(model,mask);
|
|
|
|
stream.write(*document);
|
|
|
|
Collada::DocumentManager::destroyColladaDocument(document);
|
2008-02-05 18:46:05 +01:00
|
|
|
return UtilDAE::E_NOERROR;
|
2006-11-06 06:29:40 +01:00
|
|
|
}
|
2008-01-30 09:31:04 +01:00
|
|
|
else
|
2008-02-05 18:46:05 +01:00
|
|
|
return UtilDAE::E_CANTSAVE;
|
2006-11-06 06:29:40 +01:00
|
|
|
}
|
|
|
|
|
2008-01-30 09:31:04 +01:00
|
|
|
static int GetExportMaskCapability()
|
2006-11-06 06:29:40 +01:00
|
|
|
{
|
2008-01-30 09:31:04 +01:00
|
|
|
int capability = 0;
|
2006-11-06 06:29:40 +01:00
|
|
|
|
2008-01-30 09:31:04 +01:00
|
|
|
//camera
|
|
|
|
//capability |= MeshModel::IOM_CAMERA;
|
2006-11-05 11:45:41 +01:00
|
|
|
|
2008-01-30 09:31:04 +01:00
|
|
|
//vert
|
|
|
|
capability |= MeshModel::IOM_VERTNORMAL;
|
|
|
|
capability |= MeshModel::IOM_VERTTEXCOORD;
|
|
|
|
capability |= MeshModel::IOM_VERTCOLOR;
|
|
|
|
//capability |= MeshModel::
|
|
|
|
////face
|
|
|
|
////capability |= MeshModel::IOM_FACEFLAGS;
|
|
|
|
////capability |= MeshModel::IOM_FACECOLOR;
|
|
|
|
//capability |= MeshModel::IOM_FACENORMAL;
|
2006-11-06 09:45:13 +01:00
|
|
|
|
2008-01-30 09:31:04 +01:00
|
|
|
////wedg
|
|
|
|
capability |= MeshModel::IOM_WEDGTEXCOORD;
|
|
|
|
capability |= MeshModel::IOM_WEDGNORMAL;
|
2006-11-06 09:45:13 +01:00
|
|
|
|
2008-01-30 09:31:04 +01:00
|
|
|
return capability;
|
2006-11-06 09:45:13 +01:00
|
|
|
}
|
2008-01-30 09:31:04 +01:00
|
|
|
};
|
2006-07-07 08:55:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-01-30 09:31:04 +01:00
|
|
|
#endif
|