Exporter.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (assimp)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2012, assimp team
  6. All rights reserved.
  7. Redistribution and use of this software in source and binary forms,
  8. with or without modification, are permitted provided that the following
  9. conditions are met:
  10. * Redistributions of source code must retain the above
  11. copyright notice, this list of conditions and the
  12. following disclaimer.
  13. * Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the
  15. following disclaimer in the documentation and/or other
  16. materials provided with the distribution.
  17. * Neither the name of the assimp team, nor the names of its
  18. contributors may be used to endorse or promote products
  19. derived from this software without specific prior
  20. written permission of the assimp team.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ---------------------------------------------------------------------------
  33. */
  34. /** @file Exporter.cpp
  35. Assimp export interface. While it's public interface bears many similarities
  36. to the import interface (in fact, it is largely symmetric), the internal
  37. implementations differs a lot. Exporters are considered stateless and are
  38. simple callbacks which we maintain in a global list along with their
  39. description strings.
  40. Here we implement only the C++ interface (Assimp::Exporter).
  41. */
  42. #include "AssimpPCH.h"
  43. #ifndef ASSIMP_BUILD_NO_EXPORT
  44. #include "DefaultIOSystem.h"
  45. #include "BlobIOSystem.h"
  46. #include "SceneCombiner.h"
  47. #include "BaseProcess.h"
  48. #include "Importer.h" // need this for GetPostProcessingStepInstanceList()
  49. #include "JoinVerticesProcess.h"
  50. #include "MakeVerboseFormat.h"
  51. #include "ConvertToLHProcess.h"
  52. namespace Assimp {
  53. // PostStepRegistry.cpp
  54. void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out);
  55. // ------------------------------------------------------------------------------------------------
  56. // Exporter worker function prototypes. Should not be necessary to #ifndef them, it's just a prototype
  57. // do not use const, because some exporter need to convert the scene temporary
  58. void ExportSceneCollada(const char*,IOSystem*, const aiScene*, const ExportProperties*);
  59. void ExportSceneXFile(const char*,IOSystem*, const aiScene*, const ExportProperties*);
  60. void ExportSceneObj(const char*,IOSystem*, const aiScene*, const ExportProperties*);
  61. void ExportSceneSTL(const char*,IOSystem*, const aiScene*, const ExportProperties*);
  62. void ExportSceneSTLBinary(const char*,IOSystem*, const aiScene*, const ExportProperties*);
  63. void ExportScenePly(const char*,IOSystem*, const aiScene*, const ExportProperties*);
  64. void ExportScenePlyBinary(const char*, IOSystem*, const aiScene*, const ExportProperties*);
  65. void ExportScene3DS(const char*, IOSystem*, const aiScene*, const ExportProperties*);
  66. void ExportSceneAssbin(const char*, IOSystem*, const aiScene*, const ExportProperties*);
  67. void ExportSceneAssxml(const char*, IOSystem*, const aiScene*, const ExportProperties*);
  68. // ------------------------------------------------------------------------------------------------
  69. // global array of all export formats which Assimp supports in its current build
  70. Exporter::ExportFormatEntry gExporters[] =
  71. {
  72. #ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER
  73. Exporter::ExportFormatEntry( "collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada),
  74. #endif
  75. #ifndef ASSIMP_BUILD_NO_XFILE_EXPORTER
  76. Exporter::ExportFormatEntry( "x", "X Files", "x", &ExportSceneXFile,
  77. aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs),
  78. #endif
  79. #ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER
  80. Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj,
  81. aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */),
  82. #endif
  83. #ifndef ASSIMP_BUILD_NO_STL_EXPORTER
  84. Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL,
  85. aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices
  86. ),
  87. Exporter::ExportFormatEntry( "stlb", "Stereolithography (binary)", "stl" , &ExportSceneSTLBinary,
  88. aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices
  89. ),
  90. #endif
  91. #ifndef ASSIMP_BUILD_NO_PLY_EXPORTER
  92. Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly,
  93. aiProcess_PreTransformVertices
  94. ),
  95. Exporter::ExportFormatEntry( "plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary,
  96. aiProcess_PreTransformVertices
  97. ),
  98. #endif
  99. #ifndef ASSIMP_BUILD_NO_3DS_EXPORTER
  100. Exporter::ExportFormatEntry( "3ds", "Autodesk 3DS (legacy)", "3ds" , &ExportScene3DS,
  101. aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices),
  102. #endif
  103. #ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER
  104. Exporter::ExportFormatEntry( "assbin", "Assimp Binary", "assbin" , &ExportSceneAssbin, 0),
  105. #endif
  106. #ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER
  107. Exporter::ExportFormatEntry( "assxml", "Assxml Document", "assxml" , &ExportSceneAssxml, 0),
  108. #endif
  109. };
  110. #define ASSIMP_NUM_EXPORTERS (sizeof(gExporters)/sizeof(gExporters[0]))
  111. class ExporterPimpl {
  112. public:
  113. ExporterPimpl()
  114. : blob()
  115. , mIOSystem(new Assimp::DefaultIOSystem())
  116. , mIsDefaultIOHandler(true)
  117. {
  118. GetPostProcessingStepInstanceList(mPostProcessingSteps);
  119. // grab all builtin exporters
  120. mExporters.resize(ASSIMP_NUM_EXPORTERS);
  121. std::copy(gExporters,gExporters+ASSIMP_NUM_EXPORTERS,mExporters.begin());
  122. }
  123. ~ExporterPimpl()
  124. {
  125. delete blob;
  126. // Delete all post-processing plug-ins
  127. for( unsigned int a = 0; a < mPostProcessingSteps.size(); a++) {
  128. delete mPostProcessingSteps[a];
  129. }
  130. }
  131. public:
  132. aiExportDataBlob* blob;
  133. boost::shared_ptr< Assimp::IOSystem > mIOSystem;
  134. bool mIsDefaultIOHandler;
  135. /** Post processing steps we can apply at the imported data. */
  136. std::vector< BaseProcess* > mPostProcessingSteps;
  137. /** Last fatal export error */
  138. std::string mError;
  139. /** Exporters, this includes those registered using #Assimp::Exporter::RegisterExporter */
  140. std::vector<Exporter::ExportFormatEntry> mExporters;
  141. };
  142. } // end of namespace Assimp
  143. using namespace Assimp;
  144. // ------------------------------------------------------------------------------------------------
  145. Exporter :: Exporter()
  146. : pimpl(new ExporterPimpl())
  147. {
  148. }
  149. // ------------------------------------------------------------------------------------------------
  150. Exporter :: ~Exporter()
  151. {
  152. FreeBlob();
  153. delete pimpl;
  154. }
  155. // ------------------------------------------------------------------------------------------------
  156. void Exporter :: SetIOHandler( IOSystem* pIOHandler)
  157. {
  158. pimpl->mIsDefaultIOHandler = !pIOHandler;
  159. pimpl->mIOSystem.reset(pIOHandler);
  160. }
  161. // ------------------------------------------------------------------------------------------------
  162. IOSystem* Exporter :: GetIOHandler() const
  163. {
  164. return pimpl->mIOSystem.get();
  165. }
  166. // ------------------------------------------------------------------------------------------------
  167. bool Exporter :: IsDefaultIOHandler() const
  168. {
  169. return pimpl->mIsDefaultIOHandler;
  170. }
  171. // ------------------------------------------------------------------------------------------------
  172. const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const char* pFormatId, unsigned int, const ExportProperties* pProperties)
  173. {
  174. if (pimpl->blob) {
  175. delete pimpl->blob;
  176. pimpl->blob = NULL;
  177. }
  178. boost::shared_ptr<IOSystem> old = pimpl->mIOSystem;
  179. BlobIOSystem* blobio = new BlobIOSystem();
  180. pimpl->mIOSystem = boost::shared_ptr<IOSystem>( blobio );
  181. if (AI_SUCCESS != Export(pScene,pFormatId,blobio->GetMagicFileName())) {
  182. pimpl->mIOSystem = old;
  183. return NULL;
  184. }
  185. pimpl->blob = blobio->GetBlobChain();
  186. pimpl->mIOSystem = old;
  187. return pimpl->blob;
  188. }
  189. // ------------------------------------------------------------------------------------------------
  190. bool IsVerboseFormat(const aiMesh* mesh)
  191. {
  192. // avoid slow vector<bool> specialization
  193. std::vector<unsigned int> seen(mesh->mNumVertices,0);
  194. for(unsigned int i = 0; i < mesh->mNumFaces; ++i) {
  195. const aiFace& f = mesh->mFaces[i];
  196. for(unsigned int j = 0; j < f.mNumIndices; ++j) {
  197. if(++seen[f.mIndices[j]] == 2) {
  198. // found a duplicate index
  199. return false;
  200. }
  201. }
  202. }
  203. return true;
  204. }
  205. // ------------------------------------------------------------------------------------------------
  206. bool IsVerboseFormat(const aiScene* pScene)
  207. {
  208. for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
  209. if(!IsVerboseFormat(pScene->mMeshes[i])) {
  210. return false;
  211. }
  212. }
  213. return true;
  214. }
  215. // ------------------------------------------------------------------------------------------------
  216. aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const char* pPath, unsigned int pPreprocessing, const ExportProperties* pProperties)
  217. {
  218. ASSIMP_BEGIN_EXCEPTION_REGION();
  219. // when they create scenes from scratch, users will likely create them not in verbose
  220. // format. They will likely not be aware that there is a flag in the scene to indicate
  221. // this, however. To avoid surprises and bug reports, we check for duplicates in
  222. // meshes upfront.
  223. const bool is_verbose_format = !(pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) || IsVerboseFormat(pScene);
  224. pimpl->mError = "";
  225. for (size_t i = 0; i < pimpl->mExporters.size(); ++i) {
  226. const Exporter::ExportFormatEntry& exp = pimpl->mExporters[i];
  227. if (!strcmp(exp.mDescription.id,pFormatId)) {
  228. try {
  229. // Always create a full copy of the scene. We might optimize this one day,
  230. // but for now it is the most pragmatic way.
  231. aiScene* scenecopy_tmp;
  232. SceneCombiner::CopyScene(&scenecopy_tmp,pScene);
  233. std::auto_ptr<aiScene> scenecopy(scenecopy_tmp);
  234. const ScenePrivateData* const priv = ScenePriv(pScene);
  235. // steps that are not idempotent, i.e. we might need to run them again, usually to get back to the
  236. // original state before the step was applied first. When checking which steps we don't need
  237. // to run, those are excluded.
  238. const unsigned int nonIdempotentSteps = aiProcess_FlipWindingOrder | aiProcess_FlipUVs | aiProcess_MakeLeftHanded;
  239. // Erase all pp steps that were already applied to this scene
  240. const unsigned int pp = (exp.mEnforcePP | pPreprocessing) & ~(priv && !priv->mIsCopy
  241. ? (priv->mPPStepsApplied & ~nonIdempotentSteps)
  242. : 0u);
  243. // If no extra postprocessing was specified, and we obtained this scene from an
  244. // Assimp importer, apply the reverse steps automatically.
  245. // TODO: either drop this, or document it. Otherwise it is just a bad surprise.
  246. //if (!pPreprocessing && priv) {
  247. // pp |= (nonIdempotentSteps & priv->mPPStepsApplied);
  248. //}
  249. // If the input scene is not in verbose format, but there is at least postprocessing step that relies on it,
  250. // we need to run the MakeVerboseFormat step first.
  251. bool must_join_again = false;
  252. if (!is_verbose_format) {
  253. bool verbosify = false;
  254. for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++) {
  255. BaseProcess* const p = pimpl->mPostProcessingSteps[a];
  256. if (p->IsActive(pp) && p->RequireVerboseFormat()) {
  257. verbosify = true;
  258. break;
  259. }
  260. }
  261. if (verbosify || (exp.mEnforcePP & aiProcess_JoinIdenticalVertices)) {
  262. DefaultLogger::get()->debug("export: Scene data not in verbose format, applying MakeVerboseFormat step first");
  263. MakeVerboseFormatProcess proc;
  264. proc.Execute(scenecopy.get());
  265. if(!(exp.mEnforcePP & aiProcess_JoinIdenticalVertices)) {
  266. must_join_again = true;
  267. }
  268. }
  269. }
  270. if (pp) {
  271. // the three 'conversion' steps need to be executed first because all other steps rely on the standard data layout
  272. {
  273. FlipWindingOrderProcess step;
  274. if (step.IsActive(pp)) {
  275. step.Execute(scenecopy.get());
  276. }
  277. }
  278. {
  279. FlipUVsProcess step;
  280. if (step.IsActive(pp)) {
  281. step.Execute(scenecopy.get());
  282. }
  283. }
  284. {
  285. MakeLeftHandedProcess step;
  286. if (step.IsActive(pp)) {
  287. step.Execute(scenecopy.get());
  288. }
  289. }
  290. // dispatch other processes
  291. for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++) {
  292. BaseProcess* const p = pimpl->mPostProcessingSteps[a];
  293. if (p->IsActive(pp)
  294. && !dynamic_cast<FlipUVsProcess*>(p)
  295. && !dynamic_cast<FlipWindingOrderProcess*>(p)
  296. && !dynamic_cast<MakeLeftHandedProcess*>(p)) {
  297. p->Execute(scenecopy.get());
  298. }
  299. }
  300. ScenePrivateData* const privOut = ScenePriv(scenecopy.get());
  301. ai_assert(privOut);
  302. privOut->mPPStepsApplied |= pp;
  303. }
  304. if(must_join_again) {
  305. JoinVerticesProcess proc;
  306. proc.Execute(scenecopy.get());
  307. }
  308. exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProperties);
  309. }
  310. catch (DeadlyExportError& err) {
  311. pimpl->mError = err.what();
  312. return AI_FAILURE;
  313. }
  314. return AI_SUCCESS;
  315. }
  316. }
  317. pimpl->mError = std::string("Found no exporter to handle this file format: ") + pFormatId;
  318. ASSIMP_END_EXCEPTION_REGION(aiReturn);
  319. return AI_FAILURE;
  320. }
  321. // ------------------------------------------------------------------------------------------------
  322. const char* Exporter :: GetErrorString() const
  323. {
  324. return pimpl->mError.c_str();
  325. }
  326. // ------------------------------------------------------------------------------------------------
  327. void Exporter :: FreeBlob( )
  328. {
  329. delete pimpl->blob;
  330. pimpl->blob = NULL;
  331. pimpl->mError = "";
  332. }
  333. // ------------------------------------------------------------------------------------------------
  334. const aiExportDataBlob* Exporter :: GetBlob() const
  335. {
  336. return pimpl->blob;
  337. }
  338. // ------------------------------------------------------------------------------------------------
  339. const aiExportDataBlob* Exporter :: GetOrphanedBlob() const
  340. {
  341. const aiExportDataBlob* tmp = pimpl->blob;
  342. pimpl->blob = NULL;
  343. return tmp;
  344. }
  345. // ------------------------------------------------------------------------------------------------
  346. size_t Exporter :: GetExportFormatCount() const
  347. {
  348. return pimpl->mExporters.size();
  349. }
  350. // ------------------------------------------------------------------------------------------------
  351. const aiExportFormatDesc* Exporter :: GetExportFormatDescription( size_t pIndex ) const
  352. {
  353. if (pIndex >= GetExportFormatCount()) {
  354. return NULL;
  355. }
  356. // Return from static storage if the requested index is built-in.
  357. if (pIndex < sizeof(gExporters) / sizeof(gExporters[0])) {
  358. return &gExporters[pIndex].mDescription;
  359. }
  360. return &pimpl->mExporters[pIndex].mDescription;
  361. }
  362. // ------------------------------------------------------------------------------------------------
  363. aiReturn Exporter :: RegisterExporter(const ExportFormatEntry& desc)
  364. {
  365. BOOST_FOREACH(const ExportFormatEntry& e, pimpl->mExporters) {
  366. if (!strcmp(e.mDescription.id,desc.mDescription.id)) {
  367. return aiReturn_FAILURE;
  368. }
  369. }
  370. pimpl->mExporters.push_back(desc);
  371. return aiReturn_SUCCESS;
  372. }
  373. // ------------------------------------------------------------------------------------------------
  374. void Exporter :: UnregisterExporter(const char* id)
  375. {
  376. for(std::vector<ExportFormatEntry>::iterator it = pimpl->mExporters.begin(); it != pimpl->mExporters.end(); ++it) {
  377. if (!strcmp((*it).mDescription.id,id)) {
  378. pimpl->mExporters.erase(it);
  379. break;
  380. }
  381. }
  382. }
  383. void ExportProperties :: CopyProperties(ExportProperties* dest,const ExportProperties* source)
  384. {
  385. if (!source || !dest) return;
  386. dest->mIntProperties = IntPropertyMap(source->mIntProperties);
  387. dest->mFloatProperties = FloatPropertyMap(source->mFloatProperties);
  388. dest->mStringProperties = StringPropertyMap(source->mStringProperties);
  389. dest->mMatrixProperties = MatrixPropertyMap(source->mMatrixProperties);
  390. }
  391. // ------------------------------------------------------------------------------------------------
  392. // Set a configuration property
  393. void ExportProperties :: SetPropertyInteger(const char* szName, int iValue,
  394. bool* bWasExisting /*= NULL*/)
  395. {
  396. ASSIMP_BEGIN_EXCEPTION_REGION();
  397. SetGenericProperty<int>(mIntProperties, szName,iValue,bWasExisting);
  398. ASSIMP_END_EXCEPTION_REGION(void);
  399. }
  400. // ------------------------------------------------------------------------------------------------
  401. // Set a configuration property
  402. void ExportProperties :: SetPropertyFloat(const char* szName, float iValue,
  403. bool* bWasExisting /*= NULL*/)
  404. {
  405. ASSIMP_BEGIN_EXCEPTION_REGION();
  406. SetGenericProperty<float>(mFloatProperties, szName,iValue,bWasExisting);
  407. ASSIMP_END_EXCEPTION_REGION(void);
  408. }
  409. // ------------------------------------------------------------------------------------------------
  410. // Set a configuration property
  411. void ExportProperties :: SetPropertyString(const char* szName, const std::string& value,
  412. bool* bWasExisting /*= NULL*/)
  413. {
  414. ASSIMP_BEGIN_EXCEPTION_REGION();
  415. SetGenericProperty<std::string>(mStringProperties, szName,value,bWasExisting);
  416. ASSIMP_END_EXCEPTION_REGION(void);
  417. }
  418. // ------------------------------------------------------------------------------------------------
  419. // Set a configuration property
  420. void ExportProperties :: SetPropertyMatrix(const char* szName, const aiMatrix4x4& value,
  421. bool* bWasExisting /*= NULL*/)
  422. {
  423. ASSIMP_BEGIN_EXCEPTION_REGION();
  424. SetGenericProperty<aiMatrix4x4>(mMatrixProperties, szName,value,bWasExisting);
  425. ASSIMP_END_EXCEPTION_REGION(void);
  426. }
  427. // ------------------------------------------------------------------------------------------------
  428. // Get a configuration property
  429. int ExportProperties :: GetPropertyInteger(const char* szName,
  430. int iErrorReturn /*= 0xffffffff*/) const
  431. {
  432. return GetGenericProperty<int>(mIntProperties,szName,iErrorReturn);
  433. }
  434. // ------------------------------------------------------------------------------------------------
  435. // Get a configuration property
  436. float ExportProperties :: GetPropertyFloat(const char* szName,
  437. float iErrorReturn /*= 10e10*/) const
  438. {
  439. return GetGenericProperty<float>(mFloatProperties,szName,iErrorReturn);
  440. }
  441. // ------------------------------------------------------------------------------------------------
  442. // Get a configuration property
  443. const std::string ExportProperties :: GetPropertyString(const char* szName,
  444. const std::string& iErrorReturn /*= ""*/) const
  445. {
  446. return GetGenericProperty<std::string>(mStringProperties,szName,iErrorReturn);
  447. }
  448. // ------------------------------------------------------------------------------------------------
  449. // Has a configuration property
  450. const aiMatrix4x4 ExportProperties :: GetPropertyMatrix(const char* szName,
  451. const aiMatrix4x4& iErrorReturn /*= aiMatrix4x4()*/) const
  452. {
  453. return GetGenericProperty<aiMatrix4x4>(mMatrixProperties,szName,iErrorReturn);
  454. }
  455. // ------------------------------------------------------------------------------------------------
  456. // Has a configuration property
  457. bool ExportProperties :: HasPropertyInteger(const char* szName) const
  458. {
  459. return HasGenericProperty<int>(mIntProperties, szName);
  460. }
  461. // ------------------------------------------------------------------------------------------------
  462. // Has a configuration property
  463. bool ExportProperties :: HasPropertyBool(const char* szName) const
  464. {
  465. return HasGenericProperty<int>(mIntProperties, szName);
  466. };
  467. // ------------------------------------------------------------------------------------------------
  468. // Has a configuration property
  469. bool ExportProperties :: HasPropertyFloat(const char* szName) const
  470. {
  471. return HasGenericProperty<float>(mFloatProperties, szName);
  472. };
  473. // ------------------------------------------------------------------------------------------------
  474. // Has a configuration property
  475. bool ExportProperties :: HasPropertyString(const char* szName) const
  476. {
  477. return HasGenericProperty<std::string>(mStringProperties, szName);
  478. };
  479. // ------------------------------------------------------------------------------------------------
  480. // Has a configuration property
  481. bool ExportProperties :: HasPropertyMatrix(const char* szName) const
  482. {
  483. return HasGenericProperty<aiMatrix4x4>(mMatrixProperties, szName);
  484. };
  485. #endif // !ASSIMP_BUILD_NO_EXPORT