From: gka Date: Wed, 2 Aug 2017 08:36:05 +0000 (+0300) Subject: 0029270: Added possibility to load in the STEP model a few step files. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=655a2bda621ca92faa6c2bc49361596ad95aa702;p=occt-copy.git 0029270: Added possibility to load in the STEP model a few step files. 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. --- diff --git a/src/IFSelect/IFSelect_WorkSession.cxx b/src/IFSelect/IFSelect_WorkSession.cxx index e7992db1ba..45158f5aaf 100644 --- a/src/IFSelect/IFSelect_WorkSession.cxx +++ b/src/IFSelect/IFSelect_WorkSession.cxx @@ -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(); diff --git a/src/StepSelect/StepSelect_WorkLibrary.cxx b/src/StepSelect/StepSelect_WorkLibrary.cxx index 03f303c647..e3a27a7cef 100644 --- a/src/StepSelect/StepSelect_WorkLibrary.cxx +++ b/src/StepSelect/StepSelect_WorkLibrary.cxx @@ -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);