mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0030280: Data Exchange - broken VRML output due to unescaped symbols starting comment block
This commit is contained in:
@@ -262,11 +262,14 @@ void VrmlData_ShapeConvert::Convert (const Standard_Boolean theExtractFaces,
|
|||||||
myRelMap = NCollection_DataMap <TopoDS_Shape, Handle(VrmlData_Geometry)>(100, anAlloc);
|
myRelMap = NCollection_DataMap <TopoDS_Shape, Handle(VrmlData_Geometry)>(100, anAlloc);
|
||||||
|
|
||||||
NCollection_List<ShapeData>::Iterator anIter (myShapes);
|
NCollection_List<ShapeData>::Iterator anIter (myShapes);
|
||||||
for (; anIter.More(); anIter.Next()) {
|
for (; anIter.More(); anIter.Next())
|
||||||
|
{
|
||||||
ShapeData& aData = anIter.ChangeValue();
|
ShapeData& aData = anIter.ChangeValue();
|
||||||
|
TCollection_AsciiString aGrName = aData.Name;
|
||||||
|
aGrName.ChangeAll(' ', '_');
|
||||||
|
aGrName.ChangeAll('#', '_');
|
||||||
Handle(VrmlData_Group) aGroup =
|
Handle(VrmlData_Group) aGroup =
|
||||||
new VrmlData_Group (myScene, aData.Name.ToCString());
|
new VrmlData_Group (myScene, aGrName.ToCString());
|
||||||
myScene.AddNode (aGroup);
|
myScene.AddNode (aGroup);
|
||||||
|
|
||||||
for(i = 0; i < 2; ++i) {
|
for(i = 0; i < 2; ++i) {
|
||||||
@@ -622,6 +625,8 @@ void VrmlData_ShapeConvert::addShape (const Handle(VrmlData_Group)& theParent,
|
|||||||
if (!aNameAttribute.IsNull())
|
if (!aNameAttribute.IsNull())
|
||||||
{
|
{
|
||||||
TCollection_AsciiString aName = aNameAttribute->Get();
|
TCollection_AsciiString aName = aNameAttribute->Get();
|
||||||
|
aName.ChangeAll(' ', '_');
|
||||||
|
aName.ChangeAll('#', '_');
|
||||||
aGroup = new VrmlData_Group(myScene, aName.ToCString());
|
aGroup = new VrmlData_Group(myScene, aName.ToCString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -647,6 +652,7 @@ void VrmlData_ShapeConvert::addShape (const Handle(VrmlData_Group)& theParent,
|
|||||||
{
|
{
|
||||||
TCollection_AsciiString aName = aNameAttribute->Get();
|
TCollection_AsciiString aName = aNameAttribute->Get();
|
||||||
aName.ChangeAll(' ', '_');
|
aName.ChangeAll(' ', '_');
|
||||||
|
aName.ChangeAll('#', '_');
|
||||||
aShapeNode = new VrmlData_ShapeNode(myScene, aName.ToCString());
|
aShapeNode = new VrmlData_ShapeNode(myScene, aName.ToCString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -785,6 +791,8 @@ void VrmlData_ShapeConvert::addAssembly (const Handle(VrmlData_Group)& theParent
|
|||||||
if (!aNameAttribute.IsNull())
|
if (!aNameAttribute.IsNull())
|
||||||
{
|
{
|
||||||
TCollection_AsciiString aName = aNameAttribute->Get();
|
TCollection_AsciiString aName = aNameAttribute->Get();
|
||||||
|
aName.ChangeAll(' ', '_');
|
||||||
|
aName.ChangeAll('#', '_');
|
||||||
anAssembly = new VrmlData_Group(myScene, aName.ToCString());
|
anAssembly = new VrmlData_Group(myScene, aName.ToCString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
16
tests/bugs/xde/bug30280
Normal file
16
tests/bugs/xde/bug30280
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
puts "========="
|
||||||
|
puts "OCC30280"
|
||||||
|
puts "========="
|
||||||
|
puts ""
|
||||||
|
######################################################################################
|
||||||
|
# Data Exchange - broken VRML output due to unescaped symbols starting comment block
|
||||||
|
######################################################################################
|
||||||
|
|
||||||
|
set filename bug30280_vmt02
|
||||||
|
XOpen [locate_data_file $filename.xbf] D
|
||||||
|
|
||||||
|
file delete -force ${imagedir}/$filename.wrl
|
||||||
|
WriteVrml D ${imagedir}/$filename.wrl
|
||||||
|
loadvrml a ${imagedir}/$filename.wrl
|
||||||
|
|
||||||
|
checkview -display a -3d -path ${imagedir}/${test_image}.png
|
Reference in New Issue
Block a user