]> OCCT Git - occt-copy.git/commitdiff
Additional commit
authorszv <szv@opencascade.com>
Fri, 25 Nov 2016 11:26:59 +0000 (14:26 +0300)
committerszv <szv@opencascade.com>
Fri, 25 Nov 2016 11:26:59 +0000 (14:26 +0300)
109 files changed:
src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx
src/HeaderSection/FILES
src/HeaderSection/HeaderSection.cxx
src/HeaderSection/HeaderSection_HeaderRecognizer.cxx [deleted file]
src/HeaderSection/HeaderSection_HeaderRecognizer.hxx [deleted file]
src/IFGraph/IFGraph_AllShared.cxx
src/IFGraph/IFGraph_Cumulate.cxx
src/IFSelect/IFSelect_WorkSession.cxx
src/IGESAppli/IGESAppli_Protocol.cxx
src/IGESBasic/IGESBasic_Protocol.cxx
src/IGESControl/IGESControl_Writer.cxx
src/IGESControl/IGESControl_Writer.hxx
src/IGESData/FILES
src/IGESData/IGESData.cxx
src/IGESData/IGESData.hxx
src/IGESData/IGESData_BasicEditor.cxx [deleted file]
src/IGESData/IGESData_BasicEditor.hxx [deleted file]
src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx
src/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx
src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx
src/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx
src/IGESData/IGESData_GlobalSection.cxx
src/IGESData/IGESData_IGESModel.cxx
src/IGESData/IGESData_IGESModel.hxx
src/IGESData/IGESData_IGESReaderTool.cxx
src/IGESData/IGESData_IGESReaderTool.hxx
src/IGESData/IGESData_NodeOfSpecificLib.hxx
src/IGESData/IGESData_NodeOfSpecificLib_0.cxx
src/IGESData/IGESData_NodeOfWriterLib.hxx
src/IGESData/IGESData_NodeOfWriterLib_0.cxx
src/IGESData/IGESData_Protocol.cxx
src/IGESData/IGESData_Protocol.hxx
src/IGESData/IGESData_SpecificLib.hxx
src/IGESData/IGESData_SpecificLib_0.cxx
src/IGESData/IGESData_WriterLib.hxx
src/IGESData/IGESData_WriterLib_0.cxx
src/IGESDefs/IGESDefs_Protocol.cxx
src/IGESDimen/IGESDimen_Protocol.cxx
src/IGESDraw/IGESDraw_Protocol.cxx
src/IGESFile/IGESFile_Read.cxx
src/IGESGeom/IGESGeom_Protocol.cxx
src/IGESGraph/IGESGraph_Protocol.cxx
src/IGESSolid/IGESSolid_Protocol.cxx
src/Interface/Interface_CopyTool.cxx
src/Interface/Interface_CopyTool.hxx
src/Interface/Interface_FileReaderTool.cxx
src/Interface/Interface_FileReaderTool.hxx
src/Interface/Interface_GTool.cxx
src/Interface/Interface_GTool.hxx
src/Interface/Interface_GeneralLib.hxx
src/Interface/Interface_GeneralLib_0.cxx
src/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx
src/Interface/Interface_GlobalNodeOfReaderLib_0.cxx
src/Interface/Interface_Graph.cxx
src/Interface/Interface_Graph.hxx
src/Interface/Interface_InterfaceModel.cxx
src/Interface/Interface_InterfaceModel.hxx
src/Interface/Interface_NodeOfGeneralLib_0.cxx
src/Interface/Interface_NodeOfReaderLib_0.cxx
src/Interface/Interface_Protocol.cxx
src/Interface/Interface_Protocol.hxx
src/Interface/Interface_ReaderLib.hxx
src/Interface/Interface_ReaderLib_0.cxx
src/Interface/Interface_ReaderModule.cxx
src/Interface/Interface_ReaderModule.hxx
src/Interface/Interface_ShareFlags.cxx
src/Interface/Interface_ShareTool.cxx
src/LibCtl/LibCtl_GlobalNode.gxx
src/LibCtl/LibCtl_Library.gxx
src/LibCtl/LibCtl_Node.gxx
src/RWHeaderSection/RWHeaderSection.cxx
src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx
src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
src/STEPSelections/STEPSelections_SelectDerived.cxx
src/STEPSelections/STEPSelections_SelectDerived.hxx
src/ShapeAnalysis/ShapeAnalysis_Geom.cxx
src/StepData/FILES
src/StepData/StepData.cxx
src/StepData/StepData.hxx
src/StepData/StepData_DefaultGeneral.cxx [deleted file]
src/StepData/StepData_DefaultGeneral.hxx [deleted file]
src/StepData/StepData_DescrGeneral.cxx [deleted file]
src/StepData/StepData_DescrGeneral.hxx [deleted file]
src/StepData/StepData_DescrReadWrite.cxx [deleted file]
src/StepData/StepData_DescrReadWrite.hxx [deleted file]
src/StepData/StepData_FileRecognizer.hxx [deleted file]
src/StepData/StepData_FileRecognizer_0.cxx [deleted file]
src/StepData/StepData_GeneralModule.cxx
src/StepData/StepData_GeneralModule.hxx
src/StepData/StepData_GlobalNodeOfWriterLib.hxx
src/StepData/StepData_GlobalNodeOfWriterLib_0.cxx
src/StepData/StepData_NodeOfWriterLib.hxx
src/StepData/StepData_NodeOfWriterLib_0.cxx
src/StepData/StepData_Protocol.cxx
src/StepData/StepData_Protocol.hxx
src/StepData/StepData_StepModel.cxx
src/StepData/StepData_StepModel.hxx
src/StepData/StepData_StepReaderTool.cxx
src/StepData/StepData_StepReaderTool.hxx
src/StepData/StepData_WriterLib.hxx
src/StepData/StepData_WriterLib_0.cxx
src/StepFile/StepFile_Read.cxx
src/StepFile/StepFile_Read.hxx
src/StepSelect/StepSelect_StepType.cxx
src/StepSelect/StepSelect_StepType.hxx
src/XSControl/XSControl_WorkSession.cxx
src/XSControl/XSControl_WorkSession.hxx
src/XSDRAWIGES/XSDRAWIGES.cxx
src/XSDRAWSTEP/XSDRAWSTEP.cxx

index 1ce12440d2316f7189a34ddeafe51b18f7574442..e616e19a1ce48c35b88bc919d54a9806546a4977 100644 (file)
@@ -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
 
index 38178e8905f7cf1d81b2eef22dd66692fab78dc0..4949ebd272bc18e39af81e4506c837f27729d834 100644 (file)
@@ -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
index 4badc17f53f3734550059ba9d479423fd4184a31..a3de1d2c3cb2a4301fa3fc05838cd5d29a26a969 100644 (file)
 #include <HeaderSection.hxx>
 #include <HeaderSection_Protocol.hxx>
 
-//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 (file)
index 47e6ce8..0000000
+++ /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 <HeaderSection_FileDescription.hxx>
-#include <HeaderSection_FileName.hxx>
-#include <HeaderSection_FileSchema.hxx>
-#include <HeaderSection_HeaderRecognizer.hxx>
-#include <Standard_Type.hxx>
-#include <TCollection_AsciiString.hxx>
-
-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 (file)
index 6fdba9b..0000000
+++ /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 <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_FileRecognizer.hxx>
-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
index fe92d6f13974a7761460d8855ab48ab4ead5beae..fd9d15c45d5e2b30bb4bb6b0a04af0026a8bf0c6 100644 (file)
@@ -14,7 +14,6 @@
 
 #include <IFGraph_AllShared.hxx>
 #include <Interface_EntityIterator.hxx>
-#include <Interface_InterfaceModel.hxx>
 
 
 IFGraph_AllShared::IFGraph_AllShared (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent)
index 6f2e6d945568fb76cce8843557a57e0c7057599e..4d61a764a6798e6985d41ce50d8a921937691333 100644 (file)
@@ -16,8 +16,6 @@
 #include <IFGraph_Cumulate.hxx>
 #include <Interface_EntityIterator.hxx>
 #include <Interface_Graph.hxx>
-#include <Interface_InterfaceModel.hxx>
-#include <Standard_Transient.hxx>
 
 // Calcul de cumul
 // Tres simple, on note les entites demandees, et a la fin
index 9a10aff6ed1f6bd531af2d7cf32c5ebcacd57469..3660b3513ea899e3130a09cc0a2b4c0196e849b4 100644 (file)
@@ -20,7 +20,6 @@
 #include <Dico_DictionaryOfTransient.hxx>
 #include <Message_Messenger.hxx>
 #include <Interface_Macros.hxx>
-#include <Interface_GTool.hxx>
 #include <Interface_HGraph.hxx>
 #include <Interface_MSG.hxx>
 #include <Interface_Category.hxx>
@@ -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<<Standard_Failure::Caught()->GetMessageString();
       sout<<"\n    Abandon"<<endl;
@@ -734,7 +734,7 @@ Handle(TColStd_HSequenceOfTransient) IFSelect_WorkSession::SelectionResult (cons
       res = SelectionResult(sel);    // appel normal (->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<<Standard_Failure::Caught()->GetMessageString();
       sout<<"\n    Abandon"<<endl;
index 3c6c895c70f6813d09e27f02f75835206fc0cf86..aeab6021abcf916cfbfd7da87a9071774b74ce24 100644 (file)
@@ -76,10 +76,9 @@ static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
     Handle(Interface_Protocol) IGESAppli_Protocol::Resource
   (const Standard_Integer num) const
 {
-  Handle(Interface_Protocol) res;
-  if (num == 1) res = IGESDefs::Protocol();
-  if (num == 2) res = IGESDraw::Protocol();
-  return res;
+  if (num == 1) return IGESDefs::Protocol();
+  if (num == 2) return IGESDraw::Protocol();
+  return NULL;
 }
 
     Standard_Integer IGESAppli_Protocol::TypeNumber
index 2bc10318b22938331546ed7d8debfece0b13c0f9..19397fdd979787753480918df1e780186d3e4795 100644 (file)
@@ -67,8 +67,7 @@ static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
     Handle(Interface_Protocol) IGESBasic_Protocol::Resource
   (const Standard_Integer /*num*/) const
 {
-  Handle(Interface_Protocol) res = IGESData::Protocol();
-  return res;
+  return IGESData::Protocol();
 }
 
     Standard_Integer IGESBasic_Protocol::TypeNumber
index da4db26414e4cc703d9d4b9688b1e8f1631ec0f1..c93f710a19f3b402dd4b391a9e0a7a0b39e6bf0f 100644 (file)
 #include <gp_XYZ.hxx>
 #include <IGESControl_Controller.hxx>
 #include <IGESControl_Writer.hxx>
+#include <IGESData.hxx>
+#include <IGESData_DirChecker.hxx>
 #include <IGESData_IGESEntity.hxx>
 #include <IGESData_IGESModel.hxx>
 #include <IGESData_IGESWriter.hxx>
 #include <IGESData_Protocol.hxx>
+#include <IGESData_GeneralModule.hxx>
+#include <IGESData_SpecificModule.hxx>
 #include <Interface_Macros.hxx>
 #include <Interface_Static.hxx>
+#include <Interface_Graph.hxx>
+#include <Interface_EntityIterator.hxx>
 #include <Message_ProgressIndicator.hxx>
 #include <OSD_OpenFile.hxx>
 #include <ShapeAnalysis_ShapeTolerance.hxx>
 
 #include <errno.h>
 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 <flag> 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 = "<<nums<<" ->"<<subs.Value(nums)<<endl;
+      }
+    }
+//  UseFlag (a propager)
+    if (igt / 100 == 2) {
+      G.GetFromEntity(ent,Standard_True,1);               // Annotation
+      G.GetFromEntity(ent,Standard_False,ent->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;
+}
index 8504f03b5521b2cfe27db0ab9f51873bade78286..e2e52e38b9e7202f9fb3c41e71c7f43545695490 100644 (file)
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
 
-#include <IGESData_BasicEditor.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_CString.hxx>
 #include <Standard_OStream.hxx>
+#include <Interface_GeneralLib.hxx>
+#include <IGESData_SpecificLib.hxx>
+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 <flag> has been set to 3 (user defined), <name> 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
index 4a7ba8b5df839e101945ee2604792a6ca63313d1..3bf406b44dcac7c0d9f11eda6b7a9be52afac097 100755 (executable)
@@ -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
index 1cbeaaa64502fa6b362bf5c900ede900da0e9a69..01b028ad901ce4a1357765dabf38ce6a967cdec9 100644 (file)
@@ -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 "";
 }
index 655c512d5a59821aebfe83f8672df5bab0d55526..27a05fb2b63f0840c14c2b6f670736060e3c1bf9 100644 (file)
@@ -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 (file)
index 82d22e6..0000000
+++ /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 <IGESData.hxx>
-#include <IGESData_BasicEditor.hxx>
-#include <IGESData_ColorEntity.hxx>
-#include <IGESData_DirChecker.hxx>
-#include <IGESData_GeneralModule.hxx>
-#include <IGESData_IGESEntity.hxx>
-#include <IGESData_IGESModel.hxx>
-#include <IGESData_LabelDisplayEntity.hxx>
-#include <IGESData_LevelListEntity.hxx>
-#include <IGESData_LineFontEntity.hxx>
-#include <IGESData_Protocol.hxx>
-#include <IGESData_SpecificModule.hxx>
-#include <IGESData_TransfEntity.hxx>
-#include <IGESData_ViewKindEntity.hxx>
-#include <IGESGeom_Boundary.hxx>
-#include <IGESGeom_CurveOnSurface.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_Graph.hxx>
-#include <Interface_Macros.hxx>
-#include <Interface_Static.hxx>
-#include <TCollection_HAsciiString.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <UnitsMethods.hxx>
-
-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 = "<<nums<<" ->"<<subs.Value(nums)<<endl;
-      }
-    }
-//  UseFlag (a propager)
-    if (igt / 100 == 2) {
-      G.GetFromEntity(ent,Standard_True,1);               // Annotation
-      G.GetFromEntity(ent,Standard_False,ent->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."<<i<<" Subord="<<subs.Value(i)<<" Use="<<uf<<endl;
-    ent->InitStatus(bl,subs.Value(i),uf,hy);
-  }
-}
-
-
-    Standard_Boolean  IGESData_BasicEditor::AutoCorrect
-  (const Handle(IGESData_IGESEntity)& ent)
-{
-  if (themodel.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 l entete (entites presentes)
-//    On ne verifie pas les items "Shared", presents de toute facon
-//    Entete : traite par DirChecker pour les cas standard
-/*
-  linefont = ent->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 (file)
index ba58609..0000000
+++ /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 <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
-#include <Standard_Boolean.hxx>
-#include <Interface_GeneralLib.hxx>
-#include <IGESData_SpecificLib.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_CString.hxx>
-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 <flag> 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 <val> 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 <name> is incorrect
-  //! Remark : if <flag> has been set to 3 (user defined), <name>
-  //! 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 <enforce> 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
index e9db7ad2afd0541f377c76937370412c91b4999c..8332059cf252503a31c3f5f85f7e4dc7489995a6 100644 (file)
@@ -21,8 +21,8 @@
 #include <Standard_Type.hxx>
 
 #include <Standard_Transient.hxx>
+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;
 
 
index 7a7b56fd9cb8447a374c9a9b8309740a2679ee61..0ce9a69d78f5e0a774e36ec51166257fa65a289d 100644 (file)
 #include <Standard_Type.hxx>
 
 #include <IGESData_SpecificModule.hxx>
-#include <IGESData_Protocol.hxx>
 #include <IGESData_GlobalNodeOfSpecificLib.hxx>
 #include <IGESData_IGESEntity.hxx>
 #include <IGESData_SpecificLib.hxx>
 #include <IGESData_NodeOfSpecificLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(IGESData_IGESEntity)
 #define TheObject_hxx <IGESData_IGESEntity.hxx>
 #define Handle_TheModule Handle(IGESData_SpecificModule)
 #define TheModule IGESData_SpecificModule
 #define TheModule_hxx <IGESData_SpecificModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
 #define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib
 #define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfSpecificLib.hxx>
 #define LibCtl_Node IGESData_NodeOfSpecificLib
@@ -51,4 +38,3 @@
 #define LibCtl_Library IGESData_SpecificLib
 #define LibCtl_Library_hxx <IGESData_SpecificLib.hxx>
 #include <LibCtl_GlobalNode.gxx>
-
index cea9c9c7f3a264c58e2bc23bd5827fb48d2bb1f4..96b98786fa578609434ab90a3267a77f73d3dd6f 100644 (file)
@@ -21,8 +21,8 @@
 #include <Standard_Type.hxx>
 
 #include <Standard_Transient.hxx>
+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;
 
 
index 088825aeb0af1cd01b310f1741c497a11b7d20f7..983f03f237e1a5f1734ae0264f79ecb03c180768 100644 (file)
 #include <Standard_Type.hxx>
 
 #include <IGESData_ReadWriteModule.hxx>
-#include <IGESData_Protocol.hxx>
 #include <IGESData_GlobalNodeOfWriterLib.hxx>
 #include <IGESData_IGESEntity.hxx>
 #include <IGESData_WriterLib.hxx>
 #include <IGESData_NodeOfWriterLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(IGESData_IGESEntity)
 #define TheObject_hxx <IGESData_IGESEntity.hxx>
 #define Handle_TheModule Handle(IGESData_ReadWriteModule)
 #define TheModule IGESData_ReadWriteModule
 #define TheModule_hxx <IGESData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
 #define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib
 #define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfWriterLib.hxx>
 #define LibCtl_Node IGESData_NodeOfWriterLib
@@ -51,4 +38,3 @@
 #define LibCtl_Library IGESData_WriterLib
 #define LibCtl_Library_hxx <IGESData_WriterLib.hxx>
 #include <LibCtl_GlobalNode.gxx>
-
index 87211099ac3cfb05f88d1e9985e4d90de03d3eba..0d71cbc34caa6ed3d741c9ebe69867698d943697 100644 (file)
@@ -18,7 +18,7 @@
 //#73 rln 10.03.99 S4135: "read.scale.unit" is applied after translation
 
 #include <gp_XYZ.hxx>
-#include <IGESData_BasicEditor.hxx>
+#include <IGESData.hxx>
 #include <IGESData_GlobalSection.hxx>
 #include <Interface_Check.hxx>
 #include <Interface_FileParameter.hxx>
@@ -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");
index 98df9cffe114b078179e3aff836e192156c8255b..a6ca5f8dc9aa955f62857b0fe55b26290ffb7c87 100644 (file)
@@ -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 <IGESData_BasicEditor.hxx>
+#include <IGESData.hxx>
 #include <IGESData_GlobalSection.hxx>
 #include <IGESData_IGESEntity.hxx>
 #include <IGESData_IGESModel.hxx>
@@ -138,11 +138,11 @@ void IGESData_IGESModel::DumpHeader
   if (!str.IsNull()) S<<"[22]  Company               : "<<str->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<<endl;
 
   if (theheader.HasLastChangeDate()) {
@@ -232,26 +232,6 @@ void   IGESData_IGESModel::AddStartLine
 }
 
 
-
-//=======================================================================
-//function : GlobalSection
-//purpose  : 
-//=======================================================================
-
-const IGESData_GlobalSection& IGESData_IGESModel::GlobalSection () const
-      {  return theheader;  }
-
-
-//=======================================================================
-//function : SetGlobalSection
-//purpose  : 
-//=======================================================================
-
-void IGESData_IGESModel::SetGlobalSection
-  (const IGESData_GlobalSection& header)
-      {  theheader = header;  }
-
-
 //=======================================================================
 //function : ApplyStatic
 //purpose  : 
@@ -317,25 +297,14 @@ Standard_Integer  IGESData_IGESModel::DNum
 //purpose  : 
 //=======================================================================
 
-void IGESData_IGESModel::GetFromAnother
-  (const Handle(Interface_InterfaceModel)& other)
+void IGESData_IGESModel::GetFromAnother (const Handle(IGESData_IGESModel)& other)
 {
-  DeclareAndCast(IGESData_IGESModel,another,other);
-  theheader = another->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);
   }
index 70e114685c7ce241d3322cd8fa01a59a69b701c6..fcc9c56d06a9c9a613b1f3a2a4e4a9bd7111a11f 100644 (file)
@@ -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 <me> 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.
index 1c67f28c76ff8cd23ebdef53a2adbbe1c42ed835..b0d5a2715cc89f84cd798d16a221344418d32450 100644 (file)
@@ -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);
index a7838a56c443e1f11d7fcffb437fd8a2b91d6f82..4cf6f1718aacc3778d5d1c755123d8bfe955f2e1 100644 (file)
@@ -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
index d96f224fc663e919241554c36c1c0e18bf9d29c5..42f43f23512335cb3ba1df1641ee392e864a6a4a 100644 (file)
 #include <Standard_Type.hxx>
 
 #include <MMgt_TShared.hxx>
+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
index 14927f2c10040c09583ab344c739a19aa71363ba..8ce07ebde2756920f1feaaada2a7779d4d1c634b 100644 (file)
 #include <IGESData_NodeOfSpecificLib.hxx>
 #include <IGESData_IGESEntity.hxx>
 #include <IGESData_SpecificModule.hxx>
-#include <IGESData_Protocol.hxx>
 #include <IGESData_SpecificLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(IGESData_IGESEntity)
 #define TheObject_hxx <IGESData_IGESEntity.hxx>
 #define Handle_TheModule Handle(IGESData_SpecificModule)
 #define TheModule IGESData_SpecificModule
 #define TheModule_hxx <IGESData_SpecificModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
 #define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib
 #define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfSpecificLib.hxx>
 #define LibCtl_Node IGESData_NodeOfSpecificLib
@@ -51,4 +38,3 @@
 #define LibCtl_Library IGESData_SpecificLib
 #define LibCtl_Library_hxx <IGESData_SpecificLib.hxx>
 #include <LibCtl_Node.gxx>
-
index df4f59c67d7ac1b7e92d1a330f065cc19e4e7674..543b63e29ca50ef6d4a9122accbaaa6c25053140 100644 (file)
 #include <Standard_Type.hxx>
 
 #include <MMgt_TShared.hxx>
+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
index 0ee9b8c504f7c32fbcf9e67ff56133f789ec125c..c554c9362daea661bfbdba1cb1c69c4fa32d2834 100644 (file)
 #include <IGESData_NodeOfWriterLib.hxx>
 #include <IGESData_IGESEntity.hxx>
 #include <IGESData_ReadWriteModule.hxx>
-#include <IGESData_Protocol.hxx>
 #include <IGESData_WriterLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(IGESData_IGESEntity)
 #define TheObject_hxx <IGESData_IGESEntity.hxx>
 #define Handle_TheModule Handle(IGESData_ReadWriteModule)
 #define TheModule IGESData_ReadWriteModule
 #define TheModule_hxx <IGESData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
 #define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib
 #define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfWriterLib.hxx>
 #define LibCtl_Node IGESData_NodeOfWriterLib
@@ -51,4 +38,3 @@
 #define LibCtl_Library IGESData_WriterLib
 #define LibCtl_Library_hxx <IGESData_WriterLib.hxx>
 #include <LibCtl_Node.gxx>
-
index c40e5396c6e348be5aba27cdf67c035e184fca76..781700125157cf2b30d95af955aeeaa2b159c896 100644 (file)
 
 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
index 54497254c601ad4bd2e304434a0ad8f56c316c40..9d9e59b10ec1419db93e58a033a1098a209f4c7c 100644 (file)
@@ -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.
index 99454e5adbba1d5b24d08691d76ad1c5d72ad09c..8914d119ab1efcb1b1d074f08a57baf03c414474 100644 (file)
@@ -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 <aprotocol> 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;
 
 
 
index f91251670da8bdc885abc07ae84855d2ccce3302..0a91b118fc40269de33c80c107bfdae2aa19f770 100644 (file)
@@ -20,9 +20,7 @@
 #include <Standard_NoSuchObject.hxx>
 #include <IGESData_IGESEntity.hxx>
 #include <IGESData_SpecificModule.hxx>
-#include <IGESData_Protocol.hxx>
 #include <IGESData_GlobalNodeOfSpecificLib.hxx>
-#include <Standard_Transient.hxx>
  
 
 #define TheObject Handle(IGESData_IGESEntity)
@@ -30,9 +28,6 @@
 #define Handle_TheModule Handle(IGESData_SpecificModule)
 #define TheModule IGESData_SpecificModule
 #define TheModule_hxx <IGESData_SpecificModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
 #define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib
 #define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfSpecificLib.hxx>
 #define LibCtl_Node IGESData_NodeOfSpecificLib
@@ -42,4 +37,3 @@
 #define LibCtl_Library IGESData_SpecificLib
 #define LibCtl_Library_hxx <IGESData_SpecificLib.hxx>
 #include <LibCtl_Library.gxx>
-
index d4f394f611714525b2991af1f7e5581f86c6275c..dc371b37ba5f4f28a105fa79961f91de951d8bd5 100644 (file)
@@ -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 <aprotocol> 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;
 
 
 
index af8fb61335cae391615f8c69a7da6cf6fc6c1382..aaa8000d870ccca0d6a1eef6c487ea8aa3af3ad2 100644 (file)
@@ -20,9 +20,7 @@
 #include <Standard_NoSuchObject.hxx>
 #include <IGESData_IGESEntity.hxx>
 #include <IGESData_ReadWriteModule.hxx>
-#include <IGESData_Protocol.hxx>
 #include <IGESData_GlobalNodeOfWriterLib.hxx>
-#include <Standard_Transient.hxx>
  
 
 #define TheObject Handle(IGESData_IGESEntity)
@@ -30,9 +28,6 @@
 #define Handle_TheModule Handle(IGESData_ReadWriteModule)
 #define TheModule IGESData_ReadWriteModule
 #define TheModule_hxx <IGESData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(IGESData_Protocol)
-#define TheProtocol IGESData_Protocol
-#define TheProtocol_hxx <IGESData_Protocol.hxx>
 #define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib
 #define LibCtl_GlobalNode_hxx <IGESData_GlobalNodeOfWriterLib.hxx>
 #define LibCtl_Node IGESData_NodeOfWriterLib
@@ -42,4 +37,3 @@
 #define LibCtl_Library IGESData_WriterLib
 #define LibCtl_Library_hxx <IGESData_WriterLib.hxx>
 #include <LibCtl_Library.gxx>
-
index a38f9577b614c01ebd9674775e6603827c694bb4..89b42d55c8a8ca731a34ba865b55e692bf8d675a 100644 (file)
@@ -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
index 87330aab098ed72df7d86444acdbe48dbb4967de..6bc3ea61837e90643f2e5cf8f4d1f4b8414ce35b 100644 (file)
@@ -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
index 95621fda4e63fb098837aeb726a82b74063947ae..725211335f251ddd3c54ba38121bb2eae5df6f65 100644 (file)
@@ -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
index c51dd980644b94259d99d47d694bd95c5f0c404c..e59d52a90fa51e1d11771f321ed4d71bc9c78fea 100644 (file)
@@ -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);
index 01117dc26fe3727190420314c0b7ad280496921f..38a5661f49875450e6b7884031c12dcbfad9337f 100644 (file)
@@ -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
index eb611faec85662bfdfcf02936808db0aca8fbd19..b96dec34d2f64d47459d0b9fecbc9d040db2e4cb 100644 (file)
@@ -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
index c278ff1995fec974257dcc5b94a1187c70090b5d..51fa6219fb8c4cada66270fa187c099dcdf4d4ac 100644 (file)
@@ -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
index f281f79c3869898a66505a9650f98d67a9ea8751..9c36b0a14d0d9f175f3c363d04c586bfccccc43a 100644 (file)
@@ -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
 {
index 1f5ddf4225f99ac908590ef1f15e0052b90c21f8..a63d8410c21d7438c130902f7ab34875cf1c647c 100644 (file)
@@ -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 <withreports> is given True, the entities which were
   //! reported in the Starting Model are replaced in the list
index 19ddbb97be237f5fe7a8ddafa6b1ad561f393627..65b3c662e6941f11e57a4b423159eb715cde44ae 100644 (file)
 #endif
 #include <stdio.h>
 
-// MGE 16/06/98
-// To use Msg class
 #include <Message_Msg.hxx>
-// To use TCollectionHAsciiString
 #include <TCollection_HAsciiString.hxx>
 
 // Failure pour recuperer erreur en lecture fichier,
 //=======================================================================
 
 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;
 }
index 216bb4aec986a11d7849f157df18c95605a446fd..228b0fde2a52ca3755598756e96b0a20168c8e94 100644 (file)
@@ -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.
-  //! <ach> 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.
-  //! <rlib> is used to find Protocol and CaseNumber to apply
-  //! <glib> performs the creation (by service NewVoid, or NewRead
-  //! if NewVoid gave no result)
-  //! <ach> is a check, which is transmitted to NewRead if it is
-  //! called, gives a result but which is false
-  //! <ent> 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.
+  //! <rlib> is used to find Protocol and CaseNumber to apply
+  //! <glib> performs the creation (by service NewVoid, or NewRead
+  //! if NewVoid gave no result)
+  //! <ach> is a check, which is transmitted to NewRead if it is
+  //! called, gives a result but which is false
+  //! <ent> 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.
+  //! <ach> 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
index 48871b105a33fcacda67caa72d47870454d59728..1027eb599d3e14ab7202aaba285afa67b75a93dd 100644 (file)
 
 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)
 {
index 43c11a0eabaa996822d7bbb8a741c03f58d1611a..02d113934545fafdb45c0b26542f2dda37b2e6f4 100644 (file)
@@ -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
   //! <enforce> False : minimum count
   //! <enforce> True  : clears former reservations
index c7c0bf5112fb028d046a1f4eed147383173bd4e0..a1b0caa9ea0c5150b6061d5918210a9fddeda8cd 100644 (file)
@@ -25,7 +25,7 @@
 #include <Standard_Integer.hxx>
 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 <aprotocol> 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
index ccaa03aa4d4c3e07c1e89ae1947717a76664a5ac..72a4787dae19b30c4334e3ff4de579ec8b63ecfd 100644 (file)
@@ -20,7 +20,6 @@
 #include <Standard_NoSuchObject.hxx>
 #include <Standard_Transient.hxx>
 #include <Interface_GeneralModule.hxx>
-#include <Interface_Protocol.hxx>
 #include <Interface_GlobalNodeOfGeneralLib.hxx>
  
 
@@ -29,9 +28,6 @@
 #define Handle_TheModule Handle(Interface_GeneralModule)
 #define TheModule Interface_GeneralModule
 #define TheModule_hxx <Interface_GeneralModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
 #define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib
 #define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfGeneralLib.hxx>
 #define LibCtl_Node Interface_NodeOfGeneralLib
index f3d758b87c26b20766a421f6fb0af93e80fb16ca..eaafe4a9dd56946eb5ca99a0040a68f6334ca430 100644 (file)
 #include <Standard_Type.hxx>
 
 #include <Interface_GeneralModule.hxx>
-#include <Interface_Protocol.hxx>
 #include <Interface_GlobalNodeOfGeneralLib.hxx>
 #include <Standard_Transient.hxx>
 #include <Interface_GeneralLib.hxx>
 #include <Interface_NodeOfGeneralLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(Standard_Transient)
 #define TheObject_hxx <Standard_Transient.hxx>
 #define Handle_TheModule Handle(Interface_GeneralModule)
 #define TheModule Interface_GeneralModule
 #define TheModule_hxx <Interface_GeneralModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
 #define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib
 #define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfGeneralLib.hxx>
 #define LibCtl_Node Interface_NodeOfGeneralLib
@@ -51,4 +38,3 @@
 #define LibCtl_Library Interface_GeneralLib
 #define LibCtl_Library_hxx <Interface_GeneralLib.hxx>
 #include <LibCtl_GlobalNode.gxx>
-
index 38ada70de6656d602d780a53b5321ca26c968c0c..2a04743d7f499c8677b71e719158a802d24efc65 100644 (file)
 #include <Standard_Type.hxx>
 
 #include <Interface_ReaderModule.hxx>
-#include <Interface_Protocol.hxx>
 #include <Interface_GlobalNodeOfReaderLib.hxx>
 #include <Standard_Transient.hxx>
 #include <Interface_ReaderLib.hxx>
 #include <Interface_NodeOfReaderLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(Standard_Transient)
 #define TheObject_hxx <Standard_Transient.hxx>
 #define Handle_TheModule Handle(Interface_ReaderModule)
 #define TheModule Interface_ReaderModule
 #define TheModule_hxx <Interface_ReaderModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
 #define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib
 #define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfReaderLib.hxx>
 #define LibCtl_Node Interface_NodeOfReaderLib
@@ -51,4 +38,3 @@
 #define LibCtl_Library Interface_ReaderLib
 #define LibCtl_Library_hxx <Interface_ReaderLib.hxx>
 #include <LibCtl_GlobalNode.gxx>
-
index f02a4e478c4efdfcc174dec6525ccb1dd17b67b8..972558b94cc58c69b560b8b23dc64d2e98b57e6b 100644 (file)
@@ -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) &gtool = themodel->GTool();
   if (gtool.IsNull()) return str;
 
   Handle(Interface_GeneralModule) module;
index ea0c8f4c63b4e683f6189c3f092a710028db00d6..7c42dfb583043291b134b470c15921eca2c2df93 100644 (file)
@@ -31,7 +31,6 @@
 
 class Interface_GeneralLib;
 class Interface_Protocol;
-class Interface_GTool;
 class Standard_Transient;
 class Interface_BitMap;
 class Interface_EntityIterator;
index 445edea14d10c85300d2ff019faf507f3421a2cc..100b3f65e2f315247dbb259c8a9146a590f86739 100644 (file)
@@ -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);
 }
 
 
index b949584b58113adc5c2f2cffe763e69a8bdfc9ba..bf7e3da6b0ce50852adc644374989fd06b4a53c8 100644 (file)
@@ -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 <me> (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 <num> 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
index 7c7f89420e4345ffea488fc1a6995370abb5fb2c..3632529d4fb2dd001334e9fe7577fecf80c145cc 100644 (file)
 #include <Interface_NodeOfGeneralLib.hxx>
 #include <Standard_Transient.hxx>
 #include <Interface_GeneralModule.hxx>
-#include <Interface_Protocol.hxx>
 #include <Interface_GeneralLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(Standard_Transient)
 #define TheObject_hxx <Standard_Transient.hxx>
 #define Handle_TheModule Handle(Interface_GeneralModule)
 #define TheModule Interface_GeneralModule
 #define TheModule_hxx <Interface_GeneralModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
 #define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib
 #define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfGeneralLib.hxx>
 #define LibCtl_Node Interface_NodeOfGeneralLib
index 8bbf93d360e969e818cf465747f3ae6018d67655..cd13c3ff439417b87ef0b9ada3da4fc5a4515594 100644 (file)
 #include <Interface_NodeOfReaderLib.hxx>
 #include <Standard_Transient.hxx>
 #include <Interface_ReaderModule.hxx>
-#include <Interface_Protocol.hxx>
 #include <Interface_ReaderLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(Standard_Transient)
 #define TheObject_hxx <Standard_Transient.hxx>
 #define Handle_TheModule Handle(Interface_ReaderModule)
 #define TheModule Interface_ReaderModule
 #define TheModule_hxx <Interface_ReaderModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
 #define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib
 #define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfReaderLib.hxx>
 #define LibCtl_Node Interface_NodeOfReaderLib
@@ -51,4 +38,3 @@
 #define LibCtl_Library Interface_ReaderLib
 #define LibCtl_Library_hxx <Interface_ReaderLib.hxx>
 #include <LibCtl_Node.gxx>
-
index 6a69811e6fb4f465191c43931a09de095bd6cf8b..2aab20ac274b3ce97877425459c2645a04f40979 100644 (file)
 // commercial license or contractual agreement.
 
 
-#include <Interface_Check.hxx>
-#include <Interface_Graph.hxx>
-#include <Interface_InterfaceError.hxx>
-#include <Interface_InterfaceModel.hxx>
 #include <Interface_Protocol.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
 
 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  : 
index 0a870c04b67c71452aeb7dcf37dc423baf64a4a3..df25e2f44919d938a21f81d9d3e0c1e69e7a5a5d 100644 (file)
@@ -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
index 7d982d8e0bff0aa4d6bae1fb105f68e61393ce9d..da8d42ed4776b98ee03bd930413c556d42942252 100644 (file)
@@ -25,7 +25,6 @@
 #include <Standard_Integer.hxx>
 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 <aprotocol> 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
index 3c574f21383ea4f99d798625f1173b2c1ac08cca..42a5e443bd2360c7a4fcc80b1d2ac1a717f1f25e 100644 (file)
@@ -20,7 +20,6 @@
 #include <Standard_NoSuchObject.hxx>
 #include <Standard_Transient.hxx>
 #include <Interface_ReaderModule.hxx>
-#include <Interface_Protocol.hxx>
 #include <Interface_GlobalNodeOfReaderLib.hxx>
  
 
@@ -29,9 +28,6 @@
 #define Handle_TheModule Handle(Interface_ReaderModule)
 #define TheModule Interface_ReaderModule
 #define TheModule_hxx <Interface_ReaderModule.hxx>
-#define Handle_TheProtocol Handle(Interface_Protocol)
-#define TheProtocol Interface_Protocol
-#define TheProtocol_hxx <Interface_Protocol.hxx>
 #define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib
 #define LibCtl_GlobalNode_hxx <Interface_GlobalNodeOfReaderLib.hxx>
 #define LibCtl_Node Interface_NodeOfReaderLib
@@ -41,4 +37,3 @@
 #define LibCtl_Library Interface_ReaderLib
 #define LibCtl_Library_hxx <Interface_ReaderLib.hxx>
 #include <LibCtl_Library.gxx>
-
index 152e9a38489226320f8fd6c830c3d5cdeaf8481a..b3dd26e2692ffc1a43188cdcfe2b4e460e722ae9 100644 (file)
 // commercial license or contractual agreement.
 
 
-#include <Interface_Check.hxx>
-#include <Interface_FileReaderData.hxx>
 #include <Interface_ReaderModule.hxx>
-#include <Standard_DomainError.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(Interface_ReaderModule,MMgt_TShared)
 
index 693a8c39dfe5bcab9012a488beba720a79da27ec..78e6cc47e21d72af2525e5c9eb1f5ea65719ed12 100644 (file)
 #include <Standard_Type.hxx>
 
 #include <MMgt_TShared.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Boolean.hxx>
-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 <num> in <data> 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
index 6245cd53cec1739131137ca6b73b34bd12ea0b0d..49cfbb2074ff99380ee0e7ea8082445270366379 100644 (file)
@@ -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) &gtool = themodel->GTool();
   gtool->Reservate(amodel->NbEntities());
   themodel = amodel;
   Evaluate (gtool->Lib(),gtool);
index ea4c58d7bce81be68759ca16225786b8d8b1b32a..320b076dcde33f1c6e2d2905f1a3aa0020c3e149 100644 (file)
@@ -16,7 +16,6 @@
 #include <Interface_GeneralLib.hxx>
 #include <Interface_GeneralModule.hxx>
 #include <Interface_Graph.hxx>
-#include <Interface_GTool.hxx>
 #include <Interface_HGraph.hxx>
 #include <Interface_InterfaceError.hxx>
 #include <Interface_InterfaceModel.hxx>
index a989a1dad2fe99cc4364559ef841346f52fc6fac..ab609c4ed8743c2702ef7f539c1bf7ce668142a3 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#include <LibCtl_GlobalNode.ixx>
-
 //  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 <Interface_Protocol.hxx>
 
 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
index af880064efc09c6ff9256d95fadffd08eedfec04..7e9edac52eb7d6f8e7b75a9712d80e1879711fc1 100644 (file)
@@ -12,7 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#include <LibCtl_Library.ixx>
+#include <Interface_Protocol.hxx>
 #include <Standard_NoSuchObject.hxx>
 
 
@@ -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();
index 831defa6777dfe32e3e61e7122b52467894022fd..176f2a8ccaf983a3b6e23e0c82091565d7e60e73 100644 (file)
@@ -12,9 +12,6 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-//#include <LibCtl_Node.ixx>
-
-
 //  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
index f9e63df35bba97f3779f37039568c16d055c995e..7d6302e8ee13bf8803894af40a139892bfd98b6d 100644 (file)
 #include <RWHeaderSection.hxx>
 #include <RWHeaderSection_GeneralModule.hxx>
 #include <RWHeaderSection_ReadWriteModule.hxx>
-#include <StepData.hxx>
+#include <HeaderSection.hxx>
 
 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;
 }
index 4957a2e2b7caecf13a5dc5a1a34f43399594f10b..e69f1d3aea62553c6453d5a4e47c8c2b6b329cd3 100644 (file)
@@ -12,6 +12,7 @@
 // commercial license or contractual agreement.
 
 
+#include <HeaderSection.hxx>
 #include <HeaderSection_FileDescription.hxx>
 #include <HeaderSection_FileName.hxx>
 #include <HeaderSection_FileSchema.hxx>
@@ -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 ---
index 8a362657acba8e464127c853df63febd4841c934..7338e47694fbca809c3197fc4bcbc038bd5b4ba1 100644 (file)
@@ -26,7 +26,6 @@
 #include <StepAP214_Protocol.hxx>
 #include <StepData_StepReaderData.hxx>
 #include <StepData_StepWriter.hxx>
-#include <StepData_WriterLib.hxx>
 #include <TCollection_AsciiString.hxx>
 
 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);
index 6a39a1f97432d14ff11f7446dcad4e91caa3ac94..95123d4f4a42e3953f2309480904d790fe06203c 100644 (file)
 
 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)
 {
index 434c405baedf32f94ba7a9e06d312c114189b0d1..232c04b979074933684f900e007e472671745e2b 100644 (file)
 #ifndef _STEPSelections_SelectDerived_HeaderFile
 #define _STEPSelections_SelectDerived_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <StepSelect_StepType.hxx>
-#include <Standard_Boolean.hxx>
-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
index b523f3b5498775d59e2f2f303321b6a8da2ef29a..9bf96249ae3fbd973ca0f740bdc2f003d9e4ea85 100644 (file)
@@ -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 <gtrsf>. 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 <gtrsf>. 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;
 }
index 8f783767339aac4e4948bce5d13275a21b07b9e9..ac7314e3919ec22f81aa00df519f113965254106 100644 (file)
@@ -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
index 782bc60825531ab1d574794eb2582656e7757b70..a37d7ad4975473e8532acec4cb6352acbe008af4 100644 (file)
 // 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 <StepData.hxx>
-#include <Interface_Macros.hxx>
 #include <HeaderSection.hxx>
 #include <HeaderSection_Protocol.hxx>
-#include <StepData_Protocol.hxx>
-
-//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();
 }
index 11c998f95e3b71ad04f56e6b69384a5cbdea6605..ac23787cef95dff3af79245e3ed05fda4ebdd03e 100644 (file)
@@ -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 (file)
index 68c9f23..0000000
+++ /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 <Interface_Check.hxx>
-#include <Interface_CopyTool.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_GeneralLib.hxx>
-#include <Interface_Macros.hxx>
-#include <Interface_ParamType.hxx>
-#include <Interface_ShareTool.hxx>
-#include <Interface_UndefinedContent.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData.hxx>
-#include <StepData_DefaultGeneral.hxx>
-#include <StepData_Protocol.hxx>
-#include <StepData_UndefinedEntity.hxx>
-
-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 (file)
index 7ebe56b..0000000
+++ /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 <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_GeneralModule.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Boolean.hxx>
-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
-  //! <ent>, 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 <ent>
-  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 <entfrom> to <entto> (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 (file)
index b7e4956..0000000
+++ /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 <Interface_Check.hxx>
-#include <Interface_CopyTool.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_ShareTool.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_DescrGeneral.hxx>
-#include <StepData_Described.hxx>
-#include <StepData_EDescr.hxx>
-#include <StepData_Protocol.hxx>
-
-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 (file)
index b729213..0000000
+++ /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 <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_GeneralModule.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Boolean.hxx>
-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 (file)
index 8104858..0000000
+++ /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 <Interface_Check.hxx>
-#include <Interface_Macros.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_DescrReadWrite.hxx>
-#include <StepData_ECDescr.hxx>
-#include <StepData_EDescr.hxx>
-#include <StepData_ESDescr.hxx>
-#include <StepData_FieldListN.hxx>
-#include <StepData_Plex.hxx>
-#include <StepData_Protocol.hxx>
-#include <StepData_Simple.hxx>
-#include <StepData_StepReaderData.hxx>
-#include <StepData_StepWriter.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <TColStd_HSequenceOfAsciiString.hxx>
-
-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 (file)
index 5248f70..0000000
+++ /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 <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_ReadWriteModule.hxx>
-#include <Standard_Integer.hxx>
-#include <TColStd_SequenceOfAsciiString.hxx>
-#include <Standard_Boolean.hxx>
-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 (file)
index ca42598..0000000
+++ /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 <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <Standard_Boolean.hxx>
-#include <Standard_Transient.hxx>
-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 (file)
index f6f2aad..0000000
+++ /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 <StepData_FileRecognizer.hxx>
-
-#include <Standard_Type.hxx>
-
-#include <Standard_Transient.hxx>
-#include <StepData_FileRecognizer.hxx>
-#include <Standard_NoSuchObject.hxx>
-#include <TCollection_AsciiString.hxx>
-
-
-
-
-
-
-
-
-
-#define TheKey TCollection_AsciiString
-#define TheKey_hxx <TCollection_AsciiString.hxx>
-#define Handle_TheResul Handle(Standard_Transient)
-#define TheResul Standard_Transient
-#define TheResul_hxx <Standard_Transient.hxx>
-#define Interface_Recognizer StepData_FileRecognizer
-#define Interface_Recognizer_hxx <StepData_FileRecognizer.hxx>
-#define Handle_Interface_Recognizer Handle(StepData_FileRecognizer)
-#include <Interface_Recognizer.gxx>
-
index f6b8d90103378ac4fe4797588ee28784e7480961..afc22b110ce7a9e308a785fea4ecd3b98498efc7 100644 (file)
 // commercial license or contractual agreement.
 
 
-#include <Interface_Check.hxx>
-#include <Interface_CopyTool.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_ShareTool.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
 #include <StepData_GeneralModule.hxx>
 
-IMPLEMENT_STANDARD_RTTIEXT(StepData_GeneralModule,Interface_GeneralModule)
\ No newline at end of file
+IMPLEMENT_STANDARD_RTTIEXT(StepData_GeneralModule,Interface_GeneralModule)
index aca57dbf0dbd91a37e0dfd1687ea13e137e8e43d..b811e4b32fb796a77307f896eb06e431390ac21e 100644 (file)
@@ -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
   //! <ent>. 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 <ent>
   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 <entfrom> to <entto> (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
index ee99849f0f19ff5b11e55f54b32e3c83327ec9cb..cc3a4f501c1af4a36af721b4a2c527c9117c5314 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <Standard_Transient.hxx>
 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;
 
 
index f6d60688afb326e3a6b21af482b5e52dd3e405d7..bd389d39f8148a8659b57392cc77b79b5ba25279 100644 (file)
 #include <Standard_Type.hxx>
 
 #include <StepData_ReadWriteModule.hxx>
-#include <StepData_Protocol.hxx>
 #include <StepData_GlobalNodeOfWriterLib.hxx>
 #include <Standard_Transient.hxx>
 #include <StepData_WriterLib.hxx>
 #include <StepData_NodeOfWriterLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(Standard_Transient)
 #define TheObject_hxx <Standard_Transient.hxx>
 #define Handle_TheModule Handle(StepData_ReadWriteModule)
 #define TheModule StepData_ReadWriteModule
 #define TheModule_hxx <StepData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(StepData_Protocol)
-#define TheProtocol StepData_Protocol
-#define TheProtocol_hxx <StepData_Protocol.hxx>
 #define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib
 #define LibCtl_GlobalNode_hxx <StepData_GlobalNodeOfWriterLib.hxx>
 #define LibCtl_Node StepData_NodeOfWriterLib
@@ -51,4 +38,3 @@
 #define LibCtl_Library StepData_WriterLib
 #define LibCtl_Library_hxx <StepData_WriterLib.hxx>
 #include <LibCtl_GlobalNode.gxx>
-
index 2410688f652e48423158ff000a6e06bef3f66151..8f48f2ff2c2d2654f5dd544fc81bfeed70f81f0c 100644 (file)
@@ -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
index 91139762362981d7c327dd04b60674c598495d20..5cd0f4d6c64c2ff2a7cff7e9a1fa469367bf68d3 100644 (file)
 
 #include <Standard_Type.hxx>
 
+#include <Interface_Protocol.hxx>
 #include <StepData_GlobalNodeOfWriterLib.hxx>
 #include <StepData_NodeOfWriterLib.hxx>
 #include <Standard_Transient.hxx>
 #include <StepData_ReadWriteModule.hxx>
-#include <StepData_Protocol.hxx>
 #include <StepData_WriterLib.hxx>
 
-
-
-
-
-
-
-
-
 #define TheObject Handle(Standard_Transient)
 #define TheObject_hxx <Standard_Transient.hxx>
 #define Handle_TheModule Handle(StepData_ReadWriteModule)
 #define TheModule StepData_ReadWriteModule
 #define TheModule_hxx <StepData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(StepData_Protocol)
-#define TheProtocol StepData_Protocol
-#define TheProtocol_hxx <StepData_Protocol.hxx>
 #define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib
 #define LibCtl_GlobalNode_hxx <StepData_GlobalNodeOfWriterLib.hxx>
 #define LibCtl_Node StepData_NodeOfWriterLib
index a018c8e103b7365a1ef202bc3a36100163b94d59..aec8d7e61049ffd039c1162cc0a6488af8cb0a6d 100644 (file)
@@ -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
 {
index 7e905b1903c84d26c18759da2c864a273690869c..a0120a56a634f92ffc1eb111cd390e4433560185 100644 (file)
@@ -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
index 7141e3f74c7bd805be09ec1b179ea2305ccea8d1..baec99859ebef1d51b44669db4d6055b166d55b6 100644 (file)
@@ -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
 {
index 3a54fa7b90ef3faede9982ca20560ec24d84c409..5b24e45b1b44c02edc45cb5c068ae094fbfd2df4 100644 (file)
@@ -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 <me>, 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;
   
index 074352a09c2b27f1e87c30456199cab3cc56fcde..7dc87355e154a6235cdb3cfa17215ee8ca412da8 100644 (file)
@@ -19,8 +19,6 @@
 #include <Message_Messenger.hxx>
 #include <Standard_ErrorHandler.hxx>
 #include <Standard_Failure.hxx>
-#include <Standard_Transient.hxx>
-#include <StepData_FileRecognizer.hxx>
 #include <StepData_Protocol.hxx>
 #include <StepData_ReadWriteModule.hxx>
 #include <StepData_StepModel.hxx>
@@ -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);
index fe22bb87140ca896346ae504f3c845e6cfef5090..998827823cb73994924d41b3bbe268f16cee58c5 100644 (file)
 #include <Interface_GeneralLib.hxx>
 #include <Interface_ReaderLib.hxx>
 #include <Interface_FileReaderTool.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Integer.hxx>
-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)
-  //! <optimize> 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)
-  //! <optimize : same as above
-  Standard_EXPORT void Prepare (const Handle(StepData_FileRecognizer)& reco, const Standard_Boolean optimize = Standard_True);
+  //! 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)
+  Standard_EXPORT void PrepareHeader ();
+
+ private:
   
   //! recognizes records, by asking either ReaderLib (default) or
   //! FileRecognizer (if defined) to do so. <ach> 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
index 6f0501e9ae788b5ed75a75ec2311bcb2663f9e03..a4cce789586e01f10c9eb697e876cce1df8e2d35 100644 (file)
 
 #include <Standard_Boolean.hxx>
 #include <Standard_Integer.hxx>
+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 <aprotocol> 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
index 99cb924975b42fe5ac5a715ceda7fe6468af0eb9..64e89ca406f8512676b380d9e977ed549ab11ea7 100644 (file)
@@ -20,7 +20,6 @@
 #include <Standard_NoSuchObject.hxx>
 #include <Standard_Transient.hxx>
 #include <StepData_ReadWriteModule.hxx>
-#include <StepData_Protocol.hxx>
 #include <StepData_GlobalNodeOfWriterLib.hxx>
  
 
@@ -29,9 +28,6 @@
 #define Handle_TheModule Handle(StepData_ReadWriteModule)
 #define TheModule StepData_ReadWriteModule
 #define TheModule_hxx <StepData_ReadWriteModule.hxx>
-#define Handle_TheProtocol Handle(StepData_Protocol)
-#define TheProtocol StepData_Protocol
-#define TheProtocol_hxx <StepData_Protocol.hxx>
 #define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib
 #define LibCtl_GlobalNode_hxx <StepData_GlobalNodeOfWriterLib.hxx>
 #define LibCtl_Node StepData_NodeOfWriterLib
index 2e024c9bdce09429e08a1ec9b9f7ff594a96183b..f8baa7b5d2c436778d9c59c2e5acfe9a05362b11 100644 (file)
@@ -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; 
index 6ee30cf997091d31cbe5912e5d15d9c2f2985424..864f6038d975417c5bb5ea054d9ae50ec3332bc5 100644 (file)
 
 //# include <stepread.h>  : sauf recfile_modeprint, declare ici
 # include <StepData_StepModel.hxx>
-# include <StepData_FileRecognizer.hxx>
 # include <StepData_Protocol.hxx>
 
-
 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,
index 8363e536cb305f6313afbf51194605590a9f6a2a..309212946a8ddc0bdc912fd163597a43d6511f1b 100644 (file)
 #include <Interface_InterfaceError.hxx>
 #include <Interface_InterfaceModel.hxx>
 #include <Interface_Macros.hxx>
-#include <Interface_Protocol.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_Protocol.hxx>
 #include <StepData_ReadWriteModule.hxx>
 #include <StepData_UndefinedEntity.hxx>
+#include <StepAP214.hxx>
+#include <StepAP214_Protocol.hxx>
 #include <StepSelect_StepType.hxx>
 #include <TColStd_SequenceOfAsciiString.hxx>
 
@@ -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
 {
index e0e98f55c65a21539a943dfb9705444c741fed10..22b285ec784f23aa05b76ac271327c404a95be55 100644 (file)
@@ -24,9 +24,6 @@
 #include <IFSelect_Signature.hxx>
 #include <Standard_CString.hxx>
 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 <ent> is not recognised, produces "..NOT FROM SCHEMA <name>.."
   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
index 63ee82790c0b6dd8c8bac6ed6eca7d79335c9e4d..4562189db8180fc84d8576b16edd7f4e22061372 100644 (file)
@@ -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"<<endl;
     status = Interface_RetFail;
   }
   if (status != Interface_RetDone) return status;
   if (model.IsNull()) return Interface_RetVoid;
+
   SetModel (model);
-  SetLoadedFile (theFileName);
+
+  theloaded = theFileName;
+
   return status;
 }
 
@@ -342,30 +337,31 @@ Interface_ReturnStatus XSControl_WorkSession::ReadFile (const Standard_CString t
 
 Interface_ReturnStatus XSControl_WorkSession::WriteFile (const Standard_CString theFileName)
 {
-  if (myController.IsNull())
+  if (myController.IsNull() || myController->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<<Standard_Failure::Caught()->GetMessageString();
-      sout<<"\n    Abandon"<<endl;
-      errhand = Standard_True;
-      return Interface_RetFail;
-    }
+  try {
+    OCC_CATCH_SIGNALS
+    sout << "** WorkSession : Writing all data" << endl;
+    ComputeGraph(Standard_True);
+    if (!IsLoaded())
+      return Interface_RetVoid;
+
+    checks.SetName ("X-STEP WorkSession : WriteFile");
+    Interface_CheckIterator checklst;
+    const Standard_Boolean res = myController->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<<Standard_Failure::Caught()->GetMessageString();
+    sout<<"\n    Abandon"<<endl;
+    return Interface_RetFail;
   }
-  else CopySendAll(theFileName,checks);
 
   Handle(Interface_Check) aMainFail = checks.CCheck(0);
   if (!aMainFail.IsNull() && aMainFail->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"<<endl;
-
-  const Handle(Interface_Protocol)& aProtocol = myController->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");
-}
index eadbceb6f69a6a98e4b5a64de4ade41436a33904..3dc27c9222c64227d4cce669fdadd13a67257b0b 100644 (file)
@@ -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;
index 6c936d9cff7ba9a25bb1c72cb62c441ebe5a275a..f278647059fa227795bb4a319577d82e8816039b 100644 (file)
@@ -28,7 +28,6 @@
 #include <IGESControl_Reader.hxx>
 #include <IGESControl_Writer.hxx>
 #include <IGESData.hxx>
-#include <IGESData_BasicEditor.hxx>
 #include <IGESData_IGESEntity.hxx>
 #include <IGESData_IGESModel.hxx>
 #include <IGESData_Protocol.hxx>
index 1d4e3291d51bcfcc9c8862e4908b1d4d89e098ef..60cabbdff1c8ef093a9b1c30833f7e09ff923f34 100644 (file)
@@ -71,8 +71,6 @@ static void cleanpilot ()
 #include <IFSelect_SelectSignature.hxx>
 #include <IFSelect_SelectModelEntities.hxx>
 #include <IFSelect_SelectModelRoots.hxx>
-#include <StepAP214.hxx>
-#include <StepAP214_Protocol.hxx>
 #include <STEPSelections_SelectDerived.hxx>
 #include <STEPSelections_SelectFaces.hxx>
 #include <STEPSelections_SelectInstances.hxx>
@@ -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();