Salome HOME
Customize behavior of RestoreShape() function - to optionally suppress its dumping...
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IInsertOperations.cxx
index 6b12c9bf2efa71826ffed4578e29ec2e4d024dea..8da09ad37d9c11d115763ee844412dd35e68bdd2 100644 (file)
@@ -235,8 +235,15 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::RestoreShape (std::istringstream
   //See correcponding code in GEOM_Engine.cxx (method ProcessFunction)
   //GEOM::TPythonDump(aFunction) << "#";
 
-  GEOM::TPythonDump(aFunction) << result
+  bool ignore = false;
+
+  if ( const char* env_var = getenv( "GEOM_IGNORE_RESTORE_SHAPE" ) )
+    ignore = atoi( env_var ) > 1;
+
+  if ( !ignore ) {
+    GEOM::TPythonDump(aFunction) << result
     << " = geompy.RestoreShape(\"\") # the shape string has not been dump for performance reason";
+  }
 
   SetErrorCode(OK);