0031491: Data Exchange, STEP Import - Regression due to patch 29068
authorika <ika@opencascade.com>
Wed, 16 Sep 2020 12:34:42 +0000 (15:34 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 18 Sep 2020 14:47:02 +0000 (17:47 +0300)
Add parameter read.step.root.transformation to switch on/off using transformation placed in the root shape representation.

src/STEPControl/STEPControl_ActorRead.cxx
src/STEPControl/STEPControl_Controller.cxx
tests/bugs/step/bug31491 [new file with mode: 0644]

index 8beb469..0fb9a2e 100644 (file)
@@ -303,7 +303,8 @@ Handle(Transfer_Binder)  STEPControl_ActorRead::Transfer
     }
   }
   // [END] Get version of preprocessor (to detect I-Deas case) (ssv; 23.11.2010)
-  return TransferShape (start, TP, Standard_True, Standard_True, theProgress);
+  Standard_Boolean aTrsfUse = (Interface_Static::IVal("read.step.root.transformation") == 0);
+  return TransferShape(start, TP, Standard_True, aTrsfUse, theProgress);
 }
 
 
index ba6db15..ec1559e 100644 (file)
@@ -209,6 +209,14 @@ STEPControl_Controller::STEPControl_Controller ()
     Interface_Static::Init("step","read.step.constructivegeom.relationship",'&',"eval ON");
     Interface_Static::SetCVal("read.step.constructivegeom.relationship","OFF");
 
+    // Mode to variate apply or not transformation placed in the root shape representation.
+    // Issues #29068 and #31491.
+    Interface_Static::Init("step", "read.step.root.transformation", 'e', "");
+    Interface_Static::Init("step", "read.step.root.transformation", '&', "enum 0");
+    Interface_Static::Init("step", "read.step.root.transformation", '&', "eval ON");
+    Interface_Static::Init("step", "read.step.root.transformation", '&', "eval OFF");
+    Interface_Static::SetCVal("read.step.root.transformation", "ON");
+
     init = Standard_True;
   }
 
diff --git a/tests/bugs/step/bug31491 b/tests/bugs/step/bug31491
new file mode 100644 (file)
index 0000000..908e2c0
--- /dev/null
@@ -0,0 +1,17 @@
+puts "==================================================================="
+puts "0031491: Data Exchange, STEP Import - Regression due to patch 29068"
+puts "==================================================================="
+puts ""
+
+# Use trsf.
+stepread [locate_data_file bug29068.stp] a *
+# Do not use trsf.
+param read.step.root.transformation OFF
+stepread [locate_data_file bug29068.stp] b *
+
+# Check gravity centers.
+checkgravitycenter a_1 -v 36.7307 -14.513 0.0157913 0.001
+checkgravitycenter b_1 -v 0.0157877 24.5531 -30.934 0.001
+
+# Return default behavior.
+param read.step.root.transformation ON