]> OCCT Git - occt-copy.git/commitdiff
0029270: Added possibility to load in the STEP model a few step files. CR29270_1
authorgka <gka@opencascade.com>
Wed, 2 Aug 2017 08:36:05 +0000 (11:36 +0300)
committergka <gka@opencascade.com>
Thu, 12 Sep 2019 07:51:24 +0000 (10:51 +0300)
if in the method  XSControl_Reader::SetWS(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch) flag scratch is equal to false then entities from loaded step files were added in the existing STEP model.

src/IFSelect/IFSelect_WorkSession.cxx
src/StepSelect/StepSelect_WorkLibrary.cxx

index e7992db1ba837229ce037218d61b894303764bc1..45158f5aafc9ba9e7f1419776e089e8dcf485cdc 100644 (file)
@@ -212,7 +212,7 @@ IFSelect_ReturnStatus  IFSelect_WorkSession::ReadFile
 {
   if (thelibrary.IsNull()) return IFSelect_RetVoid;
   if (theprotocol.IsNull()) return IFSelect_RetVoid;
-  Handle(Interface_InterfaceModel) model;
+  Handle(Interface_InterfaceModel) model =myModel;
   IFSelect_ReturnStatus status = IFSelect_RetVoid;
   try {
     OCC_CATCH_SIGNALS
@@ -1701,11 +1701,12 @@ Standard_Integer IFSelect_WorkSession::RunTransformer
 {
   Standard_Integer effect = 0;
   if (transf.IsNull() || !IsLoaded()) return effect;
+  
   Handle(Interface_InterfaceModel) newmod;    // Null au depart
   Interface_CheckIterator checks;
   checks.SetName("X-STEP WorkSession : RunTransformer");
   Standard_Boolean res = transf->Perform
-    (thegraph->Graph(),theprotocol,checks,newmod);
+    (thegraph->Graph(),theprotocol,checks,myModel);
 
   if (!checks.IsEmpty(Standard_False)) {
     Handle(Message_Messenger) sout = Message::DefaultMessenger();
index 03f303c647a63d71881e03c794c11870ba71727b..e3a27a7ceff759c48c24bd6fc2e3b6a5bf9dd514 100644 (file)
@@ -70,8 +70,16 @@ Standard_Integer  StepSelect_WorkLibrary::ReadFile
   long status = 1;
   DeclareAndCast(StepData_Protocol,stepro,protocol);
   if (stepro.IsNull()) return 1;
-  Handle(StepData_StepModel) stepmodel  = new StepData_StepModel;
-  model  = stepmodel;
+   
+  Handle(StepData_StepModel) stepmodel;
+  if(!model.IsNull())
+    stepmodel = Handle(StepData_StepModel)::DownCast(model);
+  if(stepmodel.IsNull())
+  {
+    stepmodel  = new StepData_StepModel;
+    model = stepmodel;
+  }
   StepFile_ReadTrace (0);
   char *pName=(char *)name;
   status = StepFile_Read (pName,stepmodel,stepro);