本文整理汇总了C++中Exporter::Export方法的典型用法代码示例。如果您正苦于以下问题:C++ Exporter::Export方法的具体用法?C++ Exporter::Export怎么用?C++ Exporter::Export使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exporter
的用法示例。
在下文中一共展示了Exporter::Export方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: actualRef
// Save
status_t
BitmapSetSaver::Save(Document* document)
{
entry_ref actualRef(fRef);
char name[B_OS_NAME_LENGTH];
// 64x64
snprintf(name, sizeof(name), "%s_64.png", fRef.name);
actualRef.set_name(name);
Exporter* exporter = new BitmapExporter(64);
exporter->SetSelfDestroy(true);
exporter->Export(document, actualRef);
// 16x16
snprintf(name, sizeof(name), "%s_16.png", fRef.name);
actualRef.set_name(name);
exporter = new BitmapExporter(16);
exporter->SetSelfDestroy(true);
exporter->Export(document, actualRef);
// 32x32
snprintf(name, sizeof(name), "%s_32.png", fRef.name);
actualRef.set_name(name);
exporter = new BitmapExporter(32);
exporter->SetSelfDestroy(true);
exporter->Export(document, actualRef);
return B_OK;
}
示例2: aiExportSceneEx
// ------------------------------------------------------------------------------------------------
ASSIMP_API aiReturn aiExportSceneEx( const aiScene* pScene, const char* pFormatId, const char* pFileName, aiFileIO* pIO, unsigned int pPreprocessing )
{
Exporter exp;
if (pIO) {
exp.SetIOHandler(new CIOSystemWrapper(pIO));
}
return exp.Export(pScene,pFormatId,pFileName,pPreprocessing);
}
示例3: on_butExport_clicked
void MainWindow::on_butExport_clicked()
{
using namespace Assimp;
#ifndef ASSIMP_BUILD_NO_EXPORT
QString filename, filter, format_id;
Exporter exporter;
QTime time_begin;
aiReturn rv;
QStringList exportersList;
QMap<QString, const aiExportFormatDesc*> exportersMap;
if(mScene == nullptr)
{
QMessageBox::critical(this, "Export error", "Scene is empty");
return;
}
for (size_t i = 0; i < exporter.GetExportFormatCount(); ++i)
{
const aiExportFormatDesc* desc = exporter.GetExportFormatDescription(i);
exportersList.push_back(desc->id + QString(": ") + desc->description);
exportersMap.insert(desc->id, desc);
}
// get an exporter
bool dialogSelectExporterOk;
QString selectedExporter = QInputDialog::getItem(this, "Export format", "Select the exporter : ", exportersList, 0, false, &dialogSelectExporterOk);
if (!dialogSelectExporterOk)
return;
// build the filter
QString selectedId = selectedExporter.left(selectedExporter.indexOf(':'));
filter = QString("*.") + exportersMap[selectedId]->fileExtension;
// get file path
filename = QFileDialog::getSaveFileName(this, "Set file name", "", filter);
// if it's canceled
if (filename == "")
return;
// begin export
time_begin = QTime::currentTime();
rv = exporter.Export(mScene, selectedId.toLocal8Bit(), filename.toLocal8Bit(), aiProcess_FlipUVs);
ui->lblExportTime->setText(QString::number(time_begin.secsTo(QTime::currentTime())));
if(rv == aiReturn_SUCCESS)
LogInfo("Export done: " + filename);
else
{
QString errorMessage = QString("Export failed: ") + filename;
LogError(errorMessage);
QMessageBox::critical(this, "Export error", errorMessage);
}
#endif
}
示例4: exporterTest
virtual bool exporterTest() {
Importer importer;
Exporter exporter;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/PLY/cube.ply", 0);
EXPECT_NE(nullptr, scene);
EXPECT_EQ(aiReturn_SUCCESS, exporter.Export(scene, "ply", ASSIMP_TEST_MODELS_DIR "/PLY/cube_test.ply"));
return true;
}
示例5: on_butExport_clicked
void MainWindow::on_butExport_clicked()
{
using namespace Assimp;
QString filename, filter, format_id;
Exporter exporter;
QTime time_begin;
aiReturn rv;
if(mScene == nullptr)
{
QMessageBox::critical(this, "Export error", "Scene is empty");
return;
}
// build filter
{
aiString filter_temp;
mImporter.GetExtensionList(filter_temp);
filter = filter_temp.C_Str();
filter.replace(';', ' ');
}
// get file path
filename = QFileDialog::getSaveFileName(this, "Set file name", "", filter);
// extract format ID
format_id = filename.right(filename.length() - filename.lastIndexOf('.') - 1);
if(format_id.isEmpty())
{
QMessageBox::critical(this, "Export error", "File name must has extension.");
return;
}
// begin export
time_begin = QTime::currentTime();
rv = exporter.Export(mScene, format_id.toLocal8Bit(), filename.toLocal8Bit());
ui->lblExportTime->setText(QString("%1").arg(time_begin.secsTo(QTime::currentTime())));
if(rv == aiReturn_SUCCESS)
LogInfo("Export done: " + filename);
else
LogError("Export failed: " + filename);
}