diff --git a/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx b/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx index 33231a1e4e..c17b776579 100644 --- a/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx +++ b/src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx @@ -34,6 +34,7 @@ #include #include #include +#include IMPLEMENT_STANDARD_RTTIEXT (StdLDrivers_DocumentRetrievalDriver, PCDM_RetrievalDriver) @@ -142,6 +143,14 @@ Handle(StdObjMgt_Persistent) StdLDrivers_DocumentRetrievalDriver::read ( aCurTypeName = aTypeData.Type (i); aCurTypeNum = aTypeData.Type (aCurTypeName); + TCollection_AsciiString newName; + if (Storage_Schema::CheckTypeMigration(aCurTypeName, newName)) { +#ifdef OCCT_DEBUG + std::cout << "CheckTypeMigration:OldType = " << aCurTypeName << " Len = " << aCurTypeNum << std::endl; + std::cout << "CheckTypeMigration:NewType = " << newName << " Len = " << newName.Length() << std::endl; +#endif + aCurTypeName = newName; + } StdObjMgt_Persistent::Instantiator anInstantiator; if (aMapOfInst.Find(aCurTypeName, anInstantiator)) anInstantiators (aCurTypeNum) = anInstantiator; diff --git a/src/StdResource/MigrationSheet.txt b/src/StdResource/MigrationSheet.txt index bb963ee94d..0a215a7421 100644 --- a/src/StdResource/MigrationSheet.txt +++ b/src/StdResource/MigrationSheet.txt @@ -8,5 +8,14 @@ TDataStd_Position TDataXtd_Position TDataStd_Placement TDataXtd_Placement TDataStd_PatternStd TDataXtd_PatternStd TPrsStd_AISPresentation TDataXtd_Presentation +PDataStd_Shape PDataXtd_Shape +PDataStd_Constraint PDataXtd_Constraint +PDataStd_Geometry PDataXtd_Geometry +PDataStd_Axis PDataXtd_Axis +PDataStd_Point PDataXtd_Point +PDataStd_Plane PDataXtd_Plane +PDataStd_Position PDataXtd_Position +PDataStd_Placement PDataXtd_Placement +PDataStd_PatternStd PDataXtd_PatternStd diff --git a/src/Storage/Storage_Schema.cxx b/src/Storage/Storage_Schema.cxx index c1740ceb4e..16f03a1024 100644 --- a/src/Storage/Storage_Schema.cxx +++ b/src/Storage/Storage_Schema.cxx @@ -773,17 +773,26 @@ Standard_Boolean Storage_Schema::CheckTypeMigration( } else { - // hard-code migration table for known types - aDMap.Bind("TDataStd_Shape", "TDataXtd_Shape"); - aDMap.Bind("TDataStd_Constraint", "TDataXtd_Constraint"); + // hard-code migration table for known types + aDMap.Bind("TDataStd_Shape", "TDataXtd_Shape"); + aDMap.Bind("TDataStd_Constraint", "TDataXtd_Constraint"); aDMap.Bind("TDataStd_Geometry", "TDataXtd_Geometry"); - aDMap.Bind("TDataStd_Axis", "TDataXtd_Axis"); - aDMap.Bind("TDataStd_Point", "TDataXtd_Point"); - aDMap.Bind("TDataStd_Plane", "TDataXtd_Plane"); - aDMap.Bind("TDataStd_Position", "TDataXtd_Position"); - aDMap.Bind("TDataStd_Placement", "TDataXtd_Placement"); - aDMap.Bind("TDataStd_PatternStd", "TDataXtd_PatternStd"); - aDMap.Bind("TPrsStd_AISPresentation", "TDataXtd_Presentation"); + aDMap.Bind("TDataStd_Axis", "TDataXtd_Axis"); + aDMap.Bind("TDataStd_Point", "TDataXtd_Point"); + aDMap.Bind("TDataStd_Plane", "TDataXtd_Plane"); + aDMap.Bind("TDataStd_Position", "TDataXtd_Position"); + aDMap.Bind("TDataStd_Placement", "TDataXtd_Placement"); + aDMap.Bind("TDataStd_PatternStd", "TDataXtd_PatternStd"); + aDMap.Bind("TPrsStd_AISPresentation", "TDataXtd_Presentation"); + aDMap.Bind("PDataStd_Shape", "PDataXtd_Shape"); + aDMap.Bind("PDataStd_Constraint", "PDataXtd_Constraint"); + aDMap.Bind("PDataStd_Geometry", "PDataXtd_Geometry"); + aDMap.Bind("PDataStd_Axis", "PDataXtd_Axis"); + aDMap.Bind("PDataStd_Point", "PDataXtd_Point"); + aDMap.Bind("PDataStd_Plane", "PDataXtd_Plane"); + aDMap.Bind("PDataStd_Position", "PDataXtd_Position"); + aDMap.Bind("PDataStd_Placement", "PDataXtd_Placement"); + aDMap.Bind("PDataStd_PatternStd", "PDataXtd_PatternStd"); } #ifdef OCCT_DEBUG std::cout << "Storage_Sheme:: aDataMap.Size = " << aDMap.Extent() << std::endl; diff --git a/tests/bugs/caf/bug31049 b/tests/bugs/caf/bug31049 new file mode 100644 index 0000000000..072b0046d5 --- /dev/null +++ b/tests/bugs/caf/bug31049 @@ -0,0 +1,20 @@ +puts "==================================================================================" +puts "0031049: OCAF document can't be opened, Type not found or Unrecognized File Format" +puts "==================================================================================" +puts "" + +Open [locate_data_file bug31049_Npr.std] D +GetPoint D 0:1:2:1:18:1:1:1:1:1:1:1:1:1:1:1:2:5 p1 +set info [dump p1] +##*********** Dump of p1 ************* +##Point : 2.136843869657140e+03, -3.636437663372889e+02, 9.822340087890625e+02 + +GetPoint D 0:1:2:1:18:1:1:1:1:1:1:1:1:1:1:3:2:5 p3 +set info3 [dump p3] +##*********** Dump of p3 ************* +##Point : 2.136843869657140e+03, -3.606482046100116e+02, 9.822340087890625e+02 + +if {[regexp "Point" $info] != 1 } {puts "Error : There is no Point attribute at the specified label 0:1:2:1:18:1:1:1:1:1:1:1:1:1:1:1:2:5" +} elseif { [regexp "Point" $info3] != 1 } {puts "Error : There is no Point attribute at the specified label 0:1:2:1:18:1:1:1:1:1:1:1:1:1:1:3:2:5" +} else {puts "Bug31049 : OK"; Close D} +