From 2a278ae90b049ba5ef8917d61ff53ffc04ed574c Mon Sep 17 00:00:00 2001 From: szv Date: Fri, 25 Nov 2016 14:26:59 +0300 Subject: [PATCH] Additional commit --- .../APIHeaderSection_MakeHeader.cxx | 2 +- src/HeaderSection/FILES | 2 - src/HeaderSection/HeaderSection.cxx | 8 +- .../HeaderSection_HeaderRecognizer.cxx | 51 -- .../HeaderSection_HeaderRecognizer.hxx | 66 --- src/IFGraph/IFGraph_AllShared.cxx | 1 - src/IFGraph/IFGraph_Cumulate.cxx | 2 - src/IFSelect/IFSelect_WorkSession.cxx | 6 +- src/IGESAppli/IGESAppli_Protocol.cxx | 7 +- src/IGESBasic/IGESBasic_Protocol.cxx | 3 +- src/IGESControl/IGESControl_Writer.cxx | 215 +++++++-- src/IGESControl/IGESControl_Writer.hxx | 39 +- src/IGESData/FILES | 2 - src/IGESData/IGESData.cxx | 103 ++++- src/IGESData/IGESData.hxx | 22 + src/IGESData/IGESData_BasicEditor.cxx | 436 ------------------ src/IGESData/IGESData_BasicEditor.hxx | 163 ------- .../IGESData_GlobalNodeOfSpecificLib.hxx | 8 +- .../IGESData_GlobalNodeOfSpecificLib_0.cxx | 14 - .../IGESData_GlobalNodeOfWriterLib.hxx | 8 +- .../IGESData_GlobalNodeOfWriterLib_0.cxx | 14 - src/IGESData/IGESData_GlobalSection.cxx | 4 +- src/IGESData/IGESData_IGESModel.cxx | 47 +- src/IGESData/IGESData_IGESModel.hxx | 15 +- src/IGESData/IGESData_IGESReaderTool.cxx | 7 - src/IGESData/IGESData_IGESReaderTool.hxx | 32 +- src/IGESData/IGESData_NodeOfSpecificLib.hxx | 4 +- src/IGESData/IGESData_NodeOfSpecificLib_0.cxx | 14 - src/IGESData/IGESData_NodeOfWriterLib.hxx | 4 +- src/IGESData/IGESData_NodeOfWriterLib_0.cxx | 14 - src/IGESData/IGESData_Protocol.cxx | 10 - src/IGESData/IGESData_Protocol.hxx | 12 +- src/IGESData/IGESData_SpecificLib.hxx | 15 +- src/IGESData/IGESData_SpecificLib_0.cxx | 6 - src/IGESData/IGESData_WriterLib.hxx | 15 +- src/IGESData/IGESData_WriterLib_0.cxx | 6 - src/IGESDefs/IGESDefs_Protocol.cxx | 3 +- src/IGESDimen/IGESDimen_Protocol.cxx | 7 +- src/IGESDraw/IGESDraw_Protocol.cxx | 3 +- src/IGESFile/IGESFile_Read.cxx | 1 - src/IGESGeom/IGESGeom_Protocol.cxx | 3 +- src/IGESGraph/IGESGraph_Protocol.cxx | 3 +- src/IGESSolid/IGESSolid_Protocol.cxx | 3 +- src/Interface/Interface_CopyTool.cxx | 33 -- src/Interface/Interface_CopyTool.hxx | 8 - src/Interface/Interface_FileReaderTool.cxx | 290 +++--------- src/Interface/Interface_FileReaderTool.hxx | 124 ++--- src/Interface/Interface_GTool.cxx | 16 - src/Interface/Interface_GTool.hxx | 18 +- src/Interface/Interface_GeneralLib.hxx | 8 +- src/Interface/Interface_GeneralLib_0.cxx | 4 - .../Interface_GlobalNodeOfGeneralLib_0.cxx | 14 - .../Interface_GlobalNodeOfReaderLib_0.cxx | 14 - src/Interface/Interface_Graph.cxx | 2 +- src/Interface/Interface_Graph.hxx | 1 - src/Interface/Interface_InterfaceModel.cxx | 32 +- src/Interface/Interface_InterfaceModel.hxx | 18 +- .../Interface_NodeOfGeneralLib_0.cxx | 13 - src/Interface/Interface_NodeOfReaderLib_0.cxx | 14 - src/Interface/Interface_Protocol.cxx | 41 +- src/Interface/Interface_Protocol.hxx | 39 +- src/Interface/Interface_ReaderLib.hxx | 7 +- src/Interface/Interface_ReaderLib_0.cxx | 5 - src/Interface/Interface_ReaderModule.cxx | 5 - src/Interface/Interface_ReaderModule.hxx | 28 +- src/Interface/Interface_ShareFlags.cxx | 2 +- src/Interface/Interface_ShareTool.cxx | 1 - src/LibCtl/LibCtl_GlobalNode.gxx | 7 +- src/LibCtl/LibCtl_Library.gxx | 39 +- src/LibCtl/LibCtl_Node.gxx | 5 +- src/RWHeaderSection/RWHeaderSection.cxx | 3 +- .../RWHeaderSection_ReadWriteModule.cxx | 7 +- .../RWStepAP214_ReadWriteModule.cxx | 4 - .../STEPSelections_SelectDerived.cxx | 4 - .../STEPSelections_SelectDerived.hxx | 34 +- src/ShapeAnalysis/ShapeAnalysis_Geom.cxx | 91 ++-- src/StepData/FILES | 8 - src/StepData/StepData.cxx | 20 - src/StepData/StepData.hxx | 3 - src/StepData/StepData_DefaultGeneral.cxx | 82 ---- src/StepData/StepData_DefaultGeneral.hxx | 85 ---- src/StepData/StepData_DescrGeneral.cxx | 62 --- src/StepData/StepData_DescrGeneral.hxx | 78 ---- src/StepData/StepData_DescrReadWrite.cxx | 143 ------ src/StepData/StepData_DescrReadWrite.hxx | 85 ---- src/StepData/StepData_FileRecognizer.hxx | 100 ---- src/StepData/StepData_FileRecognizer_0.cxx | 44 -- src/StepData/StepData_GeneralModule.cxx | 8 +- src/StepData/StepData_GeneralModule.hxx | 33 +- .../StepData_GlobalNodeOfWriterLib.hxx | 8 +- .../StepData_GlobalNodeOfWriterLib_0.cxx | 14 - src/StepData/StepData_NodeOfWriterLib.hxx | 4 +- src/StepData/StepData_NodeOfWriterLib_0.cxx | 14 +- src/StepData/StepData_Protocol.cxx | 18 - src/StepData/StepData_Protocol.hxx | 13 +- src/StepData/StepData_StepModel.cxx | 19 - src/StepData/StepData_StepModel.hxx | 6 - src/StepData/StepData_StepReaderTool.cxx | 101 ++-- src/StepData/StepData_StepReaderTool.hxx | 59 +-- src/StepData/StepData_WriterLib.hxx | 40 +- src/StepData/StepData_WriterLib_0.cxx | 4 - src/StepFile/StepFile_Read.cxx | 51 +- src/StepFile/StepFile_Read.hxx | 14 - src/StepSelect/StepSelect_StepType.cxx | 21 +- src/StepSelect/StepSelect_StepType.hxx | 30 +- src/XSControl/XSControl_WorkSession.cxx | 84 ++-- src/XSControl/XSControl_WorkSession.hxx | 2 - src/XSDRAWIGES/XSDRAWIGES.cxx | 1 - src/XSDRAWSTEP/XSDRAWSTEP.cxx | 5 - 109 files changed, 715 insertions(+), 2875 deletions(-) delete mode 100644 src/HeaderSection/HeaderSection_HeaderRecognizer.cxx delete mode 100644 src/HeaderSection/HeaderSection_HeaderRecognizer.hxx delete mode 100644 src/IGESData/IGESData_BasicEditor.cxx delete mode 100644 src/IGESData/IGESData_BasicEditor.hxx delete mode 100644 src/StepData/StepData_DefaultGeneral.cxx delete mode 100644 src/StepData/StepData_DefaultGeneral.hxx delete mode 100644 src/StepData/StepData_DescrGeneral.cxx delete mode 100644 src/StepData/StepData_DescrGeneral.hxx delete mode 100644 src/StepData/StepData_DescrReadWrite.cxx delete mode 100644 src/StepData/StepData_DescrReadWrite.hxx delete mode 100644 src/StepData/StepData_FileRecognizer.hxx delete mode 100644 src/StepData/StepData_FileRecognizer_0.cxx diff --git a/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx b/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx index 1ce12440d2..e616e19a1c 100644 --- a/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx +++ b/src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx @@ -182,7 +182,7 @@ Handle(StepData_StepModel) APIHeaderSection_MakeHeader::NewModel (const Handle(Interface_Protocol)& protocol) const { Handle(StepData_StepModel) stepmodel = new StepData_StepModel; - stepmodel->SetProtocol (protocol); + stepmodel->SetProtocol(protocol); // - Make Header information diff --git a/src/HeaderSection/FILES b/src/HeaderSection/FILES index 38178e8905..4949ebd272 100644 --- a/src/HeaderSection/FILES +++ b/src/HeaderSection/FILES @@ -6,7 +6,5 @@ HeaderSection_FileName.cxx HeaderSection_FileName.hxx HeaderSection_FileSchema.cxx HeaderSection_FileSchema.hxx -HeaderSection_HeaderRecognizer.cxx -HeaderSection_HeaderRecognizer.hxx HeaderSection_Protocol.cxx HeaderSection_Protocol.hxx diff --git a/src/HeaderSection/HeaderSection.cxx b/src/HeaderSection/HeaderSection.cxx index 4badc17f53..a3de1d2c3c 100644 --- a/src/HeaderSection/HeaderSection.cxx +++ b/src/HeaderSection/HeaderSection.cxx @@ -15,12 +15,10 @@ #include #include -//szv_c1:StaticHandle(HeaderSection_Protocol, proto); -static Handle(HeaderSection_Protocol) proto; - const Handle(HeaderSection_Protocol) & HeaderSection::Protocol() { - //szv_c1:InitHandleVoid(HeaderSection_Protocol, proto) - if (proto.IsNull()) proto = new HeaderSection_Protocol; + static Handle(HeaderSection_Protocol) proto; + if (proto.IsNull()) + proto = new HeaderSection_Protocol; return proto; } diff --git a/src/HeaderSection/HeaderSection_HeaderRecognizer.cxx b/src/HeaderSection/HeaderSection_HeaderRecognizer.cxx deleted file mode 100644 index 47e6ce8ad4..0000000000 --- a/src/HeaderSection/HeaderSection_HeaderRecognizer.cxx +++ /dev/null @@ -1,51 +0,0 @@ -// Created on: 1994-06-27 -// Created by: Frederic MAUPAS -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer) - -static TCollection_AsciiString reco_FileName ("FILE_NAME"); -static TCollection_AsciiString reco_FileSchema ("FILE_SCHEMA"); -static TCollection_AsciiString reco_FileDescription ("FILE_DESCRIPTION"); - - - -HeaderSection_HeaderRecognizer::HeaderSection_HeaderRecognizer () -{ } - -void HeaderSection_HeaderRecognizer::Eval - (const TCollection_AsciiString& key) -{ - if (key.IsEqual(reco_FileName)) { - SetOK(new HeaderSection_FileName); - return; - } - if (key.IsEqual(reco_FileSchema)) { - SetOK(new HeaderSection_FileSchema); - return; - } - if (key.IsEqual(reco_FileDescription)) { - SetOK(new HeaderSection_FileDescription); - return; - } -} diff --git a/src/HeaderSection/HeaderSection_HeaderRecognizer.hxx b/src/HeaderSection/HeaderSection_HeaderRecognizer.hxx deleted file mode 100644 index 6fdba9b595..0000000000 --- a/src/HeaderSection/HeaderSection_HeaderRecognizer.hxx +++ /dev/null @@ -1,66 +0,0 @@ -// Created on: 1994-06-27 -// Created by: Frederic MAUPAS -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _HeaderSection_HeaderRecognizer_HeaderFile -#define _HeaderSection_HeaderRecognizer_HeaderFile - -#include -#include - -#include -class TCollection_AsciiString; - - -class HeaderSection_HeaderRecognizer; -DEFINE_STANDARD_HANDLE(HeaderSection_HeaderRecognizer, StepData_FileRecognizer) - -//! Recognizes STEP Standard Header Entities -//! (FileName, FileDescription, FileSchema) -class HeaderSection_HeaderRecognizer : public StepData_FileRecognizer -{ - -public: - - - Standard_EXPORT HeaderSection_HeaderRecognizer(); - - - - - DEFINE_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer) - -protected: - - - //! Recognizes data types of Header STEP Standard - Standard_EXPORT void Eval (const TCollection_AsciiString& key) Standard_OVERRIDE; - - - -private: - - - - -}; - - - - - - - -#endif // _HeaderSection_HeaderRecognizer_HeaderFile diff --git a/src/IFGraph/IFGraph_AllShared.cxx b/src/IFGraph/IFGraph_AllShared.cxx index fe92d6f139..fd9d15c45d 100644 --- a/src/IFGraph/IFGraph_AllShared.cxx +++ b/src/IFGraph/IFGraph_AllShared.cxx @@ -14,7 +14,6 @@ #include #include -#include IFGraph_AllShared::IFGraph_AllShared (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent) diff --git a/src/IFGraph/IFGraph_Cumulate.cxx b/src/IFGraph/IFGraph_Cumulate.cxx index 6f2e6d9455..4d61a764a6 100644 --- a/src/IFGraph/IFGraph_Cumulate.cxx +++ b/src/IFGraph/IFGraph_Cumulate.cxx @@ -16,8 +16,6 @@ #include #include #include -#include -#include // Calcul de cumul // Tres simple, on note les entites demandees, et a la fin diff --git a/src/IFSelect/IFSelect_WorkSession.cxx b/src/IFSelect/IFSelect_WorkSession.cxx index 9a10aff6ed..3660b3513e 100644 --- a/src/IFSelect/IFSelect_WorkSession.cxx +++ b/src/IFSelect/IFSelect_WorkSession.cxx @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -60,6 +59,7 @@ IFSelect_WorkSession::IFSelect_WorkSession () : myNames(new Dico_DictionaryOfTransient), myVars(new IFSelect_Vars) { + errhand = Standard_True; } @@ -704,7 +704,7 @@ Interface_EntityIterator IFSelect_WorkSession::EvalSelection (const Handle(IFSel iter = EvalSelection(sel); // appel normal (donc, code pas duplique) } catch (Standard_Failure) { - Handle(Message_Messenger) sout = Message::DefaultMessenger(); + const Handle(Message_Messenger) &sout = Message::DefaultMessenger(); sout<<" **** Interruption EvalSelection par Exception : ****\n"; sout<GetMessageString(); sout<<"\n Abandon"<code unique) } catch (Standard_Failure) { - Handle(Message_Messenger) sout = Message::DefaultMessenger(); + const Handle(Message_Messenger) &sout = Message::DefaultMessenger(); sout<<" **** Interruption SelectionResult par Exception : ****\n"; sout<GetMessageString(); sout<<"\n Abandon"< #include #include +#include +#include #include #include #include #include +#include +#include #include #include +#include +#include #include #include #include @@ -48,37 +54,31 @@ #include IGESControl_Writer::IGESControl_Writer () - : myTP (new Transfer_FinderProcess(10000)) , - myIsComputed (Standard_False) +: myTP (new Transfer_FinderProcess(10000)), + myIsComputed (Standard_False) { -// faudrait aussi (?) prendre les parametres par defaut ... ? - IGESControl_Controller::Init(); - myEditor.Init(IGESControl_Controller::DefineProtocol()); - myEditor.SetUnitName(Interface_Static::CVal ("write.iges.unit")); - myEditor.ApplyUnit(); + InitProtocol(); myWriteMode = Interface_Static::IVal ("write.iges.brep.mode"); - myModel = myEditor.Model(); + myModel = IGESData::NewModel(); + SetUnitName(Interface_Static::CVal ("write.iges.unit")); } -IGESControl_Writer::IGESControl_Writer - (const Standard_CString unit, const Standard_Integer modecr) - : myTP (new Transfer_FinderProcess(10000)) , - myWriteMode (modecr) , myIsComputed (Standard_False) +IGESControl_Writer::IGESControl_Writer (const Standard_CString unit, const Standard_Integer modecr) +: myTP (new Transfer_FinderProcess(10000)), + myWriteMode (modecr), myIsComputed (Standard_False) { -// faudrait aussi (?) prendre les parametres par defaut ... ? - IGESControl_Controller::Init(); - myEditor.Init(IGESControl_Controller::DefineProtocol()); - myEditor.SetUnitName(unit); - myEditor.ApplyUnit(); - myModel = myEditor.Model(); + InitProtocol(); + myModel = IGESData::NewModel(); + SetUnitName(unit); } -IGESControl_Writer::IGESControl_Writer - (const Handle(IGESData_IGESModel)& model, const Standard_Integer modecr) - : myTP (new Transfer_FinderProcess(10000)) , - myModel (model) , - myEditor (model,IGESControl_Controller::DefineProtocol()) , - myWriteMode (modecr) , myIsComputed (Standard_False) { } +IGESControl_Writer::IGESControl_Writer (const Handle(IGESData_IGESModel)& model, const Standard_Integer modecr) +: myTP (new Transfer_FinderProcess(10000)), + myModel (model), + myWriteMode (modecr), myIsComputed (Standard_False) +{ + InitProtocol(); +} Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape) { @@ -218,8 +218,8 @@ Standard_Boolean IGESControl_Writer::AddEntity (const Handle(IGESData_IGESEntity void IGESControl_Writer::ComputeModel () { if (!myIsComputed) { - myEditor.ComputeStatus(); - myEditor.AutoCorrectModel(); + ComputeStatus(); + AutoCorrectModel(); myIsComputed = Standard_True; } } @@ -266,3 +266,166 @@ Standard_Boolean IGESControl_Writer::Write return res; } + +void IGESControl_Writer::InitProtocol () +{ + IGESControl_Controller::Init(); + const Handle(IGESData_Protocol) &aProtocol = IGESControl_Controller::DefineProtocol(); + myGLib = Interface_GeneralLib (aProtocol); + mySLib = IGESData_SpecificLib (aProtocol); +} + +void IGESControl_Writer::SetUnitName (const Standard_CString name) +{ + if (myModel.IsNull()) return; + + const Standard_Integer flag = IGESData::UnitNameFlag (name); + IGESData_GlobalSection GS = myModel->GlobalSection(); + if (GS.UnitFlag() == 3) { + char* nam = (char *)name; + if (name[1] == 'H') nam = (char *)&name[2]; + GS.SetUnitName (new TCollection_HAsciiString(nam)); + myModel->SetGlobalSection (GS); + } + else if (flag >= 1 && flag <= 11) { + //! Set a new unit from its flag (param 14 of Global Section) + //! Returns True if done, False if is incorrect + Handle(TCollection_HAsciiString) name = GS.UnitName(); + Standard_CString nam = IGESData::UnitFlagName (flag); + if (nam[0] != '\0') name = new TCollection_HAsciiString (nam); + GS.SetUnitFlag (flag); + GS.SetUnitName (name); + myModel->SetGlobalSection (GS); + + Standard_Real unit = GS.UnitValue(); + if (unit <= 0.) return; + if (unit != 1.) { + GS.SetMaxLineWeight (GS.MaxLineWeight () / unit); + GS.SetResolution (GS.Resolution () / unit); + GS.SetMaxCoord (GS.MaxCoord () / unit); + myModel->SetGlobalSection (GS); + } + } +} + +void IGESControl_Writer::ComputeStatus () +{ + if (myModel.IsNull()) return; + Standard_Integer nb = myModel->NbEntities(); + if (nb == 0) return; + TColStd_Array1OfInteger subs (0,nb); subs.Init(0); // gere Subordinate Status + Interface_Graph G (myModel); // gere & memorise UseFlag + G.ResetStatus(); + +// 2 phases : d abord on fait un calcul d ensemble. Ensuite on applique +// Tout le modele est traite, pas de jaloux + +// Chaque entite va donner une contribution sur ses descendents propres : +// pour Subordinate (1 ou 2 cumulables), pour UseFlag (1 a 6 exclusifs) +// (6 depuis IGES-5.2) + +// Pour Subordinate : Drawing et 402 (sauf p-e dimensioned geometry ?) donnent +// Logical, le reste implique Physical (sur descendants directs propres) + +// Pour UseFlag, un peu plus complique : +// D une part, les UseFlag se propagent aux descendants directs ou non +// D autre part les cas sont plus compliques (et pas aussi clairs) + +// ATTENTION, on ne peut traiter que ce qui se deduit du graphe en s appuyant +// sur les "IGES Type Number", on n a pas le droit ici d acceder a la +// description specifique des differents types : traites par AutoCorrect. +// Exemple : une courbe est 3D ou parametrique 2D(UV), non seulement selon son +// ascendant, mais selon le role qu elle y joue (ex. pour CurveOnSurface : +// CurveUV/Curve3D) +// Traites actuellement (necessaires) : +// 1(Annotation), aussi 4(pour maillage). 5(ParamUV) traite par AutoCorrect + + Standard_Integer CN; + Standard_Integer i; // svv Jan11 2000 : porting on DEC + for (i = 1; i <= nb; i ++) { +// Subordinate (sur directs en propre seulement) + Handle(IGESData_IGESEntity) ent = myModel->Entity(i); + Standard_Integer igt = ent->TypeNumber(); + Handle(Interface_GeneralModule) gmodule; + if (myGLib.Select (ent,gmodule,CN)) { + Handle(IGESData_GeneralModule) gmod = + Handle(IGESData_GeneralModule)::DownCast (gmodule); + Interface_EntityIterator sh; + gmod->OwnSharedCase (CN,ent,sh); + for (sh.Start(); sh.More(); sh.Next()) { + Standard_Integer nums = myModel->Number(sh.Value()); + if (igt == 402 || igt == 404) subs.SetValue (nums,subs.Value(nums) | 2); + else subs.SetValue (nums,subs.Value(nums) | 1); +//// cout<<"ComputeStatus : nums = "<"<UseFlag()); + } else if (igt == 134 || igt == 116 || igt == 132) { + Interface_EntityIterator sh = G.Sharings(ent); // Maillage ... + if (sh.NbEntities() > 0) G.GetFromEntity(ent,Standard_True,4); + } + } + +// A present, on va appliquer tout cela "de force" +// Seule exception : des UseFlags non nuls deja en place sont laisses + + for (i = 1; i <= nb; i ++) { + Handle(IGESData_IGESEntity) ent = myModel->Entity(i); + Standard_Integer bl = ent->BlankStatus(); + Standard_Integer uf = ent->UseFlag(); + if (uf == 0) uf = G.Status(i); + Standard_Integer hy = ent->HierarchyStatus(); + ent->InitStatus(bl,subs.Value(i),uf,hy); + } +} + +Standard_Boolean IGESControl_Writer::AutoCorrect (const Handle(IGESData_IGESEntity)& ent) +{ + if (myModel.IsNull()) return Standard_False; + Handle(IGESData_IGESEntity) bof, subent; + Handle(IGESData_LineFontEntity) linefont; + Handle(IGESData_LevelListEntity) levelist; + Handle(IGESData_ViewKindEntity) view; + Handle(IGESData_TransfEntity) transf; + Handle(IGESData_LabelDisplayEntity) labdisp; + Handle(IGESData_ColorEntity) color; + + Standard_Boolean done = Standard_False; + if (ent.IsNull()) return done; + +// Corrections dans les Assocs (les Props restent attachees a l Entite) + Interface_EntityIterator iter = ent->Associativities(); + for (iter.Start(); iter.More(); iter.Next()) { + subent = GetCasted(IGESData_IGESEntity,iter.Value()); + if (!subent.IsNull() && myModel->Number(subent) == 0) + { subent->Dissociate(ent); done = Standard_True; } + } + +// Corrections specifiques + Standard_Integer CN; + Handle(Interface_GeneralModule) gmodule; + if (myGLib.Select (ent,gmodule,CN)) { + Handle(IGESData_GeneralModule) gmod = + Handle(IGESData_GeneralModule)::DownCast (gmodule); + IGESData_DirChecker DC = gmod->DirChecker(CN,ent); + done |= DC.Correct(ent); + } + + Handle(IGESData_SpecificModule) smod; + if (mySLib.Select (ent,smod,CN)) done |= smod->OwnCorrect (CN,ent); + + return done; +} + +Standard_Integer IGESControl_Writer::AutoCorrectModel () +{ + Standard_Integer res = 0; + Standard_Integer nb = myModel->NbEntities(); + for (Standard_Integer i = 1; i <= nb; i ++) { + if (AutoCorrect (myModel->Entity(i))) res ++; + } + return res; +} diff --git a/src/IGESControl/IGESControl_Writer.hxx b/src/IGESControl/IGESControl_Writer.hxx index 8504f03b55..e2e52e38b9 100644 --- a/src/IGESControl/IGESControl_Writer.hxx +++ b/src/IGESControl/IGESControl_Writer.hxx @@ -21,15 +21,12 @@ #include #include -#include -#include -#include -#include #include +#include +#include +class TopoDS_Shape; class Transfer_FinderProcess; class IGESData_IGESModel; -class TopoDS_Shape; -class Standard_Transient; class IGESData_IGESEntity; @@ -110,12 +107,40 @@ public: Standard_EXPORT Standard_Boolean Write (const Standard_CString file, const Standard_Boolean fnes = Standard_False); private: + + //! Initialize a Protocol and Libraries + Standard_EXPORT void InitProtocol (); + + //! Sets a new unit from its name (param 15 of Global Section) + //! Remark : if has been set to 3 (user defined), is then free + Standard_EXPORT void SetUnitName (const Standard_CString name); + + //! Performs the re-computation of status on the whole model + //! (Subordinate Status and Use Flag of each IGES Entity), which + //! can have required values according the way they are referenced + //! (see definitions of Logical use, Physical use, etc...) + Standard_EXPORT void ComputeStatus(); + + //! Performs auto-correction on an IGESEntity + //! Returns True if something has changed, False if nothing done. + //! + //! Works with the specific IGES Services : DirChecker which + //! allows to correct data in "Directory Part" of Entities (such + //! as required values for status, or references to be null), and + //! the specific IGES service OwnCorrect, which is specialised for + //! each type of entity. + Standard_EXPORT Standard_Boolean AutoCorrect (const Handle(IGESData_IGESEntity)& ent); + + //! Performs auto-correction on the whole Model + //! Returns the count of modified entities + Standard_EXPORT Standard_Integer AutoCorrectModel(); Handle(Transfer_FinderProcess) myTP; Handle(IGESData_IGESModel) myModel; - IGESData_BasicEditor myEditor; Standard_Integer myWriteMode; Standard_Boolean myIsComputed; + Interface_GeneralLib myGLib; + IGESData_SpecificLib mySLib; }; #endif // _IGESControl_Writer_HeaderFile diff --git a/src/IGESData/FILES b/src/IGESData/FILES index 4a7ba8b5df..3bf406b44d 100755 --- a/src/IGESData/FILES +++ b/src/IGESData/FILES @@ -2,8 +2,6 @@ IGESData.cxx IGESData.hxx IGESData_Array1OfDirPart.hxx IGESData_Array1OfIGESEntity.hxx -IGESData_BasicEditor.cxx -IGESData_BasicEditor.hxx IGESData_ColorEntity.cxx IGESData_ColorEntity.hxx IGESData_DefaultGeneral.cxx diff --git a/src/IGESData/IGESData.cxx b/src/IGESData/IGESData.cxx index 1cbeaaa645..01b028ad90 100644 --- a/src/IGESData/IGESData.cxx +++ b/src/IGESData/IGESData.cxx @@ -193,8 +193,103 @@ const Handle(IGESData_Protocol) & IGESData::Protocol () Handle(IGESData_IGESModel) IGESData::NewModel () { - if (gIGESModel.IsNull()) return NULL; - Handle(Interface_InterfaceModel) newmod = gIGESModel->NewEmptyModel(); - newmod->GetFromAnother (gIGESModel); - return Handle(IGESData_IGESModel)::DownCast(newmod); + Handle(IGESData_IGESModel) newmod; + if (!gIGESModel.IsNull()) { + newmod = new IGESData_IGESModel; + newmod->GetFromAnother (gIGESModel); + } + return newmod; +} + +Standard_Integer IGESData::UnitNameFlag (const Standard_CString name) +{ + char* nam = (char *)&name[0]; + if (name[1] == 'H') { + nam = (char *)&name[2]; + } + if (!strcmp (nam,"INCH")) return 1; + if (!strcmp (nam,"IN")) return 1; + if (!strcmp (nam,"MM")) return 2; + if (!strcmp (nam,"FT")) return 4; + if (!strcmp (nam,"MI")) return 5; + if (!strcmp (nam,"M")) return 6; + if (!strcmp (nam,"KM")) return 7; + if (!strcmp (nam,"MIL")) return 8; + if (!strcmp (nam,"UM")) return 9; + if (!strcmp (nam,"CM")) return 10; + if (!strcmp (nam,"UIN")) return 11; + return 0; +} + +Standard_Real IGESData::UnitFlagValue (const Standard_Integer flag) +{ + switch (flag) { + case 1 : return 0.0254; + case 2 : return 0.001; + case 3 : return 1.; + case 4 : return 0.3048; + case 5 : return 1609.27; + case 6 : return 1.; + case 7 : return 1000.; + case 8 : return 0.0000254; + case 9 : return 0.000001; + case 10 : return 0.01; + case 11 : return 0.0000000254; + default : break; + } + return 0.; +} + +Standard_CString IGESData::UnitFlagName (const Standard_Integer flag) +{ + Standard_CString name = ""; + switch (flag) { + case 1 : name = "INCH"; break; + case 2 : name = "MM"; break; + case 4 : name = "FT"; break; + case 5 : name = "MI"; break; + case 6 : name = "M"; break; + case 7 : name = "KM"; break; + case 8 : name = "MIL"; break; + case 9 : name = "UM"; break; + case 10 : name = "CM"; break; + case 11 : name = "UIN"; break; + default : break; + } + return name; +} + +Standard_CString IGESData::IGESVersionName (const Standard_Integer flag) +{ + switch (flag) { + case 1 : return "1.0"; + case 2 : return "ANSI Y14.26M-1981"; + case 3 : return "2.0"; + case 4 : return "3.0"; + case 5 : return "ANSI Y14.26M-1987"; + case 6 : return "4.0"; + case 7 : return "ANSI Y14.26M-1989"; + case 8 : return "5.0"; + case 9 : return "5.1"; + case 10: return "5.2"; + case 11: return "5.3"; + default : break; + } + return ""; +} + +Standard_CString IGESData::DraftingName (const Standard_Integer flag) +{ + switch (flag) { + case 0 : return "(None)"; + case 1 : return "ISO"; + case 2 : return "AFNOR"; + case 3 : return "ANSI"; + case 4 : return "BSI"; + case 5 : return "CSA"; + case 6 : return "DIN"; + case 7 : return "JIS"; + default : break; + } + return ""; } diff --git a/src/IGESData/IGESData.hxx b/src/IGESData/IGESData.hxx index 655c512d5a..27a05fb2b6 100644 --- a/src/IGESData/IGESData.hxx +++ b/src/IGESData/IGESData.hxx @@ -36,6 +36,28 @@ class IGESData //! Returns a Protocol from IGESData (avoids to create it) Standard_EXPORT static Handle(IGESData_IGESModel) NewModel (); + + //! From the name of unit, computes flag number, 0 if incorrect + //! (in this case, user defined entity remains possible) + Standard_EXPORT static Standard_Integer UnitNameFlag (const Standard_CString name); + + //! From the flag of unit, determines value in MM, 0 if incorrect + Standard_EXPORT static Standard_Real UnitFlagValue (const Standard_Integer flag); + + //! From the flag of unit, determines its name, "" if incorrect + Standard_EXPORT static Standard_CString UnitFlagName (const Standard_Integer flag); + + //! From the flag of IGES version, returns name, "" if incorrect + Standard_EXPORT static Standard_CString IGESVersionName (const Standard_Integer flag); + + //! Returns the maximum allowed value for IGESVersion Flag + static Standard_Integer IGESVersionMax () { return 11; } + + //! From the flag of drafting standard, returns name, "" if incorrect + Standard_EXPORT static Standard_CString DraftingName (const Standard_Integer flag); + + //! Returns the maximum allowed value for Drafting Flag + static Standard_Integer DraftingMax () { return 7; } }; #endif // _IGESData_HeaderFile diff --git a/src/IGESData/IGESData_BasicEditor.cxx b/src/IGESData/IGESData_BasicEditor.cxx deleted file mode 100644 index 82d22e6813..0000000000 --- a/src/IGESData/IGESData_BasicEditor.cxx +++ /dev/null @@ -1,436 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//#73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IGESData_BasicEditor::IGESData_BasicEditor(const Handle(IGESData_Protocol)& protocol) -{ - Init(protocol); -} - -IGESData_BasicEditor::IGESData_BasicEditor(const Handle(IGESData_IGESModel)& model, - const Handle(IGESData_Protocol)& protocol) -{ - Init(model, protocol); -} - -IGESData_BasicEditor::IGESData_BasicEditor() { } - -void IGESData_BasicEditor::Init (const Handle(IGESData_Protocol)& protocol) -{ - theunit = Standard_False; - theproto = protocol; - themodel = IGESData::NewModel(); - theglib = Interface_GeneralLib (protocol); - theslib = protocol; -} - -void IGESData_BasicEditor::Init (const Handle(IGESData_IGESModel)& model, const Handle(IGESData_Protocol)& protocol) -{ - theunit = Standard_False; - theproto = protocol; - themodel = model; - theglib = Interface_GeneralLib (protocol); - theslib = protocol; -} - - Handle(IGESData_IGESModel) IGESData_BasicEditor::Model () const - { return themodel; } - -// #### Travaux sur le Header (GlobalSection) #### - - Standard_Boolean IGESData_BasicEditor::SetUnitFlag - (const Standard_Integer flag) -{ - if (themodel.IsNull()) return Standard_False; - if (flag < 1 || flag > 11) return Standard_False; - IGESData_GlobalSection GS = themodel->GlobalSection(); - Handle(TCollection_HAsciiString) name = GS.UnitName(); - Standard_CString nam = IGESData_BasicEditor::UnitFlagName (flag); - if (nam[0] != '\0') name = new TCollection_HAsciiString (nam); - GS.SetUnitFlag (flag); - GS.SetUnitName (name); - themodel->SetGlobalSection (GS); - theunit = Standard_True; - return Standard_True; -} - - Standard_Boolean IGESData_BasicEditor::SetUnitValue - (const Standard_Real val) -{ - if (val <= 0.) return Standard_False; - Standard_Real vmm = val * UnitsMethods::GetCasCadeLengthUnit(); //abv 20 Feb 00: adding cascade unit factor - //#73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection - //if (Interface_Static::IVal("read.scale.unit") == 1) vmm = vmm * 1000.; -// vmm est exprime en MILLIMETRES - if (vmm >= 25. && vmm <= 26. ) return SetUnitFlag(1); - if (vmm >= 0.9 && vmm <= 1.1 ) return SetUnitFlag(2); - if (vmm >= 300. && vmm <= 310. ) return SetUnitFlag(4); - if (vmm >= 1600000. && vmm <= 1620000. ) return SetUnitFlag(5); - if (vmm >= 990. && vmm <= 1010. ) return SetUnitFlag(6); - if (vmm >= 990000. && vmm <= 1010000. ) return SetUnitFlag(7); - if (vmm >= 0.025 && vmm <= 0.026 ) return SetUnitFlag(8); - if (vmm >= 0.0009 && vmm <= 0.0011 ) return SetUnitFlag(9); - if (vmm >= 9. && vmm <= 11. ) return SetUnitFlag(10); - if (vmm >= 0.000025 && vmm <= 0.000026) return SetUnitFlag(11); - return Standard_False; -} - -//======================================================================= -//function : SetUnitName -//purpose : -//======================================================================= -Standard_Boolean IGESData_BasicEditor::SetUnitName (const Standard_CString name) -{ - if (themodel.IsNull()) return Standard_False; - Standard_Integer flag = IGESData_BasicEditor::UnitNameFlag (name); - IGESData_GlobalSection GS = themodel->GlobalSection(); - if (GS.UnitFlag() == 3) { - char* nam = (char *)name; - if (name[1] == 'H') nam = (char *)&name[2]; - GS.SetUnitName (new TCollection_HAsciiString(nam)); - themodel->SetGlobalSection (GS); - return Standard_True; - } - if (flag > 0) return SetUnitFlag(flag); - return (flag > 0); -} - - void IGESData_BasicEditor::ApplyUnit (const Standard_Boolean enforce) -{ - if (themodel.IsNull()) return; - if (!enforce && !theunit) return; - IGESData_GlobalSection GS = themodel->GlobalSection(); - Standard_Real unit = GS.UnitValue(); - if (unit <= 0.) return; - if (unit != 1.) { - GS.SetMaxLineWeight (GS.MaxLineWeight () / unit); - GS.SetResolution (GS.Resolution () / unit); - GS.SetMaxCoord (GS.MaxCoord () / unit); - themodel->SetGlobalSection (GS); - } - theunit = Standard_False; -} - - -// #### Travaux globaux sur les entites #### - - void IGESData_BasicEditor::ComputeStatus () -{ - if (themodel.IsNull()) return; - Standard_Integer nb = themodel->NbEntities(); - if (nb == 0) return; - TColStd_Array1OfInteger subs (0,nb); subs.Init(0); // gere Subordinate Status - Interface_Graph G (themodel); // gere & memorise UseFlag - G.ResetStatus(); - -// 2 phases : d abord on fait un calcul d ensemble. Ensuite on applique -// Tout le modele est traite, pas de jaloux - -// Chaque entite va donner une contribution sur ses descendents propres : -// pour Subordinate (1 ou 2 cumulables), pour UseFlag (1 a 6 exclusifs) -// (6 depuis IGES-5.2) - -// Pour Subordinate : Drawing et 402 (sauf p-e dimensioned geometry ?) donnent -// Logical, le reste implique Physical (sur descendants directs propres) - -// Pour UseFlag, un peu plus complique : -// D une part, les UseFlag se propagent aux descendants directs ou non -// D autre part les cas sont plus compliques (et pas aussi clairs) - -// ATTENTION, on ne peut traiter que ce qui se deduit du graphe en s appuyant -// sur les "IGES Type Number", on n a pas le droit ici d acceder a la -// description specifique des differents types : traites par AutoCorrect. -// Exemple : une courbe est 3D ou parametrique 2D(UV), non seulement selon son -// ascendant, mais selon le role qu elle y joue (ex. pour CurveOnSurface : -// CurveUV/Curve3D) -// Traites actuellement (necessaires) : -// 1(Annotation), aussi 4(pour maillage). 5(ParamUV) traite par AutoCorrect - - Standard_Integer CN; - Standard_Integer i; // svv Jan11 2000 : porting on DEC - for (i = 1; i <= nb; i ++) { -// Subordinate (sur directs en propre seulement) - Handle(IGESData_IGESEntity) ent = themodel->Entity(i); - Standard_Integer igt = ent->TypeNumber(); - Handle(Interface_GeneralModule) gmodule; - if (theglib.Select (ent,gmodule,CN)) { - Handle(IGESData_GeneralModule) gmod = - Handle(IGESData_GeneralModule)::DownCast (gmodule); - Interface_EntityIterator sh; - gmod->OwnSharedCase (CN,ent,sh); - for (sh.Start(); sh.More(); sh.Next()) { - Standard_Integer nums = themodel->Number(sh.Value()); - if (igt == 402 || igt == 404) subs.SetValue (nums,subs.Value(nums) | 2); - else subs.SetValue (nums,subs.Value(nums) | 1); -//// cout<<"ComputeStatus : nums = "<"<UseFlag()); - } else if (igt == 134 || igt == 116 || igt == 132) { - Interface_EntityIterator sh = G.Sharings(ent); // Maillage ... - if (sh.NbEntities() > 0) G.GetFromEntity(ent,Standard_True,4); -// UV : voir AutoCorrect des classes concernees (Boundary et CurveOnSurface) -/* - } else if (ent->IsKind(STANDARD_TYPE(IGESGeom_CurveOnSurface))) { - DeclareAndCast(IGESGeom_CurveOnSurface,cos,ent); // Curve UV - G.GetFromEntity (cos->CurveUV(),Standard_True,5); - } else if (ent->IsKind(STANDARD_TYPE(IGESGeom_Boundary))) { - DeclareAndCast(IGESGeom_Boundary,bnd,ent); // Curve UV - Standard_Integer nc = bnd->NbModelSpaceCurves(); - for (Standard_Integer ic = 1; ic <= nc; ic ++) { - Standard_Integer nuv = bnd->NbParameterCurves(ic); - for (Standard_Integer juv = 1; juv <= nuv; juv ++) - G.GetFromEntity(bnd->ParameterCurve(ic,juv),Standard_True,5); - } -*/ - } - } - -// A present, on va appliquer tout cela "de force" -// Seule exception : des UseFlags non nuls deja en place sont laisses - - for (i = 1; i <= nb; i ++) { - Handle(IGESData_IGESEntity) ent = themodel->Entity(i); - Standard_Integer bl = ent->BlankStatus(); - Standard_Integer uf = ent->UseFlag(); - if (uf == 0) uf = G.Status(i); - Standard_Integer hy = ent->HierarchyStatus(); -//// cout<<" Ent.n0."<LineFont(); - if (!linefont.IsNull() && themodel->Number(linefont) == 0) { - linefont.Nullify(); - ent->InitLineFont(linefont,0); - done = Standard_True; - } - levelist = ent->LevelList(); - if (!levelist.IsNull() && themodel->Number(levelist) == 0) { - levelist.Nullify(); - ent->InitLevel(levelist,0); - done = Standard_True; - } - view = ent->View(); - if (!view.IsNull() && themodel->Number(view) == 0) { - view.Nullify(); - ent->InitView(view); - done = Standard_True; - } - transf = ent->Transf(); - if (!transf.IsNull() && themodel->Number(transf) == 0) { - transf.Nullify(); - ent->InitTransf(transf); - done = Standard_True; - } - labdisp = ent->LabelDisplay(); - if (!labdisp.IsNull() && themodel->Number(labdisp) == 0) { - labdisp.Nullify(); - ent->InitMisc (ent->Structure(),labdisp,ent->LineWeightNumber()); - done = Standard_True; - } - color = ent->Color(); - if (!color.IsNull() && themodel->Number(color) == 0) { - color.Nullify(); - ent->InitColor(color,0); - done = Standard_True; - } -*/ - -// Corrections dans les Assocs (les Props restent attachees a l Entite) - Interface_EntityIterator iter = ent->Associativities(); - for (iter.Start(); iter.More(); iter.Next()) { - subent = GetCasted(IGESData_IGESEntity,iter.Value()); - if (!subent.IsNull() && themodel->Number(subent) == 0) - { subent->Dissociate(ent); done = Standard_True; } - } - -// Corrections specifiques - Standard_Integer CN; - Handle(Interface_GeneralModule) gmodule; - if (theglib.Select (ent,gmodule,CN)) { - Handle(IGESData_GeneralModule) gmod = - Handle(IGESData_GeneralModule)::DownCast (gmodule); - IGESData_DirChecker DC = gmod->DirChecker(CN,ent); - done |= DC.Correct(ent); - } - - Handle(IGESData_SpecificModule) smod; - if (theslib.Select (ent,smod,CN)) done |= smod->OwnCorrect (CN,ent); - - return done; -} - - - Standard_Integer IGESData_BasicEditor::AutoCorrectModel () -{ - Standard_Integer res = 0; - Standard_Integer nb = themodel->NbEntities(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (AutoCorrect (themodel->Entity(i))) res ++; - } - return res; -} - - - -//======================================================================= -//function : UnitNameFlag -//purpose : -//======================================================================= -Standard_Integer IGESData_BasicEditor::UnitNameFlag (const Standard_CString name) -{ - char* nam = (char *)&name[0]; - if (name[1] == 'H') { - nam = (char *)&name[2]; - } - if (!strcmp (nam,"INCH")) return 1; - if (!strcmp (nam,"IN")) return 1; - if (!strcmp (nam,"MM")) return 2; - if (!strcmp (nam,"FT")) return 4; - if (!strcmp (nam,"MI")) return 5; - if (!strcmp (nam,"M")) return 6; - if (!strcmp (nam,"KM")) return 7; - if (!strcmp (nam,"MIL")) return 8; - if (!strcmp (nam,"UM")) return 9; - if (!strcmp (nam,"CM")) return 10; - if (!strcmp (nam,"UIN")) return 11; - return 0; -} - -Standard_Real IGESData_BasicEditor::UnitFlagValue (const Standard_Integer flag) -{ - switch (flag) { - case 1 : return 0.0254; - case 2 : return 0.001; - case 3 : return 1.; - case 4 : return 0.3048; - case 5 : return 1609.27; - case 6 : return 1.; - case 7 : return 1000.; - case 8 : return 0.0000254; - case 9 : return 0.000001; - case 10 : return 0.01; - case 11 : return 0.0000000254; - default : break; - } - return 0.; -} - -Standard_CString IGESData_BasicEditor::UnitFlagName (const Standard_Integer flag) -{ - Standard_CString name = ""; - switch (flag) { - case 1 : name = "INCH"; break; - case 2 : name = "MM"; break; - case 4 : name = "FT"; break; - case 5 : name = "MI"; break; - case 6 : name = "M"; break; - case 7 : name = "KM"; break; - case 8 : name = "MIL"; break; - case 9 : name = "UM"; break; - case 10 : name = "CM"; break; - case 11 : name = "UIN"; break; - default : break; - } - return name; -} - -Standard_CString IGESData_BasicEditor::IGESVersionName (const Standard_Integer flag) -{ - switch (flag) { - case 1 : return "1.0"; - case 2 : return "ANSI Y14.26M-1981"; - case 3 : return "2.0"; - case 4 : return "3.0"; - case 5 : return "ANSI Y14.26M-1987"; - case 6 : return "4.0"; - case 7 : return "ANSI Y14.26M-1989"; - case 8 : return "5.0"; - case 9 : return "5.1"; - case 10: return "5.2"; - case 11: return "5.3"; - default : break; - } - return ""; -} - -Standard_Integer IGESData_BasicEditor::IGESVersionMax () - { return 11; } - -Standard_CString IGESData_BasicEditor::DraftingName (const Standard_Integer flag) -{ - switch (flag) { - case 0 : return "(None)"; - case 1 : return "ISO"; - case 2 : return "AFNOR"; - case 3 : return "ANSI"; - case 4 : return "BSI"; - case 5 : return "CSA"; - case 6 : return "DIN"; - case 7 : return "JIS"; - default : break; - } - return ""; -} - -Standard_Integer IGESData_BasicEditor::DraftingMax () - { return 7; } diff --git a/src/IGESData/IGESData_BasicEditor.hxx b/src/IGESData/IGESData_BasicEditor.hxx deleted file mode 100644 index ba58609407..0000000000 --- a/src/IGESData/IGESData_BasicEditor.hxx +++ /dev/null @@ -1,163 +0,0 @@ -// Created on: 1995-08-25 -// Created by: Christian CAILLET -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESData_BasicEditor_HeaderFile -#define _IGESData_BasicEditor_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -class IGESData_Protocol; -class IGESData_IGESModel; -class IGESData_IGESEntity; - - -//! This class provides various functions of basic edition, -//! such as : -//! - setting header unit (WARNING : DOES NOT convert entities) -//! - computation of the status (Subordinate, UseFlag) of entities -//! of IGES Entities on a whole model -//! - auto correction of IGES Entities, defined both by DirChecker -//! and by specific service AutoCorrect -//! (this auto correction performs non-ambigious, rather logic, -//! editions) -class IGESData_BasicEditor -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Creates an empty Basic Editor which should be initialized via Init() method. - Standard_EXPORT IGESData_BasicEditor(); - - //! Creates a Basic Editor, with a new IGESModel, ready to run - Standard_EXPORT IGESData_BasicEditor(const Handle(IGESData_Protocol)& protocol); - - //! Creates a Basic Editor for IGES Data, ready to run - Standard_EXPORT IGESData_BasicEditor(const Handle(IGESData_IGESModel)& model, const Handle(IGESData_Protocol)& protocol); - - //! Initialize a Basic Editor, with a new IGESModel, ready to run - Standard_EXPORT void Init (const Handle(IGESData_Protocol)& protocol); - - //! Initialize a Basic Editor for IGES Data, ready to run - Standard_EXPORT void Init (const Handle(IGESData_IGESModel)& model, const Handle(IGESData_Protocol)& protocol); - - //! Returns the designated model - Standard_EXPORT Handle(IGESData_IGESModel) Model() const; - - //! Sets a new unit from its flag (param 14 of Global Section) - //! Returns True if done, False if is incorrect - Standard_EXPORT Standard_Boolean SetUnitFlag (const Standard_Integer flag); - - //! Sets a new unit from its value in meters (rounded to the - //! closest one, max gap 1%) - //! Returns True if done, False if is too far from a - //! suitable value - Standard_EXPORT Standard_Boolean SetUnitValue (const Standard_Real val); - - //! Sets a new unit from its name (param 15 of Global Section) - //! Returns True if done, False if is incorrect - //! Remark : if has been set to 3 (user defined), - //! is then free - Standard_EXPORT Standard_Boolean SetUnitName (const Standard_CString name); - - //! Applies unit value to convert header data : Resolution, - //! MaxCoord, MaxLineWeight - //! Applies unit only once after SetUnit... has been called, - //! if is given as True. - //! It can be called just before writing the model to a file, - //! i.e. when definitive values are finally known - Standard_EXPORT void ApplyUnit (const Standard_Boolean enforce = Standard_False); - - //! Performs the re-computation of status on the whole model - //! (Subordinate Status and Use Flag of each IGES Entity), which - //! can have required values according the way they are referenced - //! (see definitions of Logical use, Physical use, etc...) - Standard_EXPORT void ComputeStatus(); - - //! Performs auto-correction on an IGESEntity - //! Returns True if something has changed, False if nothing done. - //! - //! Works with the specific IGES Services : DirChecker which - //! allows to correct data in "Directory Part" of Entities (such - //! as required values for status, or references to be null), and - //! the specific IGES service OwnCorrect, which is specialised for - //! each type of entity. - Standard_EXPORT Standard_Boolean AutoCorrect (const Handle(IGESData_IGESEntity)& ent); - - //! Performs auto-correction on the whole Model - //! Returns the count of modified entities - Standard_EXPORT Standard_Integer AutoCorrectModel(); - - //! From the name of unit, computes flag number, 0 if incorrect - //! (in this case, user defined entity remains possible) - Standard_EXPORT static Standard_Integer UnitNameFlag (const Standard_CString name); - - //! From the flag of unit, determines value in MM, 0 if incorrect - Standard_EXPORT static Standard_Real UnitFlagValue (const Standard_Integer flag); - - //! From the flag of unit, determines its name, "" if incorrect - Standard_EXPORT static Standard_CString UnitFlagName (const Standard_Integer flag); - - //! From the flag of IGES version, returns name, "" if incorrect - Standard_EXPORT static Standard_CString IGESVersionName (const Standard_Integer flag); - - //! Returns the maximum allowed value for IGESVersion Flag - Standard_EXPORT static Standard_Integer IGESVersionMax(); - - //! From the flag of drafting standard, returns name, "" if incorrect - Standard_EXPORT static Standard_CString DraftingName (const Standard_Integer flag); - - //! Returns the maximum allowed value for Drafting Flag - Standard_EXPORT static Standard_Integer DraftingMax(); - - - - -protected: - - - - - -private: - - - - Standard_Boolean theunit; - Handle(IGESData_Protocol) theproto; - Handle(IGESData_IGESModel) themodel; - Interface_GeneralLib theglib; - IGESData_SpecificLib theslib; - - -}; - - - - - - - -#endif // _IGESData_BasicEditor_HeaderFile diff --git a/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx b/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx index e9db7ad2af..8332059cf2 100644 --- a/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx +++ b/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx @@ -21,8 +21,8 @@ #include #include +class Interface_Protocol; class IGESData_SpecificModule; -class IGESData_Protocol; class IGESData_IGESEntity; class IGESData_SpecificLib; class IGESData_NodeOfSpecificLib; @@ -45,13 +45,13 @@ public: //! nothing if already in the list, THAT IS, Same Type (exact //! match) and Same State (that is, IsEqual is not required) //! Once added, stores its attached Protocol in correspondance - Standard_EXPORT void Add (const Handle(IGESData_SpecificModule)& amodule, const Handle(IGESData_Protocol)& aprotocol); + Standard_EXPORT void Add (const Handle(IGESData_SpecificModule)& amodule, const Handle(Interface_Protocol)& aprotocol); //! Returns the Module stored in a given GlobalNode Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const; //! Returns the attached Protocol stored in a given GlobalNode - Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; //! Returns the Next GlobalNode. If none is defined, returned //! value is a Null Handle @@ -71,7 +71,7 @@ private: Handle(IGESData_SpecificModule) themod; - Handle(IGESData_Protocol) theprot; + Handle(Interface_Protocol) theprot; Handle(IGESData_GlobalNodeOfSpecificLib) thenext; diff --git a/src/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx b/src/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx index 7a7b56fd9c..0ce9a69d78 100644 --- a/src/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx +++ b/src/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx @@ -19,29 +19,16 @@ #include #include -#include #include #include #include #include - - - - - - - - - #define TheObject Handle(IGESData_IGESEntity) #define TheObject_hxx #define Handle_TheModule Handle(IGESData_SpecificModule) #define TheModule IGESData_SpecificModule #define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node IGESData_NodeOfSpecificLib @@ -51,4 +38,3 @@ #define LibCtl_Library IGESData_SpecificLib #define LibCtl_Library_hxx #include - diff --git a/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx b/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx index cea9c9c7f3..96b98786fa 100644 --- a/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx +++ b/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx @@ -21,8 +21,8 @@ #include #include +class Interface_Protocol; class IGESData_ReadWriteModule; -class IGESData_Protocol; class IGESData_IGESEntity; class IGESData_WriterLib; class IGESData_NodeOfWriterLib; @@ -45,13 +45,13 @@ public: //! nothing if already in the list, THAT IS, Same Type (exact //! match) and Same State (that is, IsEqual is not required) //! Once added, stores its attached Protocol in correspondance - Standard_EXPORT void Add (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(IGESData_Protocol)& aprotocol); + Standard_EXPORT void Add (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(Interface_Protocol)& aprotocol); //! Returns the Module stored in a given GlobalNode Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const; //! Returns the attached Protocol stored in a given GlobalNode - Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; //! Returns the Next GlobalNode. If none is defined, returned //! value is a Null Handle @@ -71,7 +71,7 @@ private: Handle(IGESData_ReadWriteModule) themod; - Handle(IGESData_Protocol) theprot; + Handle(Interface_Protocol) theprot; Handle(IGESData_GlobalNodeOfWriterLib) thenext; diff --git a/src/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx b/src/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx index 088825aeb0..983f03f237 100644 --- a/src/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx +++ b/src/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx @@ -19,29 +19,16 @@ #include #include -#include #include #include #include #include - - - - - - - - - #define TheObject Handle(IGESData_IGESEntity) #define TheObject_hxx #define Handle_TheModule Handle(IGESData_ReadWriteModule) #define TheModule IGESData_ReadWriteModule #define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node IGESData_NodeOfWriterLib @@ -51,4 +38,3 @@ #define LibCtl_Library IGESData_WriterLib #define LibCtl_Library_hxx #include - diff --git a/src/IGESData/IGESData_GlobalSection.cxx b/src/IGESData/IGESData_GlobalSection.cxx index 87211099ac..0d71cbc34c 100644 --- a/src/IGESData/IGESData_GlobalSection.cxx +++ b/src/IGESData/IGESData_GlobalSection.cxx @@ -18,7 +18,7 @@ //#73 rln 10.03.99 S4135: "read.scale.unit" is applied after translation #include -#include +#include #include #include #include @@ -249,7 +249,7 @@ void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params, //default (inches) value taken corrected = 1; else - corrected = IGESData_BasicEditor::UnitNameFlag (theUnitName->ToCString()); + corrected = IGESData::UnitNameFlag (theUnitName->ToCString()); if (corrected > 0) theUnitFlag = corrected; else if (theUnitFlag == 3) { Message_Msg Msg49 ("XSTEP_49"); diff --git a/src/IGESData/IGESData_IGESModel.cxx b/src/IGESData/IGESData_IGESModel.cxx index 98df9cffe1..a6ca5f8dc9 100644 --- a/src/IGESData/IGESData_IGESModel.cxx +++ b/src/IGESData/IGESData_IGESModel.cxx @@ -15,7 +15,7 @@ //#73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection //#13 smh 13.01.2000 : Parsing long year date -#include +#include #include #include #include @@ -138,11 +138,11 @@ void IGESData_IGESModel::DumpHeader if (!str.IsNull()) S<<"[22] Company : "<ToCString()<<"\n"; Standard_Integer num = theheader.IGESVersion(); S << "[23] IGES Version Number : " << num << " -> Name : " - << IGESData_BasicEditor::IGESVersionName(num); + << IGESData::IGESVersionName(num); num = theheader.DraftingStandard(); S << "\n[24] Drafting Standard : " << num; - if (num > 0) S<< " -> Name : " << IGESData_BasicEditor::DraftingName(num); + if (num > 0) S<< " -> Name : " << IGESData::DraftingName(num); S<GlobalSection(); + theheader = other->GlobalSection(); theheader.CopyRefs(); - SetStartSection (another->StartSection(),Standard_True); + SetStartSection (other->StartSection(),Standard_True); } -//======================================================================= -//function : NewEmptyModel -//purpose : -//======================================================================= - -Handle(Interface_InterfaceModel) IGESData_IGESModel::NewEmptyModel () const - { return new IGESData_IGESModel; } - - //======================================================================= //function : VerifyCheck //purpose : @@ -467,14 +436,14 @@ void IGESData_IGESModel::VerifyCheck (Handle(Interface_Check)& ach) const // Sending of message : Version Flag parameter is incorrect. if (theheader.IGESVersion() < 1 || - theheader.IGESVersion() > IGESData_BasicEditor::IGESVersionMax()) { + theheader.IGESVersion() > IGESData::IGESVersionMax()) { Message_Msg Msg53 ("XSTEP_53"); ach->SendWarning(Msg53); } // Sending of message : Drafting Standard Flag parameter is incorrect. if (theheader.DraftingStandard() < 0 || - theheader.DraftingStandard() > IGESData_BasicEditor::DraftingMax()) { + theheader.DraftingStandard() > IGESData::DraftingMax()) { Message_Msg Msg54 ("XSTEP_54"); ach->SendWarning(Msg54); } diff --git a/src/IGESData/IGESData_IGESModel.hxx b/src/IGESData/IGESData_IGESModel.hxx index 70e114685c..fcc9c56d06 100644 --- a/src/IGESData/IGESData_IGESModel.hxx +++ b/src/IGESData/IGESData_IGESModel.hxx @@ -99,11 +99,11 @@ public: Standard_EXPORT void AddStartLine (const Standard_CString line, const Standard_Integer atnum = 0); //! Returns the Global section of the IGES file. - Standard_EXPORT const IGESData_GlobalSection& GlobalSection() const; - + const IGESData_GlobalSection& GlobalSection() const { return theheader; } + //! Sets the Global section of the IGES file. - Standard_EXPORT void SetGlobalSection (const IGESData_GlobalSection& header); - + void SetGlobalSection (const IGESData_GlobalSection& header) { theheader = header; } + //! Sets some of the Global section //! parameters with the values defined by the translation //! parameters. param may be: @@ -113,7 +113,7 @@ public: //! The default value for param is an empty string. //! Returns True when done and if param is given, False if param is //! unknown or empty. Note: Set the unit in the IGES - //! file Global section via IGESData_BasicEditor class. + //! file Global section via IGESData class. Standard_EXPORT Standard_Boolean ApplyStatic (const Standard_CString param = ""); //! Returns an IGES entity given by its rank number. @@ -125,10 +125,7 @@ public: Standard_EXPORT Standard_Integer DNum (const Handle(IGESData_IGESEntity)& ent) const; //! gets Header (GlobalSection) from another Model - Standard_EXPORT void GetFromAnother (const Handle(Interface_InterfaceModel)& other) Standard_OVERRIDE; - - //! Returns a New Empty Model, same type as i.e. IGESModel - Standard_EXPORT Handle(Interface_InterfaceModel) NewEmptyModel() const Standard_OVERRIDE; + Standard_EXPORT void GetFromAnother (const Handle(IGESData_IGESModel)& other); //! Checks that the IGES file Global //! section contains valid data that conforms to the IGES specifications. diff --git a/src/IGESData/IGESData_IGESReaderTool.cxx b/src/IGESData/IGESData_IGESReaderTool.cxx index 1c67f28c76..b0d5a2715c 100644 --- a/src/IGESData/IGESData_IGESReaderTool.cxx +++ b/src/IGESData/IGESData_IGESReaderTool.cxx @@ -169,7 +169,6 @@ IGESData_IGESReaderTool::IGESData_IGESReaderTool return (!ach->HasFailed()); } ReadProps (ent,igesdat,PR); -// thestep = IGESData_ReadEnd; if (!PR.IsCheckEmpty()) ach = PR.Check(); return (!ach->HasFailed()); } @@ -177,11 +176,6 @@ IGESData_IGESReaderTool::IGESData_IGESReaderTool void IGESData_IGESReaderTool::EndRead (const Handle(Interface_InterfaceModel)& /* amodel */) { -/* - DeclareAndCast(IGESData_IGESModel,amod,amodel); - DeclareAndCast(IGESData_IGESReaderData,igesdat,Data()); - amod->SetLineWeights(igesdat->DefaultLineWeight()); -*/ } @@ -356,7 +350,6 @@ IGESData_IGESReaderTool::IGESData_IGESReaderTool undent->ReadOwnParams(IR,PR); // IGESEntity creee puis non reconnue ... (bizarre, non ?) } else { -// IGESData_IGESType DT = ent->IGESType(); // Sending of message : Unknown Entity Message_Msg Msg36 ("XSTEP_36"); Msg36.Arg(thecnum); diff --git a/src/IGESData/IGESData_IGESReaderTool.hxx b/src/IGESData/IGESData_IGESReaderTool.hxx index a7838a56c4..4cf6f1718a 100644 --- a/src/IGESData/IGESData_IGESReaderTool.hxx +++ b/src/IGESData/IGESData_IGESReaderTool.hxx @@ -45,11 +45,10 @@ class IGESData_ParamReader; //! Parameters are accessed through specific objects, ParamReaders class IGESData_IGESReaderTool : public Interface_FileReaderTool { -public: + public: DEFINE_STANDARD_ALLOC - //! creates IGESReaderTool to work with an IGESReaderData and an //! IGES Protocol. //! Actually, no Lib is used @@ -60,18 +59,20 @@ public: //! RQ : Actually, sets DNum into IGES Entities //! Also loads the list of parameters for ParamReader Standard_EXPORT void Prepare (const Handle(IGESData_FileRecognizer)& reco); + + private: //! recognizes records by asking Protocol (on data of DirType) - Standard_EXPORT Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE; //! fills model's header, that is, its GlobalSection - Standard_EXPORT void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE; + Standard_EXPORT virtual void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE; //! fills an entity, given record no; works by calling ReadDirPart //! then ReadParams (with help of a ParamReader), then if required //! ReadProps and ReadAssocs, from IGESEntity //! Returns True if no fail has been recorded - Standard_EXPORT Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) Standard_OVERRIDE; + Standard_EXPORT virtual Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) Standard_OVERRIDE; //! after reading entities, true line weights can be computed Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE; @@ -101,19 +102,6 @@ public: //! Note that "Associated" entities are not declared "Shared" Standard_EXPORT void ReadAssocs (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const; - - - -protected: - - - - - -private: - - - Handle(Interface_ParamList) thelist; Handle(IGESData_FileRecognizer) thereco; Interface_GeneralLib theglib; @@ -125,14 +113,6 @@ private: Standard_Integer thegradweight; Standard_Real themaxweight; Standard_Real thedefweight; - - }; - - - - - - #endif // _IGESData_IGESReaderTool_HeaderFile diff --git a/src/IGESData/IGESData_NodeOfSpecificLib.hxx b/src/IGESData/IGESData_NodeOfSpecificLib.hxx index d96f224fc6..42f43f2351 100644 --- a/src/IGESData/IGESData_NodeOfSpecificLib.hxx +++ b/src/IGESData/IGESData_NodeOfSpecificLib.hxx @@ -21,10 +21,10 @@ #include #include +class Interface_Protocol; class IGESData_GlobalNodeOfSpecificLib; class IGESData_IGESEntity; class IGESData_SpecificModule; -class IGESData_Protocol; class IGESData_SpecificLib; @@ -49,7 +49,7 @@ public: Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const; //! Returns the Protocol designated by a precise Node - Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; //! Returns the Next Node. If none was defined, returned value //! is a Null Handle diff --git a/src/IGESData/IGESData_NodeOfSpecificLib_0.cxx b/src/IGESData/IGESData_NodeOfSpecificLib_0.cxx index 14927f2c10..8ce07ebde2 100644 --- a/src/IGESData/IGESData_NodeOfSpecificLib_0.cxx +++ b/src/IGESData/IGESData_NodeOfSpecificLib_0.cxx @@ -22,26 +22,13 @@ #include #include #include -#include #include - - - - - - - - - #define TheObject Handle(IGESData_IGESEntity) #define TheObject_hxx #define Handle_TheModule Handle(IGESData_SpecificModule) #define TheModule IGESData_SpecificModule #define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node IGESData_NodeOfSpecificLib @@ -51,4 +38,3 @@ #define LibCtl_Library IGESData_SpecificLib #define LibCtl_Library_hxx #include - diff --git a/src/IGESData/IGESData_NodeOfWriterLib.hxx b/src/IGESData/IGESData_NodeOfWriterLib.hxx index df4f59c67d..543b63e29c 100644 --- a/src/IGESData/IGESData_NodeOfWriterLib.hxx +++ b/src/IGESData/IGESData_NodeOfWriterLib.hxx @@ -21,10 +21,10 @@ #include #include +class Interface_Protocol; class IGESData_GlobalNodeOfWriterLib; class IGESData_IGESEntity; class IGESData_ReadWriteModule; -class IGESData_Protocol; class IGESData_WriterLib; @@ -49,7 +49,7 @@ public: Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const; //! Returns the Protocol designated by a precise Node - Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; //! Returns the Next Node. If none was defined, returned value //! is a Null Handle diff --git a/src/IGESData/IGESData_NodeOfWriterLib_0.cxx b/src/IGESData/IGESData_NodeOfWriterLib_0.cxx index 0ee9b8c504..c554c9362d 100644 --- a/src/IGESData/IGESData_NodeOfWriterLib_0.cxx +++ b/src/IGESData/IGESData_NodeOfWriterLib_0.cxx @@ -22,26 +22,13 @@ #include #include #include -#include #include - - - - - - - - - #define TheObject Handle(IGESData_IGESEntity) #define TheObject_hxx #define Handle_TheModule Handle(IGESData_ReadWriteModule) #define TheModule IGESData_ReadWriteModule #define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node IGESData_NodeOfWriterLib @@ -51,4 +38,3 @@ #define LibCtl_Library IGESData_WriterLib #define LibCtl_Library_hxx #include - diff --git a/src/IGESData/IGESData_Protocol.cxx b/src/IGESData/IGESData_Protocol.cxx index c40e5396c6..7817001251 100644 --- a/src/IGESData/IGESData_Protocol.cxx +++ b/src/IGESData/IGESData_Protocol.cxx @@ -24,16 +24,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESData_Protocol,Interface_Protocol) -IGESData_Protocol::IGESData_Protocol () { } - - - Standard_Integer IGESData_Protocol::NbResources () const { return 0; } - - Handle(Interface_Protocol) IGESData_Protocol::Resource - (const Standard_Integer /*num*/) const - { Handle(Interface_Protocol) nulpro; return nulpro; } - - // TypeNumber : Ici, on reconnait UndefinedEntity (faut bien quelqu un) Standard_Integer IGESData_Protocol::TypeNumber diff --git a/src/IGESData/IGESData_Protocol.hxx b/src/IGESData/IGESData_Protocol.hxx index 54497254c6..9d9e59b10e 100644 --- a/src/IGESData/IGESData_Protocol.hxx +++ b/src/IGESData/IGESData_Protocol.hxx @@ -37,17 +37,9 @@ DEFINE_STANDARD_HANDLE(IGESData_Protocol, Interface_Protocol) //! Undefined-FreeFormat-Entity class IGESData_Protocol : public Interface_Protocol { + public: -public: - - - Standard_EXPORT IGESData_Protocol(); - - //! Gives the count of Resource Protocol. Here, none - Standard_EXPORT Standard_Integer NbResources() const Standard_OVERRIDE; - - //! Returns a Resource, given a rank. Here, none - Standard_EXPORT Handle(Interface_Protocol) Resource (const Standard_Integer num) const Standard_OVERRIDE; + IGESData_Protocol() {} //! Returns a Case Number, specific of each recognized Type //! Here, Undefined and Free Format Entities have the Number 1. diff --git a/src/IGESData/IGESData_SpecificLib.hxx b/src/IGESData/IGESData_SpecificLib.hxx index 99454e5adb..8914d119ab 100644 --- a/src/IGESData/IGESData_SpecificLib.hxx +++ b/src/IGESData/IGESData_SpecificLib.hxx @@ -27,9 +27,8 @@ class IGESData_NodeOfSpecificLib; class Standard_NoSuchObject; class IGESData_IGESEntity; class IGESData_SpecificModule; -class IGESData_Protocol; class IGESData_GlobalNodeOfSpecificLib; -class Standard_Transient; +class Interface_Protocol; @@ -42,13 +41,13 @@ public: //! Adds a couple (Module-Protocol) into the global definition set //! for this class of Library. - Standard_EXPORT static void SetGlobal (const Handle(IGESData_SpecificModule)& amodule, const Handle(IGESData_Protocol)& aprotocol); + Standard_EXPORT static void SetGlobal (const Handle(IGESData_SpecificModule)& amodule, const Handle(Interface_Protocol)& aprotocol); //! Creates a Library which complies with a Protocol, that is : //! Same class (criterium IsInstance) //! This creation gets the Modules from the global set, those //! which are bound to the given Protocol and its Resources - Standard_EXPORT IGESData_SpecificLib(const Handle(IGESData_Protocol)& aprotocol); + Standard_EXPORT IGESData_SpecificLib(const Handle(Interface_Protocol)& aprotocol); //! Creates an empty Library : it will later by filled by method //! AddProtocol @@ -57,17 +56,13 @@ public: //! Adds a couple (Module-Protocol) to the Library, given the //! class of a Protocol. Takes Resources into account. //! (if is not of type TheProtocol, it is not added) - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol); //! Clears the list of Modules of a library (can be used to //! redefine the order of Modules before action : Clear then //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); - //! Sets a library to be defined with the complete Global list - //! (all the couples Protocol/Modules recorded in it) - Standard_EXPORT void SetComplete(); - //! Selects a Module from the Library, given an Object. //! Returns True if Select has succeeded, False else. //! Also Returns (as arguments) the selected Module and the Case @@ -90,7 +85,7 @@ public: Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const; //! Returns the current Protocol in the Iteration - Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; diff --git a/src/IGESData/IGESData_SpecificLib_0.cxx b/src/IGESData/IGESData_SpecificLib_0.cxx index f91251670d..0a91b118fc 100644 --- a/src/IGESData/IGESData_SpecificLib_0.cxx +++ b/src/IGESData/IGESData_SpecificLib_0.cxx @@ -20,9 +20,7 @@ #include #include #include -#include #include -#include #define TheObject Handle(IGESData_IGESEntity) @@ -30,9 +28,6 @@ #define Handle_TheModule Handle(IGESData_SpecificModule) #define TheModule IGESData_SpecificModule #define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node IGESData_NodeOfSpecificLib @@ -42,4 +37,3 @@ #define LibCtl_Library IGESData_SpecificLib #define LibCtl_Library_hxx #include - diff --git a/src/IGESData/IGESData_WriterLib.hxx b/src/IGESData/IGESData_WriterLib.hxx index d4f394f611..dc371b37ba 100644 --- a/src/IGESData/IGESData_WriterLib.hxx +++ b/src/IGESData/IGESData_WriterLib.hxx @@ -27,9 +27,8 @@ class IGESData_NodeOfWriterLib; class Standard_NoSuchObject; class IGESData_IGESEntity; class IGESData_ReadWriteModule; -class IGESData_Protocol; class IGESData_GlobalNodeOfWriterLib; -class Standard_Transient; +class Interface_Protocol; @@ -42,13 +41,13 @@ public: //! Adds a couple (Module-Protocol) into the global definition set //! for this class of Library. - Standard_EXPORT static void SetGlobal (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(IGESData_Protocol)& aprotocol); + Standard_EXPORT static void SetGlobal (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(Interface_Protocol)& aprotocol); //! Creates a Library which complies with a Protocol, that is : //! Same class (criterium IsInstance) //! This creation gets the Modules from the global set, those //! which are bound to the given Protocol and its Resources - Standard_EXPORT IGESData_WriterLib(const Handle(IGESData_Protocol)& aprotocol); + Standard_EXPORT IGESData_WriterLib(const Handle(Interface_Protocol)& aprotocol); //! Creates an empty Library : it will later by filled by method //! AddProtocol @@ -57,17 +56,13 @@ public: //! Adds a couple (Module-Protocol) to the Library, given the //! class of a Protocol. Takes Resources into account. //! (if is not of type TheProtocol, it is not added) - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol); //! Clears the list of Modules of a library (can be used to //! redefine the order of Modules before action : Clear then //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); - //! Sets a library to be defined with the complete Global list - //! (all the couples Protocol/Modules recorded in it) - Standard_EXPORT void SetComplete(); - //! Selects a Module from the Library, given an Object. //! Returns True if Select has succeeded, False else. //! Also Returns (as arguments) the selected Module and the Case @@ -90,7 +85,7 @@ public: Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const; //! Returns the current Protocol in the Iteration - Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; diff --git a/src/IGESData/IGESData_WriterLib_0.cxx b/src/IGESData/IGESData_WriterLib_0.cxx index af8fb61335..aaa8000d87 100644 --- a/src/IGESData/IGESData_WriterLib_0.cxx +++ b/src/IGESData/IGESData_WriterLib_0.cxx @@ -20,9 +20,7 @@ #include #include #include -#include #include -#include #define TheObject Handle(IGESData_IGESEntity) @@ -30,9 +28,6 @@ #define Handle_TheModule Handle(IGESData_ReadWriteModule) #define TheModule IGESData_ReadWriteModule #define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node IGESData_NodeOfWriterLib @@ -42,4 +37,3 @@ #define LibCtl_Library IGESData_WriterLib #define LibCtl_Library_hxx #include - diff --git a/src/IGESDefs/IGESDefs_Protocol.cxx b/src/IGESDefs/IGESDefs_Protocol.cxx index a38f9577b6..89b42d55c8 100644 --- a/src/IGESDefs/IGESDefs_Protocol.cxx +++ b/src/IGESDefs/IGESDefs_Protocol.cxx @@ -48,8 +48,7 @@ static Handle(Standard_Type) atype1,atype2,atype3,atype4,atype5,atype6,atype7; Handle(Interface_Protocol) IGESDefs_Protocol::Resource (const Standard_Integer /*num*/) const { - Handle(Interface_Protocol) res = IGESGraph::Protocol(); - return res; + return IGESGraph::Protocol(); } Standard_Integer IGESDefs_Protocol::TypeNumber diff --git a/src/IGESDimen/IGESDimen_Protocol.cxx b/src/IGESDimen/IGESDimen_Protocol.cxx index 87330aab09..6bc3ea6183 100644 --- a/src/IGESDimen/IGESDimen_Protocol.cxx +++ b/src/IGESDimen/IGESDimen_Protocol.cxx @@ -84,10 +84,9 @@ static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06, Handle(Interface_Protocol) IGESDimen_Protocol::Resource (const Standard_Integer num) const { - Handle(Interface_Protocol) res; - if (num == 1) res = IGESGraph::Protocol(); - if (num == 2) res = IGESGeom::Protocol(); - return res; + if (num == 1) return IGESGraph::Protocol(); + if (num == 2) return IGESGeom::Protocol(); + return NULL; } Standard_Integer IGESDimen_Protocol::TypeNumber diff --git a/src/IGESDraw/IGESDraw_Protocol.cxx b/src/IGESDraw/IGESDraw_Protocol.cxx index 95621fda4e..725211335f 100644 --- a/src/IGESDraw/IGESDraw_Protocol.cxx +++ b/src/IGESDraw/IGESDraw_Protocol.cxx @@ -63,8 +63,7 @@ static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06, Handle(Interface_Protocol) IGESDraw_Protocol::Resource (const Standard_Integer /*num*/) const { - Handle(Interface_Protocol) res = IGESDimen::Protocol();; - return res; + return IGESDimen::Protocol(); } Standard_Integer IGESDraw_Protocol::TypeNumber diff --git a/src/IGESFile/IGESFile_Read.cxx b/src/IGESFile/IGESFile_Read.cxx index c51dd98064..e59d52a90f 100644 --- a/src/IGESFile/IGESFile_Read.cxx +++ b/src/IGESFile/IGESFile_Read.cxx @@ -164,7 +164,6 @@ Standard_Integer IGESFile_Read iges_finfile(1); IGESData_IGESReaderTool IT (IR,protocol); IT.Prepare(reco); - IT.SetErrorHandle(Standard_True); // Sending of message : Loading of Model : Beginning IT.LoadModel(amodel); diff --git a/src/IGESGeom/IGESGeom_Protocol.cxx b/src/IGESGeom/IGESGeom_Protocol.cxx index 01117dc26f..38a5661f49 100644 --- a/src/IGESGeom/IGESGeom_Protocol.cxx +++ b/src/IGESGeom/IGESGeom_Protocol.cxx @@ -82,8 +82,7 @@ static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06, Handle(Interface_Protocol) IGESGeom_Protocol::Resource (const Standard_Integer /*num*/) const { - Handle(Interface_Protocol) res = IGESBasic::Protocol();; - return res; + return IGESBasic::Protocol(); } Standard_Integer IGESGeom_Protocol::TypeNumber diff --git a/src/IGESGraph/IGESGraph_Protocol.cxx b/src/IGESGraph/IGESGraph_Protocol.cxx index eb611faec8..b96dec34d2 100644 --- a/src/IGESGraph/IGESGraph_Protocol.cxx +++ b/src/IGESGraph/IGESGraph_Protocol.cxx @@ -63,8 +63,7 @@ static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06, Handle(Interface_Protocol) IGESGraph_Protocol::Resource (const Standard_Integer /*num*/) const { - Handle(Interface_Protocol) res = IGESBasic::Protocol();; - return res; + return IGESBasic::Protocol(); } Standard_Integer IGESGraph_Protocol::TypeNumber diff --git a/src/IGESSolid/IGESSolid_Protocol.cxx b/src/IGESSolid/IGESSolid_Protocol.cxx index c278ff1995..51fa6219fb 100644 --- a/src/IGESSolid/IGESSolid_Protocol.cxx +++ b/src/IGESSolid/IGESSolid_Protocol.cxx @@ -84,8 +84,7 @@ static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06, Handle(Interface_Protocol) IGESSolid_Protocol::Resource (const Standard_Integer /*num*/) const { - Handle(Interface_Protocol) res = IGESGeom::Protocol();; - return res; + return IGESGeom::Protocol(); } Standard_Integer IGESSolid_Protocol::TypeNumber diff --git a/src/Interface/Interface_CopyTool.cxx b/src/Interface/Interface_CopyTool.cxx index f281f79c38..9c36b0a14d 100644 --- a/src/Interface/Interface_CopyTool.cxx +++ b/src/Interface/Interface_CopyTool.cxx @@ -53,21 +53,6 @@ Interface_CopyTool::Interface_CopyTool const Handle(Interface_Protocol)& protocol) : thelib (protocol) , thelst (amodel->NbEntities()) { - thelst.Init(Standard_False); - themod = amodel; - themap = new Interface_CopyMap (amodel); - therep = new Interface_CopyMap (amodel); - thelev = 0; theimp = Standard_False; -} - - - Interface_CopyTool::Interface_CopyTool - (const Handle(Interface_InterfaceModel)& amodel) - : thelib (Interface_Protocol::Active()) , thelst (amodel->NbEntities()) -{ - if (Interface_Protocol::Active().IsNull()) Interface_InterfaceError::Raise - ("Interface CopyTool : Create with Active Protocol undefined"); - thelst.Init(Standard_False); themod = amodel; themap = new Interface_CopyMap (amodel); @@ -110,7 +95,6 @@ Interface_CopyTool::Interface_CopyTool Standard_Boolean res = thelib.Select (entfrom,themdu,theCN); if (res) res = themdu->NewVoid (theCN,entto); if (!res) res = themdu->NewCopiedCase (theCN,entfrom,entto,*this); -// if (!res) entto = entfrom->ShallowCopy(); sorry, nothing more possible return res; } @@ -283,23 +267,6 @@ Interface_CopyTool::Interface_CopyTool } - void Interface_CopyTool::FillModel - (const Handle(Interface_InterfaceModel)& bmodel) -{ -// Travaux preparatoires concernant les modeles -// On commence : cela implique le Header - bmodel->Clear(); - bmodel->GetFromAnother(themod); - -// Transfert Passe 1 : On prend les Entites prealablement copiees - Interface_EntityIterator list = CompleteResult(Standard_True); - bmodel->GetFromTransfer(list); - -// Transfert Passe 2 : recuperation des relations non "Share" (mais "Imply") - RenewImpliedRefs(); -} - - Interface_EntityIterator Interface_CopyTool::CompleteResult (const Standard_Boolean withreports) const { diff --git a/src/Interface/Interface_CopyTool.hxx b/src/Interface/Interface_CopyTool.hxx index 1f5ddf4225..a63d8410c2 100644 --- a/src/Interface/Interface_CopyTool.hxx +++ b/src/Interface/Interface_CopyTool.hxx @@ -67,7 +67,6 @@ public: DEFINE_STANDARD_ALLOC - //! Creates a CopyTool adapted to work from a Model. Works //! with a General Service Library, given as an argument Standard_EXPORT Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib); @@ -75,9 +74,6 @@ public: //! Same as above, but Library is defined through a Protocol Standard_EXPORT Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol); - //! Same as above, but works with the Active Protocol - Standard_EXPORT Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel); - //! Returns the Model on which the CopyTool works Standard_EXPORT Handle(Interface_InterfaceModel) Model() const; @@ -161,10 +157,6 @@ public: //! "back pointers". Standard_EXPORT void RenewImpliedRefs(); - //! Fills a Model with the result of the transfer (TransferList) - //! Commands copy of Header too, and calls RenewImpliedRefs - Standard_EXPORT void FillModel (const Handle(Interface_InterfaceModel)& bmodel); - //! Returns the complete list of copied Entities //! If is given True, the entities which were //! reported in the Starting Model are replaced in the list diff --git a/src/Interface/Interface_FileReaderTool.cxx b/src/Interface/Interface_FileReaderTool.cxx index 19ddbb97be..65b3c662e6 100644 --- a/src/Interface/Interface_FileReaderTool.cxx +++ b/src/Interface/Interface_FileReaderTool.cxx @@ -42,10 +42,7 @@ #endif #include -// MGE 16/06/98 -// To use Msg class #include -// To use TCollectionHAsciiString #include // Failure pour recuperer erreur en lecture fichier, @@ -62,68 +59,11 @@ //======================================================================= Interface_FileReaderTool::Interface_FileReaderTool () +: themessenger(Message::DefaultMessenger()), + thetrace(1), + thenbrep0(0), + thenbreps(0) { - themessenger = Message::DefaultMessenger(); - theerrhand = Standard_True; - thetrace = 1; - thenbrep0 = thenbreps = 0; -} - -//======================================================================= -//function : SetData -//purpose : -//======================================================================= - -void Interface_FileReaderTool::SetData(const Handle(Interface_FileReaderData)& reader, - const Handle(Interface_Protocol)& protocol) -{ - thereader = reader; - theproto = protocol; -} - - -//======================================================================= -//function : Protocol -//purpose : -//======================================================================= - -Handle(Interface_Protocol) Interface_FileReaderTool::Protocol () const -{ - return theproto; -} - - -//======================================================================= -//function : Data -//purpose : -//======================================================================= - -Handle(Interface_FileReaderData) Interface_FileReaderTool::Data () const -{ - return thereader; -} - - -//======================================================================= -//function : SetModel -//purpose : -//======================================================================= - -void Interface_FileReaderTool::SetModel - (const Handle(Interface_InterfaceModel)& amodel) -{ - themodel = amodel; -} - - -//======================================================================= -//function : Model -//purpose : -//======================================================================= - -Handle(Interface_InterfaceModel) Interface_FileReaderTool::Model () const -{ - return themodel; } //======================================================================= @@ -133,61 +73,7 @@ Handle(Interface_InterfaceModel) Interface_FileReaderTool::Model () const void Interface_FileReaderTool::SetMessenger (const Handle(Message_Messenger)& messenger) { - if ( messenger.IsNull() ) - themessenger = Message::DefaultMessenger(); - else - themessenger = messenger; -} - -//======================================================================= -//function : Messenger -//purpose : -//======================================================================= - -Handle(Message_Messenger) Interface_FileReaderTool::Messenger () const -{ - return themessenger; -} - -//======================================================================= -//function : SetTraceLevel -//purpose : -//======================================================================= - -void Interface_FileReaderTool::SetTraceLevel (const Standard_Integer tracelev) -{ - thetrace = tracelev; -} - -//======================================================================= -//function : TraceLevel -//purpose : -//======================================================================= - -Standard_Integer Interface_FileReaderTool::TraceLevel () const -{ - return thetrace; -} - -//======================================================================= -//function : SetErrorHandle -//purpose : -//======================================================================= - -void Interface_FileReaderTool::SetErrorHandle(const Standard_Boolean err) -{ - theerrhand = err; -} - - -//======================================================================= -//function : ErrorHandle -//purpose : -//======================================================================= - -Standard_Boolean Interface_FileReaderTool::ErrorHandle() const -{ - return theerrhand; + themessenger = ( messenger.IsNull()? Message::DefaultMessenger() : messenger ); } // .... Actions Connexes au CHARGEMENT DU MODELE .... @@ -213,16 +99,11 @@ void Interface_FileReaderTool::SetEntities () num = thereader->FindNextRecord(num)) { Handle(Standard_Transient) newent; Handle(Interface_Check) ach = new Interface_Check; - if (!Recognize (num,ach,newent)) { - newent = UnknownEntity(); - if (thereports.IsNull()) thereports = - new TColStd_HArray1OfTransient (1,thereader->NbRecords()); - thenbreps ++; thenbrep0 ++; - thereports->SetValue (num,new Interface_ReportEntity(ach,newent)); - } - else if ((ach->NbFails() + ach->NbWarnings() > 0) && !newent.IsNull()) { - if (thereports.IsNull()) thereports = - new TColStd_HArray1OfTransient (1,thereader->NbRecords()); + Standard_Boolean res = Recognize (num,ach,newent); + if (!res) newent = theproto->UnknownEntity(); + else res = ((ach->NbFails() + ach->NbWarnings()) == 0) || newent.IsNull(); + if (!res) { + if (thereports.IsNull()) thereports = new TColStd_HArray1OfTransient (1,thereader->NbRecords()); thenbreps ++; thenbrep0 ++; thereports->SetValue (num,new Interface_ReportEntity(ach,newent)); } @@ -231,66 +112,6 @@ void Interface_FileReaderTool::SetEntities () } -//======================================================================= -//function : RecognizeByLib -//purpose : -//======================================================================= - -Standard_Boolean Interface_FileReaderTool::RecognizeByLib(const Standard_Integer num, - Interface_GeneralLib& glib, - Interface_ReaderLib& rlib, - Handle(Interface_Check)& ach, - Handle(Standard_Transient)& ent) const -{ - Handle(Interface_GeneralModule) gmod; - Handle(Interface_ReaderModule) rmod; - Handle(Interface_Protocol) proto; - Standard_Integer CN = 0; -// Chercher dans ReaderLib : Reconnaissance de cas -> CN , proto - for (rlib.Start(); rlib.More(); rlib.Next()) { - rmod = rlib.Module(); - if (rmod.IsNull()) continue; - CN = rmod->CaseNum(thereader,num); - if (CN > 0) { proto = rlib.Protocol(); break; } - } - if (CN <= 0 || proto.IsNull()) return Standard_False; -// Se recaler dans GeneralLib : Creation de l entite vide - Handle(Standard_Type) typrot = proto->DynamicType(); - for (glib.Start(); glib.More(); glib.Next()) { - proto = glib.Protocol(); - if (proto.IsNull()) continue; - if (proto->DynamicType() != typrot) continue; - Standard_Boolean res = glib.Module()->NewVoid(CN,ent); - if (res) return res; - if (!rmod.IsNull()) return rmod->NewRead (CN,thereader,num,ach,ent); -// return res; - } - return Standard_False; -} - - -//======================================================================= -//function : UnknownEntity -//purpose : -//======================================================================= - -Handle(Standard_Transient) Interface_FileReaderTool::UnknownEntity() const -{ - return theproto->UnknownEntity(); -} - - -//======================================================================= -//function : NewModel -//purpose : -//======================================================================= - -Handle(Interface_InterfaceModel) Interface_FileReaderTool::NewModel() const -{ - return theproto->NewModel(); -} - - //======================================================================= //function : EndRead //purpose : @@ -309,8 +130,7 @@ void Interface_FileReaderTool::EndRead(const Handle(Interface_InterfaceModel)& ) //purpose : //======================================================================= -void Interface_FileReaderTool::LoadModel - (const Handle(Interface_InterfaceModel)& amodel) +void Interface_FileReaderTool::LoadModel (const Handle(Interface_InterfaceModel)& amodel) // // Methode generale de lecture d un fichier : il est lu via un FileReaderData // qui doit y donner acces de la facon la plus performante possible @@ -326,19 +146,15 @@ void Interface_FileReaderTool::LoadModel SetModel(amodel); // .. Demarrage : Lecture du Header .. - if (theerrhand) { - try { - OCC_CATCH_SIGNALS - BeginRead(amodel); // selon la norme - } - catch (Standard_Failure) { - // Sendinf of message : Internal error during the header reading - Message_Msg Msg11("XSTEP_11"); - TF->Send (Msg11, Message_Info); - } - } - else + try { + OCC_CATCH_SIGNALS BeginRead(amodel); // selon la norme + } + catch (Standard_Failure) { + // Sendinf of message : Internal error during the header reading + Message_Msg Msg11("XSTEP_11"); + TF->Send (Msg11, Message_Info); + } // .. Lecture des Entites .. @@ -430,7 +246,7 @@ void Interface_FileReaderTool::LoadModel thenbreps ++; Handle(Interface_ReportEntity) rep = new Interface_ReportEntity(ach,anent); - Handle(Standard_Transient) undef = UnknownEntity(); + Handle(Standard_Transient) undef = theproto->UnknownEntity(); AnalyseRecord(num,undef,ach); rep->SetContent(undef); @@ -476,19 +292,15 @@ void Interface_FileReaderTool::LoadModel } // Conclusion : peut ne rien faire : selon necessite - if (theerrhand) { - try { - OCC_CATCH_SIGNALS - EndRead(amodel); // selon la norme - } - catch (Standard_Failure) { - // Sendinf of message : Internal error during the header reading - Message_Msg Msg11("XSTEP_11"); - TF->Send (Msg11, Message_Info); - } - } - else + try { + OCC_CATCH_SIGNALS EndRead(amodel); // selon la norme + } + catch (Standard_Failure) { + // Sendinf of message : Internal error during the header reading + Message_Msg Msg11("XSTEP_11"); + TF->Send (Msg11, Message_Info); + } } @@ -497,8 +309,7 @@ void Interface_FileReaderTool::LoadModel //purpose : //======================================================================= -Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity - (const Standard_Integer num) +Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity (const Standard_Integer num) { Handle(Standard_Transient) anent = thereader->BoundEntity(num); Handle(Interface_Check) ach = new Interface_Check(anent); @@ -552,30 +363,47 @@ Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity // Rechargement ? si oui, dans une UnknownEntity fournie par le protocole if (thereader->IsErrorLoad()) nbf = (thereader->ResetErrorLoad() ? 1 : 0); if (nbf > 0) { - Handle(Standard_Transient) undef = UnknownEntity(); + Handle(Standard_Transient) undef = theproto->UnknownEntity(); AnalyseRecord(num,undef,ach); rep->SetContent(undef); } -// Conclusion (Unknown : traite en externe because traitement Raise) -//// if (irep > 0) themodel->SetReportEntity (nbe,rep); en bloc a la fin - return anent; } //======================================================================= -//function : ~Interface_FileReaderTool +//function : RecognizeByLib //purpose : //======================================================================= -Interface_FileReaderTool::~Interface_FileReaderTool() -{} - -void Interface_FileReaderTool::Clear() +Standard_Boolean Interface_FileReaderTool::RecognizeByLib(const Standard_Integer num, + Interface_GeneralLib& glib, + Interface_ReaderLib& rlib, + Handle(Interface_Check)& ach, + Handle(Standard_Transient)& ent) const { - theproto.Nullify(); - thereader.Nullify(); - themodel.Nullify(); - thereports.Nullify(); + Handle(Interface_GeneralModule) gmod; + Handle(Interface_ReaderModule) rmod; + Handle(Interface_Protocol) proto; + Standard_Integer CN = 0; +// Chercher dans ReaderLib : Reconnaissance de cas -> CN , proto + for (rlib.Start(); rlib.More(); rlib.Next()) { + rmod = rlib.Module(); + if (rmod.IsNull()) continue; + CN = rmod->CaseNum(thereader,num); + if (CN > 0) { proto = rlib.Protocol(); break; } + } + if (CN <= 0 || proto.IsNull()) return Standard_False; +// Se recaler dans GeneralLib : Creation de l entite vide + Handle(Standard_Type) typrot = proto->DynamicType(); + for (glib.Start(); glib.More(); glib.Next()) { + proto = glib.Protocol(); + if (proto.IsNull()) continue; + if (proto->DynamicType() != typrot) continue; + Standard_Boolean res = glib.Module()->NewVoid(CN,ent); + if (res) return res; + if (!rmod.IsNull()) return rmod->NewRead (CN,thereader,num,ach,ent); + } + return Standard_False; } diff --git a/src/Interface/Interface_FileReaderTool.hxx b/src/Interface/Interface_FileReaderTool.hxx index 216bb4aec9..228b0fde2a 100644 --- a/src/Interface/Interface_FileReaderTool.hxx +++ b/src/Interface/Interface_FileReaderTool.hxx @@ -55,21 +55,24 @@ public: DEFINE_STANDARD_ALLOC - //! Sets Data to a FileReaderData. Works with a Protocol - Standard_EXPORT void SetData (const Handle(Interface_FileReaderData)& reader, const Handle(Interface_Protocol)& protocol); + void SetData (const Handle(Interface_FileReaderData)& reader, const Handle(Interface_Protocol)& protocol) + { + thereader = reader; + theproto = protocol; + } //! Returns the Protocol given at creation time - Standard_EXPORT Handle(Interface_Protocol) Protocol() const; + const Handle(Interface_Protocol) & Protocol() const { return theproto; } //! Returns the FileReaderData which is used to work - Standard_EXPORT Handle(Interface_FileReaderData) Data() const; + const Handle(Interface_FileReaderData) & Data() const { return thereader; } //! Stores a Model. Used when the Model has been loaded - Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& amodel); + void SetModel (const Handle(Interface_InterfaceModel)& amodel) { themodel = amodel; } //! Returns the stored Model - Standard_EXPORT Handle(Interface_InterfaceModel) Model() const; + const Handle(Interface_InterfaceModel) & Model() const { return themodel; } //! Sets Messenger used for outputting messages Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger); @@ -77,7 +80,7 @@ public: //! Returns Messenger used for outputting messages. //! The returned object is guaranteed to be non-null; //! default is Message::Messenger(). - Standard_EXPORT Handle(Message_Messenger) Messenger() const; + const Handle(Message_Messenger) & Messenger() const { return themessenger; } //! Sets trace level used for outputting messages //! - 0: no trace at all @@ -85,20 +88,10 @@ public: //! - 2: errors and warnings //! - 3: all messages //! Default is 1 : Errors traced - Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev); + void SetTraceLevel (const Standard_Integer tracelev) { thetrace = tracelev; } //! Returns trace level used for outputting messages. - Standard_EXPORT Standard_Integer TraceLevel() const; - - //! Allows controlling whether exception raisings are handled - //! If err is False, they are not (hence, dbx can take control) - //! If err is True, they are, and they are traced - //! (by putting on messenger Entity's Number and file record num) - //! Default given at Model's creation time is True - Standard_EXPORT void SetErrorHandle (const Standard_Boolean err); - - //! Returns ErrorHandle flag - Standard_EXPORT Standard_Boolean ErrorHandle() const; + Standard_Integer TraceLevel() const { return thetrace; } //! Fills records with empty entities; once done, each entity can //! ask the FileReaderTool for any entity referenced through an @@ -106,39 +99,6 @@ public: //! type of FileReaderTool Standard_EXPORT void SetEntities(); - //! Recognizes a record, given its number. Specific to each - //! Interface; called by SetEntities. It can call the basic method - //! RecognizeByLib. - //! Returns False if recognition has failed, True else. - //! has not to be filled if simply Recognition has failed : - //! it must record true error messages : RecognizeByLib can - //! generate error messages if NewRead is called - //! - //! Note that it works thru a Recognizer (method Evaluate) which - //! has to be memorized before starting - Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) = 0; - - //! Recognizes a record with the help of Libraries. Can be used - //! to implement the method Recognize. - //! is used to find Protocol and CaseNumber to apply - //! performs the creation (by service NewVoid, or NewRead - //! if NewVoid gave no result) - //! is a check, which is transmitted to NewRead if it is - //! called, gives a result but which is false - //! is the result - //! Returns False if recognition has failed, True else - Standard_EXPORT Standard_Boolean RecognizeByLib (const Standard_Integer num, Interface_GeneralLib& glib, Interface_ReaderLib& rlib, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) const; - - //! Provides an unknown entity, specific to the Interface - //! called by SetEntities when Recognize has failed (Unknown alone) - //! or by LoadModel when an Entity has caused a Fail on reading - //! (to keep at least its literal description) - //! Uses Protocol to do it - Standard_EXPORT Handle(Standard_Transient) UnknownEntity() const; - - //! Creates an empty Model of the norm. Uses Protocol to do it - Standard_EXPORT Handle(Interface_InterfaceModel) NewModel() const; - //! Reads and fills Entities from the FileReaderData set by //! SetData to an InterfaceModel. //! It enchains required operations, the specific ones correspond @@ -155,6 +115,34 @@ public: //! Warning, by producing a ReportEntyty plus , for a Fail, a //! literal Content (as an UnknownEntity). Performs also Trace Standard_EXPORT Handle(Standard_Transient) LoadedEntity (const Standard_Integer num); + + protected: + + //! Constructor; sets default fields + Standard_EXPORT Interface_FileReaderTool(); + + //! Recognizes a record with the help of Libraries. Can be used + //! to implement the method Recognize. + //! is used to find Protocol and CaseNumber to apply + //! performs the creation (by service NewVoid, or NewRead + //! if NewVoid gave no result) + //! is a check, which is transmitted to NewRead if it is + //! called, gives a result but which is false + //! is the result + //! Returns False if recognition has failed, True else + Standard_EXPORT Standard_Boolean RecognizeByLib (const Standard_Integer num, Interface_GeneralLib& glib, Interface_ReaderLib& rlib, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) const; + + //! Recognizes a record, given its number. Specific to each + //! Interface; called by SetEntities. It can call the basic method + //! RecognizeByLib. + //! Returns False if recognition has failed, True else. + //! has not to be filled if simply Recognition has failed : + //! it must record true error messages : RecognizeByLib can + //! generate error messages if NewRead is called + //! + //! Note that it works thru a Recognizer (method Evaluate) which + //! has to be memorized before starting + Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) = 0; //! Fills model's header; each Interface defines for its Model its //! own file header; this method fills it from FileReaderTool.+ @@ -175,48 +163,20 @@ public: //! else (in case of syntactic fail) Standard_EXPORT virtual Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) = 0; - Standard_EXPORT virtual ~Interface_FileReaderTool(); - //! Ends file reading after reading all the entities //! default is doing nothing; redefinable as necessary - Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel); - - //! Clear filelds - Standard_EXPORT void Clear(); - - - - -protected: - - - //! Constructor; sets default fields - Standard_EXPORT Interface_FileReaderTool(); - - - - -private: - + Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel) = 0; + private: Handle(Interface_Protocol) theproto; Handle(Interface_FileReaderData) thereader; Handle(Interface_InterfaceModel) themodel; Handle(Message_Messenger) themessenger; Standard_Integer thetrace; - Standard_Boolean theerrhand; Standard_Integer thenbrep0; Standard_Integer thenbreps; Handle(TColStd_HArray1OfTransient) thereports; - - }; - - - - - - #endif // _Interface_FileReaderTool_HeaderFile diff --git a/src/Interface/Interface_GTool.cxx b/src/Interface/Interface_GTool.cxx index 48871b105a..1027eb599d 100644 --- a/src/Interface/Interface_GTool.cxx +++ b/src/Interface/Interface_GTool.cxx @@ -23,20 +23,11 @@ IMPLEMENT_STANDARD_RTTIEXT(Interface_GTool,MMgt_TShared) -Interface_GTool::Interface_GTool () { } - Interface_GTool::Interface_GTool (const Handle(Interface_Protocol)& proto, const Standard_Integer nb) : theproto (proto) , thelib (proto) { if (nb > 0) { thentnum.ReSize(nb); thentmod.ReSize(nb); } } - - void Interface_GTool::SetSignType (const Handle(Interface_SignType)& sign) - { thesign = sign; } - - Handle(Interface_SignType) Interface_GTool::SignType () const - { return thesign; } - Standard_CString Interface_GTool::SignValue (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const @@ -52,7 +43,6 @@ Interface_GTool::Interface_GTool () { } return thesign->Name(); } - void Interface_GTool::SetProtocol (const Handle(Interface_Protocol)& proto, const Standard_Boolean enforce) { @@ -62,12 +52,6 @@ Interface_GTool::Interface_GTool () { } thelib.AddProtocol (proto); } - Handle(Interface_Protocol) Interface_GTool::Protocol () const - { return theproto; } - - Interface_GeneralLib& Interface_GTool::Lib () - { return thelib; } - void Interface_GTool::Reservate (const Standard_Integer nb, const Standard_Boolean enforce) { diff --git a/src/Interface/Interface_GTool.hxx b/src/Interface/Interface_GTool.hxx index 43c11a0eab..02d1139345 100644 --- a/src/Interface/Interface_GTool.hxx +++ b/src/Interface/Interface_GTool.hxx @@ -46,22 +46,20 @@ DEFINE_STANDARD_HANDLE(Interface_GTool, MMgt_TShared) //! Shareable between several users : as a Handle class Interface_GTool : public MMgt_TShared { + public: -public: - - //! Creates an empty, not set, GTool - Standard_EXPORT Interface_GTool(); + Interface_GTool() {} //! Creates a GTool from a Protocol //! Optional starting count of entities Standard_EXPORT Interface_GTool(const Handle(Interface_Protocol)& proto, const Standard_Integer nbent = 0); //! Sets a new SignType - Standard_EXPORT void SetSignType (const Handle(Interface_SignType)& sign); + void SetSignType (const Handle(Interface_SignType)& sign) { thesign = sign; } //! Returns the SignType. Can be null - Standard_EXPORT Handle(Interface_SignType) SignType() const; + const Handle(Interface_SignType) & SignType() const { return thesign; } //! Returns the Signature for a Transient Object in a Model //! It calls SignType to do that @@ -77,11 +75,11 @@ public: Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto, const Standard_Boolean enforce = Standard_False); //! Returns the Protocol. Warning : it can be Null - Standard_EXPORT Handle(Interface_Protocol) Protocol() const; - + const Handle(Interface_Protocol) & Protocol() const { return theproto; } + //! Returns the GeneralLib itself - Standard_EXPORT Interface_GeneralLib& Lib(); - + Interface_GeneralLib& Lib() { return thelib; } + //! Reservates maps for a count of entities //! False : minimum count //! True : clears former reservations diff --git a/src/Interface/Interface_GeneralLib.hxx b/src/Interface/Interface_GeneralLib.hxx index c7c0bf5112..a1b0caa9ea 100644 --- a/src/Interface/Interface_GeneralLib.hxx +++ b/src/Interface/Interface_GeneralLib.hxx @@ -25,7 +25,7 @@ #include class Interface_NodeOfGeneralLib; class Standard_NoSuchObject; -class Standard_Transient; +class Interface_Protocol; class Interface_GeneralModule; class Interface_Protocol; class Interface_GlobalNodeOfGeneralLib; @@ -56,17 +56,13 @@ public: //! Adds a couple (Module-Protocol) to the Library, given the //! class of a Protocol. Takes Resources into account. //! (if is not of type TheProtocol, it is not added) - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol); //! Clears the list of Modules of a library (can be used to //! redefine the order of Modules before action : Clear then //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); - //! Sets a library to be defined with the complete Global list - //! (all the couples Protocol/Modules recorded in it) - Standard_EXPORT void SetComplete(); - //! Selects a Module from the Library, given an Object. //! Returns True if Select has succeeded, False else. //! Also Returns (as arguments) the selected Module and the Case diff --git a/src/Interface/Interface_GeneralLib_0.cxx b/src/Interface/Interface_GeneralLib_0.cxx index ccaa03aa4d..72a4787dae 100644 --- a/src/Interface/Interface_GeneralLib_0.cxx +++ b/src/Interface/Interface_GeneralLib_0.cxx @@ -20,7 +20,6 @@ #include #include #include -#include #include @@ -29,9 +28,6 @@ #define Handle_TheModule Handle(Interface_GeneralModule) #define TheModule Interface_GeneralModule #define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node Interface_NodeOfGeneralLib diff --git a/src/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx b/src/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx index f3d758b87c..eaafe4a9dd 100644 --- a/src/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx +++ b/src/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx @@ -19,29 +19,16 @@ #include #include -#include #include #include #include #include - - - - - - - - - #define TheObject Handle(Standard_Transient) #define TheObject_hxx #define Handle_TheModule Handle(Interface_GeneralModule) #define TheModule Interface_GeneralModule #define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node Interface_NodeOfGeneralLib @@ -51,4 +38,3 @@ #define LibCtl_Library Interface_GeneralLib #define LibCtl_Library_hxx #include - diff --git a/src/Interface/Interface_GlobalNodeOfReaderLib_0.cxx b/src/Interface/Interface_GlobalNodeOfReaderLib_0.cxx index 38ada70de6..2a04743d7f 100644 --- a/src/Interface/Interface_GlobalNodeOfReaderLib_0.cxx +++ b/src/Interface/Interface_GlobalNodeOfReaderLib_0.cxx @@ -19,29 +19,16 @@ #include #include -#include #include #include #include #include - - - - - - - - - #define TheObject Handle(Standard_Transient) #define TheObject_hxx #define Handle_TheModule Handle(Interface_ReaderModule) #define TheModule Interface_ReaderModule #define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node Interface_NodeOfReaderLib @@ -51,4 +38,3 @@ #define LibCtl_Library Interface_ReaderLib #define LibCtl_Library_hxx #include - diff --git a/src/Interface/Interface_Graph.cxx b/src/Interface/Interface_Graph.cxx index f02a4e478c..972558b94c 100644 --- a/src/Interface/Interface_Graph.cxx +++ b/src/Interface/Interface_Graph.cxx @@ -440,7 +440,7 @@ Handle(TCollection_HAsciiString) Interface_Graph::Name(const Handle(Standard_Tr if (themodel.IsNull()) return str; if (themodel->Number(ent)) return str; - Handle(Interface_GTool) gtool = themodel->GTool(); + const Handle(Interface_GTool) >ool = themodel->GTool(); if (gtool.IsNull()) return str; Handle(Interface_GeneralModule) module; diff --git a/src/Interface/Interface_Graph.hxx b/src/Interface/Interface_Graph.hxx index ea0c8f4c63..7c42dfb583 100644 --- a/src/Interface/Interface_Graph.hxx +++ b/src/Interface/Interface_Graph.hxx @@ -31,7 +31,6 @@ class Interface_GeneralLib; class Interface_Protocol; -class Interface_GTool; class Standard_Transient; class Interface_BitMap; class Interface_EntityIterator; diff --git a/src/Interface/Interface_InterfaceModel.cxx b/src/Interface/Interface_InterfaceModel.cxx index 445edea14d..100b3f65e2 100644 --- a/src/Interface/Interface_InterfaceModel.cxx +++ b/src/Interface/Interface_InterfaceModel.cxx @@ -83,7 +83,7 @@ Interface_InterfaceModel::~Interface_InterfaceModel () // on fait un mimumum void Interface_InterfaceModel::SetProtocol(const Handle(Interface_Protocol)& proto) { - thegtool = new Interface_GTool(proto); + myGTool = new Interface_GTool(proto); } @@ -92,10 +92,10 @@ void Interface_InterfaceModel::SetProtocol(const Handle(Interface_Protocol)& pro //purpose : //======================================================================= -Handle(Interface_Protocol) Interface_InterfaceModel::Protocol () const +const Handle(Interface_Protocol) & Interface_InterfaceModel::Protocol () const { - Handle(Interface_Protocol) proto; - if (!thegtool.IsNull()) return thegtool->Protocol(); + static const Handle(Interface_Protocol) proto; + if (!myGTool.IsNull()) return myGTool->Protocol(); return proto; } @@ -127,8 +127,8 @@ void Interface_InterfaceModel::ClearEntities () therepch.Clear(); haschecksem = Standard_False; - if (!thegtool.IsNull()) { - thegtool->ClearEntities(); //smh#14 FRA62479 + if (!myGTool.IsNull()) { + myGTool->ClearEntities(); //smh#14 FRA62479 } isdispatch = Standard_False; theentities.Clear(); @@ -181,8 +181,8 @@ Standard_Integer Interface_InterfaceModel::Number (const Handle(Standard_Transie Standard_Integer Interface_InterfaceModel::NbTypes (const Handle(Standard_Transient)& ent) const { - if (Protocol().IsNull()) return 1; - return Protocol()->NbTypes(ent); + if (myGTool.IsNull() || myGTool->Protocol().IsNull()) return 1; + return myGTool->Protocol()->NbTypes(ent); } @@ -194,8 +194,8 @@ Standard_Integer Interface_InterfaceModel::NbTypes (const Handle(Standard_Transi Handle(Standard_Type) Interface_InterfaceModel::Type (const Handle(Standard_Transient)& ent, const Standard_Integer nt) const { - if (Protocol().IsNull()) return ent->DynamicType(); - return Protocol()->Type(ent,nt); + if (myGTool.IsNull() || myGTool->Protocol().IsNull()) return ent->DynamicType(); + return myGTool->Protocol()->Type(ent,nt); } @@ -207,7 +207,7 @@ Handle(Standard_Type) Interface_InterfaceModel::Type Standard_CString Interface_InterfaceModel::TypeName (const Handle(Standard_Transient)& ent, const Standard_Boolean complet) const { - if (!thegtool.IsNull()) return thegtool->SignValue (ent,this); + if (!myGTool.IsNull()) return myGTool->SignValue (ent,this); Standard_CString tn = ent->DynamicType()->Name(); if (complet) return tn; return Interface_InterfaceModel::ClassName(tn); @@ -501,7 +501,8 @@ void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& ane } Interface_GeneralLib lib(proto); AddWithRefs (anent,lib,level,listall); - if (Protocol().IsNull() && !proto.IsNull()) SetProtocol(proto); + if ((myGTool.IsNull() || myGTool->Protocol().IsNull()) && !proto.IsNull()) + SetProtocol(proto); } @@ -514,10 +515,9 @@ void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& ane const Standard_Integer level, const Standard_Boolean listall) { - Handle(Interface_Protocol) proto = Protocol(); - if (proto.IsNull()) Interface_InterfaceMismatch::Raise - ("InterfaceModel : AddWithRefs"); - AddWithRefs (anent,proto,level,listall); + if (myGTool.IsNull() || myGTool->Protocol().IsNull()) + Interface_InterfaceMismatch::Raise ("InterfaceModel : AddWithRefs"); + AddWithRefs (anent,myGTool->Protocol(),level,listall); } diff --git a/src/Interface/Interface_InterfaceModel.hxx b/src/Interface/Interface_InterfaceModel.hxx index b949584b58..bf7e3da6b0 100644 --- a/src/Interface/Interface_InterfaceModel.hxx +++ b/src/Interface/Interface_InterfaceModel.hxx @@ -78,13 +78,13 @@ class Interface_InterfaceModel : public MMgt_TShared //! Returns the Protocol which has been set by SetProtocol, or //! AddWithRefs with Protocol - Standard_EXPORT virtual Handle(Interface_Protocol) Protocol() const; + Standard_EXPORT const Handle(Interface_Protocol) & Protocol() const; //! Sets a GTool for this model, which already defines a Protocol - void SetGTool (const Handle(Interface_GTool)& gtool) { thegtool = gtool; } + void SetGTool (const Handle(Interface_GTool)& gtool) { myGTool = gtool; } //! Returns the GTool, set by SetProtocol or by SetGTool - const Handle(Interface_GTool) & GTool() const { return thegtool; } + const Handle(Interface_GTool) & GTool() const { return myGTool; } //! Returns the Dispatch Status, either for get or set //! A Model which is produced from Dispatch may share entities @@ -276,16 +276,6 @@ class Interface_InterfaceModel : public MMgt_TShared //! Transfer tool (e.g TransferCopy). Starts from clear Standard_EXPORT void GetFromTransfer (const Interface_EntityIterator& aniter); - //! Gets header (data specific of a defined Interface) from - //! another InterfaceModel; called from TransferCopy - Standard_EXPORT virtual void GetFromAnother (const Handle(Interface_InterfaceModel)& other) = 0; - - //! Returns a New Empty Model, same type as (whatever its - //! Type); called to Copy parts a Model into other ones, then - //! followed by a call to GetFromAnother (Header) then filling - //! with specified Entities, themselves copied - Standard_EXPORT virtual Handle(Interface_InterfaceModel) NewEmptyModel() const = 0; - //! Records a category number for an entity number //! Returns True when done, False if is out of range Standard_EXPORT Standard_Boolean SetCategoryNumber (const Standard_Integer num, const Standard_Integer val); @@ -386,7 +376,7 @@ class Interface_InterfaceModel : public MMgt_TShared Standard_Boolean haschecksem; Standard_Boolean isdispatch; Handle(TCollection_HAsciiString) thecategory; - Handle(Interface_GTool) thegtool; + Handle(Interface_GTool) myGTool; }; #endif // _Interface_InterfaceModel_HeaderFile diff --git a/src/Interface/Interface_NodeOfGeneralLib_0.cxx b/src/Interface/Interface_NodeOfGeneralLib_0.cxx index 7c7f89420e..3632529d4f 100644 --- a/src/Interface/Interface_NodeOfGeneralLib_0.cxx +++ b/src/Interface/Interface_NodeOfGeneralLib_0.cxx @@ -22,26 +22,13 @@ #include #include #include -#include #include - - - - - - - - - #define TheObject Handle(Standard_Transient) #define TheObject_hxx #define Handle_TheModule Handle(Interface_GeneralModule) #define TheModule Interface_GeneralModule #define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node Interface_NodeOfGeneralLib diff --git a/src/Interface/Interface_NodeOfReaderLib_0.cxx b/src/Interface/Interface_NodeOfReaderLib_0.cxx index 8bbf93d360..cd13c3ff43 100644 --- a/src/Interface/Interface_NodeOfReaderLib_0.cxx +++ b/src/Interface/Interface_NodeOfReaderLib_0.cxx @@ -22,26 +22,13 @@ #include #include #include -#include #include - - - - - - - - - #define TheObject Handle(Standard_Transient) #define TheObject_hxx #define Handle_TheModule Handle(Interface_ReaderModule) #define TheModule Interface_ReaderModule #define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node Interface_NodeOfReaderLib @@ -51,4 +38,3 @@ #define LibCtl_Library Interface_ReaderLib #define LibCtl_Library_hxx #include - diff --git a/src/Interface/Interface_Protocol.cxx b/src/Interface/Interface_Protocol.cxx index 6a69811e6f..2aab20ac27 100644 --- a/src/Interface/Interface_Protocol.cxx +++ b/src/Interface/Interface_Protocol.cxx @@ -12,60 +12,33 @@ // commercial license or contractual agreement. -#include -#include -#include -#include #include -#include -#include IMPLEMENT_STANDARD_RTTIEXT(Interface_Protocol,MMgt_TShared) -// Gestion du Protocol actif : tres simple, une variable statique -static Handle(Interface_Protocol)& theactive() -{ - static Handle(Interface_Protocol) theact; - return theact; -} - - -//======================================================================= -//function : Active -//purpose : -//======================================================================= - -Handle(Interface_Protocol) Interface_Protocol::Active () -{ - return theactive(); -} - - + //======================================================================= -//function : SetActive +//function : NbResources //purpose : //======================================================================= -void Interface_Protocol::SetActive(const Handle(Interface_Protocol)& aprotocol) +Standard_Integer Interface_Protocol::NbResources() const { - theactive() = aprotocol; + return 0; } //======================================================================= -//function : ClearActive +//function : Resource //purpose : //======================================================================= -void Interface_Protocol::ClearActive () +Handle(Interface_Protocol) Interface_Protocol::Resource (const Standard_Integer) const { - theactive().Nullify(); + return NULL; } -// === Typage (formules fournies par defaut) - - //======================================================================= //function : CaseNumber //purpose : diff --git a/src/Interface/Interface_Protocol.hxx b/src/Interface/Interface_Protocol.hxx index 0a870c04b6..df25e2f449 100644 --- a/src/Interface/Interface_Protocol.hxx +++ b/src/Interface/Interface_Protocol.hxx @@ -44,26 +44,13 @@ DEFINE_STANDARD_HANDLE(Interface_Protocol, MMgt_TShared) //! like multi-typing, may involve another way class Interface_Protocol : public MMgt_TShared { - -public: - - - //! Returns the Active Protocol, if defined (else, returns a - //! Null Handle, which means "no defined active protocol") - Standard_EXPORT static Handle(Interface_Protocol) Active(); - - //! Sets a given Protocol to be the Active one (for the users of - //! Active, see just above). Applies to every sub-type of Protocol - Standard_EXPORT static void SetActive (const Handle(Interface_Protocol)& aprotocol); - - //! Erases the Active Protocol (hence it becomes undefined) - Standard_EXPORT static void ClearActive(); + public: //! Returns count of Protocol used as Resources (level one) - Standard_EXPORT virtual Standard_Integer NbResources() const = 0; + Standard_EXPORT virtual Standard_Integer NbResources() const; //! Returns a Resource, given its rank (between 1 and NbResources) - Standard_EXPORT virtual Handle(Interface_Protocol) Resource (const Standard_Integer num) const = 0; + Standard_EXPORT virtual Handle(Interface_Protocol) Resource (const Standard_Integer num) const; //! Returns a unique positive CaseNumber for each Recognized //! Object. By default, recognition is based on Type(1) @@ -114,27 +101,7 @@ public: //! (for an Entity out of the Norm, answer can be unpredicable) Standard_EXPORT virtual Standard_Boolean IsUnknownEntity (const Handle(Standard_Transient)& ent) const = 0; - - - DEFINE_STANDARD_RTTIEXT(Interface_Protocol,MMgt_TShared) - -protected: - - - - -private: - - - - }; - - - - - - #endif // _Interface_Protocol_HeaderFile diff --git a/src/Interface/Interface_ReaderLib.hxx b/src/Interface/Interface_ReaderLib.hxx index 7d982d8e0b..da8d42ed47 100644 --- a/src/Interface/Interface_ReaderLib.hxx +++ b/src/Interface/Interface_ReaderLib.hxx @@ -25,7 +25,6 @@ #include class Interface_NodeOfReaderLib; class Standard_NoSuchObject; -class Standard_Transient; class Interface_ReaderModule; class Interface_Protocol; class Interface_GlobalNodeOfReaderLib; @@ -56,17 +55,13 @@ public: //! Adds a couple (Module-Protocol) to the Library, given the //! class of a Protocol. Takes Resources into account. //! (if is not of type TheProtocol, it is not added) - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol); //! Clears the list of Modules of a library (can be used to //! redefine the order of Modules before action : Clear then //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); - //! Sets a library to be defined with the complete Global list - //! (all the couples Protocol/Modules recorded in it) - Standard_EXPORT void SetComplete(); - //! Selects a Module from the Library, given an Object. //! Returns True if Select has succeeded, False else. //! Also Returns (as arguments) the selected Module and the Case diff --git a/src/Interface/Interface_ReaderLib_0.cxx b/src/Interface/Interface_ReaderLib_0.cxx index 3c574f2138..42a5e443bd 100644 --- a/src/Interface/Interface_ReaderLib_0.cxx +++ b/src/Interface/Interface_ReaderLib_0.cxx @@ -20,7 +20,6 @@ #include #include #include -#include #include @@ -29,9 +28,6 @@ #define Handle_TheModule Handle(Interface_ReaderModule) #define TheModule Interface_ReaderModule #define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node Interface_NodeOfReaderLib @@ -41,4 +37,3 @@ #define LibCtl_Library Interface_ReaderLib #define LibCtl_Library_hxx #include - diff --git a/src/Interface/Interface_ReaderModule.cxx b/src/Interface/Interface_ReaderModule.cxx index 152e9a3848..b3dd26e269 100644 --- a/src/Interface/Interface_ReaderModule.cxx +++ b/src/Interface/Interface_ReaderModule.cxx @@ -12,12 +12,7 @@ // commercial license or contractual agreement. -#include -#include #include -#include -#include -#include IMPLEMENT_STANDARD_RTTIEXT(Interface_ReaderModule,MMgt_TShared) diff --git a/src/Interface/Interface_ReaderModule.hxx b/src/Interface/Interface_ReaderModule.hxx index 693a8c39df..78e6cc47e2 100644 --- a/src/Interface/Interface_ReaderModule.hxx +++ b/src/Interface/Interface_ReaderModule.hxx @@ -21,12 +21,8 @@ #include #include -#include -#include -class Standard_DomainError; class Interface_FileReaderData; class Interface_Check; -class Standard_Transient; class Interface_ReaderModule; @@ -43,10 +39,8 @@ DEFINE_STANDARD_HANDLE(Interface_ReaderModule, MMgt_TShared) //! ReaderModule reads it according to this Case Number class Interface_ReaderModule : public MMgt_TShared { + public: -public: - - //! Translates the type of record in to a positive //! Case Number. If Recognition fails, must return 0 Standard_EXPORT virtual Standard_Integer CaseNum (const Handle(Interface_FileReaderData)& data, const Standard_Integer num) const = 0; @@ -69,27 +63,7 @@ public: //! treated as "Unrecognized case" by reader tool. Standard_EXPORT virtual Standard_Boolean NewRead (const Standard_Integer casenum, const Handle(Interface_FileReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) const; - - - DEFINE_STANDARD_RTTIEXT(Interface_ReaderModule,MMgt_TShared) - -protected: - - - - -private: - - - - }; - - - - - - #endif // _Interface_ReaderModule_HeaderFile diff --git a/src/Interface/Interface_ShareFlags.cxx b/src/Interface/Interface_ShareFlags.cxx index 6245cd53ce..49cfbb2074 100644 --- a/src/Interface/Interface_ShareFlags.cxx +++ b/src/Interface/Interface_ShareFlags.cxx @@ -59,7 +59,7 @@ Interface_ShareFlags::Interface_ShareFlags (const Handle(Interface_InterfaceModel)& amodel) : theflags (amodel->NbEntities()) { - Handle(Interface_GTool) gtool = themodel->GTool(); + const Handle(Interface_GTool) >ool = themodel->GTool(); gtool->Reservate(amodel->NbEntities()); themodel = amodel; Evaluate (gtool->Lib(),gtool); diff --git a/src/Interface/Interface_ShareTool.cxx b/src/Interface/Interface_ShareTool.cxx index ea4c58d7bc..320b076dcd 100644 --- a/src/Interface/Interface_ShareTool.cxx +++ b/src/Interface/Interface_ShareTool.cxx @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/src/LibCtl/LibCtl_GlobalNode.gxx b/src/LibCtl/LibCtl_GlobalNode.gxx index a989a1dad2..ab609c4ed8 100644 --- a/src/LibCtl/LibCtl_GlobalNode.gxx +++ b/src/LibCtl/LibCtl_GlobalNode.gxx @@ -12,19 +12,18 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -//#include - // Classe generique imbriquee dans Library : utilisee pour construire les // listes globales de Modules attaches a une classe instanciee de Library // (cf Library pour plus de details) +#include LibCtl_GlobalNode::LibCtl_GlobalNode () { } // ATTENTION, Add agit en substitution : pour un Protocol donne, c est le // dernier appel qui l emporte void LibCtl_GlobalNode::Add - (const Handle(TheModule)& amodule, const Handle(TheProtocol)& aprotocol) + (const Handle(TheModule)& amodule, const Handle(Interface_Protocol)& aprotocol) { if (themod == amodule) return; if (theprot == aprotocol) themod = amodule; @@ -41,7 +40,7 @@ LibCtl_GlobalNode::LibCtl_GlobalNode () { } const Handle(TheModule)& LibCtl_GlobalNode::Module () const { return themod; } - const Handle(TheProtocol)& LibCtl_GlobalNode::Protocol () const + const Handle(Interface_Protocol)& LibCtl_GlobalNode::Protocol () const { return theprot; } const Handle(LibCtl_GlobalNode)& LibCtl_GlobalNode::Next () const diff --git a/src/LibCtl/LibCtl_Library.gxx b/src/LibCtl/LibCtl_Library.gxx index af880064ef..7e9edac52e 100644 --- a/src/LibCtl/LibCtl_Library.gxx +++ b/src/LibCtl/LibCtl_Library.gxx @@ -12,7 +12,7 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -//#include +#include #include @@ -22,7 +22,7 @@ static Handle(LibCtl_GlobalNode) theglobal; // Donnees pour optimisation (dernier Protocole demande) -static Handle(TheProtocol) theprotocol; +static Handle(Interface_Protocol) theprotocol; static Handle(LibCtl_Node) thelast; @@ -30,14 +30,14 @@ static Handle(LibCtl_Node) thelast; // ATTENTION : SetGlobal fait de la substitution, c-a-d que c est le dernier // qui a raison pour un Protocol donne void LibCtl_Library::SetGlobal - (const Handle(TheModule)& amodule, const Handle(TheProtocol)& aprotocol) + (const Handle(TheModule)& amodule, const Handle(Interface_Protocol)& aprotocol) { if (theglobal.IsNull()) theglobal = new LibCtl_GlobalNode; theglobal->Add(amodule,aprotocol); } // Constructeur d apres Protocole - LibCtl_Library::LibCtl_Library (const Handle(TheProtocol)& aprotocol) + LibCtl_Library::LibCtl_Library (const Handle(Interface_Protocol)& aprotocol) { Standard_Boolean last = Standard_False; if (aprotocol.IsNull()) return; // PAS de protocole = Lib VIDE @@ -60,17 +60,14 @@ static Handle(LibCtl_Node) thelast; // Ajout d un Protocol : attention, desoptimise (sinon risque de confusion !) void LibCtl_Library::AddProtocol - (const Handle(Standard_Transient)& aprotocol) + (const Handle(Interface_Protocol)& aprotocol) { -// DownCast car Protocol->Resources, meme redefini et utilise dans d autres -// librairies, doit toujours renvoyer le type le plus haut - Handle(TheProtocol) aproto = Handle(TheProtocol)::DownCast(aprotocol); - if (aproto.IsNull()) return; + if (aprotocol.IsNull()) return; // D abord, ajouter celui-ci a la liste : chercher le Node Handle(LibCtl_GlobalNode) curr; for (curr = theglobal; !curr.IsNull(); ) { // curr->Next : plus loin - const Handle(TheProtocol)& protocol = curr->Protocol(); + const Handle(Interface_Protocol)& protocol = curr->Protocol(); if (!protocol.IsNull()) { // Match Protocol ? if (protocol->DynamicType() == aprotocol->DynamicType()) { @@ -82,9 +79,9 @@ static Handle(LibCtl_Node) thelast; curr = curr->Next(); // cette formule est refusee dans "for" } // Ensuite, Traiter les ressources - Standard_Integer nb = aproto->NbResources(); + Standard_Integer nb = aprotocol->NbResources(); for (Standard_Integer i = 1; i <= nb; i ++) { - AddProtocol (aproto->Resource(i)); + AddProtocol (aprotocol->Resource(i)); } // Ne pas oublier de desoptimiser theprotocol.Nullify(); @@ -94,20 +91,6 @@ static Handle(LibCtl_Node) thelast; void LibCtl_Library::Clear () { thelist = new LibCtl_Node; } - void LibCtl_Library::SetComplete () -{ - thelist = new LibCtl_Node; -// On prend chacun des Protocoles de la Liste Globale et on l ajoute - Handle(LibCtl_GlobalNode) curr; - for (curr = theglobal; !curr.IsNull(); ) { // curr->Next : plus loin - const Handle(TheProtocol)& protocol = curr->Protocol(); -// Comme on prend tout tout tout, on ne se preoccupe pas des Ressources ! - if (!protocol.IsNull()) thelist->AddNode(curr); - curr = curr->Next(); // cette formule est refusee dans "for" - } -} - - // Selection : Tres fort, on retourne le Module correspondant a un Type // (ainsi que le CaseNumber retourne par le protocole correspondant) @@ -119,7 +102,7 @@ static Handle(LibCtl_Node) thelast; if (thelist.IsNull()) return Standard_False; Handle(LibCtl_Node) curr = thelist; for (curr = thelist; !curr.IsNull(); ) { // curr->Next : plus loin - const Handle(TheProtocol)& protocol = curr->Protocol(); + const Handle(Interface_Protocol)& protocol = curr->Protocol(); if (!protocol.IsNull()) { CN = protocol->CaseNumber(obj); if (CN > 0) { @@ -150,7 +133,7 @@ static Handle(LibCtl_Node) thelast; return thecurr->Module(); } - const Handle(TheProtocol)& LibCtl_Library::Protocol () const + const Handle(Interface_Protocol)& LibCtl_Library::Protocol () const { if (thecurr.IsNull()) Standard_NoSuchObject::Raise("Library from LibCtl"); return thecurr->Protocol(); diff --git a/src/LibCtl/LibCtl_Node.gxx b/src/LibCtl/LibCtl_Node.gxx index 831defa677..176f2a8cca 100644 --- a/src/LibCtl/LibCtl_Node.gxx +++ b/src/LibCtl/LibCtl_Node.gxx @@ -12,9 +12,6 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -//#include - - // Classe generique imbriquee dans Library : utilisee pour construire la // listes de Modules d une librairie (cf Library pour plus de details) // (En fait : Liste de Global Nodes -> Module + Protocol) @@ -38,7 +35,7 @@ LibCtl_Node::LibCtl_Node () { } const Handle(TheModule)& LibCtl_Node::Module () const { return thenode->Module(); } - const Handle(TheProtocol)& LibCtl_Node::Protocol () const + const Handle(Interface_Protocol)& LibCtl_Node::Protocol () const { return thenode->Protocol(); } const Handle(LibCtl_Node)& LibCtl_Node::Next () const diff --git a/src/RWHeaderSection/RWHeaderSection.cxx b/src/RWHeaderSection/RWHeaderSection.cxx index f9e63df35b..7d6302e8ee 100644 --- a/src/RWHeaderSection/RWHeaderSection.cxx +++ b/src/RWHeaderSection/RWHeaderSection.cxx @@ -15,14 +15,13 @@ #include #include #include -#include +#include static Handle(RWHeaderSection_ReadWriteModule) rwm; static Handle(RWHeaderSection_GeneralModule) rwg; void RWHeaderSection::Init() { - const Handle(StepData_Protocol) &hp = StepData::HeaderProtocol(); if (rwm.IsNull()) rwm = new RWHeaderSection_ReadWriteModule; if (rwg.IsNull()) rwg = new RWHeaderSection_GeneralModule; } diff --git a/src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx b/src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx index 4957a2e2b7..e69f1d3aea 100644 --- a/src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx +++ b/src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx @@ -12,6 +12,7 @@ // commercial license or contractual agreement. +#include #include #include #include @@ -44,9 +45,9 @@ static TCollection_AsciiString Reco_FileSchema ("FILE_SCHEMA"); RWHeaderSection_ReadWriteModule::RWHeaderSection_ReadWriteModule () { - Handle(HeaderSection_Protocol) protocol = new HeaderSection_Protocol; - StepData_WriterLib::SetGlobal(this,protocol); - Interface_ReaderLib::SetGlobal(this,protocol); + const Handle(HeaderSection_Protocol) &protocol = HeaderSection::Protocol(); + StepData_WriterLib::SetGlobal(this,protocol); + Interface_ReaderLib::SetGlobal(this,protocol); } // --- Case Recognition --- diff --git a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx index 8a362657ac..7338e47694 100644 --- a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx +++ b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx @@ -26,7 +26,6 @@ #include #include #include -#include #include IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule) @@ -2041,9 +2040,6 @@ static Handle(Dico_DictionaryOfInteger) typeshor; RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule () { -// Handle(StepAP214_Protocol) protocol = new StepAP214_Protocol; -// StepData_WriterLib::SetGlobal(Handle(RWStepAP214_ReadWriteModule)::DownCast(This()),protocol); -// Interface_ReaderLib::SetGlobal(Handle(RWStepAP214_ReadWriteModule)::DownCast(This()),protocol); if (!typenums.IsNull()) return; typenums = new Dico_DictionaryOfInteger; typenums->SetItem (Reco_CartesianPoint, 59); diff --git a/src/STEPSelections/STEPSelections_SelectDerived.cxx b/src/STEPSelections/STEPSelections_SelectDerived.cxx index 6a39a1f974..95123d4f4a 100644 --- a/src/STEPSelections/STEPSelections_SelectDerived.cxx +++ b/src/STEPSelections/STEPSelections_SelectDerived.cxx @@ -27,10 +27,6 @@ IMPLEMENT_STANDARD_RTTIEXT(STEPSelections_SelectDerived,StepSelect_StepType) -STEPSelections_SelectDerived::STEPSelections_SelectDerived():StepSelect_StepType() -{ -} - static Handle(Standard_Type) GetStepType(const Handle(StepData_ReadWriteModule)& module, const TCollection_AsciiString& type) { diff --git a/src/STEPSelections/STEPSelections_SelectDerived.hxx b/src/STEPSelections/STEPSelections_SelectDerived.hxx index 434c405bae..232c04b979 100644 --- a/src/STEPSelections/STEPSelections_SelectDerived.hxx +++ b/src/STEPSelections/STEPSelections_SelectDerived.hxx @@ -17,15 +17,7 @@ #ifndef _STEPSelections_SelectDerived_HeaderFile #define _STEPSelections_SelectDerived_HeaderFile -#include -#include - #include -#include -class Standard_Transient; -class Interface_InterfaceModel; -class TCollection_AsciiString; - class STEPSelections_SelectDerived; DEFINE_STANDARD_HANDLE(STEPSelections_SelectDerived, StepSelect_StepType) @@ -33,35 +25,13 @@ DEFINE_STANDARD_HANDLE(STEPSelections_SelectDerived, StepSelect_StepType) class STEPSelections_SelectDerived : public StepSelect_StepType { + public: -public: + STEPSelections_SelectDerived() {} - - Standard_EXPORT STEPSelections_SelectDerived(); - Standard_EXPORT virtual Standard_Boolean Matches (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model, const TCollection_AsciiString& text, const Standard_Boolean exact) const Standard_OVERRIDE; - - - DEFINE_STANDARD_RTTIEXT(STEPSelections_SelectDerived,StepSelect_StepType) - -protected: - - - - -private: - - - - }; - - - - - - #endif // _STEPSelections_SelectDerived_HeaderFile diff --git a/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx b/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx index b523f3b549..9bf96249ae 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx @@ -131,60 +131,47 @@ Standard_Boolean ShapeAnalysis_Geom::NearestPlane(const TColgp_Array1OfPnt& Pnts for (Standard_Integer j = 1; j <= 4; j ++) gtrsf.SetValue (i,j, coefs->Value(i,j)); - //try { //szv#4:S4163:12Mar99 waste try - //// trsf = gtrsf.Trsf(); - // --- Prec et Unit ont ete lues suite aux StepFile_Read - // Valables pour tous les composants d un assemblage transmis - //trsf = gp_Trsf(); // Identite forcee au depart //szv#4:S4163:12Mar99 not needed - // On prend le contenu de . Attention a l adressage - gp_XYZ v1 ( gtrsf.Value(1,1), gtrsf.Value(2,1), gtrsf.Value(3,1) ); - gp_XYZ v2 ( gtrsf.Value(1,2), gtrsf.Value(2,2), gtrsf.Value(3,2) ); - gp_XYZ v3 ( gtrsf.Value(1,3), gtrsf.Value(2,3), gtrsf.Value(3,3) ); - // A-t-on affaire a une similitude ? - Standard_Real m1 = v1.Modulus(); - Standard_Real m2 = v2.Modulus(); - Standard_Real m3 = v3.Modulus(); - - // D abord est-elle singuliere cette matrice ? - if (m1 < prec || m2 < prec || m3 < prec) return Standard_False; - Standard_Real mm = (m1+m2+m3)/3.; // voici la Norme moyenne, cf Scale - //szv#4:S4163:12Mar99 optimized - Standard_Real pmm = prec*mm; - if ( Abs(m1 - mm) > pmm || Abs(m2 - mm) > pmm || Abs(m3 - mm) > pmm ) - return Standard_False; - //szv#4:S4163:12Mar99 warning - v1.Divide(m1); - v2.Divide(m2); - v3.Divide(m3); - //szv#4:S4163:12Mar99 optimized - if ( Abs(v1.Dot(v2)) > prec || Abs(v2.Dot(v3)) > prec || Abs(v3.Dot(v1)) > prec ) - return Standard_False; - - // Ici, Orthogonale et memes normes. En plus on l a Normee - // On isole le cas de l Identite (tellement facile et avantageux) - if (v1.X() != 1 || v1.Y() != 0 || v1.Z() != 0 || - v2.X() != 0 || v2.Y() != 1 || v2.Z() != 0 || - v3.X() != 0 || v3.Y() != 0 || v3.Z() != 1 ) { + // On prend le contenu de . Attention a l adressage + gp_XYZ v1 ( gtrsf.Value(1,1), gtrsf.Value(2,1), gtrsf.Value(3,1) ); + gp_XYZ v2 ( gtrsf.Value(1,2), gtrsf.Value(2,2), gtrsf.Value(3,2) ); + gp_XYZ v3 ( gtrsf.Value(1,3), gtrsf.Value(2,3), gtrsf.Value(3,3) ); + // A-t-on affaire a une similitude ? + Standard_Real m1 = v1.Modulus(); + Standard_Real m2 = v2.Modulus(); + Standard_Real m3 = v3.Modulus(); + + // D abord est-elle singuliere cette matrice ? + if (m1 < prec || m2 < prec || m3 < prec) return Standard_False; + Standard_Real mm = (m1+m2+m3)/3.; // voici la Norme moyenne, cf Scale + Standard_Real pmm = prec*mm; + if ( Abs(m1 - mm) > pmm || Abs(m2 - mm) > pmm || Abs(m3 - mm) > pmm ) + return Standard_False; + v1.Divide(m1); + v2.Divide(m2); + v3.Divide(m3); + if ( Abs(v1.Dot(v2)) > prec || Abs(v2.Dot(v3)) > prec || Abs(v3.Dot(v1)) > prec ) + return Standard_False; + + // Ici, Orthogonale et memes normes. En plus on l a Normee + // On isole le cas de l Identite (tellement facile et avantageux) + if (v1.X() != 1 || v1.Y() != 0 || v1.Z() != 0 || + v2.X() != 0 || v2.Y() != 1 || v2.Z() != 0 || + v3.X() != 0 || v3.Y() != 0 || v3.Z() != 1 ) { // Pas Identite : vraie construction depuis un Ax3 - gp_Dir d1(v1); - gp_Dir d2(v2); - gp_Dir d3(v3); - gp_Ax3 axes (gp_Pnt(0,0,0),d3,d1); - d3.Cross(d1); - if (d3.Dot(d2) < 0) axes.YReverse(); - trsf.SetTransformation(axes); - } + gp_Dir d1(v1); + gp_Dir d2(v2); + gp_Dir d3(v3); + gp_Ax3 axes (gp_Pnt(0,0,0),d3,d1); + d3.Cross(d1); + if (d3.Dot(d2) < 0) axes.YReverse(); + trsf.SetTransformation(axes); + } - // Restent les autres caracteristiques : - if ( Abs(mm - 1.) > prec ) trsf.SetScale(gp_Pnt(0,0,0), mm); //szv#4:S4163:12Mar99 optimized - gp_Vec tp (gtrsf.TranslationPart()); - if (unit != 1.) tp.Multiply(unit); - if (tp.X() != 0 || tp.Y() != 0 || tp.Z() != 0) trsf.SetTranslationPart(tp); - /* } - catch(Standard_Failure) { - trsf = gp_Trsf(); - result = Standard_False; - } */ + // Restent les autres caracteristiques : + if ( Abs(mm - 1.) > prec ) trsf.SetScale(gp_Pnt(0,0,0), mm); //szv#4:S4163:12Mar99 optimized + gp_Vec tp (gtrsf.TranslationPart()); + if (unit != 1.) tp.Multiply(unit); + if (tp.X() != 0 || tp.Y() != 0 || tp.Z() != 0) trsf.SetTranslationPart(tp); return result; } diff --git a/src/StepData/FILES b/src/StepData/FILES index 8f78376733..ac7314e391 100644 --- a/src/StepData/FILES +++ b/src/StepData/FILES @@ -1,14 +1,8 @@ StepData.cxx StepData.hxx StepData_Array1OfField.hxx -StepData_DefaultGeneral.cxx -StepData_DefaultGeneral.hxx -StepData_DescrGeneral.cxx -StepData_DescrGeneral.hxx StepData_Described.cxx StepData_Described.hxx -StepData_DescrReadWrite.cxx -StepData_DescrReadWrite.hxx StepData_ECDescr.cxx StepData_ECDescr.hxx StepData_EDescr.cxx @@ -27,8 +21,6 @@ StepData_FieldListD.cxx StepData_FieldListD.hxx StepData_FieldListN.cxx StepData_FieldListN.hxx -StepData_FileRecognizer.hxx -StepData_FileRecognizer_0.cxx StepData_FreeFormEntity.cxx StepData_FreeFormEntity.hxx StepData_GeneralModule.cxx diff --git a/src/StepData/StepData.cxx b/src/StepData/StepData.cxx index 782bc60825..a37d7ad497 100644 --- a/src/StepData/StepData.cxx +++ b/src/StepData/StepData.cxx @@ -11,31 +11,11 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -// abv 09.04.99 S4136: eliminate parameter step.readaccept.void -// svv #2 23.02.00: porting on SIL - #include -#include #include #include -#include - -//szv_c1:StaticHandle(StepData_Protocol,proto); -static Handle(StepData_Protocol) proto; - -//szv_c1:StaticHandleA(StepData_Protocol,theheader); -static Handle(StepData_Protocol) theheader; - -const Handle(StepData_Protocol) & StepData::Protocol () -{ - //szv_c1:InitHandleVoid(StepData_Protocol,proto);// svv #2 - if (proto.IsNull()) proto = new StepData_Protocol; - return proto; -} const Handle(StepData_Protocol) & StepData::HeaderProtocol () { - /*szv_c1:UseHandle(StepData_Protocol,theheader); - return theheader;*/ return HeaderSection::Protocol(); } diff --git a/src/StepData/StepData.hxx b/src/StepData/StepData.hxx index 11c998f95e..ac23787cef 100644 --- a/src/StepData/StepData.hxx +++ b/src/StepData/StepData.hxx @@ -27,9 +27,6 @@ class StepData_Protocol; class StepData { public: - - //! Returns a Protocol from StepData - Standard_EXPORT static const Handle(StepData_Protocol) & Protocol(); //! Returns the recorded HeaderProtocol, which can be : //! - a Null Handle if no Header Protocol was yet defined diff --git a/src/StepData/StepData_DefaultGeneral.cxx b/src/StepData/StepData_DefaultGeneral.cxx deleted file mode 100644 index 68c9f23ac5..0000000000 --- a/src/StepData/StepData_DefaultGeneral.cxx +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(StepData_DefaultGeneral,StepData_GeneralModule) - -// DefaultGeneral de StepData reconnait UN SEUL TYPE : UndefinedEntity -StepData_DefaultGeneral::StepData_DefaultGeneral () -{ - Interface_GeneralLib::SetGlobal (this, StepData::Protocol()); -} - - void StepData_DefaultGeneral::FillSharedCase - (const Standard_Integer casenum, const Handle(Standard_Transient)& ent, - Interface_EntityIterator& iter) const -{ - if (casenum != 1) return; - DeclareAndCast(StepData_UndefinedEntity,undf,ent); - Handle(Interface_UndefinedContent) cont = undf->UndefinedContent(); - Standard_Integer nb = cont->NbParams(); - for (Standard_Integer i = 1; i <= nb; i ++) { - Interface_ParamType ptype = cont->ParamType(i); - if (ptype == Interface_ParamSub) { - DeclareAndCast(StepData_UndefinedEntity,subent,cont->ParamEntity(i)); - FillSharedCase(casenum,cont->ParamEntity(i),iter); - } else if (ptype == Interface_ParamIdent) { - iter.GetOneItem(cont->ParamEntity(i)); - } - } -} - - -void StepData_DefaultGeneral::CheckCase(const Standard_Integer, - const Handle(Standard_Transient)&, - const Interface_ShareTool&, - Handle(Interface_Check)&) const -{ -} // pas de Check sur une UndefinedEntity - - - Standard_Boolean StepData_DefaultGeneral::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - if (CN != 1) return Standard_False; - ent = new StepData_UndefinedEntity; - return Standard_True; -} - - void StepData_DefaultGeneral::CopyCase - (const Standard_Integer casenum, const Handle(Standard_Transient)& entfrom, - const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const -{ - if (casenum != 1) return; - DeclareAndCast(StepData_UndefinedEntity,undfrom,entfrom); - DeclareAndCast(StepData_UndefinedEntity,undto,entto); - undto->GetFromAnother(undfrom,TC); // On pourrait rapatrier cela -} diff --git a/src/StepData/StepData_DefaultGeneral.hxx b/src/StepData/StepData_DefaultGeneral.hxx deleted file mode 100644 index 7ebe56b15f..0000000000 --- a/src/StepData/StepData_DefaultGeneral.hxx +++ /dev/null @@ -1,85 +0,0 @@ -// Created on: 1993-03-26 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _StepData_DefaultGeneral_HeaderFile -#define _StepData_DefaultGeneral_HeaderFile - -#include -#include - -#include -#include -#include -class Standard_Transient; -class Interface_EntityIterator; -class Interface_ShareTool; -class Interface_Check; -class Interface_CopyTool; - - -class StepData_DefaultGeneral; -DEFINE_STANDARD_HANDLE(StepData_DefaultGeneral, StepData_GeneralModule) - -//! DefaultGeneral defines a GeneralModule which processes -//! Unknown Entity from StepData only -class StepData_DefaultGeneral : public StepData_GeneralModule -{ - -public: - - - //! Creates a Default General Module - Standard_EXPORT StepData_DefaultGeneral(); - - //! Specific filling of the list of Entities shared by an Entity - //! , which is an UnknownEntity from StepData. - Standard_EXPORT void FillSharedCase (const Standard_Integer casenum, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - - //! Specific Checking of an Entity - Standard_EXPORT void CheckCase (const Standard_Integer casenum, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Specific creation of a new void entity - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE; - - //! Specific Copy ("Deep") from to (same type) - //! by using a CopyTool which provides its working Map. - //! Use method Transferred from TransferControl to work - Standard_EXPORT void CopyCase (const Standard_Integer casenum, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(StepData_DefaultGeneral,StepData_GeneralModule) - -protected: - - - - -private: - - - - -}; - - - - - - - -#endif // _StepData_DefaultGeneral_HeaderFile diff --git a/src/StepData/StepData_DescrGeneral.cxx b/src/StepData/StepData_DescrGeneral.cxx deleted file mode 100644 index b7e4956c66..0000000000 --- a/src/StepData/StepData_DescrGeneral.cxx +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(StepData_DescrGeneral,StepData_GeneralModule) - -StepData_DescrGeneral::StepData_DescrGeneral - (const Handle(StepData_Protocol)& proto) - : theproto (proto) { } - - - void StepData_DescrGeneral::FillSharedCase - (const Standard_Integer, const Handle(Standard_Transient)& ent, - Interface_EntityIterator& iter) const -{ - Handle(StepData_Described) ds = Handle(StepData_Described)::DownCast(ent); - if (!ds.IsNull()) ds->Shared (iter); -} - - -void StepData_DescrGeneral::CheckCase(const Standard_Integer , - const Handle(Standard_Transient)&, - const Interface_ShareTool&, - Handle(Interface_Check)&) const -{ -} // pour l instant - - -void StepData_DescrGeneral::CopyCase(const Standard_Integer, - const Handle(Standard_Transient)&, - const Handle(Standard_Transient)&, - Interface_CopyTool&) const -{ -} // pour l instant - -Standard_Boolean StepData_DescrGeneral::NewVoid - (const Standard_Integer CN, Handle(Standard_Transient)& ent) const -{ - ent = theproto->Descr(CN)->NewEntity(); - return (!ent.IsNull()); -} diff --git a/src/StepData/StepData_DescrGeneral.hxx b/src/StepData/StepData_DescrGeneral.hxx deleted file mode 100644 index b729213a73..0000000000 --- a/src/StepData/StepData_DescrGeneral.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// Created on: 1997-05-21 -// Created by: Christian CAILLET -// Copyright (c) 1997-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _StepData_DescrGeneral_HeaderFile -#define _StepData_DescrGeneral_HeaderFile - -#include -#include - -#include -#include -#include -class StepData_Protocol; -class Standard_Transient; -class Interface_EntityIterator; -class Interface_ShareTool; -class Interface_Check; -class Interface_CopyTool; - - -class StepData_DescrGeneral; -DEFINE_STANDARD_HANDLE(StepData_DescrGeneral, StepData_GeneralModule) - -//! Works with a Protocol by considering its entity descriptions -class StepData_DescrGeneral : public StepData_GeneralModule -{ - -public: - - - Standard_EXPORT StepData_DescrGeneral(const Handle(StepData_Protocol)& proto); - - Standard_EXPORT void FillSharedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE; - - Standard_EXPORT void CheckCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - Standard_EXPORT void CopyCase (const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const Standard_OVERRIDE; - - Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& ent) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(StepData_DescrGeneral,StepData_GeneralModule) - -protected: - - - - -private: - - - Handle(StepData_Protocol) theproto; - - -}; - - - - - - - -#endif // _StepData_DescrGeneral_HeaderFile diff --git a/src/StepData/StepData_DescrReadWrite.cxx b/src/StepData/StepData_DescrReadWrite.cxx deleted file mode 100644 index 8104858067..0000000000 --- a/src/StepData/StepData_DescrReadWrite.cxx +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(StepData_DescrReadWrite,StepData_ReadWriteModule) - -static TCollection_AsciiString nocp("?"); - - - StepData_DescrReadWrite::StepData_DescrReadWrite - (const Handle(StepData_Protocol)& proto) - : theproto (proto) { } - - Standard_Integer StepData_DescrReadWrite::CaseStep - (const TCollection_AsciiString& atype) const -{ - Handle(StepData_ESDescr) descr = theproto->ESDescr (atype.ToCString(),Standard_False); - if (descr.IsNull()) return 0; - return theproto->DescrNumber (descr); -} - - Standard_Integer StepData_DescrReadWrite::CaseStep - (const TColStd_SequenceOfAsciiString& types) const -{ - Handle(StepData_ECDescr) descr = theproto->ECDescr (types,Standard_False); - if (descr.IsNull()) return 0; - return theproto->DescrNumber (descr); -} - - - Standard_Boolean StepData_DescrReadWrite::IsComplex - (const Standard_Integer CN) const -{ - Handle(StepData_EDescr) descr = theproto->Descr (CN); - if (descr.IsNull()) return Standard_False; - return descr->IsComplex(); -} - - const TCollection_AsciiString& StepData_DescrReadWrite::StepType - (const Standard_Integer CN) const -{ - Handle(StepData_ESDescr) descr = Handle(StepData_ESDescr)::DownCast - (theproto->Descr (CN)); - if (descr.IsNull()) return nocp; - return descr->StepType(); -} - - Standard_Boolean StepData_DescrReadWrite::ComplexType - (const Standard_Integer CN, TColStd_SequenceOfAsciiString& types) const -{ - Handle(StepData_ECDescr) descr = Handle(StepData_ECDescr)::DownCast - (theproto->Descr (CN)); - if (descr.IsNull()) return Standard_False; - Handle(TColStd_HSequenceOfAsciiString) list = descr->TypeList(); - if (list.IsNull()) return Standard_False; - Standard_Integer i, nb = list->Length(); - for (i = 1; i <= nb; i ++) types.Append (list->Value(i)); - return Standard_True; -} - - -void StepData_DescrReadWrite::ReadStep(const Standard_Integer CN, - const Handle(StepData_StepReaderData)& data, - const Standard_Integer num, - Handle(Interface_Check)& ach, - const Handle(Standard_Transient)&ent) const -{ - if (CN == 0) return; - DeclareAndCast(StepData_Simple,sent,ent); - if (!sent.IsNull()) { - Handle(StepData_ESDescr) sdescr = sent->ESDescr(); - StepData_FieldListN& fl = sent->CFields(); - data->ReadList (num,ach,sdescr,fl); - return; - } - - DeclareAndCast(StepData_Plex,cent,ent); - Standard_Integer i, nb=0; - if (!cent.IsNull()) nb = cent->NbMembers(); - Standard_Integer n0 = num; - for (i = 1; i <= nb; i ++) { - Handle(StepData_Simple) si = cent->Member(i); - Handle(StepData_ESDescr) sdescr = si->ESDescr(); - StepData_FieldListN& fl = si->CFields(); - data->ReadList (n0,ach,sdescr,fl); - if (i < nb) n0 = data->NextForComplex(n0); - } -} - - - void StepData_DescrReadWrite::WriteStep - (const Standard_Integer CN, - StepData_StepWriter& SW, - const Handle(Standard_Transient)&ent) const -{ - if (CN == 0) return; - - DeclareAndCast(StepData_Simple,sent,ent); - if (!sent.IsNull()) { - Handle(StepData_ESDescr) sdescr = sent->ESDescr(); - const StepData_FieldListN& fl = sent->Fields(); - SW.SendList (fl,sdescr); - return; - } - - DeclareAndCast(StepData_Plex,cent,ent); - Standard_Integer i, nb=0; - if (!cent.IsNull()) nb = cent->NbMembers(); - for (i = 1; i <= nb; i ++) { - Handle(StepData_Simple) si = cent->Member(i); - Handle(StepData_ESDescr) sdescr = si->ESDescr(); - const StepData_FieldListN& fl = si->Fields(); - SW.StartEntity (sdescr->TypeName()); - SW.SendList (fl,sdescr); - } -} diff --git a/src/StepData/StepData_DescrReadWrite.hxx b/src/StepData/StepData_DescrReadWrite.hxx deleted file mode 100644 index 5248f70001..0000000000 --- a/src/StepData/StepData_DescrReadWrite.hxx +++ /dev/null @@ -1,85 +0,0 @@ -// Created on: 1997-05-21 -// Created by: Christian CAILLET -// Copyright (c) 1997-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _StepData_DescrReadWrite_HeaderFile -#define _StepData_DescrReadWrite_HeaderFile - -#include -#include - -#include -#include -#include -#include -class StepData_Protocol; -class TCollection_AsciiString; -class StepData_StepReaderData; -class Interface_Check; -class Standard_Transient; -class StepData_StepWriter; - - -class StepData_DescrReadWrite; -DEFINE_STANDARD_HANDLE(StepData_DescrReadWrite, StepData_ReadWriteModule) - - -class StepData_DescrReadWrite : public StepData_ReadWriteModule -{ - -public: - - - Standard_EXPORT StepData_DescrReadWrite(const Handle(StepData_Protocol)& proto); - - Standard_EXPORT Standard_Integer CaseStep (const TCollection_AsciiString& atype) const Standard_OVERRIDE; - - Standard_EXPORT virtual Standard_Integer CaseStep (const TColStd_SequenceOfAsciiString& types) const Standard_OVERRIDE; - - Standard_EXPORT virtual Standard_Boolean IsComplex (const Standard_Integer CN) const Standard_OVERRIDE; - - Standard_EXPORT const TCollection_AsciiString& StepType (const Standard_Integer CN) const Standard_OVERRIDE; - - Standard_EXPORT virtual Standard_Boolean ComplexType (const Standard_Integer CN, TColStd_SequenceOfAsciiString& types) const Standard_OVERRIDE; - - Standard_EXPORT void ReadStep (const Standard_Integer CN, const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; - - Standard_EXPORT void WriteStep (const Standard_Integer CN, StepData_StepWriter& SW, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(StepData_DescrReadWrite,StepData_ReadWriteModule) - -protected: - - - - -private: - - - Handle(StepData_Protocol) theproto; - - -}; - - - - - - - -#endif // _StepData_DescrReadWrite_HeaderFile diff --git a/src/StepData/StepData_FileRecognizer.hxx b/src/StepData/StepData_FileRecognizer.hxx deleted file mode 100644 index ca425986a2..0000000000 --- a/src/StepData/StepData_FileRecognizer.hxx +++ /dev/null @@ -1,100 +0,0 @@ -// Created on: 1992-02-11 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _StepData_FileRecognizer_HeaderFile -#define _StepData_FileRecognizer_HeaderFile - -#include -#include - -#include -#include -class Standard_Transient; -class Standard_NoSuchObject; -class TCollection_AsciiString; - - -class StepData_FileRecognizer; -DEFINE_STANDARD_HANDLE(StepData_FileRecognizer, Standard_Transient) - - -class StepData_FileRecognizer : public Standard_Transient -{ - -public: - - - //! Evaluates if recognition has a result, returns it if yes - //! In case of success, Returns True and puts result in "res" - //! In case of Failure, simply Returns False - //! Works by calling deferred method Eval, and in case of failure, - //! looks for Added Recognizers to work - Standard_EXPORT Standard_Boolean Evaluate (const TCollection_AsciiString& akey, Handle(Standard_Transient)& res); - - //! Returns result of last recognition (call of Evaluate) - Standard_EXPORT Handle(Standard_Transient) Result() const; - - //! Adds a new Recognizer to the Compound, at the end - //! Several calls to Add work by adding in the order of calls : - //! Hence, when Eval has failed to recognize, Evaluate will call - //! Evaluate from the first added Recognizer if there is one, - //! and to the second if there is still no result, and so on - Standard_EXPORT void Add (const Handle(StepData_FileRecognizer)& reco); - - - - - DEFINE_STANDARD_RTTI_INLINE(StepData_FileRecognizer,Standard_Transient) - -protected: - - - //! Assumes that no result has yet been recognized - Standard_EXPORT StepData_FileRecognizer(); - - //! Records the result of the recognition. Called by specific - //! method Eval to record a result : after calling it, Eval has - //! finished and can return - Standard_EXPORT void SetOK (const Handle(Standard_Transient)& aresult); - - //! Records that recognition gives no result - Standard_EXPORT void SetKO(); - - //! THIS METHOD DEFINES THE RECOGNITION PROTOCOL, it is proper to - //! each precise type of Recognizer - //! For a suitable type of akey, it calls SetOK(result) where - //! result is an empty result of appropriate type, then returns - Standard_EXPORT virtual void Eval (const TCollection_AsciiString& akey) = 0; - - - -private: - - - Handle(Standard_Transient) theres; - Standard_Boolean hasnext; - Handle(StepData_FileRecognizer) thenext; - - -}; - - - - - - - -#endif // _StepData_FileRecognizer_HeaderFile diff --git a/src/StepData/StepData_FileRecognizer_0.cxx b/src/StepData/StepData_FileRecognizer_0.cxx deleted file mode 100644 index f6f2aad364..0000000000 --- a/src/StepData/StepData_FileRecognizer_0.cxx +++ /dev/null @@ -1,44 +0,0 @@ -// Created on: 1992-02-11 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -#include - -#include -#include -#include -#include - - - - - - - - - - -#define TheKey TCollection_AsciiString -#define TheKey_hxx -#define Handle_TheResul Handle(Standard_Transient) -#define TheResul Standard_Transient -#define TheResul_hxx -#define Interface_Recognizer StepData_FileRecognizer -#define Interface_Recognizer_hxx -#define Handle_Interface_Recognizer Handle(StepData_FileRecognizer) -#include - diff --git a/src/StepData/StepData_GeneralModule.cxx b/src/StepData/StepData_GeneralModule.cxx index f6b8d90103..afc22b110c 100644 --- a/src/StepData/StepData_GeneralModule.cxx +++ b/src/StepData/StepData_GeneralModule.cxx @@ -12,12 +12,6 @@ // commercial license or contractual agreement. -#include -#include -#include -#include -#include -#include #include -IMPLEMENT_STANDARD_RTTIEXT(StepData_GeneralModule,Interface_GeneralModule) \ No newline at end of file +IMPLEMENT_STANDARD_RTTIEXT(StepData_GeneralModule,Interface_GeneralModule) diff --git a/src/StepData/StepData_GeneralModule.hxx b/src/StepData/StepData_GeneralModule.hxx index aca57dbf0d..b811e4b32f 100644 --- a/src/StepData/StepData_GeneralModule.hxx +++ b/src/StepData/StepData_GeneralModule.hxx @@ -35,47 +35,16 @@ DEFINE_STANDARD_HANDLE(StepData_GeneralModule, Interface_GeneralModule) //! Specific features for General Services adapted to STEP class StepData_GeneralModule : public Interface_GeneralModule { + public: -public: - - //! Specific filling of the list of Entities shared by an Entity //! . Can use the internal utility method Share, below Standard_EXPORT virtual void FillSharedCase (const Standard_Integer casenum, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE = 0; //! Specific Checking of an Entity Standard_EXPORT virtual void CheckCase (const Standard_Integer casenum, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE = 0; - - //! Specific Copy ("Deep") from to (same type) - //! by using a TransferControl which provides its working Map. - //! Use method Transferred from TransferControl to work - //! Specific Copying of Implied References - //! A Default is provided which does nothing (must current case !) - //! Already copied references (by CopyFrom) must remain unchanged - //! Use method Search from TransferControl to work - Standard_EXPORT virtual void CopyCase (const Standard_Integer casenum, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const Standard_OVERRIDE = 0; - - - DEFINE_STANDARD_RTTIEXT(StepData_GeneralModule,Interface_GeneralModule) - -protected: - - - - -private: - - - - }; - - - - - - #endif // _StepData_GeneralModule_HeaderFile diff --git a/src/StepData/StepData_GlobalNodeOfWriterLib.hxx b/src/StepData/StepData_GlobalNodeOfWriterLib.hxx index ee99849f0f..cc3a4f501c 100644 --- a/src/StepData/StepData_GlobalNodeOfWriterLib.hxx +++ b/src/StepData/StepData_GlobalNodeOfWriterLib.hxx @@ -22,7 +22,7 @@ #include class StepData_ReadWriteModule; -class StepData_Protocol; +class Interface_Protocol; class Standard_Transient; class StepData_WriterLib; class StepData_NodeOfWriterLib; @@ -45,13 +45,13 @@ public: //! nothing if already in the list, THAT IS, Same Type (exact //! match) and Same State (that is, IsEqual is not required) //! Once added, stores its attached Protocol in correspondance - Standard_EXPORT void Add (const Handle(StepData_ReadWriteModule)& amodule, const Handle(StepData_Protocol)& aprotocol); + Standard_EXPORT void Add (const Handle(StepData_ReadWriteModule)& amodule, const Handle(Interface_Protocol)& aprotocol); //! Returns the Module stored in a given GlobalNode Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const; //! Returns the attached Protocol stored in a given GlobalNode - Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const; + Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; //! Returns the Next GlobalNode. If none is defined, returned //! value is a Null Handle @@ -71,7 +71,7 @@ private: Handle(StepData_ReadWriteModule) themod; - Handle(StepData_Protocol) theprot; + Handle(Interface_Protocol) theprot; Handle(StepData_GlobalNodeOfWriterLib) thenext; diff --git a/src/StepData/StepData_GlobalNodeOfWriterLib_0.cxx b/src/StepData/StepData_GlobalNodeOfWriterLib_0.cxx index f6d60688af..bd389d39f8 100644 --- a/src/StepData/StepData_GlobalNodeOfWriterLib_0.cxx +++ b/src/StepData/StepData_GlobalNodeOfWriterLib_0.cxx @@ -19,29 +19,16 @@ #include #include -#include #include #include #include #include - - - - - - - - - #define TheObject Handle(Standard_Transient) #define TheObject_hxx #define Handle_TheModule Handle(StepData_ReadWriteModule) #define TheModule StepData_ReadWriteModule #define TheModule_hxx -#define Handle_TheProtocol Handle(StepData_Protocol) -#define TheProtocol StepData_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node StepData_NodeOfWriterLib @@ -51,4 +38,3 @@ #define LibCtl_Library StepData_WriterLib #define LibCtl_Library_hxx #include - diff --git a/src/StepData/StepData_NodeOfWriterLib.hxx b/src/StepData/StepData_NodeOfWriterLib.hxx index 2410688f65..8f48f2ff2c 100644 --- a/src/StepData/StepData_NodeOfWriterLib.hxx +++ b/src/StepData/StepData_NodeOfWriterLib.hxx @@ -24,7 +24,7 @@ class StepData_GlobalNodeOfWriterLib; class Standard_Transient; class StepData_ReadWriteModule; -class StepData_Protocol; +class Interface_Protocol; class StepData_WriterLib; @@ -49,7 +49,7 @@ public: Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const; //! Returns the Protocol designated by a precise Node - Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const; + Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; //! Returns the Next Node. If none was defined, returned value //! is a Null Handle diff --git a/src/StepData/StepData_NodeOfWriterLib_0.cxx b/src/StepData/StepData_NodeOfWriterLib_0.cxx index 9113976236..5cd0f4d6c6 100644 --- a/src/StepData/StepData_NodeOfWriterLib_0.cxx +++ b/src/StepData/StepData_NodeOfWriterLib_0.cxx @@ -18,30 +18,18 @@ #include +#include #include #include #include #include -#include #include - - - - - - - - - #define TheObject Handle(Standard_Transient) #define TheObject_hxx #define Handle_TheModule Handle(StepData_ReadWriteModule) #define TheModule StepData_ReadWriteModule #define TheModule_hxx -#define Handle_TheProtocol Handle(StepData_Protocol) -#define TheProtocol StepData_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node StepData_NodeOfWriterLib diff --git a/src/StepData/StepData_Protocol.cxx b/src/StepData/StepData_Protocol.cxx index a018c8e103..aec8d7e610 100644 --- a/src/StepData/StepData_Protocol.cxx +++ b/src/StepData/StepData_Protocol.cxx @@ -34,24 +34,6 @@ IMPLEMENT_STANDARD_RTTIEXT(StepData_Protocol,Interface_Protocol) //static TCollection_AsciiString thename("(DEFAULT)"); static Standard_CString thename = "(DEFAULT)"; -StepData_Protocol::StepData_Protocol () -{ -} - -Standard_Integer StepData_Protocol::NbResources () const -{ - return 0; -} - - -Handle(Interface_Protocol) StepData_Protocol::Resource - (const Standard_Integer /*num*/) const -{ - Handle(Interface_Protocol) nulproto; - return nulproto; -} - - Standard_Integer StepData_Protocol::CaseNumber (const Handle(Standard_Transient)& obj) const { diff --git a/src/StepData/StepData_Protocol.hxx b/src/StepData/StepData_Protocol.hxx index 7e905b1903..a0120a56a6 100644 --- a/src/StepData/StepData_Protocol.hxx +++ b/src/StepData/StepData_Protocol.hxx @@ -47,18 +47,9 @@ DEFINE_STANDARD_HANDLE(StepData_Protocol, Interface_Protocol) //! NbResources and Resources. class StepData_Protocol : public Interface_Protocol { + public: -public: - - - Standard_EXPORT StepData_Protocol(); - - //! Gives the count of Protocols used as Resource (can be zero) - //! Here, No resource - Standard_EXPORT Standard_Integer NbResources() const Standard_OVERRIDE; - - //! Returns a Resource, given a rank. Here, none - Standard_EXPORT Handle(Interface_Protocol) Resource (const Standard_Integer num) const Standard_OVERRIDE; + StepData_Protocol() {} //! Returns a unique positive number for any recognized entity //! Redefined to work by calling both TypeNumber and, for a diff --git a/src/StepData/StepData_StepModel.cxx b/src/StepData/StepData_StepModel.cxx index 7141e3f74c..baec99859e 100644 --- a/src/StepData/StepData_StepModel.cxx +++ b/src/StepData/StepData_StepModel.cxx @@ -41,25 +41,6 @@ Handle(Standard_Transient) StepData_StepModel::Entity (const Standard_Integer num) const { return Value(num); } // nom plus joli -void StepData_StepModel::GetFromAnother -(const Handle(Interface_InterfaceModel)& other) -{ - theheader.Clear(); - DeclareAndCast(StepData_StepModel,another,other); - if (another.IsNull()) return; - Interface_EntityIterator iter = another->Header(); - // recopier le header. Attention, header distinct du contenu ... - Interface_CopyTool TC (this,StepData::HeaderProtocol()); - for (; iter.More(); iter.Next()) { - Handle(Standard_Transient) newhead; - if (!TC.Copy(iter.Value(),newhead,Standard_False,Standard_False)) continue; - if (!newhead.IsNull()) theheader.Append(newhead); - } -} - -Handle(Interface_InterfaceModel) StepData_StepModel::NewEmptyModel () const -{ return new StepData_StepModel; } - Interface_EntityIterator StepData_StepModel::Header () const { diff --git a/src/StepData/StepData_StepModel.hxx b/src/StepData/StepData_StepModel.hxx index 3a54fa7b90..5b24e45b1b 100644 --- a/src/StepData/StepData_StepModel.hxx +++ b/src/StepData/StepData_StepModel.hxx @@ -54,12 +54,6 @@ public: //! Same as InterfaceEntity, but with a shorter name Standard_EXPORT Handle(Standard_Transient) Entity (const Standard_Integer num) const; - //! gets header from another Model (uses Header Protocol) - Standard_EXPORT void GetFromAnother (const Handle(Interface_InterfaceModel)& other) Standard_OVERRIDE; - - //! Returns a New Empty Model, same type as , i.e. StepModel - Standard_EXPORT Handle(Interface_InterfaceModel) NewEmptyModel() const Standard_OVERRIDE; - //! returns Header entities under the form of an iterator Standard_EXPORT Interface_EntityIterator Header() const; diff --git a/src/StepData/StepData_StepReaderTool.cxx b/src/StepData/StepData_StepReaderTool.cxx index 074352a09c..7dc87355e1 100644 --- a/src/StepData/StepData_StepReaderTool.cxx +++ b/src/StepData/StepData_StepReaderTool.cxx @@ -19,8 +19,6 @@ #include #include #include -#include -#include #include #include #include @@ -42,29 +40,6 @@ StepData_StepReaderTool::StepData_StepReaderTool } -//======================================================================= -//function : Recognize -//purpose : -//======================================================================= - -Standard_Boolean StepData_StepReaderTool::Recognize(const Standard_Integer num, - Handle(Interface_Check)& ach, - Handle(Standard_Transient)& ent) -{ -// Handle(Standard_Transient) bid; // pas exploite -// return thereco->Evaluate(thetypes.Value(num),bid); - -// Recognizer : C est lui qui assure la Reconnaissance (-> Liste limitative) - if (!thereco.IsNull()) { - DeclareAndCast(StepData_StepReaderData,stepdat,Data()); - return thereco->Evaluate(stepdat->RecordType(num),ent); - } - -// Pas de Recognizer : Reconnaissance par la librairie - return RecognizeByLib (num,theglib,therlib,ach,ent); -} - - // .... Methodes de preparations propres a StepReaderTool .... @@ -73,41 +48,21 @@ Standard_Boolean StepData_StepReaderTool::Recognize(const Standard_Integer num, //purpose : //======================================================================= -void StepData_StepReaderTool::Prepare - (const Handle(StepData_FileRecognizer)& reco, const Standard_Boolean optim) -{ - thereco = reco; - Prepare(optim); -} - - -//======================================================================= -//function : Prepare -//purpose : -//======================================================================= - -void StepData_StepReaderTool::Prepare (const Standard_Boolean optim) +void StepData_StepReaderTool::Prepare () { // SetEntityNumbers a ete mis du cote de ReaderData, because beaucoup acces - Standard_Boolean erh = ErrorHandle(); DeclareAndCast(StepData_StepReaderData,stepdat,Data()); - if (erh) { - try { - OCC_CATCH_SIGNALS - stepdat->SetEntityNumbers(optim); - SetEntities(); - } - catch(Standard_Failure) { - Handle(Message_Messenger) sout = Message::DefaultMessenger(); - sout << " Exception Raised during Preparation :\n"; - sout << Standard_Failure::Caught()->GetMessageString(); - sout << "\n Now, trying to continue, but with presomption of failure\n"; - } - } - else { - stepdat->SetEntityNumbers(optim); + try { + OCC_CATCH_SIGNALS + stepdat->SetEntityNumbers(Standard_True); SetEntities(); } + catch(Standard_Failure) { + const Handle(Message_Messenger) &sout = Message::DefaultMessenger(); + sout << " Exception Raised during Preparation :\n"; + sout << Standard_Failure::Caught()->GetMessageString(); + sout << "\n Now, trying to continue, but with presomption of failure\n"; + } } @@ -119,8 +74,7 @@ void StepData_StepReaderTool::Prepare (const Standard_Boolean optim) //purpose : //======================================================================= -void StepData_StepReaderTool::PrepareHeader - (const Handle(StepData_FileRecognizer)& reco) +void StepData_StepReaderTool::PrepareHeader () { Standard_Integer i = 0; @@ -128,16 +82,9 @@ void StepData_StepReaderTool::PrepareHeader DeclareAndCast(StepData_StepReaderData,stepdat,Data()); while ( (i = stepdat->FindNextHeaderRecord(i)) != 0) { Handle(Standard_Transient) ent; -// On a donne un Recognizer : il fixe une liste limitative de types reconnus - if (!reco.IsNull()) { - if (!reco->Evaluate(stepdat->RecordType(i),ent)) { - ent = Protocol()->UnknownEntity(); - } - } else { -// Pas de Recognizer : Reconnaissance par la librairie - Handle(Interface_Check) ach = new Interface_Check; // faudrait le lister ... ? - RecognizeByLib (i,theglib,therlib,ach,ent); - } +// Reconnaissance par la librairie + Handle(Interface_Check) ach = new Interface_Check; // faudrait le lister ... ? + RecognizeByLib (i,theglib,therlib,ach,ent); if (ent.IsNull()) ent = Protocol()->UnknownEntity(); stepdat->BindEntity(i,ent); } @@ -148,6 +95,20 @@ void StepData_StepReaderTool::PrepareHeader } +//======================================================================= +//function : Recognize +//purpose : +//======================================================================= + +Standard_Boolean StepData_StepReaderTool::Recognize(const Standard_Integer num, + Handle(Interface_Check)& ach, + Handle(Standard_Transient)& ent) +{ +// Reconnaissance par la librairie + return RecognizeByLib (num,theglib,therlib,ach,ent); +} + + // .... Methodes pour la lecture du Modele (apres preparation) .... // @@ -156,8 +117,7 @@ void StepData_StepReaderTool::PrepareHeader //purpose : //======================================================================= -void StepData_StepReaderTool::BeginRead - (const Handle(Interface_InterfaceModel)& amodel) +void StepData_StepReaderTool::BeginRead (const Handle(Interface_InterfaceModel)& amodel) { Handle(Message_Messenger) sout = Message::DefaultMessenger(); DeclareAndCast(StepData_StepModel,model,amodel); @@ -235,8 +195,7 @@ Standard_Boolean StepData_StepReaderTool::AnalyseRecord //purpose : //======================================================================= -void StepData_StepReaderTool::EndRead - (const Handle(Interface_InterfaceModel)& amodel) +void StepData_StepReaderTool::EndRead (const Handle(Interface_InterfaceModel)& amodel) { DeclareAndCast(StepData_StepReaderData,stepdat,Data()); DeclareAndCast(StepData_StepModel,stepmodel,amodel); diff --git a/src/StepData/StepData_StepReaderTool.hxx b/src/StepData/StepData_StepReaderTool.hxx index fe22bb8714..998827823c 100644 --- a/src/StepData/StepData_StepReaderTool.hxx +++ b/src/StepData/StepData_StepReaderTool.hxx @@ -24,13 +24,9 @@ #include #include #include -#include -#include -class StepData_FileRecognizer; class StepData_StepReaderData; class StepData_Protocol; class Interface_Check; -class Standard_Transient; class Interface_InterfaceModel; @@ -40,45 +36,34 @@ class Interface_InterfaceModel; //! Remarks : works with a ReaderLib to load Entities class StepData_StepReaderTool : public Interface_FileReaderTool { -public: + public: DEFINE_STANDARD_ALLOC - //! creates StepReaderTool to work with a StepReaderData according //! to a Step Protocol. Defines the ReaderLib at this time Standard_EXPORT StepData_StepReaderTool(const Handle(StepData_StepReaderData)& reader, const Handle(StepData_Protocol)& protocol); - //! Bounds empty entities to records, uses default Recognition - //! provided by ReaderLib and ReaderModule. Also calls computation - //! of references (SetEntityNumbers from StepReaderData) + //! Bounds empty entities to records //! Works only on data entities (skips header) - //! given False allows to test some internal algorithms - //! which are normally avoided (see also StepReaderData) - Standard_EXPORT void Prepare (const Standard_Boolean optimize = Standard_True); + Standard_EXPORT void Prepare (); - //! Bounds empty entities to records, works with a specific - //! FileRecognizer, stored and later used in Recognize - //! Works only on data entities (skips header) - //! is to call //! RecognizeByLib - Standard_EXPORT Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE; - - //! bounds empty entities and sub-lists to header records - //! works like Prepare + SetEntityNumbers, but for header - //! (N.B.: in Header, no Ident and no reference) - //! FileRecognizer is to specify Entities which are allowed to be - //! defined in the Header (not every type can be) - Standard_EXPORT void PrepareHeader (const Handle(StepData_FileRecognizer)& reco); + Standard_EXPORT virtual Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE; //! fills model's header; that is, gives to it Header entities //! and commands their loading. Also fills StepModel's Global //! Check from StepReaderData's GlobalCheck - Standard_EXPORT void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE; + Standard_EXPORT virtual void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE; //! fills an entity, given record no; works by using a ReaderLib //! to load each entity, which must be a Transient @@ -89,30 +74,8 @@ public: //! Here, it binds in the model, Idents to Entities (for checks) Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE; - - - -protected: - - - - - -private: - - - - Handle(StepData_FileRecognizer) thereco; Interface_GeneralLib theglib; Interface_ReaderLib therlib; - - }; - - - - - - #endif // _StepData_StepReaderTool_HeaderFile diff --git a/src/StepData/StepData_WriterLib.hxx b/src/StepData/StepData_WriterLib.hxx index 6f0501e9ae..a4cce78958 100644 --- a/src/StepData/StepData_WriterLib.hxx +++ b/src/StepData/StepData_WriterLib.hxx @@ -23,31 +23,28 @@ #include #include +class Interface_Protocol; class StepData_NodeOfWriterLib; -class Standard_NoSuchObject; -class Standard_Transient; class StepData_ReadWriteModule; -class StepData_Protocol; class StepData_GlobalNodeOfWriterLib; class StepData_WriterLib { -public: + public: DEFINE_STANDARD_ALLOC - //! Adds a couple (Module-Protocol) into the global definition set //! for this class of Library. - Standard_EXPORT static void SetGlobal (const Handle(StepData_ReadWriteModule)& amodule, const Handle(StepData_Protocol)& aprotocol); + Standard_EXPORT static void SetGlobal (const Handle(StepData_ReadWriteModule)& amodule, const Handle(Interface_Protocol)& aprotocol); //! Creates a Library which complies with a Protocol, that is : //! Same class (criterium IsInstance) //! This creation gets the Modules from the global set, those //! which are bound to the given Protocol and its Resources - Standard_EXPORT StepData_WriterLib(const Handle(StepData_Protocol)& aprotocol); + Standard_EXPORT StepData_WriterLib(const Handle(Interface_Protocol)& aprotocol); //! Creates an empty Library : it will later by filled by method //! AddProtocol @@ -56,17 +53,13 @@ public: //! Adds a couple (Module-Protocol) to the Library, given the //! class of a Protocol. Takes Resources into account. //! (if is not of type TheProtocol, it is not added) - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + Standard_EXPORT void AddProtocol (const Handle(Interface_Protocol)& aprotocol); //! Clears the list of Modules of a library (can be used to //! redefine the order of Modules before action : Clear then //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); - //! Sets a library to be defined with the complete Global list - //! (all the couples Protocol/Modules recorded in it) - Standard_EXPORT void SetComplete(); - //! Selects a Module from the Library, given an Object. //! Returns True if Select has succeeded, False else. //! Also Returns (as arguments) the selected Module and the Case @@ -89,31 +82,12 @@ public: Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const; //! Returns the current Protocol in the Iteration - Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const; - - - - -protected: - - - - - -private: - + Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; + private: Handle(StepData_NodeOfWriterLib) thelist; Handle(StepData_NodeOfWriterLib) thecurr; - - }; - - - - - - #endif // _StepData_WriterLib_HeaderFile diff --git a/src/StepData/StepData_WriterLib_0.cxx b/src/StepData/StepData_WriterLib_0.cxx index 99cb924975..64e89ca406 100644 --- a/src/StepData/StepData_WriterLib_0.cxx +++ b/src/StepData/StepData_WriterLib_0.cxx @@ -20,7 +20,6 @@ #include #include #include -#include #include @@ -29,9 +28,6 @@ #define Handle_TheModule Handle(StepData_ReadWriteModule) #define TheModule StepData_ReadWriteModule #define TheModule_hxx -#define Handle_TheProtocol Handle(StepData_Protocol) -#define TheProtocol StepData_Protocol -#define TheProtocol_hxx #define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib #define LibCtl_GlobalNode_hxx #define LibCtl_Node StepData_NodeOfWriterLib diff --git a/src/StepFile/StepFile_Read.cxx b/src/StepFile/StepFile_Read.cxx index 2e024c9bdc..f8baa7b5d2 100644 --- a/src/StepFile/StepFile_Read.cxx +++ b/src/StepFile/StepFile_Read.cxx @@ -65,46 +65,6 @@ void StepFile_ReadTrace (const Standard_Integer mode) modepr = mode; // recfile_modeprint est rappele a chaque lecture de fichier } - -static Standard_Integer StepFile_Read - (char* nomfic, - const Handle(StepData_StepModel)& stepmodel, - const Handle(StepData_Protocol)& protocol, - const Handle(StepData_FileRecognizer)& recoheader, - const Handle(StepData_FileRecognizer)& recodata); - - -Standard_Integer StepFile_Read - (char* nomfic, - const Handle(StepData_StepModel)& stepmodel, - const Handle(StepData_FileRecognizer)& recoheader, - const Handle(StepData_FileRecognizer)& recodata) -{ - return StepFile_Read - (nomfic,stepmodel, - Handle(StepData_Protocol)::DownCast(Interface_Protocol::Active()), - recoheader,recodata); -} - -Standard_Integer StepFile_Read - (char* nomfic, - const Handle(StepData_StepModel)& stepmodel, - const Handle(StepData_FileRecognizer)& recoheader, - const Handle(StepData_Protocol)& protocol) -{ - Handle(StepData_FileRecognizer) nulreco; - return StepFile_Read (nomfic,stepmodel,protocol,recoheader,nulreco); -} - -Standard_Integer StepFile_Read - (char* nomfic, - const Handle(StepData_StepModel)& stepmodel, - const Handle(StepData_Protocol)& protocol) -{ - Handle(StepData_FileRecognizer) nulreco; - return StepFile_Read (nomfic,stepmodel,protocol,nulreco,nulreco); -} - // ## ## ## ## ## ## Corps de la Routine ## ## ## ## ## ## static Interface_ParamType LesTypes[10]; // passage types (recstep/Interface) @@ -112,9 +72,7 @@ static Interface_ParamType LesTypes[10]; // passage types (recstep/Interface) Standard_Integer StepFile_Read (char* nomfic, const Handle(StepData_StepModel)& stepmodel, - const Handle(StepData_Protocol)& protocol, - const Handle(StepData_FileRecognizer)& recoheader, - const Handle(StepData_FileRecognizer)& recodata) + const Handle(StepData_Protocol)& protocol) { Handle(Message_Messenger) sout = Message::DefaultMessenger(); @@ -147,7 +105,6 @@ Standard_Integer StepFile_Read return 1; } // Continue reading of file despite of possible fails - //if (checkread->HasFailed()) { lir_file_fin(3); stepread_endinput (newin,ficnom); return 1; } #ifdef CHRONOMESURE sout << " ... STEP File Read ... " << endl; c.Show(); @@ -201,10 +158,9 @@ Standard_Integer StepFile_Read // Analyse : par StepReaderTool StepData_StepReaderTool readtool (undirec,protocol); - readtool.SetErrorHandle (Standard_True); - readtool.PrepareHeader(recoheader); // Header. reco nul -> pour Protocol - readtool.Prepare(recodata); // Data. reco nul -> pour Protocol + readtool.PrepareHeader(); + readtool.Prepare(); #ifdef CHRONOMESURE sout << " ... Parameters prepared ... "; @@ -215,7 +171,6 @@ Standard_Integer StepFile_Read if (stepmodel->Protocol().IsNull()) stepmodel->SetProtocol (protocol); lir_file_fin(2); - readtool.Clear(); undirec.Nullify(); #ifdef CHRONOMESURE sout << " ... Objets analysed ... " << endl; diff --git a/src/StepFile/StepFile_Read.hxx b/src/StepFile/StepFile_Read.hxx index 6ee30cf997..864f6038d9 100644 --- a/src/StepFile/StepFile_Read.hxx +++ b/src/StepFile/StepFile_Read.hxx @@ -29,25 +29,11 @@ //# include : sauf recfile_modeprint, declare ici # include -# include # include - Standard_EXPORT void StepFile_ReadTrace (const Standard_Integer mode); // Modal : 0 pas de trace, 1 trace LoadModel, 2 & 3 + trace interne lex-yac -Standard_EXPORT Standard_Integer StepFile_Read - (char* nomfic, - const Handle(StepData_StepModel)& stepmodel, - const Handle(StepData_FileRecognizer)& recoheader, // Reconnait le Header - const Handle(StepData_FileRecognizer)& recodata); // Entites du Data - -Standard_EXPORT Standard_Integer StepFile_Read - (char* nomfic, - const Handle(StepData_StepModel)& stepmodel, - const Handle(StepData_FileRecognizer)& recoheader, // Reconnait le Header - const Handle(StepData_Protocol)& protocol); // Entites du Data - Standard_EXPORT Standard_Integer StepFile_Read (char* nomfic, const Handle(StepData_StepModel)& stepmodel, diff --git a/src/StepSelect/StepSelect_StepType.cxx b/src/StepSelect/StepSelect_StepType.cxx index 8363e536cb..309212946a 100644 --- a/src/StepSelect/StepSelect_StepType.cxx +++ b/src/StepSelect/StepSelect_StepType.cxx @@ -15,12 +15,10 @@ #include #include #include -#include -#include -#include -#include #include #include +#include +#include #include #include @@ -29,15 +27,12 @@ IMPLEMENT_STANDARD_RTTIEXT(StepSelect_StepType,IFSelect_Signature) static TCollection_AsciiString lastvalue; - StepSelect_StepType::StepSelect_StepType () - : IFSelect_Signature ("Step Type") { } - - void StepSelect_StepType::SetProtocol - (const Handle(Interface_Protocol)& proto) +StepSelect_StepType::StepSelect_StepType () +: IFSelect_Signature ("Step Type") { - DeclareAndCast(StepData_Protocol,newproto,proto); - if (newproto.IsNull()) Interface_InterfaceError::Raise("StepSelect_StepType"); - theproto = newproto; + const Handle(StepAP214_Protocol) &proto = StepAP214::Protocol(); + if (proto.IsNull()) Interface_InterfaceError::Raise("StepSelect_StepType"); + theproto = proto; thelib.Clear(); thelib.AddProtocol (theproto); thename.Clear(); @@ -46,7 +41,7 @@ static TCollection_AsciiString lastvalue; thename.AssignCat (")"); } - Standard_CString StepSelect_StepType::Value +Standard_CString StepSelect_StepType::Value (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& /*model*/) const { diff --git a/src/StepSelect/StepSelect_StepType.hxx b/src/StepSelect/StepSelect_StepType.hxx index e0e98f55c6..22b285ec78 100644 --- a/src/StepSelect/StepSelect_StepType.hxx +++ b/src/StepSelect/StepSelect_StepType.hxx @@ -24,9 +24,6 @@ #include #include class StepData_Protocol; -class Interface_InterfaceError; -class Interface_Protocol; -class Standard_Transient; class Interface_InterfaceModel; @@ -44,46 +41,23 @@ DEFINE_STANDARD_HANDLE(StepSelect_StepType, IFSelect_Signature) //! Write time only), StepType produces : "(..COMPLEX TYPE..)" class StepSelect_StepType : public IFSelect_Signature { + public: -public: - - //! Creates a Signature for Step Type. Protocol is undefined here, //! hence no Signature may yet be produced. The StepType signature //! requires a Protocol before working Standard_EXPORT StepSelect_StepType(); - //! Sets the StepType signature to work with a Protocol : this - //! initialises the library - Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto); - //! Returns the Step Type defined from the Protocol (see above). //! If is not recognised, produces "..NOT FROM SCHEMA .." Standard_EXPORT Standard_CString Value (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; - - - DEFINE_STANDARD_RTTIEXT(StepSelect_StepType,IFSelect_Signature) -protected: - + protected: StepData_WriterLib thelib; - - -private: - - Handle(StepData_Protocol) theproto; - - }; - - - - - - #endif // _StepSelect_StepType_HeaderFile diff --git a/src/XSControl/XSControl_WorkSession.cxx b/src/XSControl/XSControl_WorkSession.cxx index 63ee82790c..4562189db8 100644 --- a/src/XSControl/XSControl_WorkSession.cxx +++ b/src/XSControl/XSControl_WorkSession.cxx @@ -47,8 +47,6 @@ IMPLEMENT_STANDARD_RTTIEXT(XSControl_WorkSession,MMgt_TShared) #define Flag_Incorrect 2 // (Bit Map n0 2) -static Standard_Boolean errhand; // pb : un seul a la fois, mais ca va si vite - // ################################################################# //======================================================================= @@ -63,7 +61,6 @@ XSControl_WorkSession::XSControl_WorkSession () myReaderProcess(new Transfer_TransientProcess), myWriterProcess(new Transfer_FinderProcess) { - errhand = Standard_True; } @@ -74,16 +71,15 @@ XSControl_WorkSession::XSControl_WorkSession () void XSControl_WorkSession::SetModel (const Handle(Interface_InterfaceModel)& model) { - if (myModel != model) + if (myModel != model) { theloaded.Clear(); - else myModel = model; + } if (!thegtool.IsNull()) thegtool->ClearEntities(); //smh#14 FRA62479 myModel->SetGTool (thegtool); - thegraph.Nullify(); - ComputeGraph(); // fait qqchose si Protocol present. Sinon, ne fait rien + ComputeGraph(Standard_True); thecheckdone = Standard_False; // RAZ CheckList, a refaire @@ -283,12 +279,8 @@ void XSControl_WorkSession::SetController(const Handle(XSControl_Controller)& ct myController = ctl; const Handle(Interface_Protocol) &aProtocol = myController->Protocol(); - Interface_Protocol::SetActive(aProtocol); thegtool->SetProtocol(aProtocol); - /*szv_c1:ClearItems(); - ClearShareOut();*/ - // Set worksession parameters from the controller Handle(XSControl_WorkSession) aWorkSession(this); myController->Customise (aWorkSession); @@ -308,8 +300,8 @@ void XSControl_WorkSession::SetController(const Handle(XSControl_Controller)& ct Interface_ReturnStatus XSControl_WorkSession::ReadFile (const Standard_CString theFileName) { - if (myController.IsNull()) return Interface_RetVoid; - if (myController->Protocol().IsNull()) return Interface_RetVoid; + if (myController.IsNull() || myController->Protocol().IsNull()) + return Interface_RetVoid; Handle(Interface_InterfaceModel) model; Interface_ReturnStatus status = Interface_RetVoid; @@ -322,15 +314,18 @@ Interface_ReturnStatus XSControl_WorkSession::ReadFile (const Standard_CString t } catch(Standard_Failure) { const Handle(Message_Messenger) &sout = Message::DefaultMessenger(); - sout<<" **** Interruption ReadFile par Exception : ****\n"; + sout<<" **** Exception in XSControl_WorkSession::ReadFile : ****\n"; sout << Standard_Failure::Caught()->GetMessageString(); sout<<"\n Abandon"<Protocol().IsNull()) return Interface_RetVoid; - ComputeGraph(Standard_True); - if (!IsLoaded()) - return Interface_RetVoid; + const Handle(Message_Messenger) &sout = Message::DefaultMessenger(); Interface_CheckIterator checks; - if (errhand) { - errhand = Standard_False; - try { - OCC_CATCH_SIGNALS - CopySendAll(theFileName,checks); - } - catch (Standard_Failure) { - const Handle(Message_Messenger) &sout = Message::DefaultMessenger(); - sout<<" **** Exception in XSControl_WorkSession::WriteFile : ****\n"; - sout<GetMessageString(); - sout<<"\n Abandon"<WriteFile(theFileName,myModel,checklst); + checks.Merge(checklst); + if (!res) checks.CCheck(0)->AddFail ("WriteFile has failed"); + } + catch (Standard_Failure) { + sout<<" **** Exception in XSControl_WorkSession::WriteFile : ****\n"; + sout<GetMessageString(); + sout<<"\n Abandon"<HasFailed ()) @@ -465,23 +461,3 @@ Handle(Interface_InterfaceModel) XSControl_WorkSession::NewModel () return newmod; } - -//======================================================================= -//function : CopySendAll -//purpose : -//======================================================================= - -void XSControl_WorkSession::CopySendAll (const Standard_CString theFileName, Interface_CheckIterator &theChecks) -{ - theChecks.SetName ("X-STEP WorkSession : Send All"); - Message::DefaultMessenger() << "** WorkSession : Sending all data"<Protocol(); - const Handle(Interface_InterfaceModel) &aModel = thegraph->Graph().Model(); - if (aModel.IsNull() || aProtocol.IsNull()) return; - - Interface_CheckIterator checklst; - const Standard_Boolean res = myController->WriteFile(theFileName,aModel,checklst); - theChecks.Merge(checklst); - if (!res) theChecks.CCheck(0)->AddFail ("SendAll (WriteFile) has failed"); -} diff --git a/src/XSControl/XSControl_WorkSession.hxx b/src/XSControl/XSControl_WorkSession.hxx index eadbceb6f6..3dc27c9222 100644 --- a/src/XSControl/XSControl_WorkSession.hxx +++ b/src/XSControl/XSControl_WorkSession.hxx @@ -179,8 +179,6 @@ class XSControl_WorkSession : public MMgt_TShared protected: - Standard_EXPORT void CopySendAll (const Standard_CString filename, Interface_CheckIterator &checks); - Handle(XSControl_Controller) myController; // thelibrary; Handle(Interface_InterfaceModel) myModel; diff --git a/src/XSDRAWIGES/XSDRAWIGES.cxx b/src/XSDRAWIGES/XSDRAWIGES.cxx index 6c936d9cff..f278647059 100644 --- a/src/XSDRAWIGES/XSDRAWIGES.cxx +++ b/src/XSDRAWIGES/XSDRAWIGES.cxx @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/src/XSDRAWSTEP/XSDRAWSTEP.cxx b/src/XSDRAWSTEP/XSDRAWSTEP.cxx index 1d4e3291d5..60cabbdff1 100644 --- a/src/XSDRAWSTEP/XSDRAWSTEP.cxx +++ b/src/XSDRAWSTEP/XSDRAWSTEP.cxx @@ -71,8 +71,6 @@ static void cleanpilot () #include #include #include -#include -#include #include #include #include @@ -86,7 +84,6 @@ static Handle(IFSelect_Signature) SignType() static Handle(StepSelect_StepType) sty; if (!sty.IsNull()) return sty; sty = new StepSelect_StepType; - sty->SetProtocol (StepAP214::Protocol()); return sty; } @@ -153,7 +150,6 @@ void XSDRAWSTEP::Init () gSessionItems.AddItem (new IFSelect_SignAncestor(),"xst-derived"); Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived(); - stdvar->SetProtocol(StepAP214::Protocol()); gSessionItems.AddItem (stdvar,"step-derived"); Handle(IFSelect_SelectSignature) selsdr = NewSelectSDR(); @@ -213,7 +209,6 @@ void XSDRAWSTEP::Init () //pdn S4133 18.02.99 WS->AddNamedItem ("xst-derived",new IFSelect_SignAncestor()); Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived(); - stdvar->SetProtocol(StepAP214::Protocol()); WS->AddNamedItem ("step-derived",stdvar); Handle(IFSelect_SelectSignature) selsdr = NewSelectSDR(); -- 2.39.5