本文整理汇总了C++中assimp::Importer::IsExtensionSupported方法的典型用法代码示例。如果您正苦于以下问题:C++ Importer::IsExtensionSupported方法的具体用法?C++ Importer::IsExtensionSupported怎么用?C++ Importer::IsExtensionSupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assimp::Importer
的用法示例。
在下文中一共展示了Importer::IsExtensionSupported方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: aiIsExtensionSupported
// ------------------------------------------------------------------------------------------------
// Returns the error text of the last failed import process.
aiBool aiIsExtensionSupported(const char* szExtension)
{
ai_assert(NULL != szExtension);
aiBool candoit=AI_FALSE;
ASSIMP_BEGIN_EXCEPTION_REGION();
// FIXME: no need to create a temporary Importer instance just for that ..
Assimp::Importer tmp;
candoit = tmp.IsExtensionSupported(std::string(szExtension)) ? AI_TRUE : AI_FALSE;
ASSIMP_END_EXCEPTION_REGION(aiBool);
return candoit;
}
示例2: aiIsExtensionSupported
// ------------------------------------------------------------------------------------------------
// Returns the error text of the last failed import process.
int aiIsExtensionSupported(const char* szExtension)
{
ai_assert(NULL != szExtension);
// lock the mutex
#if (defined AI_C_THREADSAFE)
boost::mutex::scoped_lock lock(gMutex);
#endif
if (!gActiveImports.empty()) {
return (int)((*(gActiveImports.begin())).second->IsExtensionSupported( szExtension ));
}
// need to create a temporary Importer instance.
// TODO: Find a better solution ...
Assimp::Importer* pcTemp = new Assimp::Importer();
int i = (int)pcTemp->IsExtensionSupported(std::string(szExtension));
delete pcTemp;
return i;
}
示例3: aiIsExtensionSupported
// ------------------------------------------------------------------------------------------------
// Returns the error text of the last failed import process.
aiBool aiIsExtensionSupported(const char* szExtension)
{
ai_assert(NULL != szExtension);
aiBool candoit=AI_FALSE;
ASSIMP_BEGIN_EXCEPTION_REGION();
#ifdef AI_C_THREADSAFE
boost::mutex::scoped_lock lock(gMutex);
#endif
if (!gActiveImports.empty()) {
return ((*(gActiveImports.begin())).second->IsExtensionSupported( szExtension )) ? AI_TRUE : AI_FALSE;
}
// fixme: no need to create a temporary Importer instance just for that ..
Assimp::Importer tmp;
candoit = tmp.IsExtensionSupported(std::string(szExtension)) ? AI_TRUE : AI_FALSE;
ASSIMP_END_EXCEPTION_REGION(aiBool);
return candoit;
}
示例4: main
//.........这里部分代码省略.........
// assimp listext
// List all file extensions supported by Assimp
if (! strcmp(argv[1], "listext")) {
aiString s;
imp.GetExtensionList(s);
printf("%s\n",s.data);
return 0;
}
#ifndef ASSIMP_BUILD_NO_EXPORT
// assimp listexport
// List all export file formats supported by Assimp (not the file extensions, just the format identifiers!)
if (! strcmp(argv[1], "listexport")) {
aiString s;
for(size_t i = 0, end = exp.GetExportFormatCount(); i < end; ++i) {
const aiExportFormatDesc* const e = exp.GetExportFormatDescription(i);
s.Append( e->id );
if (i!=end-1) {
s.Append("\n");
}
}
printf("%s\n",s.data);
return 0;
}
// assimp exportinfo
// stat an export format
if (! strcmp(argv[1], "exportinfo")) {
aiString s;
if (argc<3) {
printf("Expected file format id\n");
return -11;
}
for(size_t i = 0, end = exp.GetExportFormatCount(); i < end; ++i) {
const aiExportFormatDesc* const e = exp.GetExportFormatDescription(i);
if (!strcmp(e->id,argv[2])) {
printf("%s\n%s\n%s\n",e->id,e->fileExtension,e->description);
return 0;
}
}
printf("Unknown file format id: \'%s\'\n",argv[2]);
return -12;
}
// assimp export
// Export a model to a file
if (! strcmp(argv[1], "export")) {
return Assimp_Export (&argv[2],argc-2);
}
#endif
// assimp knowext
// Check whether a particular file extension is known by us, return 0 on success
if (! strcmp(argv[1], "knowext")) {
if (argc<3) {
printf("Expected file extension");
return -10;
}
const bool b = imp.IsExtensionSupported(argv[2]);
printf("File extension \'%s\' is %sknown\n",argv[2],(b?"":"not "));
return b?0:-1;
}
// assimp info
// Print basic model statistics
if (! strcmp(argv[1], "info")) {
return Assimp_Info ((const char**)&argv[2],argc-2);
}
// assimp dump
// Dump a model to a file
if (! strcmp(argv[1], "dump")) {
return Assimp_Dump (&argv[2],argc-2);
}
// assimp extract
// Extract an embedded texture from a file
if (! strcmp(argv[1], "extract")) {
return Assimp_Extract (&argv[2],argc-2);
}
// assimp testbatchload
// Used by /test/other/streamload.py to load a list of files
// using the same importer instance to check for incompatible
// importers.
if (! strcmp(argv[1], "testbatchload")) {
return Assimp_TestBatchLoad (&argv[2],argc-2);
}
printf("Unrecognized command. Use \'assimp help\' for a detailed command list\n");
return 1;
}