2
0

XFileExporter.cpp 18 KB

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