From b569f2a3baa7445b553f435874b4f770f0ce4f5c Mon Sep 17 00:00:00 2001 From: vro Date: Thu, 12 Sep 2013 14:12:08 +0400 Subject: [PATCH] 0024115: A draw-command loadvrml fails on non-current folder A folder is taken from the input file name (if it contains one). Removed spaces. Adding test case for issue CR23846 The test for bug 23846 depends on this fix (24115) and the source files of 23846. Therefore the test on 23846 shouldn't participate in the test for 24115. --- src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx index d7b95da3d5..1fc7e3e30a 100755 --- a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx +++ b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx @@ -160,9 +160,24 @@ static Standard_Integer loadvrml if (fic.open(argv[2], ios::in)) { + // Get path of the VRML file. + OSD_Path path(argv[2]); + TCollection_AsciiString vrmlDir("."); + TCollection_AsciiString disk = path.Disk(); + TCollection_AsciiString trek = path.Trek(); + if (!trek.IsEmpty()) + { + if (!disk.IsEmpty()) + vrmlDir = disk; + else + vrmlDir.Clear(); + trek.ChangeAll('|', '/'); + vrmlDir += trek; + } + VrmlData_Scene aScene; - aScene.SetVrmlDir ("."); + aScene.SetVrmlDir (vrmlDir); aScene << aStream; const char * aStr = 0L; switch (aScene.Status()) {