XFileExporter.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. /*
  2. Open Asset Import Library (assimp)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2016, assimp team
  5. All rights reserved.
  6. Redistribution and use of this software in source and binary forms,
  7. with or without modification, are permitted provided that the
  8. following conditions are met:
  9. * Redistributions of source code must retain the above
  10. copyright notice, this list of conditions and the
  11. following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the
  14. following disclaimer in the documentation and/or other
  15. materials provided with the distribution.
  16. * Neither the name of the assimp team, nor the names of its
  17. contributors may be used to endorse or promote products
  18. derived from this software without specific prior
  19. written permission of the assimp team.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. @author: Richard Steffen, 2014
  32. ----------------------------------------------------------------------
  33. */
  34. #ifndef ASSIMP_BUILD_NO_EXPORT
  35. #ifndef ASSIMP_BUILD_NO_X_EXPORTER
  36. #include "XFileExporter.h"
  37. #include "ConvertToLHProcess.h"
  38. #include "Bitmap.h"
  39. #include "BaseImporter.h"
  40. #include "fast_atof.h"
  41. #include "SceneCombiner.h"
  42. #include "DefaultIOSystem.h"
  43. #include <ctime>
  44. #include <set>
  45. #include <memory>
  46. #include "Exceptional.h"
  47. #include <assimp/IOSystem.hpp>
  48. #include <assimp/scene.h>
  49. #include <assimp/light.h>
  50. using namespace Assimp;
  51. namespace Assimp
  52. {
  53. // ------------------------------------------------------------------------------------------------
  54. // Worker function for exporting a scene to Collada. Prototyped and registered in Exporter.cpp
  55. void ExportSceneXFile(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties)
  56. {
  57. std::string path = DefaultIOSystem::absolutePath(std::string(pFile));
  58. std::string file = DefaultIOSystem::completeBaseName(std::string(pFile));
  59. // create/copy Properties
  60. ExportProperties props(*pProperties);
  61. // set standard properties if not set
  62. if (!props.HasPropertyBool(AI_CONFIG_EXPORT_XFILE_64BIT)) props.SetPropertyBool(AI_CONFIG_EXPORT_XFILE_64BIT, false);
  63. // invoke the exporter
  64. XFileExporter iDoTheExportThing( pScene, pIOSystem, path, file, &props);
  65. // we're still here - export successfully completed. Write result to the given IOSYstem
  66. std::unique_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
  67. if(outfile == NULL) {
  68. throw DeadlyExportError("could not open output .x file: " + std::string(pFile));
  69. }
  70. // XXX maybe use a small wrapper around IOStream that behaves like std::stringstream in order to avoid the extra copy.
  71. outfile->Write( iDoTheExportThing.mOutput.str().c_str(), static_cast<size_t>(iDoTheExportThing.mOutput.tellp()),1);
  72. }
  73. } // end of namespace Assimp
  74. // ------------------------------------------------------------------------------------------------
  75. // Constructor for a specific scene to export
  76. XFileExporter::XFileExporter(const aiScene* pScene, IOSystem* pIOSystem, const std::string& path, const std::string& file, const ExportProperties* pProperties)
  77. : mProperties(pProperties),
  78. mIOSystem(pIOSystem),
  79. mPath(path),
  80. mFile(file),
  81. mScene(pScene),
  82. mSceneOwned(false),
  83. endstr("\n")
  84. {
  85. // make sure that all formatting happens using the standard, C locale and not the user's current locale
  86. mOutput.imbue( std::locale("C") );
  87. mOutput.precision(16);
  88. // start writing
  89. WriteFile();
  90. }
  91. // ------------------------------------------------------------------------------------------------
  92. // Destructor
  93. XFileExporter::~XFileExporter()
  94. {
  95. if(mSceneOwned) {
  96. delete mScene;
  97. }
  98. }
  99. // ------------------------------------------------------------------------------------------------
  100. // Starts writing the contents
  101. void XFileExporter::WriteFile()
  102. {
  103. // note, that all realnumber values must be comma separated in x files
  104. mOutput.setf(std::ios::fixed);
  105. mOutput.precision(16); // precission for double
  106. // entry of writing the file
  107. WriteHeader();
  108. mOutput << startstr << "Frame DXCC_ROOT {" << endstr;
  109. PushTag();
  110. aiMatrix4x4 I; // identity
  111. WriteFrameTransform(I);
  112. WriteNode(mScene->mRootNode);
  113. PopTag();
  114. mOutput << startstr << "}" << endstr;
  115. }
  116. // ------------------------------------------------------------------------------------------------
  117. // Writes the asset header
  118. void XFileExporter::WriteHeader()
  119. {
  120. if (mProperties->GetPropertyBool(AI_CONFIG_EXPORT_XFILE_64BIT) == true)
  121. mOutput << startstr << "xof 0303txt 0064" << endstr;
  122. else
  123. mOutput << startstr << "xof 0303txt 0032" << endstr;
  124. mOutput << endstr;
  125. mOutput << startstr << "template Frame {" << endstr;
  126. PushTag();
  127. mOutput << startstr << "<3d82ab46-62da-11cf-ab39-0020af71e433>" << endstr;
  128. mOutput << startstr << "[...]" << endstr;
  129. PopTag();
  130. mOutput << startstr << "}" << endstr;
  131. mOutput << endstr;
  132. mOutput << startstr << "template Matrix4x4 {" << endstr;
  133. PushTag();
  134. mOutput << startstr << "<f6f23f45-7686-11cf-8f52-0040333594a3>" << endstr;
  135. mOutput << startstr << "array FLOAT matrix[16];" << endstr;
  136. PopTag();
  137. mOutput << startstr << "}" << endstr;
  138. mOutput << endstr;
  139. mOutput << startstr << "template FrameTransformMatrix {" << endstr;
  140. PushTag();
  141. mOutput << startstr << "<f6f23f41-7686-11cf-8f52-0040333594a3>" << endstr;
  142. mOutput << startstr << "Matrix4x4 frameMatrix;" << endstr;
  143. PopTag();
  144. mOutput << startstr << "}" << endstr;
  145. mOutput << endstr;
  146. mOutput << startstr << "template Vector {" << endstr;
  147. PushTag();
  148. mOutput << startstr << "<3d82ab5e-62da-11cf-ab39-0020af71e433>" << endstr;
  149. mOutput << startstr << "FLOAT x;" << endstr;
  150. mOutput << startstr << "FLOAT y;" << endstr;
  151. mOutput << startstr << "FLOAT z;" << endstr;
  152. PopTag();
  153. mOutput << startstr << "}" << endstr;
  154. mOutput << endstr;
  155. mOutput << startstr << "template MeshFace {" << endstr;
  156. PushTag();
  157. mOutput << startstr << "<3d82ab5f-62da-11cf-ab39-0020af71e433>" << endstr;
  158. mOutput << startstr << "DWORD nFaceVertexIndices;" << endstr;
  159. mOutput << startstr << "array DWORD faceVertexIndices[nFaceVertexIndices];" << endstr;
  160. PopTag();
  161. mOutput << startstr << "}" << endstr;
  162. mOutput << endstr;
  163. mOutput << startstr << "template Mesh {" << endstr;
  164. PushTag();
  165. mOutput << startstr << "<3d82ab44-62da-11cf-ab39-0020af71e433>" << endstr;
  166. mOutput << startstr << "DWORD nVertices;" << endstr;
  167. mOutput << startstr << "array Vector vertices[nVertices];" << endstr;
  168. mOutput << startstr << "DWORD nFaces;" << endstr;
  169. mOutput << startstr << "array MeshFace faces[nFaces];" << endstr;
  170. mOutput << startstr << "[...]" << endstr;
  171. PopTag();
  172. mOutput << startstr << "}" << endstr;
  173. mOutput << endstr;
  174. mOutput << startstr << "template MeshNormals {" << endstr;
  175. PushTag();
  176. mOutput << startstr << "<f6f23f43-7686-11cf-8f52-0040333594a3>" << endstr;
  177. mOutput << startstr << "DWORD nNormals;" << endstr;
  178. mOutput << startstr << "array Vector normals[nNormals];" << endstr;
  179. mOutput << startstr << "DWORD nFaceNormals;" << endstr;
  180. mOutput << startstr << "array MeshFace faceNormals[nFaceNormals];" << endstr;
  181. PopTag();
  182. mOutput << startstr << "}" << endstr;
  183. mOutput << endstr;
  184. mOutput << startstr << "template Coords2d {" << endstr;
  185. PushTag();
  186. mOutput << startstr << "<f6f23f44-7686-11cf-8f52-0040333594a3>" << endstr;
  187. mOutput << startstr << "FLOAT u;" << endstr;
  188. mOutput << startstr << "FLOAT v;" << endstr;
  189. PopTag();
  190. mOutput << startstr << "}" << endstr;
  191. mOutput << endstr;
  192. mOutput << startstr << "template MeshTextureCoords {" << endstr;
  193. PushTag();
  194. mOutput << startstr << "<f6f23f40-7686-11cf-8f52-0040333594a3>" << endstr;
  195. mOutput << startstr << "DWORD nTextureCoords;" << endstr;
  196. mOutput << startstr << "array Coords2d textureCoords[nTextureCoords];" << endstr;
  197. PopTag();
  198. mOutput << startstr << "}" << endstr;
  199. mOutput << endstr;
  200. mOutput << startstr << "template ColorRGBA {" << endstr;
  201. PushTag();
  202. mOutput << startstr << "<35ff44e0-6c7c-11cf-8f52-0040333594a3>" << endstr;
  203. mOutput << startstr << "FLOAT red;" << endstr;
  204. mOutput << startstr << "FLOAT green;" << endstr;
  205. mOutput << startstr << "FLOAT blue;" << endstr;
  206. mOutput << startstr << "FLOAT alpha;" << endstr;
  207. PopTag();
  208. mOutput << startstr << "}" << endstr;
  209. mOutput << endstr;
  210. mOutput << startstr << "template IndexedColor {" << endstr;
  211. PushTag();
  212. mOutput << startstr << "<1630b820-7842-11cf-8f52-0040333594a3>" << endstr;
  213. mOutput << startstr << "DWORD index;" << endstr;
  214. mOutput << startstr << "ColorRGBA indexColor;" << endstr;
  215. PopTag();
  216. mOutput << startstr << "}" << endstr;
  217. mOutput << endstr;
  218. mOutput << startstr << "template MeshVertexColors {" << endstr;
  219. PushTag();
  220. mOutput << startstr << "<1630b821-7842-11cf-8f52-0040333594a3>" << endstr;
  221. mOutput << startstr << "DWORD nVertexColors;" << endstr;
  222. mOutput << startstr << "array IndexedColor vertexColors[nVertexColors];" << endstr;
  223. PopTag();
  224. mOutput << startstr << "}" << endstr;
  225. mOutput << endstr;
  226. mOutput << startstr << "template VertexElement {" << endstr;
  227. PushTag();
  228. mOutput << startstr << "<f752461c-1e23-48f6-b9f8-8350850f336f>" << endstr;
  229. mOutput << startstr << "DWORD Type;" << endstr;
  230. mOutput << startstr << "DWORD Method;" << endstr;
  231. mOutput << startstr << "DWORD Usage;" << endstr;
  232. mOutput << startstr << "DWORD UsageIndex;" << endstr;
  233. PopTag();
  234. mOutput << startstr << "}" << endstr;
  235. mOutput << endstr;
  236. mOutput << startstr << "template DeclData {" << endstr;
  237. PushTag();
  238. mOutput << startstr << "<bf22e553-292c-4781-9fea-62bd554bdd93>" << endstr;
  239. mOutput << startstr << "DWORD nElements;" << endstr;
  240. mOutput << startstr << "array VertexElement Elements[nElements];" << endstr;
  241. mOutput << startstr << "DWORD nDWords;" << endstr;
  242. mOutput << startstr << "array DWORD data[nDWords];" << endstr;
  243. PopTag();
  244. mOutput << startstr << "}" << endstr;
  245. mOutput << endstr;
  246. }
  247. // Writes the material setup
  248. void XFileExporter::WriteFrameTransform(aiMatrix4x4& m)
  249. {
  250. mOutput << startstr << "FrameTransformMatrix {" << endstr << " ";
  251. PushTag();
  252. mOutput << startstr << m.a1 << ", " << m.b1 << ", " << m.c1 << ", " << m.d1 << "," << endstr;
  253. mOutput << startstr << m.a2 << ", " << m.b2 << ", " << m.c2 << ", " << m.d2 << "," << endstr;
  254. mOutput << startstr << m.a3 << ", " << m.b3 << ", " << m.c3 << ", " << m.d3 << "," << endstr;
  255. mOutput << startstr << m.a4 << ", " << m.b4 << ", " << m.c4 << ", " << m.d4 << ";;" << endstr;
  256. PopTag();
  257. mOutput << startstr << "}" << endstr << endstr;
  258. }
  259. // ------------------------------------------------------------------------------------------------
  260. // Recursively writes the given node
  261. void XFileExporter::WriteNode( aiNode* pNode)
  262. {
  263. if (pNode->mName.length==0)
  264. {
  265. std::stringstream ss;
  266. ss << "Node_" << pNode;
  267. pNode->mName.Set(ss.str());
  268. }
  269. mOutput << startstr << "Frame " << toXFileString(pNode->mName) << " {" << endstr;
  270. PushTag();
  271. aiMatrix4x4 m = pNode->mTransformation;
  272. WriteFrameTransform(m);
  273. for (size_t i = 0; i < pNode->mNumMeshes; ++i)
  274. WriteMesh(mScene->mMeshes[pNode->mMeshes[i]]);
  275. // recursive call the Nodes
  276. for (size_t i = 0; i < pNode->mNumChildren; ++i)
  277. WriteNode(pNode->mChildren[i]);
  278. PopTag();
  279. mOutput << startstr << "}" << endstr << endstr;
  280. }
  281. void XFileExporter::WriteMesh(aiMesh* mesh)
  282. {
  283. mOutput << startstr << "Mesh " << toXFileString(mesh->mName) << "_mShape" << " {" << endstr;
  284. PushTag();
  285. // write all the vertices
  286. mOutput << startstr << mesh->mNumVertices << ";" << endstr;
  287. for (size_t a = 0; a < mesh->mNumVertices; a++)
  288. {
  289. aiVector3D &v = mesh->mVertices[a];
  290. mOutput << startstr << v[0] << ";"<< v[1] << ";" << v[2] << ";";
  291. if (a < mesh->mNumVertices - 1)
  292. mOutput << "," << endstr;
  293. else
  294. mOutput << ";" << endstr;
  295. }
  296. // write all the faces
  297. mOutput << startstr << mesh->mNumFaces << ";" << endstr;
  298. for( size_t a = 0; a < mesh->mNumFaces; ++a )
  299. {
  300. const aiFace& face = mesh->mFaces[a];
  301. mOutput << startstr << face.mNumIndices << ";";
  302. // must be counter clockwise triangle
  303. //for(int b = face.mNumIndices - 1; b >= 0 ; --b)
  304. for(size_t b = 0; b < face.mNumIndices ; ++b)
  305. {
  306. mOutput << face.mIndices[b];
  307. //if (b > 0)
  308. if (b<face.mNumIndices-1)
  309. mOutput << ",";
  310. else
  311. mOutput << ";";
  312. }
  313. if (a < mesh->mNumFaces - 1)
  314. mOutput << "," << endstr;
  315. else
  316. mOutput << ";" << endstr;
  317. }
  318. mOutput << endstr;
  319. if (mesh->HasTextureCoords(0))
  320. {
  321. const aiMaterial* mat = mScene->mMaterials[mesh->mMaterialIndex];
  322. aiString relpath;
  323. mat->Get(_AI_MATKEY_TEXTURE_BASE, aiTextureType_DIFFUSE, 0, relpath);
  324. mOutput << startstr << "MeshMaterialList {" << endstr;
  325. PushTag();
  326. mOutput << startstr << "1;" << endstr; // number of materials
  327. mOutput << startstr << mesh->mNumFaces << ";" << endstr; // number of faces
  328. mOutput << startstr;
  329. for( size_t a = 0; a < mesh->mNumFaces; ++a )
  330. {
  331. mOutput << "0"; // the material index
  332. if (a < mesh->mNumFaces - 1)
  333. mOutput << ", ";
  334. else
  335. mOutput << ";" << endstr;
  336. }
  337. mOutput << startstr << "Material {" << endstr;
  338. PushTag();
  339. mOutput << startstr << "1.0; 1.0; 1.0; 1.000000;;" << endstr;
  340. mOutput << startstr << "1.000000;" << endstr; // power
  341. mOutput << startstr << "0.000000; 0.000000; 0.000000;;" << endstr; // specularity
  342. mOutput << startstr << "0.000000; 0.000000; 0.000000;;" << endstr; // emission
  343. mOutput << startstr << "TextureFilename { \"";
  344. writePath(relpath);
  345. mOutput << "\"; }" << endstr;
  346. PopTag();
  347. mOutput << startstr << "}" << endstr;
  348. PopTag();
  349. mOutput << startstr << "}" << endstr;
  350. }
  351. // write normals (every vertex has one)
  352. if (mesh->HasNormals())
  353. {
  354. mOutput << endstr << startstr << "MeshNormals {" << endstr;
  355. mOutput << startstr << mesh->mNumVertices << ";" << endstr;
  356. for (size_t a = 0; a < mesh->mNumVertices; a++)
  357. {
  358. aiVector3D &v = mesh->mNormals[a];
  359. // because we have a LHS and also changed wth winding, we need to invert the normals again
  360. mOutput << startstr << -v[0] << ";"<< -v[1] << ";" << -v[2] << ";";
  361. if (a < mesh->mNumVertices - 1)
  362. mOutput << "," << endstr;
  363. else
  364. mOutput << ";" << endstr;
  365. }
  366. mOutput << startstr << mesh->mNumFaces << ";" << endstr;
  367. for (size_t a = 0; a < mesh->mNumFaces; a++)
  368. {
  369. const aiFace& face = mesh->mFaces[a];
  370. mOutput << startstr << face.mNumIndices << ";";
  371. //for(int b = face.mNumIndices-1; b >= 0 ; --b)
  372. for(size_t b = 0; b < face.mNumIndices ; ++b)
  373. {
  374. mOutput << face.mIndices[b];
  375. //if (b > 0)
  376. if (b<face.mNumIndices-1)
  377. mOutput << ",";
  378. else
  379. mOutput << ";";
  380. }
  381. if (a < mesh->mNumFaces-1)
  382. mOutput << "," << endstr;
  383. else
  384. mOutput << ";" << endstr;
  385. }
  386. mOutput << startstr << "}" << endstr;
  387. }
  388. // write texture UVs if available
  389. if (mesh->HasTextureCoords(0))
  390. {
  391. mOutput << endstr << startstr << "MeshTextureCoords {" << endstr;
  392. mOutput << startstr << mesh->mNumVertices << ";" << endstr;
  393. for (size_t a = 0; a < mesh->mNumVertices; a++)
  394. //for (int a = (int)mesh->mNumVertices-1; a >=0 ; a--)
  395. {
  396. aiVector3D& uv = mesh->mTextureCoords[0][a]; // uv of first uv layer for the vertex
  397. mOutput << startstr << uv.x << ";" << uv.y;
  398. if (a < mesh->mNumVertices-1)
  399. //if (a >0 )
  400. mOutput << ";," << endstr;
  401. else
  402. mOutput << ";;" << endstr;
  403. }
  404. mOutput << startstr << "}" << endstr;
  405. }
  406. // write color channel if available
  407. if (mesh->HasVertexColors(0))
  408. {
  409. mOutput << endstr << startstr << "MeshVertexColors {" << endstr;
  410. mOutput << startstr << mesh->mNumVertices << ";" << endstr;
  411. for (size_t a = 0; a < mesh->mNumVertices; a++)
  412. {
  413. aiColor4D& mColors = mesh->mColors[0][a]; // color of first vertex color set for the vertex
  414. mOutput << startstr << a << ";" << mColors.r << ";" << mColors.g << ";" << mColors.b << ";" << mColors.a << ";;";
  415. if (a < mesh->mNumVertices-1)
  416. mOutput << "," << endstr;
  417. else
  418. mOutput << ";" << endstr;
  419. }
  420. mOutput << startstr << "}" << endstr;
  421. }
  422. /*
  423. else
  424. {
  425. mOutput << endstr << startstr << "MeshVertexColors {" << endstr;
  426. mOutput << startstr << mesh->mNumVertices << ";" << endstr;
  427. for (size_t a = 0; a < mesh->mNumVertices; a++)
  428. {
  429. aiColor4D* mColors = mesh->mColors[a];
  430. mOutput << startstr << a << ";0.500000;0.000000;0.000000;0.500000;;";
  431. if (a < mesh->mNumVertices-1)
  432. mOutput << "," << endstr;
  433. else
  434. mOutput << ";" << endstr;
  435. }
  436. mOutput << startstr << "}" << endstr;
  437. }
  438. */
  439. PopTag();
  440. mOutput << startstr << "}" << endstr << endstr;
  441. }
  442. std::string XFileExporter::toXFileString(aiString &name)
  443. {
  444. std::string pref = ""; // node name prefix to prevent unexpected start of string
  445. std::string str = pref + std::string(name.C_Str());
  446. for (int i=0; i < (int) str.length(); ++i)
  447. {
  448. if ((str[i] >= '0' && str[i] <= '9') || // 0-9
  449. (str[i] >= 'A' && str[i] <= 'Z') || // A-Z
  450. (str[i] >= 'a' && str[i] <= 'z')) // a-z
  451. continue;
  452. str[i] = '_';
  453. }
  454. return str;
  455. }
  456. void XFileExporter::writePath(const aiString &path)
  457. {
  458. std::string str = std::string(path.C_Str());
  459. BaseImporter::ConvertUTF8toISO8859_1(str);
  460. while( str.find( "\\\\") != std::string::npos)
  461. str.replace( str.find( "\\\\"), 2, "\\");
  462. while( str.find( "\\") != std::string::npos)
  463. str.replace( str.find( "\\"), 1, "/");
  464. mOutput << str;
  465. }
  466. #endif
  467. #endif