0028024: Data Exchange - create a convenient mechanism for managing shape healing...
authoratereshi <atereshi@opencascade.com>
Mon, 16 May 2022 13:17:12 +0000 (16:17 +0300)
committersmoskvin <smoskvin@opencascade.com>
Mon, 31 Oct 2022 15:06:02 +0000 (18:06 +0300)
Problem: There is no possibility to change shape healing options from DRAW without rewriting resource file.
Change: Shape healing parameters from STEP and IGES resource files were duplicated to InterfaceStatic. Resource manager initialize from InterfaceStatic if resource file name is empty.
Result: User can operationally change shape healing parameters from DRAW command using "param" command.

14 files changed:
src/IFSelect/IFSelect_Functions.cxx
src/IGESData/IGESData.cxx
src/Interface/Interface_Static.cxx
src/Interface/Interface_Static.hxx
src/Resource/Resource_Manager.cxx
src/Resource/Resource_Manager.hxx
src/STEPControl/STEPControl_Controller.cxx
src/ShapeProcess/ShapeProcess_Context.cxx
src/XSAlgo/XSAlgo_AlgoContainer.cxx
src/XSTEPResource/FILES [changed mode: 0755->0644]
src/XSTEPResource/IGES [changed mode: 0755->0644]
src/XSTEPResource/STEP [changed mode: 0755->0644]
tests/bugs/step/bug28024 [new file with mode: 0644]
tests/bugs/xde/bug6805 [changed mode: 0755->0644]

index 4a89cb7..c044591 100644 (file)
@@ -839,14 +839,38 @@ static IFSelect_ReturnStatus fun27
   Standard_Integer argc = pilot->NbWords();
   Handle(IFSelect_WorkSession) WS = pilot->Session();
   const Standard_CString arg1 = pilot->Arg(1);
-  const Standard_CString arg2 = pilot->Arg(2);
+  Standard_CString arg2 = pilot->Arg(2);
+  const Standard_CString anEmptyStr = "";
+  if (arg2 && strlen(arg2) == 2 && arg2[0] == '"' && arg2[1] == '"')
+  {
+    arg2 = anEmptyStr;
+  }
 //        ****    Param(Value)         ****
   Message_Messenger::StreamBuffer sout = Message::SendInfo();
-  if (argc < 2) {
+  if (argc < 2 || (argc == 3 && strcmp (arg1, "-p") == 0)) {
     Handle(TColStd_HSequenceOfHAsciiString) li = Interface_Static::Items();
-    Standard_Integer i,nb = li->Length();
-    sout<<" List of parameters : "<<nb<<" items : "<<std::endl;
+    Standard_Integer i,nb = li->Length(), aPatternNb = 0;
+    size_t aPatternLen = strlen(arg2);
+    if (argc == 3)
+    {
+      for (i = 1; i <= nb; i ++)
+      {
+        if (strncmp(li->Value(i)->String().ToCString(), arg2, aPatternLen) == 0)
+        {
+          aPatternNb++;
+        }
+      }
+    }
+    else
+    {
+      aPatternNb = nb;
+    }
+    sout << " List of parameters : " << aPatternNb << " items : " << std::endl;
     for (i = 1; i <= nb; i ++) {
+      if (argc == 3 && strncmp(li->Value(i)->String().ToCString(), arg2, aPatternLen) != 0)
+      {
+        continue;
+      }
       sout<<li->Value(i)->String();
       sout<<" : "<<Interface_Static::CVal(li->Value(i)->ToCString())<<std::endl;
     }
@@ -864,7 +888,14 @@ static IFSelect_ReturnStatus fun27
 
     if (argc == 2) sout<<"To modify, param name_param new_val"<<std::endl;
     else {
-      sout<<" New demanded value : "<<arg2;
+      if (strlen(arg2) != 0)
+      {
+        sout<<" New demanded value : "<<arg2;
+      }
+      else
+      {
+        sout<<" New demanded value : not valued";
+      }
       if (Interface_Static::SetCVal (arg1,arg2))
        {  sout<<"   OK"<<std::endl;  return IFSelect_RetDone;  }
       else  {  sout <<" , refused"<<std::endl;  return IFSelect_RetError;  }
@@ -2437,7 +2468,9 @@ void IFSelect_Functions::Init()
   IFSelect_Act::AddFunc("itemlabel","xxx xxx : liste items having this label",fun24);
   IFSelect_Act::AddFunc("xsave","filename:string  : sauve items-session",fun25);
   IFSelect_Act::AddFunc("xrestore","filename:string  : restaure items-session",fun26);
-  IFSelect_Act::AddFunc("param","nompar:string : displays parameter value; + nompar val : changes it",fun27);
+  IFSelect_Act::AddFunc("param","[-p Pattern] - displays all parameters or filtered by pattern;\n"
+                                "par_name - displays parameter;\n"
+                                "par_name par_value - changes parameter's value", fun27);
 
   IFSelect_Act::AddFunc("sentfiles","Lists files sent from last Load",fun29);
   IFSelect_Act::AddFunc("fileprefix","prefix:string    : definit File Prefix",fun30);
index 6263a39..65c6e71 100644 (file)
@@ -90,10 +90,64 @@ static Handle(IGESData_DefaultSpecific)   speci;
   Interface_Static::SetIVal ("write.convertsurface.mode",0);
 
   // abv 15.11.00: ShapeProcessing
-  Interface_Static::Init ("XSTEP","write.iges.resource.name",'t',"IGES");
-  Interface_Static::Init ("XSTEP","read.iges.resource.name",'t',"IGES");
-  Interface_Static::Init ("XSTEP","write.iges.sequence",'t',"ToIGES");
-  Interface_Static::Init ("XSTEP","read.iges.sequence",'t',"FromIGES");
+  Interface_Static::Init ("XSTEP", "write.iges.resource.name",                      't', "IGES");
+  Interface_Static::Init ("XSTEP", "read.iges.resource.name",                       't', "IGES");
+  Interface_Static::Init ("XSTEP", "write.iges.sequence",                           't', "ToIGES");
+  Interface_Static::Init ("XSTEP", "read.iges.sequence",                            't', "FromIGES");
+  Interface_Static::Init ("XSTEP", "ToIGES.exec.op",                                't', "DirectFaces");
+  Interface_Static::Init ("XSTEP", "FromIGES.exec.op",                              't', "FixShape");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.Tolerance3d",                 't', "&Runtime.Tolerance");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.MaxTolerance3d",              't', "&Runtime.MaxTolerance");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.MinTolerance3d",              't', "1.e-7");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFreeShellMode",            't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFreeFaceMode",             't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFreeWireMode",             't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSameParameterMode",        't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSolidMode",                't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixShellOrientationMode",     't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.CreateOpenSolidMode",         't', "1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixShellMode",                't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFaceOrientationMode",      't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFaceMode",                 't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixWireMode",                 't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixOrientationMode",          't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixAddNaturalBoundMode",      't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixMissingSeamMode",          't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSmallAreaWireMode",        't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.RemoveSmallAreaFaceMode",     't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixIntersectingWiresMode",    't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixLoopWiresMode",            't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSplitFaceMode",            't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.AutoCorrectPrecisionMode",    't', "1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.ModifyTopologyMode",          't', "0");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.ModifyGeometryMode",          't', "1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.ClosedWireMode",              't', "1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.PreferencePCurveMode",        't', "1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixReorderMode",              't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSmallMode",                't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixConnectedMode",            't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixEdgeCurvesMode",           't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixDegeneratedMode",          't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixLackingMode",              't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSelfIntersectionMode",     't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.RemoveLoopMode",              't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixReversed2dMode",           't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixRemovePCurveMode",         't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixRemoveCurve3dMode",        't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixAddPCurveMode",            't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixAddCurve3dMode",           't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSeamMode",                 't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixShiftedMode",              't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixEdgeSameParameterMode",    't', "0");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixNotchedEdgesMode",         't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixTailMode",                 't', "0");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.MaxTailAngle",                't', "0.0");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.MaxTailWidth",                't', "-1.0");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSelfIntersectingEdgeMode", 't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixIntersectingEdgesMode",    't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixNonAdjacentIntersectingEdgesMode", 't', "-1");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixVertexPositionMode",       't', "0");
+  Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixVertexToleranceMode",      't', "-1"); 
 
   // sln 11.06.2002 OCC448 : Initialize "read.onlyvisible" parameter to control transferring
   // invisible sub entities which logically depend on the grouping entities
index cbed11b..afa597d 100644 (file)
@@ -407,3 +407,29 @@ Handle(TColStd_HSequenceOfHAsciiString)  Interface_Static::Items
   }
   return list;
 }
+
+//=======================================================================
+// function : FillMap
+// purpose  : Fills given string-to-string map with all static data
+//=======================================================================
+void Interface_Static::FillMap (NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString, TCollection_AsciiString>& theMap)
+{
+  theMap.Clear();
+
+  NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>& aMap = MoniTool_TypedValue::Stats();
+
+  for (NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>::Iterator anIt(aMap); anIt.More(); anIt.Next())
+  {
+    Handle(Interface_Static) aValue = Handle(Interface_Static)::DownCast(anIt.Value());
+    if (aValue.IsNull())
+    {
+      continue;
+    }
+    if (aValue->HStringValue().IsNull())
+    {
+      continue;
+    }
+
+    theMap.Bind (anIt.Key(), aValue->HStringValue()->String());
+  }
+}
index 8c001e0..7069c5f 100644 (file)
@@ -245,8 +245,8 @@ public:
   //! must be defined around it
   Standard_EXPORT static void Standards();
 
-
-
+  //! Fills given string-to-string map with all static data
+  Standard_EXPORT static void FillMap(NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString, TCollection_AsciiString>& theMap);
 
   DEFINE_STANDARD_RTTIEXT(Interface_Static,Interface_TypedValue)
 
index 6d94e9a..01b8ab4 100644 (file)
@@ -128,6 +128,16 @@ Resource_Manager::Resource_Manager(const Standard_CString aName,
     std::cout << "Resource Manager Warning: Environment variable \"CSF_" << aName << "UserDefaults\" not set." << std::endl;
 }
 
+// =======================================================================
+// function : Resource_Manager
+// purpose  :
+// =======================================================================
+Resource_Manager::Resource_Manager()
+  : myName(""), myVerbose(Standard_False)
+{
+
+}
+
 // =======================================================================
 // function : Load
 // purpose  :
@@ -538,3 +548,12 @@ void Resource_Manager::GetResourcePath (TCollection_AsciiString& aPath, const St
 
   anOSDPath.SystemName(aPath);
 }
+
+//=======================================================================
+// function : GetMap
+// purpose  :
+//=======================================================================
+Resource_DataMapOfAsciiStringAsciiString& Resource_Manager::GetMap(Standard_Boolean theRefMap)
+{
+  return theRefMap ? myRefMap : myUserMap;
+}
index 7697ad2..64bf32a 100644 (file)
@@ -54,6 +54,9 @@ public:
   //! syntax of an individual resource line is:
   Standard_EXPORT Resource_Manager(const Standard_CString aName, const Standard_Boolean Verbose = Standard_False);
 
+  //! Create an empty Resource manager
+  Standard_EXPORT Resource_Manager();
+
   //! Create a Resource manager.
   //! @param theName [in] description file name
   //! @param theDefaultsDirectory  [in] default folder for looking description file
@@ -112,6 +115,9 @@ public:
   //! or file doesn't exist returns empty string.
   Standard_EXPORT static void GetResourcePath (TCollection_AsciiString& aPath, const Standard_CString aName, const Standard_Boolean isUserDefaults);
 
+  //! Returns internal Ref or User map with parameters 
+  Standard_EXPORT Resource_DataMapOfAsciiStringAsciiString& GetMap(Standard_Boolean theRefMap = Standard_True);
+  
 private:
 
   Standard_EXPORT void Load (const TCollection_AsciiString& thePath,
index 2408e2c..1970fff 100644 (file)
@@ -179,12 +179,66 @@ STEPControl_Controller::STEPControl_Controller ()
     Interface_Static::Init ("step","write.step.vertex.mode",'&',"eval One Compound");
     Interface_Static::Init ("step","write.step.vertex.mode",'&',"eval Single Vertex");
     Interface_Static::SetIVal("write.step.vertex.mode",0);
-  
+
     // abv 15.11.00: ShapeProcessing
-    Interface_Static::Init ("XSTEP","write.step.resource.name",'t',"STEP");
-    Interface_Static::Init ("XSTEP","read.step.resource.name",'t',"STEP");
-    Interface_Static::Init ("XSTEP","write.step.sequence",'t',"ToSTEP");
-    Interface_Static::Init ("XSTEP","read.step.sequence",'t',"FromSTEP");
+    Interface_Static::Init ("XSTEP", "write.step.resource.name",                      't', "STEP");
+    Interface_Static::Init ("XSTEP", "read.step.resource.name",                       't', "STEP");
+    Interface_Static::Init ("XSTEP", "write.step.sequence",                           't', "ToSTEP");
+    Interface_Static::Init ("XSTEP", "read.step.sequence",                            't', "FromSTEP");
+    Interface_Static::Init ("XSTEP", "ToSTEP.exec.op",                                't', "SplitCommonVertex,DirectFaces");
+    Interface_Static::Init ("XSTEP", "FromSTEP.exec.op",                              't', "FixShape");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.Tolerance3d",                 't', "&Runtime.Tolerance");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.MaxTolerance3d",              't', "&Runtime.MaxTolerance");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.MinTolerance3d",              't', "1.e-7");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFreeShellMode",            't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFreeFaceMode",             't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFreeWireMode",             't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSameParameterMode",        't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSolidMode",                't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixShellOrientationMode",     't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.CreateOpenSolidMode",         't', "0");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixShellMode",                't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFaceOrientationMode",      't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFaceMode",                 't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixWireMode",                 't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixOrientationMode",          't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixAddNaturalBoundMode",      't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixMissingSeamMode",          't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSmallAreaWireMode",        't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.RemoveSmallAreaFaceMode",     't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixIntersectingWiresMode",    't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixLoopWiresMode",            't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSplitFaceMode",            't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.AutoCorrectPrecisionMode",    't', "1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.ModifyTopologyMode",          't', "0");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.ModifyGeometryMode",          't', "1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.ClosedWireMode",              't', "1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.PreferencePCurveMode",        't', "1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixReorderMode",              't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSmallMode",                't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixConnectedMode",            't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixEdgeCurvesMode",           't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixDegeneratedMode",          't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixLackingMode",              't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSelfIntersectionMode",     't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.RemoveLoopMode",              't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixReversed2dMode",           't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixRemovePCurveMode",         't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixRemoveCurve3dMode",        't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixAddPCurveMode",            't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixAddCurve3dMode",           't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSeamMode",                 't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixShiftedMode",              't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixEdgeSameParameterMode",    't', "0");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixNotchedEdgesMode",         't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixTailMode",                 't', "0");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.MaxTailAngle",                't', "0.0");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.MaxTailWidth",                't', "-1.0");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSelfIntersectingEdgeMode", 't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixIntersectingEdgesMode",    't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixNonAdjacentIntersectingEdgesMode", 't', "-1");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixVertexPositionMode",       't', "0");
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixVertexToleranceMode",      't', "-1"); 
 
     // ika 28.07.16: Parameter to read all top level solids and shells,
     // should be used only in case of invalid shape_representation without links to shapes.
index 7bce894..1e9d891 100644 (file)
@@ -62,7 +62,14 @@ Standard_Boolean ShapeProcess_Context::Init (const Standard_CString file,
                                              const Standard_CString scope)
 {
   myScope.Nullify();
-  myRC = LoadResourceManager ( file ); 
+  if (file != nullptr && strlen (file) != 0)
+  {
+    myRC = LoadResourceManager ( file ); 
+  }
+  else
+  {
+    myRC = new Resource_Manager();
+  }
   if ( scope && scope[0] ) {
     SetScope ( scope );
   }
index ab91acd..6f3ccb3 100644 (file)
@@ -100,9 +100,17 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
   if ( context.IsNull() )
   {
     Standard_CString rscfile = Interface_Static::CVal(prscfile);
-    if (!rscfile)
-      rscfile = prscfile;
-    context = new ShapeProcess_ShapeContext(shape, rscfile);
+    if (rscfile != nullptr && strlen (rscfile) == 0)
+    {
+      context = new ShapeProcess_ShapeContext(shape, nullptr);
+      Interface_Static::FillMap(context->ResourceManager()->GetMap());
+    }
+    else
+    {
+      if (!rscfile)
+        rscfile = prscfile;
+      context = new ShapeProcess_ShapeContext(shape, rscfile);
+    }
     context->SetDetalisation(TopAbs_EDGE);
   }
   context->SetNonManifold(NonManifold);
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/tests/bugs/step/bug28024 b/tests/bugs/step/bug28024
new file mode 100644 (file)
index 0000000..45df53c
--- /dev/null
@@ -0,0 +1,47 @@
+puts "============"
+puts "OCC28024 Data Exchange, Configuration - revise XSTEPResource initialization"
+puts "============"
+puts ""
+#####################################################
+# Testing the mechanism for changing options of ShapeHealing
+# from DRAW
+#####################################################
+
+pload MODELING XDE
+
+if { [info exists imagedir] == 0 } {
+   set imagedir ../bug28024
+   if {![file exists ${imagedir}]} {
+       file mkdir ${imagedir}
+   }
+}
+set step_file ${imagedir}/inv_triangle.stp
+
+# Make simple triangle with INNER wire
+vertex v1 0 0 0
+vertex v2 1 0 0
+vertex v3 0 1 0
+edge e1 v2 v1
+edge e2 v3 v2
+edge e3 v1 v3
+wire w1 e1 e3 e2
+plane p1
+mkface f1 p1 w1 norient
+
+# Save to STEP
+testwritestep ${step_file} f1
+
+# Empty resource file name to take params from InterfaceStatic
+param "read.step.resource.name" "\"\""
+# Turn off FixOrientation procedure
+param "FromSTEP.FixShape.FixOrientationMode" 0
+
+# Read from STEP without shape healing
+stepread ${step_file} r *
+explode r_1 f
+
+# The area of triangle must be negative
+checkarea r_1_1 -0.5 1e-6 0.001
+
+param "read.step.resource.name" "STEP"
+param "FromSTEP.FixShape.FixOrientationMode" -1
old mode 100755 (executable)
new mode 100644 (file)