]> OCCT Git - occt-copy.git/commitdiff
Remove static StepEdit, StepProtocol. Mutex for parser
authoraka <aka@opencascade.com>
Fri, 18 Aug 2017 07:54:00 +0000 (10:54 +0300)
committeraka <aka@opencascade.com>
Fri, 18 Aug 2017 07:54:00 +0000 (10:54 +0300)
14 files changed:
src/Interface/Interface_InterfaceModel.cxx
src/RWStepAP214/RWStepAP214.cxx
src/RWStepAP214/RWStepAP214.hxx
src/RWStepAP214/RWStepAP214_GeneralModule.cxx
src/STEPControl/STEPControl_Controller.cxx
src/STEPControl/STEPControl_Controller.hxx
src/STEPEdit/STEPEdit.cxx [deleted file]
src/STEPEdit/STEPEdit.hxx [deleted file]
src/StepAP214/StepAP214.cxx [deleted file]
src/StepAP214/StepAP214.hxx [deleted file]
src/StepAP214/StepAP214_Protocol.cxx
src/StepAP214/StepAP214_Protocol.hxx
src/StepFile/StepFile_Read.cxx
src/XSAlgo/XSAlgo_AlgoContainer.cxx

index 419941f59ee8cb012641947fdcdb1bd6f94c59a9..ff8e4b9f5345b8bd9ba3737682f32973e1fec2df 100644 (file)
@@ -1048,6 +1048,13 @@ Handle(TColStd_HSequenceOfHAsciiString) Interface_InterfaceModel::ListTemplates
 Handle(Interface_Static) Interface_InterfaceModel::GetParam
 (const Standard_CString theParamName)
 {
+  if (IsEqual(theParamName, "write.step.schema"))
+  {
+    Handle(Standard_Transient) result;
+    myParamMap.Find(theParamName, result);
+    Standard_Integer anInt = Handle(Interface_Static)::DownCast(result)->IntegerValue();
+
+  }
   Handle(Standard_Transient) result;
   myParamMap.Find(theParamName, result);
   return Handle(Interface_Static)::DownCast(result);
index 66933632837cb6536d1e4bb4c48d9dd07361f4b6..21835951e891d41332b416f4592559cd380e0a52 100644 (file)
 #include <RWStepAP214.hxx>
 #include <RWStepAP214_GeneralModule.hxx>
 #include <RWStepAP214_ReadWriteModule.hxx>
-#include <StepAP214.hxx>
-#include <StepAP214_Protocol.hxx>
 #include <StepData_WriterLib.hxx>
 
 static int THE_RWStepAP214_init = 0;
 
-void RWStepAP214::Init()
+void RWStepAP214::Init(const Handle(StepAP214_Protocol)& theProto)
 {
   if (THE_RWStepAP214_init)
   {
@@ -32,8 +30,7 @@ void RWStepAP214::Init()
   }
   THE_RWStepAP214_init = 1;
   RWHeaderSection::Init();
-  Handle(StepAP214_Protocol) proto = StepAP214::Protocol();
-  Interface_GeneralLib::SetGlobal (new RWStepAP214_GeneralModule,proto);
-  Interface_ReaderLib::SetGlobal  (new RWStepAP214_ReadWriteModule,proto);
-  StepData_WriterLib::SetGlobal   (new RWStepAP214_ReadWriteModule,proto);
+  Interface_GeneralLib::SetGlobal (new RWStepAP214_GeneralModule, theProto);
+  Interface_ReaderLib::SetGlobal  (new RWStepAP214_ReadWriteModule, theProto);
+  StepData_WriterLib::SetGlobal   (new RWStepAP214_ReadWriteModule, theProto);
 }
index af59444314edfe550b898e34064c2ae0b1077f3d..eece0e0769a1fd2c3cc59845dfce9cd4ac09b4ef 100644 (file)
@@ -20,6 +20,7 @@
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
+#include <StepAP214_Protocol.hxx>
 
 class RWStepAP214_ReadWriteModule;
 class RWStepAP214_GeneralModule;
@@ -60,7 +61,7 @@ public:
 
   
   //! enforced the initialisation of the  libraries
-  Standard_EXPORT static void Init();
+  Standard_EXPORT static void Init(const Handle(StepAP214_Protocol)& theProto);
 
 
 
index b10c5c27aa8193759a7d1d042a77b4c197133aea..05081cb5ad7ad2b22840d5e1abfd011ab875d338 100644 (file)
 #include <StepAP203_ChangeRequest.hxx>
 #include <StepAP203_StartRequest.hxx>
 #include <StepAP203_StartWork.hxx>
-#include <StepAP214.hxx>
 #include <StepAP214_AppliedApprovalAssignment.hxx>
 #include <StepAP214_AppliedDateAndTimeAssignment.hxx>
 #include <StepAP214_AppliedDateAssignment.hxx>
@@ -1375,7 +1374,6 @@ RWStepAP214_GeneralModule::RWStepAP214_GeneralModule ()
   catstr = Interface_Category::Number("Structure");
   catdsc = Interface_Category::Number("Description");
   cataux = Interface_Category::Number("Auxiliary");
-//// Interface_GeneralLib::SetGlobal(Handle(RWStepAP214_GeneralModule)::DownCast(This()), StepAP214::Protocol());
 }
 
 
index 700b0d1aa0242887bf18851dd5c380992027c755..bd16d3d529a29ef14120cf9c491c3529f37d8e44 100644 (file)
@@ -23,6 +23,7 @@
 #include <IFSelect_SelectSignature.hxx>
 #include <IFSelect_SignAncestor.hxx>
 #include <IFSelect_SignCounter.hxx>
+#include <IFSelect_SelectModelEntities.hxx>
 #include <Interface_InterfaceModel.hxx>
 #include <Interface_Macros.hxx>
 #include <RWHeaderSection.hxx>
 #include <ShapeExtend.hxx>
 #include <Standard_Type.hxx>
 #include <Standard_Version.hxx>
+#include <StepAP214_Protocol.hxx>
 #include <STEPControl_ActorRead.hxx>
 #include <STEPControl_ActorWrite.hxx>
 #include <STEPControl_Controller.hxx>
 #include <StepData_FileProtocol.hxx>
 #include <StepData_StepModel.hxx>
-#include <STEPEdit.hxx>
 #include <STEPEdit_EditContext.hxx>
 #include <STEPEdit_EditSDR.hxx>
 #include <StepSelect_StepType.hxx>
@@ -60,7 +61,10 @@ IMPLEMENT_STANDARD_RTTIEXT(STEPControl_Controller,XSControl_Controller)
 STEPControl_Controller::STEPControl_Controller()
   : XSControl_Controller("STEP", "step")
 {
-  RWHeaderSection::Init();  RWStepAP214::Init();
+  RWHeaderSection::Init();
+
+  myAdaptorProtocol = new StepAP214_Protocol();
+  RWStepAP214::Init(Handle(StepAP214_Protocol)::DownCast(myAdaptorProtocol));
 
   Handle(STEPControl_ActorWrite) ActWrite = new STEPControl_ActorWrite;
   myAdaptorWrite = ActWrite;
@@ -68,9 +72,11 @@ STEPControl_Controller::STEPControl_Controller()
   Handle(StepSelect_WorkLibrary) swl = new StepSelect_WorkLibrary;
   swl->SetDumpLabel(1);
   myAdaptorLibrary  = swl;
-  myAdaptorProtocol = STEPEdit::Protocol();
   myAdaptorRead     = new STEPControl_ActorRead;  // par ex pour Recognize
 
+  myStepType = new StepSelect_StepType;
+  myStepType->SetProtocol(myAdaptorProtocol);
+
   SetModeWrite (0,4);
   SetModeWriteHelp (0,"As Is");
   SetModeWriteHelp (1,"Faceted Brep");
@@ -82,9 +88,8 @@ STEPControl_Controller::STEPControl_Controller()
 
   DeclareAndCast(IFSelect_Selection,xmr,SessionItem("xst-model-roots"));
   if (!xmr.IsNull()) {
-    Handle(IFSelect_Signature) sty = STEPEdit::SignType();
-    AddSessionItem (sty,"step-type");
-    Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(sty,Standard_False,Standard_True);
+    AddSessionItem (myStepType,"step-type");
+    Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(myStepType,Standard_False,Standard_True);
     AddSessionItem (tys,"step-types");
 
     //szv:mySignType = sty;
@@ -93,16 +98,32 @@ STEPControl_Controller::STEPControl_Controller()
     AddSessionItem (new IFSelect_SignAncestor(),"xst-derived");
 
     Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived();
-    stdvar->SetProtocol(STEPEdit::Protocol());
+    stdvar->SetProtocol(myAdaptorProtocol);
     AddSessionItem (stdvar,"step-derived");
     
-    Handle(IFSelect_SelectSignature) selsdr = STEPEdit::NewSelectSDR();
+    //Creates a Selection for ShapeDefinitionRepresentation
+    Handle(IFSelect_SelectSignature) selsdr = new IFSelect_SelectSignature
+    (myStepType, "SHAPE_DEFINITION_REPRESENTATION");
     selsdr->SetInput (xmr);
     AddSessionItem (selsdr,"step-shape-def-repr");
 
-    AddSessionItem (STEPEdit::NewSelectPlacedItem(),"step-placed-items");
-    // input deja pret avec ModelAll
-    AddSessionItem (STEPEdit::NewSelectShapeRepr(),"step-shape-repr");
+    // Creates a Selection for Placed Items, i.e. MappedItem or
+    // ContextDependentShapeRepresentation, which itself refers to a
+    // RepresentationRelationship with possible subtypes (Shape...
+    // and/or ...WithTransformation)
+    Handle(IFSelect_SelectSignature) selrrs = new IFSelect_SelectSignature
+    (myStepType, "MAPPED_ITEM|CONTEXT_DEPENDENT_SHAPE_REPRESENTATION", Standard_False);
+    selrrs->SetInput(new IFSelect_SelectModelEntities);
+    AddSessionItem (selrrs,"step-placed-items");
+
+    // Creates a Selection for ShapeRepresentation and its sub - types,
+    // plus ContextDependentShapeRepresentation (which is not a
+    // sub-type of ShapeRepresentation)
+    Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature
+    (myStepType, "SHAPE_REPRESENTATION", Standard_False);
+    // REPRESENTATION_RELATIONSHIP passe par CONTEXT_DEPENDENT_SHAPE_REPRESENTATION
+    sel->SetInput(new IFSelect_SelectModelEntities);
+    AddSessionItem (sel,"step-shape-repr");
   }
   
   //pdn
@@ -143,7 +164,8 @@ STEPControl_Controller::STEPControl_Controller()
 
 Handle(Interface_InterfaceModel)  STEPControl_Controller::NewModel () const
 {
-  return STEPEdit::NewModel();
+  APIHeaderSection_MakeHeader head;
+  return head.NewModel(myAdaptorProtocol);
 }
 
 //  ####    PROVISOIRE ???   ####
@@ -210,29 +232,43 @@ void STEPControl_Controller::Customise(Handle(XSControl_WorkSession)& WS)
   WS->AddNamedItem ("xst-transferrable-roots",st1);
 
   if (!slr.IsNull()) {
-    Handle(IFSelect_Signature) sty = STEPEdit::SignType();
-    WS->AddNamedItem ("step-type",sty);
+    WS->AddNamedItem ("step-type", myStepType);
     
-    Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(sty,Standard_False,Standard_True);
+    Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(myStepType,Standard_False,Standard_True);
     WS->AddNamedItem ("step-types",tys);
 
        //szv:mySignType = sty;
-    WS->SetSignType( sty );
+    WS->SetSignType(myStepType);
     
     //pdn S4133 18.02.99
     WS->AddNamedItem ("xst-derived",new IFSelect_SignAncestor());
     Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived();
-    stdvar->SetProtocol(STEPEdit::Protocol());
+    stdvar->SetProtocol(myAdaptorProtocol);
     WS->AddNamedItem ("step-derived",stdvar);
-    
-    Handle(IFSelect_SelectSignature) selsdr = STEPEdit::NewSelectSDR();
-    selsdr->SetInput (slr);
-    WS->AddNamedItem ("step-shape-def-repr",selsdr);
-    Handle(IFSelect_SelectSignature) selrrs = STEPEdit::NewSelectPlacedItem();
+
+    //Creates a Selection for ShapeDefinitionRepresentation
+    Handle(IFSelect_SelectSignature) selsdr = new IFSelect_SelectSignature
+    (myStepType, "SHAPE_DEFINITION_REPRESENTATION");
+    selsdr->SetInput(slr);
+    WS->AddNamedItem("step-shape-def-repr", selsdr);
+
+    // Creates a Selection for Placed Items, i.e. MappedItem or
+    // ContextDependentShapeRepresentation, which itself refers to a
+    // RepresentationRelationship with possible subtypes (Shape...
+    // and/or ...WithTransformation)
+    Handle(IFSelect_SelectSignature) selrrs = new IFSelect_SelectSignature
+    (myStepType, "MAPPED_ITEM|CONTEXT_DEPENDENT_SHAPE_REPRESENTATION", Standard_False);
+    selrrs->SetInput(new IFSelect_SelectModelEntities);
     WS->AddNamedItem ("step-placed-items",selrrs);
-    Handle(IFSelect_SelectSignature) selsr = STEPEdit::NewSelectShapeRepr();
-    // input deja pret avec ModelAll
-    WS->AddNamedItem ("step-shape-repr",selsr);
+
+    // Creates a Selection for ShapeRepresentation and its sub - types,
+    // plus ContextDependentShapeRepresentation (which is not a
+    // sub-type of ShapeRepresentation)
+    Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature
+    (myStepType, "SHAPE_REPRESENTATION", Standard_False);
+    // REPRESENTATION_RELATIONSHIP passe par CONTEXT_DEPENDENT_SHAPE_REPRESENTATION
+    sel->SetInput(new IFSelect_SelectModelEntities);
+    WS->AddNamedItem ("step-shape-repr", sel);
   }
   
   //pdn
index db27a4a5c677aa30d1e98f0737ec822b3bf69fed..071b934250e6ba9e87fe5359d020cf3bfb364094 100644 (file)
@@ -24,6 +24,7 @@
 #include <IFSelect_ReturnStatus.hxx>
 #include <Standard_Integer.hxx>
 #include <Standard_Boolean.hxx>
+#include <StepSelect_StepType.hxx>
 class Interface_InterfaceModel;
 class Transfer_ActorOfTransientProcess;
 class XSControl_WorkSession;
@@ -71,7 +72,7 @@ protected:
 
 
 private:
-
+  Handle(StepSelect_StepType) myStepType;
 
 };
 
diff --git a/src/STEPEdit/STEPEdit.cxx b/src/STEPEdit/STEPEdit.cxx
deleted file mode 100644 (file)
index 42e1295..0000000
+++ /dev/null
@@ -1,78 +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 <APIHeaderSection_MakeHeader.hxx>
-#include <IFSelect_SelectModelEntities.hxx>
-#include <IFSelect_SelectModelRoots.hxx>
-#include <IFSelect_SelectSignature.hxx>
-#include <IFSelect_Signature.hxx>
-#include <Interface_Protocol.hxx>
-#include <StepAP214.hxx>
-#include <StepAP214_Protocol.hxx>
-#include <StepData_StepModel.hxx>
-#include <STEPEdit.hxx>
-#include <StepSelect_StepType.hxx>
-
-Handle(Interface_Protocol)  STEPEdit::Protocol ()
-{
-/*
-  static Handle(StepData_FileProtocol) proto;
-  if (!proto.IsNull()) return proto;
-  proto =  new StepData_FileProtocol;
-  proto->Add (StepAP214::Protocol());
-  proto->Add (HeaderSection::Protocol());
-  return proto;
-*/
-  return StepAP214::Protocol();
-}
-
-Handle(StepData_StepModel)  STEPEdit::NewModel ()
-{
-  APIHeaderSection_MakeHeader head;
-  return head.NewModel(STEPEdit::Protocol());
-}
-
-Handle(IFSelect_Signature)  STEPEdit::SignType ()
-{
-  static Handle(StepSelect_StepType) sty;
-  if (!sty.IsNull()) return sty;
-  sty = new StepSelect_StepType;
-  sty->SetProtocol (STEPEdit::Protocol());
-  return sty;
-}
-
-Handle(IFSelect_SelectSignature)  STEPEdit::NewSelectSDR ()
-{
-  Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature
-    (STEPEdit::SignType(),"SHAPE_DEFINITION_REPRESENTATION");
-  sel->SetInput (new IFSelect_SelectModelRoots);
-  return sel;
-}
-
-Handle(IFSelect_SelectSignature)  STEPEdit::NewSelectPlacedItem ()
-{
-  Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature
-    (STEPEdit::SignType(),"MAPPED_ITEM|CONTEXT_DEPENDENT_SHAPE_REPRESENTATION",Standard_False);
-  sel->SetInput (new IFSelect_SelectModelEntities);
-  return sel;
-}
-
-Handle(IFSelect_SelectSignature)  STEPEdit::NewSelectShapeRepr ()
-{
-  Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature
-    (STEPEdit::SignType(),"SHAPE_REPRESENTATION",Standard_False);
-// REPRESENTATION_RELATIONSHIP passe par CONTEXT_DEPENDENT_SHAPE_REPRESENTATION
-  sel->SetInput (new IFSelect_SelectModelEntities);
-  return sel;
-}
diff --git a/src/STEPEdit/STEPEdit.hxx b/src/STEPEdit/STEPEdit.hxx
deleted file mode 100644 (file)
index 5e323a6..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-// Created on: 1998-07-29
-// Created by: Christian CAILLET
-// Copyright (c) 1998-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 _STEPEdit_HeaderFile
-#define _STEPEdit_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
-class Interface_Protocol;
-class StepData_StepModel;
-class IFSelect_Signature;
-class IFSelect_SelectSignature;
-class STEPEdit_EditContext;
-class STEPEdit_EditSDR;
-
-
-//! Provides tools to exploit and edit a set of STEP data :
-//! editors, selections ..
-class STEPEdit 
-{
-public:
-
-  DEFINE_STANDARD_ALLOC
-
-  
-  //! Returns a Protocol fit for STEP (creates the first time)
-  Standard_EXPORT static Handle(Interface_Protocol) Protocol();
-  
-  //! Returns a new empty StepModel fit for STEP
-  //! i.e. with its header determined from Protocol
-  Standard_EXPORT static Handle(StepData_StepModel) NewModel();
-  
-  //! Returns a SignType fit for STEP (creates the first time)
-  Standard_EXPORT static Handle(IFSelect_Signature) SignType();
-  
-  //! Creates a Selection for ShapeDefinitionRepresentation
-  //! By default searches among root entities
-  Standard_EXPORT static Handle(IFSelect_SelectSignature) NewSelectSDR();
-  
-  //! Creates a Selection for Placed Items, i.e. MappedItem or
-  //! ContextDependentShapeRepresentation, which itself refers to a
-  //! RepresentationRelationship with possible subtypes (Shape...
-  //! and/or ...WithTransformation)
-  //! By default in the whole StepModel
-  Standard_EXPORT static Handle(IFSelect_SelectSignature) NewSelectPlacedItem();
-  
-  //! Creates a Selection for ShapeRepresentation and its sub-types,
-  //! plus ContextDependentShapeRepresentation (which is not a
-  //! sub-type of ShapeRepresentation)
-  //! By default in the whole StepModel
-  Standard_EXPORT static Handle(IFSelect_SelectSignature) NewSelectShapeRepr();
-
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
-
-friend class STEPEdit_EditContext;
-friend class STEPEdit_EditSDR;
-
-};
-
-
-
-
-
-
-
-#endif // _STEPEdit_HeaderFile
diff --git a/src/StepAP214/StepAP214.cxx b/src/StepAP214/StepAP214.cxx
deleted file mode 100644 (file)
index 77702ea..0000000
+++ /dev/null
@@ -1,27 +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_Statics.hxx>
-#include <StepAP214.hxx>
-#include <StepAP214_Protocol.hxx>
-
-StaticHandle(StepAP214_Protocol, proto);
-
-Handle(StepAP214_Protocol) StepAP214::Protocol()
-
-       {
-               InitHandleVoid(StepAP214_Protocol, proto);
-               return proto;
-       }
-
diff --git a/src/StepAP214/StepAP214.hxx b/src/StepAP214/StepAP214.hxx
deleted file mode 100644 (file)
index c603454..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-// Created on: 1995-12-01
-// Created by: EXPRESS->CDL V0.2 Translator
-// 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 _StepAP214_HeaderFile
-#define _StepAP214_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
-class StepAP214_Protocol;
-class StepAP214_AutoDesignDateAndPersonItem;
-class StepAP214_AutoDesignDateAndTimeItem;
-class StepAP214_AutoDesignDatedItem;
-class StepAP214_AutoDesignGeneralOrgItem;
-class StepAP214_AutoDesignOrganizationItem;
-class StepAP214_AutoDesignGroupedItem;
-class StepAP214_AutoDesignPresentedItemSelect;
-class StepAP214_AutoDesignReferencingItem;
-class StepAP214_DateAndTimeItem;
-class StepAP214_DateItem;
-class StepAP214_ApprovalItem;
-class StepAP214_OrganizationItem;
-class StepAP214_DocumentReferenceItem;
-class StepAP214_GroupItem;
-class StepAP214_PersonAndOrganizationItem;
-class StepAP214_PresentedItemSelect;
-class StepAP214_SecurityClassificationItem;
-class StepAP214_Protocol;
-class StepAP214_AutoDesignApprovalAssignment;
-class StepAP214_AutoDesignActualDateAndTimeAssignment;
-class StepAP214_AutoDesignNominalDateAndTimeAssignment;
-class StepAP214_AutoDesignActualDateAssignment;
-class StepAP214_AutoDesignNominalDateAssignment;
-class StepAP214_AutoDesignGroupAssignment;
-class StepAP214_AutoDesignOrganizationAssignment;
-class StepAP214_AutoDesignDateAndPersonAssignment;
-class StepAP214_AutoDesignPersonAndOrganizationAssignment;
-class StepAP214_AutoDesignPresentedItem;
-class StepAP214_AutoDesignSecurityClassificationAssignment;
-class StepAP214_AutoDesignDocumentReference;
-class StepAP214_AppliedApprovalAssignment;
-class StepAP214_AppliedDateAndTimeAssignment;
-class StepAP214_AppliedDateAssignment;
-class StepAP214_AppliedGroupAssignment;
-class StepAP214_AppliedOrganizationAssignment;
-class StepAP214_AppliedPersonAndOrganizationAssignment;
-class StepAP214_AppliedPresentedItem;
-class StepAP214_AppliedSecurityClassificationAssignment;
-class StepAP214_AppliedDocumentReference;
-class StepAP214_AppliedExternalIdentificationAssignment;
-class StepAP214_Class;
-class StepAP214_ExternalIdentificationItem;
-class StepAP214_ExternallyDefinedClass;
-class StepAP214_ExternallyDefinedGeneralProperty;
-class StepAP214_RepItemGroup;
-
-
-//! Complete AP214 CC1 , Revision 4
-//! Upgrading from Revision 2 to Revision 4 : 26 Mar 1997
-//! Splitting in sub-schemas : 5 Nov 1997
-class StepAP214 
-{
-public:
-
-  DEFINE_STANDARD_ALLOC
-
-  
-  //! creates a Protocol
-  Standard_EXPORT static Handle(StepAP214_Protocol) Protocol();
-
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
-
-friend class StepAP214_AutoDesignDateAndPersonItem;
-friend class StepAP214_AutoDesignDateAndTimeItem;
-friend class StepAP214_AutoDesignDatedItem;
-friend class StepAP214_AutoDesignGeneralOrgItem;
-friend class StepAP214_AutoDesignOrganizationItem;
-friend class StepAP214_AutoDesignGroupedItem;
-friend class StepAP214_AutoDesignPresentedItemSelect;
-friend class StepAP214_AutoDesignReferencingItem;
-friend class StepAP214_DateAndTimeItem;
-friend class StepAP214_DateItem;
-friend class StepAP214_ApprovalItem;
-friend class StepAP214_OrganizationItem;
-friend class StepAP214_DocumentReferenceItem;
-friend class StepAP214_GroupItem;
-friend class StepAP214_PersonAndOrganizationItem;
-friend class StepAP214_PresentedItemSelect;
-friend class StepAP214_SecurityClassificationItem;
-friend class StepAP214_Protocol;
-friend class StepAP214_AutoDesignApprovalAssignment;
-friend class StepAP214_AutoDesignActualDateAndTimeAssignment;
-friend class StepAP214_AutoDesignNominalDateAndTimeAssignment;
-friend class StepAP214_AutoDesignActualDateAssignment;
-friend class StepAP214_AutoDesignNominalDateAssignment;
-friend class StepAP214_AutoDesignGroupAssignment;
-friend class StepAP214_AutoDesignOrganizationAssignment;
-friend class StepAP214_AutoDesignDateAndPersonAssignment;
-friend class StepAP214_AutoDesignPersonAndOrganizationAssignment;
-friend class StepAP214_AutoDesignPresentedItem;
-friend class StepAP214_AutoDesignSecurityClassificationAssignment;
-friend class StepAP214_AutoDesignDocumentReference;
-friend class StepAP214_AppliedApprovalAssignment;
-friend class StepAP214_AppliedDateAndTimeAssignment;
-friend class StepAP214_AppliedDateAssignment;
-friend class StepAP214_AppliedGroupAssignment;
-friend class StepAP214_AppliedOrganizationAssignment;
-friend class StepAP214_AppliedPersonAndOrganizationAssignment;
-friend class StepAP214_AppliedPresentedItem;
-friend class StepAP214_AppliedSecurityClassificationAssignment;
-friend class StepAP214_AppliedDocumentReference;
-friend class StepAP214_AppliedExternalIdentificationAssignment;
-friend class StepAP214_Class;
-friend class StepAP214_ExternalIdentificationItem;
-friend class StepAP214_ExternallyDefinedClass;
-friend class StepAP214_ExternallyDefinedGeneralProperty;
-friend class StepAP214_RepItemGroup;
-
-};
-
-
-
-
-
-
-
-#endif // _StepAP214_HeaderFile
index 0653fcbff0b089721eb1cf7a978a0aa0ee5b78bd..a92f41fc8f819d7408ff04797d3fc10960d0f06b 100644 (file)
@@ -749,8 +749,6 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
 #include <StepVisual_CameraModelD3MultiClippingUnion.hxx>
 #include <StepVisual_AnnotationCurveOccurrenceAndAnnotationOccurrenceAndGeomReprItemAndReprItemAndStyledItem.hxx>
 
-static int THE_StepAP214_Protocol_init = 0;
-static Interface_DataMapOfTransientInteger types(800);
 
 //=======================================================================
 //function : StepAP214_Protocol
@@ -758,14 +756,9 @@ static Interface_DataMapOfTransientInteger types(800);
 //=======================================================================
 
 StepAP214_Protocol::StepAP214_Protocol () :
-  myShemaName(schemaAP214IS)
+  myShemaName(schemaAP214IS),
+  types(800)
 {
-  if (THE_StepAP214_Protocol_init)
-  {
-    return;
-  }
-  THE_StepAP214_Protocol_init = 1;
-
   types.Bind (STANDARD_TYPE(StepBasic_Address), 1);
   types.Bind (STANDARD_TYPE(StepShape_AdvancedBrepShapeRepresentation), 2);
   types.Bind (STANDARD_TYPE(StepShape_AdvancedFace), 3);
index cb0f01f5eca0c8ecfb978208bf3bfcf173ce1f04..3d491f1356b850d086d9f6785c99d6b8cfde10f8 100644 (file)
@@ -64,6 +64,7 @@ protected:
 private:
 
   Standard_CString myShemaName;
+  Interface_DataMapOfTransientInteger types;
 
 };
 
index 9ce43273dcba5ec764685bf87a88334e412f7b73..1ef93d5ad03e82faae9a15c4bb3d09200cb567e9 100644 (file)
@@ -47,6 +47,7 @@ extern "C" void recfile_modeprint (int mode);  // controle trace recfile
 
 #include <Message_Messenger.hxx>
 #include <Message.hxx>
+#include <Standard_Mutex.hxx>
 
 #ifdef OCCT_DEBUG
 #define CHRONOMESURE
@@ -117,115 +118,120 @@ Standard_Integer StepFile_Read
   const Handle(StepData_FileRecognizer)& recodata)
 
 {
-  Handle(Message_Messenger) sout = Message::DefaultMessenger();
-  char *ficnom = nomfic ;  // because const (non reconnu par C)
-
-  checkread->Clear();
-  recfile_modeprint ( (modepr > 0 ? modepr-1 : 0) );
-  FILE* newin = stepread_setinput(ficnom);
-  if (!newin) return -1;
+  static Standard_Mutex aPars;
+  {
+    Standard_Mutex::Sentry aLock(aPars);
+      
+    Handle(Message_Messenger) sout = Message::DefaultMessenger();
+    char *ficnom = nomfic;  // because const (non reconnu par C)
+
+    checkread->Clear();
+    recfile_modeprint(( modepr > 0 ? modepr - 1 : 0 ));
+    FILE* newin = stepread_setinput(ficnom);
+    if (!newin) return -1;
 #ifdef CHRONOMESURE
-  Standard_Integer n ; 
-  OSD_Timer c ; 
-  c.Reset () ; 
-  c.Start();
-  sout << "      ...    Step File Reading : " << ficnom << "" << endl;  
+    Standard_Integer n;
+    OSD_Timer c;
+    c.Reset();
+    c.Start();
+    sout << "      ...    Step File Reading : " << ficnom << "" << endl;
 #endif
 
-  try {
-    OCC_CATCH_SIGNALS
-    if (stepread () != 0) {  lir_file_fin(3);  stepread_endinput (newin,ficnom);  return 1;  }
-  }
-  catch (Standard_Failure const& anException) {
+    try {
+      OCC_CATCH_SIGNALS
+        if (stepread() != 0) { lir_file_fin(3);  stepread_endinput(newin, ficnom);  return 1; }
+    }
+    catch (Standard_Failure const& anException) {
 #ifdef OCCT_DEBUG
-    sout << " ...  Exception Raised while reading Step File : " << ficnom << ":\n" << endl;
-    sout << anException.GetMessageString();  
-    sout << "    ..." << endl;
+      sout << " ...  Exception Raised while reading Step File : " << ficnom << ":\n" << endl;
+      sout << anException.GetMessageString();
+      sout << "    ..." << endl;
 #endif
-    (void)anException;
-    lir_file_fin(3);  
-    stepread_endinput (newin,ficnom);  
-    return 1;
-  }
-  // Continue reading of file despite of possible fails
-  //if (checkread->HasFailed()) {  lir_file_fin(3);  stepread_endinput (newin,ficnom);  return 1;  }
+      (void)anException;
+      lir_file_fin(3);
+      stepread_endinput(newin, ficnom);
+      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(); 
+    sout << "      ...    STEP File   Read    ... " << endl;
+    c.Show();
 #endif
 
 
-//  Creation du StepReaderData
-
-  LesTypes[rec_argNondef]    = Interface_ParamVoid ;
-  LesTypes[rec_argSub]       = Interface_ParamSub ;
-  LesTypes[rec_argIdent]     = Interface_ParamIdent ;
-  LesTypes[rec_argInteger]   = Interface_ParamInteger ;
-  LesTypes[rec_argFloat]     = Interface_ParamReal ;
-  LesTypes[rec_argEnum]      = Interface_ParamEnum ;
-  LesTypes[rec_argBinary]    = Interface_ParamBinary ;
-  LesTypes[rec_argText]      = Interface_ParamText ;
-  LesTypes[rec_argHexa]      = Interface_ParamHexa ;
-  LesTypes[rec_argMisc]      = Interface_ParamMisc ;
-
-  Standard_Integer nbhead, nbrec, nbpar;
-  lir_file_nbr (&nbhead,&nbrec,&nbpar);  // renvoi par lex/yacc
-  Handle(StepData_StepReaderData) undirec =
-    new StepData_StepReaderData(nbhead,nbrec,nbpar);  // creation tableau de records
-
-  for ( Standard_Integer nr = 1; nr <= nbrec; nr ++) {
-    int nbarg; char* ident; char* typrec = 0;
-    lir_file_rec (&ident, &typrec, &nbarg);
-    undirec->SetRecord (nr, ident, typrec, nbarg);
-
-    if (nbarg>0) {
-      int typa; char* val;
-      Interface_ParamType newtype;
-      while(lir_file_arg (&typa, &val) == 1) {
-        newtype = LesTypes[typa] ;
-        undirec->AddStepParam (nr, val, newtype);
+    //  Creation du StepReaderData
+
+    LesTypes[rec_argNondef] = Interface_ParamVoid;
+    LesTypes[rec_argSub] = Interface_ParamSub;
+    LesTypes[rec_argIdent] = Interface_ParamIdent;
+    LesTypes[rec_argInteger] = Interface_ParamInteger;
+    LesTypes[rec_argFloat] = Interface_ParamReal;
+    LesTypes[rec_argEnum] = Interface_ParamEnum;
+    LesTypes[rec_argBinary] = Interface_ParamBinary;
+    LesTypes[rec_argText] = Interface_ParamText;
+    LesTypes[rec_argHexa] = Interface_ParamHexa;
+    LesTypes[rec_argMisc] = Interface_ParamMisc;
+
+    Standard_Integer nbhead, nbrec, nbpar;
+    lir_file_nbr(&nbhead, &nbrec, &nbpar);  // renvoi par lex/yacc
+    Handle(StepData_StepReaderData) undirec =
+      new StepData_StepReaderData(nbhead, nbrec, nbpar);  // creation tableau de records
+
+    for (Standard_Integer nr = 1; nr <= nbrec; nr++) {
+      int nbarg; char* ident; char* typrec = 0;
+      lir_file_rec(&ident, &typrec, &nbarg);
+      undirec->SetRecord(nr, ident, typrec, nbarg);
+
+      if (nbarg > 0) {
+        int typa; char* val;
+        Interface_ParamType newtype;
+        while (lir_file_arg(&typa, &val) == 1) {
+          newtype = LesTypes[typa];
+          undirec->AddStepParam(nr, val, newtype);
+        }
       }
+      undirec->InitParams(nr);
+      lir_file_finrec();
     }
-    undirec->InitParams(nr);
-    lir_file_finrec();
-  }
-  lir_file_fin(1);
-//  on a undirec pret pour la suite
+    lir_file_fin(1);
+    //  on a undirec pret pour la suite
 
 #ifdef CHRONOMESURE
-  sout << "      ... Step File loaded  ... " << endl; 
-  c.Show();
-  sout << "   "<< undirec->NbRecords () <<
-      " records (entities,sub-lists,scopes), "<< nbpar << " parameters\n" << endl;
+    sout << "      ... Step File loaded  ... " << endl;
+    c.Show();
+    sout << "   " << undirec->NbRecords() <<
+      " records (entities,sub-lists,scopes), " << nbpar << " parameters\n" << endl;
 #endif
 
-//   Analyse : par StepReaderTool
+    //   Analyse : par StepReaderTool
 
-  StepData_StepReaderTool readtool (undirec,protocol);
-  readtool.SetErrorHandle (Standard_True);
+    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(recoheader);  // Header. reco nul -> pour Protocol
+    readtool.Prepare(recodata);          // Data.   reco nul -> pour Protocol
 
 #ifdef CHRONOMESURE
-  sout << "      ... Parameters prepared ... "; 
-  c.Show(); 
+    sout << "      ... Parameters prepared ... ";
+    c.Show();
 #endif
 
-  readtool.LoadModel(stepmodel);
-  if (stepmodel->Protocol().IsNull()) stepmodel->SetProtocol (protocol);
-  lir_file_fin(2);
-  
-  readtool.Clear();
-  undirec.Nullify();
+    readtool.LoadModel(stepmodel);
+    if (stepmodel->Protocol().IsNull()) stepmodel->SetProtocol(protocol);
+    lir_file_fin(2);
+
+    readtool.Clear();
+    undirec.Nullify();
 #ifdef CHRONOMESURE
-  sout << "      ...   Objets analysed  ... " << endl; 
-  c.Show();
-  n = stepmodel->NbEntities() ;
-  sout << "  STEP Loading done : " << n << " Entities" << endl;
+    sout << "      ...   Objets analysed  ... " << endl;
+    c.Show();
+    n = stepmodel->NbEntities();
+    sout << "  STEP Loading done : " << n << " Entities" << endl;
 #endif
-  
-  stepread_endinput (newin,ficnom);  return 0 ;
+
+    stepread_endinput(newin, ficnom);  return 0;
+  }
 }
 
 void StepFile_Interrupt (char* mess)
index 89b6243d881a12c58e52791b4231a29926c68042..a38666fa8961e8e3b4bb5841de926c4fdcb526a0 100644 (file)
@@ -137,7 +137,7 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
       try {
         OCC_CATCH_SIGNALS
        Handle(ShapeExtend_MsgRegistrator) msg = new ShapeExtend_MsgRegistrator;
-       Handle(ShapeFix_Shape) sfs = ShapeAlgo::AlgoContainer()->ToolContainer()->FixShape();
+        Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;// ShapeAlgo::AlgoContainer()->ToolContainer()->FixShape();
        sfs->Init ( shape );
        sfs->SetMsgRegistrator ( msg );
        sfs->SetPrecision ( Prec );