diff --git a/src/XmlMDataXtd/XmlMDataXtd_GeometryDriver.cxx b/src/XmlMDataXtd/XmlMDataXtd_GeometryDriver.cxx index ff170ee9c9..ddd2b221a0 100644 --- a/src/XmlMDataXtd/XmlMDataXtd_GeometryDriver.cxx +++ b/src/XmlMDataXtd/XmlMDataXtd_GeometryDriver.cxx @@ -31,11 +31,14 @@ static Standard_Boolean GeometryTypeEnum IMPLEMENT_DOMSTRING (TypeString, "geomtype") -IMPLEMENT_DOMSTRING (GeomAnyString, "any") -IMPLEMENT_DOMSTRING (GeomPointString, "point") -IMPLEMENT_DOMSTRING (GeomLineString, "line") -IMPLEMENT_DOMSTRING (GeomCircleString, "circle") -IMPLEMENT_DOMSTRING (GeomEllipseString, "ellipse") +IMPLEMENT_DOMSTRING (GeomAnyString, "any") +IMPLEMENT_DOMSTRING (GeomPointString, "point") +IMPLEMENT_DOMSTRING (GeomLineString, "line") +IMPLEMENT_DOMSTRING (GeomCircleString, "circle") +IMPLEMENT_DOMSTRING (GeomEllipseString, "ellipse") +IMPLEMENT_DOMSTRING (GeomSplineString, "slpine") +IMPLEMENT_DOMSTRING (GeomPlaneString, "plane") +IMPLEMENT_DOMSTRING (GeomCylinderString, "cylinder") //======================================================================= //function : XmlMDataXtd_GeometryDriver @@ -110,6 +113,12 @@ static Standard_Boolean GeometryTypeEnum (const XmlObjMgt_DOMString& theString, aResult = TDataXtd_CIRCLE; else if (theString.equals (::GeomEllipseString())) aResult = TDataXtd_ELLIPSE; + else if (theString.equals(::GeomSplineString())) + aResult = TDataXtd_SPLINE; + else if (theString.equals(::GeomPlaneString())) + aResult = TDataXtd_PLANE; + else if (theString.equals(::GeomCylinderString())) + aResult = TDataXtd_CYLINDER; else return Standard_False; } @@ -131,7 +140,10 @@ static const XmlObjMgt_DOMString& GeometryTypeString case TDataXtd_LINE : return ::GeomLineString(); case TDataXtd_CIRCLE : return ::GeomCircleString(); case TDataXtd_ELLIPSE : return ::GeomEllipseString(); - + case TDataXtd_SPLINE : return ::GeomSplineString(); + case TDataXtd_PLANE : return ::GeomPlaneString(); + case TDataXtd_CYLINDER : return ::GeomCylinderString(); + default: throw Standard_DomainError("TDataXtd_GeometryEnum; enum term unknown"); } diff --git a/tests/bugs/caf/bug25536 b/tests/bugs/caf/bug25536 new file mode 100644 index 0000000000..3c182ef8e2 --- /dev/null +++ b/tests/bugs/caf/bug25536 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC25536" +puts "============" +puts "" +####################################################################### +# XmlMDataXtd_GeometryDriver doesn't support TDataXtd_SPLINE, TDataXtd_PLANE and TDataXtd_CYLINDER. +####################################################################### + +NewDocument Doc XmlOcaf + +# set attributes not supported by geometry driver before this issue fix +Label Doc 0:2:1 +SetGeometry Doc 0:2:1 spl +Label Doc 0:2:2 +SetGeometry Doc 0:2:2 pln +Label Doc 0:2:3 +SetGeometry Doc 0:2:3 cyl + +set aFile ${imagedir}/bug25536_test.xml +SaveAs Doc ${aFile} +Close Doc + +# check attributes are correctly restored +Open ${aFile} Doc2 + +set aType [GetGeometryType Doc2 0:2:1] +if {${aType} != "spl"} { + puts "Error: Restored Geometry Type '${aType}' is not stored 'spl'" +} +set aType [GetGeometryType Doc2 0:2:2] +if {${aType} != "pln"} { + puts "Error: Restored Geometry Type '${aType}' is not stored 'pln'" +} +set aType [GetGeometryType Doc2 0:2:3] +if {${aType} != "cyl"} { + puts "Error: Restored Geometry Type '${aType}' is not stored 'cyl'" +} + +Close Doc2 +