vcglib/wrap/io_trimesh/export_dae.h

83 lines
3.0 KiB
C
Raw Normal View History

2008-07-12 08:12:46 +02:00
/****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyright(C) 2004-2008 \/)\/ *
* Visual Computing Lab /\/| *
* ISTI - Italian National Research Council | *
* \ *
* All rights reserved. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
* for more details. *
* *
****************************************************************************/
#ifndef EXPORTER_DAE_H
#define EXPORTER_DAE_H
#include <wrap/dae/xmldocumentmanaging.h>
#include <wrap/dae/colladaformat.h>
#include <wrap/dae/util_dae.h>
namespace vcg
{
namespace tri
{
namespace io
{
template<typename MESHMODEL>
class ExporterDAE
2006-11-06 06:29:40 +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
{
XMLDocumentWriter stream(filename);
if (stream.isReliable())
2006-11-06 06:29:40 +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
}
else
2008-02-05 18:46:05 +01:00
return UtilDAE::E_CANTSAVE;
2006-11-06 06:29:40 +01:00
}
static int GetExportMaskCapability()
2006-11-06 06:29:40 +01:00
{
int capability = 0;
2006-11-06 06:29:40 +01:00
//camera
//capability |= MeshModel::IOM_CAMERA;
2006-11-05 11:45:41 +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
////wedg
capability |= MeshModel::IOM_WEDGTEXCOORD;
capability |= MeshModel::IOM_WEDGNORMAL;
2006-11-06 09:45:13 +01:00
return capability;
2006-11-06 09:45:13 +01:00
}
};
}
}
}
#endif