]> OCCT Git - occt.git/commitdiff
0033589: Data Exchange, Step Export - Using thread-safety interface ignore model...
authordpasukhi <dpasukhi@opencascade.com>
Mon, 29 Jan 2024 11:02:23 +0000 (11:02 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Fri, 16 Feb 2024 11:38:23 +0000 (11:38 +0000)
Fixed issue with MakeHeader.
Fix isn't for review or integration. Only for the internal usage.
Need to adapt into work env.

src/APIHeaderSection/APIHeaderSection_MakeHeader.cxx
src/StepAP214/StepAP214_Protocol.cxx
src/StepAP214/StepAP214_Protocol.hxx
src/StepData/StepData_Protocol.cxx
src/StepData/StepData_Protocol.hxx

index 9f90004ff9488a51b23b85d9d243ac8587dde906..1421261c5d907d032a3469e1ef0456ec76087103 100644 (file)
@@ -162,7 +162,7 @@ void APIHeaderSection_MakeHeader::Apply
       Handle(StepData_Protocol) stepro = Handle(StepData_Protocol)::DownCast
        ( model->Protocol());
       if (!stepro.IsNull()) sch = new TCollection_HAsciiString
-       (stepro->SchemaName());
+       (stepro->SchemaName(model));
       if (!sch.IsNull()) schid->SetValue (1,sch);
     }
     header.AddItem(fs);
index 16643aa1784d219b13b18b10dc5fda70eafd417f..8f3ad571d61d59cb101a7339a530aada15872a42 100644 (file)
@@ -27,6 +27,7 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
 
 #include <HeaderSection_Protocol.hxx>
 
+#include <StepData_StepModel.hxx>
 #include <StepShape_AdvancedBrepShapeRepresentation.hxx>
 #include <StepShape_AdvancedFace.hxx>
 // Removed from CC1-Rev2 to Rev4 : <StepVisual_AnnotationCurveOccurrence.hxx>
@@ -1577,6 +1578,39 @@ Handle(Standard_Type)& atype) const
 }
 
 
+//=======================================================================
+//function : SchemaName
+//purpose  :
+//=======================================================================
+Standard_CString StepAP214_Protocol::SchemaName(const Handle(Interface_InterfaceModel)& theModel) const
+{      
+  Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(theModel);
+  StepData_ConfParameters aParam;
+  if (!aModel.IsNull())
+  {
+    aParam = aModel->InternalParameters;
+  }
+  switch (aModel->InternalParameters.WriteSchema)
+  {
+    case StepData_ConfParameters::WriteMode_StepSchema_AP214CD:
+      return schemaAP214CD;
+      break;
+    case StepData_ConfParameters::WriteMode_StepSchema_AP214DIS:
+      return schemaAP214DIS;
+      break;
+    case StepData_ConfParameters::WriteMode_StepSchema_AP203:
+      return schemaAP203;
+      break;
+    case StepData_ConfParameters::WriteMode_StepSchema_AP214IS:
+      return schemaAP214IS;
+      break;
+    case StepData_ConfParameters::WriteMode_StepSchema_AP242DIS:
+      return schemaAP242DIS;
+      break;
+  }
+  return "";
+}
+
 //=======================================================================
 //function : SchemaName
 //purpose  : 
index 988c55c8b50b17368fe946a927ba9ffcc4e14eb5..1a6971d6f75b8c4d6200e63eeda68769abb181e8 100644 (file)
@@ -42,6 +42,8 @@ public:
   //! Returns a Case Number for each of the StepAP214 Entities
   Standard_EXPORT virtual Standard_Integer TypeNumber (const Handle(Standard_Type)& atype) const Standard_OVERRIDE;
   
+  Standard_EXPORT virtual Standard_CString SchemaName(const Handle(Interface_InterfaceModel)& theModel) const Standard_OVERRIDE;
+
   Standard_EXPORT virtual Standard_CString SchemaName() const Standard_OVERRIDE;
   
   //! Returns count of Protocol used as Resources (level one)
index 330299ccd7d735b892616e8d6ff3f954bfe35df1..3a5bd7859b18de6c869f34b390d969036bddd28e 100644 (file)
@@ -67,9 +67,14 @@ Standard_Integer  StepData_Protocol::TypeNumber
   return 0;
 }
 
+Standard_CString StepData_Protocol::SchemaName() const
+{
+  return thename;
+}
 
-Standard_CString StepData_Protocol::SchemaName () const
+Standard_CString StepData_Protocol::SchemaName (const Handle(Interface_InterfaceModel)& theModel) const
 {
+  (void)theModel;
   return thename;
 }
 
index 65f975efefb3e59bd46f1cba0662c28ec1ae75d8..c20a791dd6d15fa1eb072f8eef41cc26cb3a2f6a 100644 (file)
@@ -67,6 +67,14 @@ public:
   //! To be redefined by each sub-class
   //! Here, SchemaName returns "(DEFAULT)"
   //! was C++ : return const
+  Standard_EXPORT virtual Standard_CString SchemaName(const Handle(Interface_InterfaceModel)& theModel) const;
+
+  //! Returns the Schema Name attached to each class of Protocol
+  //! To be redefined by each sub-class
+  //! Here, SchemaName returns "(DEFAULT)"
+  //! was C++ : return const
+  Standard_DEPRECATED("USED old static interface to extract active schema.\n"\
+    "Recommended to use method with input model to extract from current session")
   Standard_EXPORT virtual Standard_CString SchemaName() const;
   
   //! Creates an empty Model for Step Norm