]> OCCT Git - occt.git/commitdiff
0033811: CAD Import - Update DE Readers with ShapeHealing logic CR33811
authorichesnok <ichesnok@opencascade.com>
Thu, 29 Aug 2024 16:25:42 +0000 (17:25 +0100)
committerichesnok <ichesnok@opencascade.com>
Thu, 19 Sep 2024 12:10:59 +0000 (13:10 +0100)
27 files changed:
src/DE/DE_ShapeFixConfigurationNode.cxx
src/DE/DE_ShapeFixConfigurationNode.hxx
src/DE/DE_ShapeFixParameters.cxx [new file with mode: 0644]
src/DE/DE_ShapeFixParameters.hxx
src/DE/FILES
src/IGESCAFControl/IGESCAFControl_ConfigurationNode.cxx
src/IGESCAFControl/IGESCAFControl_ConfigurationNode.hxx
src/IGESCAFControl/IGESCAFControl_Provider.cxx
src/IGESToBRep/IGESToBRep_Actor.cxx
src/IGESToBRep/IGESToBRep_Actor.hxx
src/IGESToBRep/IGESToBRep_Reader.cxx
src/STEPCAFControl/STEPCAFControl_ConfigurationNode.cxx
src/STEPCAFControl/STEPCAFControl_ConfigurationNode.hxx
src/STEPCAFControl/STEPCAFControl_Provider.cxx
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/STEPCAFControl/STEPCAFControl_Reader.hxx
src/STEPControl/STEPControl_ActorRead.cxx
src/STEPControl/STEPControl_ActorRead.hxx
src/STEPControl/STEPControl_ActorWrite.cxx
src/STEPControl/STEPControl_Reader.cxx
src/XSAlgo/XSAlgo_AlgoContainer.cxx
src/XSAlgo/XSAlgo_AlgoContainer.hxx
src/XSAlgo/XSAlgo_AlgoProcessShape.cxx
src/XSAlgo/XSAlgo_AlgoProcessShape.hxx
src/XSControl/XSControl_Reader.hxx
src/XSDRAWIGES/XSDRAWIGES.cxx
src/XSDRAWSTEP/XSDRAWSTEP.cxx

index 8d9bf2a1a707b44ab50dc0714230702d8a6332cc..837a54002c3253473c5047d4a46f225383338113 100644 (file)
@@ -490,3 +490,11 @@ TCollection_AsciiString DE_ShapeFixConfigurationNode::Save() const
 
   return aResult;
 }
+
+//=======================================================================
+// function : ChangeHealingParams
+// purpose  :
+//=======================================================================
+void DE_ShapeFixConfigurationNode::ChangeHealingParams()
+{
+}
index 7596a4c8595aba359fb70f0c365737a070aec792..129d2ba3bd1b9a05344fd12f89ae799de80c7d2e 100644 (file)
@@ -42,6 +42,9 @@ public:
   //! @return result resource string
   Standard_EXPORT virtual TCollection_AsciiString Save() const Standard_OVERRIDE;
 
+  //! Redefined some healing parameters, depending on format
+  Standard_EXPORT virtual void ChangeHealingParams();
+
 public:
 
   DE_ShapeFixParameters HealingParameters; //!< Shape healing parameters
diff --git a/src/DE/DE_ShapeFixParameters.cxx b/src/DE/DE_ShapeFixParameters.cxx
new file mode 100644 (file)
index 0000000..13f1e0e
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright (c) 2024 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 <DE_ShapeFixParameters.hxx>
+#include <NCollection_DataMap.hxx>
+#include <NCollection_Shared.hxx>
+#include <TCollection_AsciiString.hxx>
+
+//! Fill healing parameters map
+void DE_ShapeFixParameters::FillParamsMap(DE_ShapeFixParameters::HealingParamMap& theMap)
+{
+  theMap.Bind("Tolerance3d", TCollection_AsciiString(Tolerance3d));
+  theMap.Bind("MinTolerance3d", TCollection_AsciiString(MinTolerance3d));
+  theMap.Bind("MaxTolerance3d", TCollection_AsciiString(MaxTolerance3d));
+  theMap.Bind("FixFreeShellMode", TCollection_AsciiString(static_cast<int>(FixFreeShellMode)));
+  theMap.Bind("FixFreeFaceMode", TCollection_AsciiString(static_cast<int>(FixFreeFaceMode)));
+  theMap.Bind("FixFreeFaceMode", TCollection_AsciiString(static_cast<int>(FixFreeFaceMode)));
+  theMap.Bind("FixFreeWireMode", TCollection_AsciiString(static_cast<int>(FixFreeWireMode)));
+  theMap.Bind("FixSameParameterMode", TCollection_AsciiString(static_cast<int>(FixSameParameterMode)));
+  theMap.Bind("FixSolidMode", TCollection_AsciiString(static_cast<int>(FixSolidMode)));
+  theMap.Bind("FixShellOrientationMode", TCollection_AsciiString(static_cast<int>(FixShellOrientationMode)));
+  theMap.Bind("CreateOpenSolidMode", TCollection_AsciiString(static_cast<int>(CreateOpenSolidMode)));
+  theMap.Bind("FixShellMode", TCollection_AsciiString(static_cast<int>(FixShellMode)));
+  theMap.Bind("FixFaceOrientationMode", TCollection_AsciiString(static_cast<int>(FixFaceOrientationMode)));
+  theMap.Bind("FixFaceMode", TCollection_AsciiString(static_cast<int>(FixFaceMode)));
+  theMap.Bind("FixWireMode", TCollection_AsciiString(static_cast<int>(FixWireMode)));
+  theMap.Bind("FixOrientationMode", TCollection_AsciiString(static_cast<int>(FixOrientationMode)));
+  theMap.Bind("FixAddNaturalBoundMode", TCollection_AsciiString(static_cast<int>(FixAddNaturalBoundMode)));
+  theMap.Bind("FixMissingSeamMode", TCollection_AsciiString(static_cast<int>(FixMissingSeamMode)));
+  theMap.Bind("FixSmallAreaWireMode", TCollection_AsciiString(static_cast<int>(FixSmallAreaWireMode)));
+  theMap.Bind("RemoveSmallAreaFaceMode", TCollection_AsciiString(static_cast<int>(RemoveSmallAreaFaceMode)));
+  theMap.Bind("FixIntersectingWiresMode", TCollection_AsciiString(static_cast<int>(FixIntersectingWiresMode)));
+  theMap.Bind("FixLoopWiresMode", TCollection_AsciiString(static_cast<int>(FixLoopWiresMode)));
+  theMap.Bind("FixSplitFaceMode", TCollection_AsciiString(static_cast<int>(FixSplitFaceMode)));
+  theMap.Bind("AutoCorrectPrecisionMode", TCollection_AsciiString(static_cast<int>(AutoCorrectPrecisionMode)));
+  theMap.Bind("ModifyTopologyMode", TCollection_AsciiString(static_cast<int>(ModifyTopologyMode)));
+  theMap.Bind("ClosedWireMode", TCollection_AsciiString(static_cast<int>(ClosedWireMode)));
+  theMap.Bind("PreferencePCurveMode", TCollection_AsciiString(static_cast<int>(PreferencePCurveMode)));
+  theMap.Bind("FixReorderMode", TCollection_AsciiString(static_cast<int>(FixReorderMode)));
+  theMap.Bind("FixSmallMode", TCollection_AsciiString(static_cast<int>(FixSmallMode)));
+  theMap.Bind("FixConnectedMode", TCollection_AsciiString(static_cast<int>(FixConnectedMode)));
+  theMap.Bind("FixEdgeCurvesMode", TCollection_AsciiString(static_cast<int>(FixEdgeCurvesMode)));
+  theMap.Bind("FixDegeneratedMode", TCollection_AsciiString(static_cast<int>(FixDegeneratedMode)));
+  theMap.Bind("FixLackingMode", TCollection_AsciiString(static_cast<int>(FixLackingMode)));
+  theMap.Bind("FixSelfIntersectionMode", TCollection_AsciiString(static_cast<int>(FixSelfIntersectionMode)));
+  theMap.Bind("RemoveLoopMode", TCollection_AsciiString(static_cast<int>(RemoveLoopMode)));
+  theMap.Bind("FixReversed2dMode", TCollection_AsciiString(static_cast<int>(FixReversed2dMode)));
+  theMap.Bind("FixRemovePCurveMode", TCollection_AsciiString(static_cast<int>(FixRemovePCurveMode)));
+  theMap.Bind("FixRemoveCurve3dMode", TCollection_AsciiString(static_cast<int>(FixRemoveCurve3dMode)));
+  theMap.Bind("FixAddPCurveMode", TCollection_AsciiString(static_cast<int>(FixAddPCurveMode)));
+  theMap.Bind("FixAddCurve3dMode", TCollection_AsciiString(static_cast<int>(FixAddCurve3dMode)));
+  theMap.Bind("FixSeamMode", TCollection_AsciiString(static_cast<int>(FixSeamMode)));
+  theMap.Bind("FixShiftedMode", TCollection_AsciiString(static_cast<int>(FixShiftedMode)));
+  theMap.Bind("FixEdgeSameParameterMode", TCollection_AsciiString(static_cast<int>(FixEdgeSameParameterMode)));
+  theMap.Bind("FixNotchedEdgesMode", TCollection_AsciiString(static_cast<int>(FixNotchedEdgesMode)));
+  theMap.Bind("FixTailMode", TCollection_AsciiString(static_cast<int>(FixTailMode)));
+  theMap.Bind("MaxTailAngle", TCollection_AsciiString(static_cast<int>(MaxTailAngle)));
+  theMap.Bind("MaxTailWidth", TCollection_AsciiString(static_cast<int>(MaxTailWidth)));
+  theMap.Bind("FixSelfIntersectingEdgeMode", TCollection_AsciiString(static_cast<int>(FixSelfIntersectingEdgeMode)));
+  theMap.Bind("FixIntersectingEdgesMode", TCollection_AsciiString(static_cast<int>(FixIntersectingEdgesMode)));
+  theMap.Bind("FixNonAdjacentIntersectingEdgesMode", TCollection_AsciiString(static_cast<int>(FixNonAdjacentIntersectingEdgesMode)));
+  theMap.Bind("FixVertexPositionMode", TCollection_AsciiString(static_cast<int>(FixVertexPositionMode)));
+  theMap.Bind("FixVertexToleranceMode", TCollection_AsciiString(static_cast<int>(FixVertexToleranceMode)));
+}
index 5d61a8a867bc197f853deb20965d339169002831..4aa57b4a1421908ea77d5bcc4ca31441638155ae 100644 (file)
 #ifndef _DE_ShapeFixParameters_HeaderFile
 #define _DE_ShapeFixParameters_HeaderFile
 
+#include <NCollection_DataMap.hxx>
+#include <NCollection_Shared.hxx>
+#include <TCollection_AsciiString.hxx>
+
 //! Struct for shape healing parameters storage
 struct DE_ShapeFixParameters
 {
+  typedef NCollection_Shared<NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString>> HealingParamMap;
+
   //! Enum, classifying a type of value for parameters
   enum class FixMode : char
   {
@@ -47,7 +53,7 @@ struct DE_ShapeFixParameters
   FixMode FixIntersectingWiresMode = FixMode::FixOrNot;
   FixMode FixLoopWiresMode = FixMode::FixOrNot;
   FixMode FixSplitFaceMode = FixMode::FixOrNot;
-  FixMode AutoCorrectPrecisionMode = FixMode::FixOrNot;
+  FixMode AutoCorrectPrecisionMode = FixMode::Fix;
   FixMode ModifyTopologyMode = FixMode::NotFix;
   FixMode ModifyGeometryMode = FixMode::Fix;
   FixMode ClosedWireMode = FixMode::Fix;
@@ -77,6 +83,10 @@ struct DE_ShapeFixParameters
   FixMode FixNonAdjacentIntersectingEdgesMode = FixMode::FixOrNot;
   FixMode FixVertexPositionMode = FixMode::NotFix;
   FixMode FixVertexToleranceMode = FixMode::FixOrNot;
+
+  //! Fill healing parameters map
+  Standard_EXPORT void DE_ShapeFixParameters::FillParamsMap(DE_ShapeFixParameters::HealingParamMap& theMap);
+
 };
 
 #endif // _DE_ShapeFixParameters_HeaderFile
index bfdd4bff7d24eab790a9e7179c96cb31fe08e673..029ed0e42345ee4b955730a603c12bf099aef63e 100644 (file)
@@ -7,6 +7,7 @@ DE_Provider.cxx
 DE_Provider.hxx
 DE_ShapeFixConfigurationNode.cxx
 DE_ShapeFixConfigurationNode.hxx
+DE_ShapeFixParameters.cxx
 DE_ShapeFixParameters.hxx
 DE_Wrapper.cxx
 DE_Wrapper.hxx
index dff11a3de1496a346159c049e2503629c0370b2e..0e5c2b4c32590ee896810dd555bdc926384fe93d 100644 (file)
@@ -18,7 +18,7 @@
 #include <IGESCAFControl_Provider.hxx>
 #include <NCollection_Buffer.hxx>
 
-IMPLEMENT_STANDARD_RTTIEXT(IGESCAFControl_ConfigurationNode, DE_ConfigurationNode)
+IMPLEMENT_STANDARD_RTTIEXT(IGESCAFControl_ConfigurationNode, DE_ShapeFixConfigurationNode)
 
 namespace
 {
@@ -37,17 +37,20 @@ namespace
 // purpose  : 
 //=======================================================================
 IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode() :
-  DE_ConfigurationNode()
-{}
+  DE_ShapeFixConfigurationNode()
+{
+  ChangeHealingParams();
+}
 
 //=======================================================================
 // function : IGESCAFControl_ConfigurationNode
 // purpose  : 
 //=======================================================================
 IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode(const Handle(IGESCAFControl_ConfigurationNode)& theNode)
-  :DE_ConfigurationNode(theNode)
+  :DE_ShapeFixConfigurationNode(theNode)
 {
   InternalParameters = theNode->InternalParameters;
+  ChangeHealingParams();
 }
 
 //=======================================================================
@@ -456,3 +459,12 @@ bool IGESCAFControl_ConfigurationNode::CheckContent(const Handle(NCollection_Buf
   }
   return false;
 }
+
+//=======================================================================
+// function : ChangeHealingParams
+// purpose  :
+//=======================================================================
+void IGESCAFControl_ConfigurationNode::ChangeHealingParams()
+{
+  HealingParameters.CreateOpenSolidMode = DE_ShapeFixParameters::FixMode::Fix;
+}
index c3eafca60ba8e94b6e8fd5a50be64cc139ecc4cc..296ea847852ea785b3d3be970c537dfb2c780647 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef _IGESCAFControl_ConfigurationNode_HeaderFile
 #define _IGESCAFControl_ConfigurationNode_HeaderFile
 
-#include <DE_ConfigurationNode.hxx>
+#include <DE_ShapeFixConfigurationNode.hxx>
 #include <UnitsMethods_LengthUnit.hxx>
 
 //! The purpose of this class is to configure the transfer process for IGES format
@@ -27,9 +27,9 @@
 //! The supported CAD extensions are ".igs", ".iges"
 //! The import process is supported.
 //! The export process is supported.
-class IGESCAFControl_ConfigurationNode : public DE_ConfigurationNode
+class IGESCAFControl_ConfigurationNode : public DE_ShapeFixConfigurationNode
 {
-  DEFINE_STANDARD_RTTIEXT(IGESCAFControl_ConfigurationNode, DE_ConfigurationNode)
+  DEFINE_STANDARD_RTTIEXT(IGESCAFControl_ConfigurationNode, DE_ShapeFixConfigurationNode)
 public:
 
   //! Initializes all fields by default
@@ -84,6 +84,9 @@ public:
   //! @return Standard_True if file is supported by a current provider
   Standard_EXPORT virtual bool CheckContent(const Handle(NCollection_Buffer)& theBuffer) const Standard_OVERRIDE;
 
+  //! Redefined some healing parameters, depending on format
+  Standard_EXPORT virtual void ChangeHealingParams() Standard_OVERRIDE;
+
 public:
 
   enum ReadMode_BSplineContinuity
index d2ec791127090a8046cd29905e29a64cf24e5a2c..7d101dd51354ee24c2c85664b96aee564469fee5 100644 (file)
 #include <IGESControl_Controller.hxx>
 #include <IGESData.hxx>
 #include <IGESData_IGESModel.hxx>
+#include <IGESToBRep_Actor.hxx>
 #include <Interface_Static.hxx>
 #include <Message.hxx>
+#include <MoniTool_Macros.hxx>
 #include <XCAFDoc_DocumentTool.hxx>
+#include <XSControl_TransferReader.hxx>
 #include <XSControl_WorkSession.hxx>
 #include <UnitsMethods.hxx>
 
@@ -187,14 +190,19 @@ bool IGESCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
   IGESCAFControl_Reader aReader;
   aReader.SetWS(theWS);
 
-  aReader.SetReadVisible(aNode->InternalParameters.ReadOnlyVisible);
+  DE_ShapeFixParameters::HealingParamMap aMap = aReader.DEHealingParameters();
+  aNode->HealingParameters.FillParamsMap(aMap);
+  aReader.SetDEHealingParameters(aMap);
 
+  aReader.SetReadVisible(aNode->InternalParameters.ReadOnlyVisible);
   aReader.SetColorMode(aNode->InternalParameters.ReadColor);
   aReader.SetNameMode(aNode->InternalParameters.ReadName);
   aReader.SetLayerMode(aNode->InternalParameters.ReadLayer);
 
   IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
   aReadStat = aReader.ReadFile(thePath.ToCString());
+  DeclareAndCast(IGESToBRep_Actor, anActor, aReader.WS()->TransferReader()->Actor());
+  anActor->SetDEHealingParameters(aMap);
   if (aReadStat != IFSelect_RetDone)
   {
     Message::SendFail() << "Error in the IGESCAFControl_Provider during reading the file " <<
@@ -302,8 +310,15 @@ bool IGESCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
   IGESControl_Reader aReader;
   aReader.SetWS(theWS);
   aReader.SetReadVisible(aNode->InternalParameters.ReadOnlyVisible);
+
+  DE_ShapeFixParameters::HealingParamMap aMap = aReader.DEHealingParameters();
+  aNode->HealingParameters.FillParamsMap(aMap);
+  aReader.SetDEHealingParameters(aMap);
+
   IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
   aReadStat = aReader.ReadFile(thePath.ToCString());
+  DeclareAndCast(IGESToBRep_Actor, anActor, aReader.WS()->TransferReader()->Actor());
+  anActor->SetDEHealingParameters(aMap);
   if (aReadStat != IFSelect_RetDone)
   {
     Message::SendFail() << "Error in the IGESCAFControl_Provider during reading the file " <<
index 12638809c50b9cd516daac22173659c374fe682c..77781f643d5c028d629f94182b4bf9467762a51e 100644 (file)
@@ -33,6 +33,7 @@
 #include <TransferBRep_ShapeBinder.hxx>
 #include <XSAlgo.hxx>
 #include <XSAlgo_AlgoContainer.hxx>
+#include <XSAlgo_AlgoProcessShape.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(IGESToBRep_Actor,Transfer_ActorOfTransientProcess)
 
@@ -194,11 +195,17 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
     
     // fixing shape
     Handle(Standard_Transient) info;
-    shape = XSAlgo::AlgoContainer()->ProcessShape(shape, theeps, CAS.GetMaxTol(),
-                                                  "read.iges.resource.name",
-                                                  "read.iges.sequence",
-                                                  info, mymodel->ReShape(),
-                                                  aPS.Next(), false, TopAbs_EDGE);
+    XSAlgo_AlgoProcessShape aProcessShape;
+    aProcessShape.SetShape(shape);
+    aProcessShape.SetPrscfile("read.iges.resource.name");
+    aProcessShape.SetPseq("read.iges.sequence");
+    aProcessShape.SetInfo(info);
+    aProcessShape.SetDetalisationLevel(TopAbs_EDGE);
+    aProcessShape.SetProgressRange(aPS.Next());
+    aProcessShape.SetPrecision(theeps);
+    aProcessShape.SetMaxTol(CAS.GetMaxTol());
+    aProcessShape.SetReShape(mymodel->ReShape());
+    shape = aProcessShape.ProcessShape();
     XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
   }
 
index 6e157fbd4b887712ba25385309f5da77159d2780..fe571a0e64a20e9516fa4d357f3b32a1c21e7729 100644 (file)
@@ -20,6 +20,7 @@
 #include <Standard.hxx>
 #include <Standard_Type.hxx>
 
+#include <DE_ShapeFixParameters.hxx>
 #include <Standard_Integer.hxx>
 #include <Transfer_ActorOfTransientProcess.hxx>
 #include <Message_ProgressRange.hxx>
@@ -66,7 +67,11 @@ public:
   //! the file or from statics
   Standard_EXPORT Standard_Real UsedTolerance() const;
 
+  //! Returns healing parameters map
+  Standard_EXPORT DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEHealingParameters; }
 
+  //! Sets healing parameters map
+  Standard_EXPORT void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEHealingParameters = theDEHealingParams; }
 
 
   DEFINE_STANDARD_RTTIEXT(IGESToBRep_Actor,Transfer_ActorOfTransientProcess)
@@ -82,7 +87,7 @@ private:
   Handle(Interface_InterfaceModel) themodel;
   Standard_Integer thecontinuity;
   Standard_Real theeps;
-
+  DE_ShapeFixParameters::HealingParamMap myDEHealingParameters;
 
 };
 
index 0230ca403fdc538aac1edde19eb94a84a86534ee..5fcb5b140df0ef7ad3d73bbc794abf3c40d0ee82 100644 (file)
@@ -46,6 +46,7 @@
 #include <TransferBRep.hxx>
 #include <XSAlgo.hxx>
 #include <XSAlgo_AlgoContainer.hxx>
+#include <XSAlgo_AlgoProcessShape.hxx>
 
 #include <stdio.h>
 //#include <ShapeCustom.hxx>
@@ -549,10 +550,17 @@ Standard_Boolean  IGESToBRep_Reader::Transfer(const Standard_Integer num,
 //    shape = XSAlgo::AlgoContainer()->PerformFixShape ( shape, theProc, eps*CAS.GetUnitFactor(), CAS.GetMaxTol() );
 
     Handle(Standard_Transient) info;
-    shape = XSAlgo::AlgoContainer()->ProcessShape( shape, eps*CAS.GetUnitFactor(), CAS.GetMaxTol(),
-                                                   "read.iges.resource.name", 
-                                                   "read.iges.sequence", info,
-                                                   aPS.Next(), false, TopAbs_EDGE);
+    XSAlgo_AlgoProcessShape aProcessShape;
+    aProcessShape.SetShape(shape);
+    aProcessShape.SetPrscfile("read.iges.resource.name");
+    aProcessShape.SetPseq("read.iges.sequence");
+    aProcessShape.SetInfo(info);
+    aProcessShape.SetDetalisationLevel(TopAbs_EDGE);
+    aProcessShape.SetProgressRange(theProgress);
+    aProcessShape.SetPrecision(eps * CAS.GetUnitFactor());
+    aProcessShape.SetMaxTol(CAS.GetMaxTol());
+    shape = aProcessShape.ProcessShape();
+
     if (aPS.UserBreak())
       return Standard_False;
 
index f93174e070c4bf06105584b5e9f37127b8763ae8..921a79fb5fd9c6c005b390d7cb17f25f7df9f15a 100644 (file)
 #include <STEPCAFControl_ConfigurationNode.hxx>
 
 #include <DE_ConfigurationContext.hxx>
+#include <DE_ShapeFixConfigurationNode.hxx>
 #include <DE_PluginHolder.hxx>
 #include <NCollection_Buffer.hxx>
 #include <STEPCAFControl_Provider.hxx>
 
-IMPLEMENT_STANDARD_RTTIEXT(STEPCAFControl_ConfigurationNode, DE_ConfigurationNode)
+IMPLEMENT_STANDARD_RTTIEXT(STEPCAFControl_ConfigurationNode, DE_ShapeFixConfigurationNode)
 
 namespace
 {
@@ -37,17 +38,19 @@ namespace
 // purpose  :
 //=======================================================================
 STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode() :
-  DE_ConfigurationNode()
-{}
+  DE_ShapeFixConfigurationNode()
+{
+}
 
 //=======================================================================
 // function : STEPCAFControl_ConfigurationNode
 // purpose  :
 //=======================================================================
 STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode(const Handle(STEPCAFControl_ConfigurationNode)& theNode)
-  :DE_ConfigurationNode(theNode),
+  :DE_ShapeFixConfigurationNode(theNode),
   InternalParameters(theNode->InternalParameters)
-{}
+{
+}
 
 //=======================================================================
 // function : Load
index 0611154dbd2c0b2fb33a3d090034eb3889a5567c..fce878e04436d7d521618789b851e983e5778cfb 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef _STEPCAFControl_ConfigurationNode_HeaderFile
 #define _STEPCAFControl_ConfigurationNode_HeaderFile
 
-#include <DE_ConfigurationNode.hxx>
+#include <DE_ShapeFixConfigurationNode.hxx>
 #include <STEPControl_StepModelType.hxx>
 #include <StepData_ConfParameters.hxx>
 #include <Resource_FormatType.hxx>
@@ -30,9 +30,9 @@
 //! The supported CAD extensions are ".stp", ".step", ".stpz"
 //! The import process is supported.
 //! The export process is supported.
-class STEPCAFControl_ConfigurationNode : public DE_ConfigurationNode
+class STEPCAFControl_ConfigurationNode : public DE_ShapeFixConfigurationNode
 {
-  DEFINE_STANDARD_RTTIEXT(STEPCAFControl_ConfigurationNode, DE_ConfigurationNode)
+  DEFINE_STANDARD_RTTIEXT(STEPCAFControl_ConfigurationNode, DE_ShapeFixConfigurationNode)
 public:
 
   //! Initializes all field by default
index 969c54d220e114a3284907c359308210f97fe43d..7bf2607510a29138b67f731ebe88f5a0eb6ebb12 100644 (file)
@@ -14,6 +14,7 @@
 #include <STEPCAFControl_Provider.hxx>
 
 #include <BinXCAFDrivers.hxx>
+#include <DE_ShapeFixParameters.hxx>
 #include <Interface_Static.hxx>
 #include <Message.hxx>
 #include <StepData_StepModel.hxx>
@@ -23,6 +24,8 @@
 #include <STEPCAFControl_Reader.hxx>
 #include <STEPCAFControl_Writer.hxx>
 #include <XCAFDoc_DocumentTool.hxx>
+#include <XSAlgo.hxx>
+#include <XSAlgo_AlgoContainer.hxx>
 #include <XSControl_WorkSession.hxx>
 #include <UnitsMethods.hxx>
 
@@ -68,12 +71,17 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
   personizeWS(theWS);
   XCAFDoc_DocumentTool::SetLengthUnit(theDocument, aNode->GlobalParameters.LengthUnit, UnitsMethods_LengthUnit_Millimeter);
   STEPCAFControl_Reader aReader;
+  DE_ShapeFixParameters aParameters;
+  DE_ShapeFixParameters::HealingParamMap aDEHealingParams = aReader.ChangeReader().DEHealingParameters();
+  aNode->HealingParameters.FillParamsMap(aDEHealingParams);
+  aReader.ChangeReader().SetDEHealingParameters(aDEHealingParams);
   aReader.Init(theWS);
   aReader.SetColorMode(aNode->InternalParameters.ReadColor);
   aReader.SetNameMode(aNode->InternalParameters.ReadName);
   aReader.SetLayerMode(aNode->InternalParameters.ReadLayer);
   aReader.SetPropsMode(aNode->InternalParameters.ReadProps);
   aReader.SetMetaMode(aNode->InternalParameters.ReadMetadata);
+  aReader.SetDEHealingParameters(aReader.ChangeReader().DEHealingParameters());
 
   IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
   StepData_ConfParameters aParams;
@@ -200,6 +208,9 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
   personizeWS(theWS);
   STEPControl_Reader aReader;
   aReader.SetWS(theWS);
+  DE_ShapeFixParameters::HealingParamMap aDEHealingParams = aReader.DEHealingParameters();
+  aNode->HealingParameters.FillParamsMap(aDEHealingParams);
+  aReader.SetDEHealingParameters(aDEHealingParams);
   IFSelect_ReturnStatus aReadstat = IFSelect_RetVoid;
   StepData_ConfParameters aParams;
   aReadstat = aReader.ReadFile(thePath.ToCString(), aParams);
index dd9eef42fb5f8cbcf7f5eb2d60caa55a92a61a85..9e5832e1dc02635e015b781b3f3c56c1400dcd5d 100644 (file)
@@ -24,6 +24,7 @@
 #include <HeaderSection_FileSchema.hxx>
 #include <Interface_Static.hxx>
 #include <Message_ProgressScope.hxx>
+#include <MoniTool_Macros.hxx>
 #include <NCollection_DataMap.hxx>
 #include <OSD_Path.hxx>
 #include <Quantity_ColorRGBA.hxx>
@@ -2341,7 +2342,8 @@ Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane)& t
 void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
   const Handle(Standard_Transient)& theGDT,
   const Handle(Standard_Transient)& theDimObject,
-  const StepData_Factors& theLocalFactors)
+  const StepData_Factors& theLocalFactors,
+  DE_ShapeFixParameters::HealingParamMap theDEParams)
 {
   if (theGDT.IsNull() || theDimObject.IsNull())
     return;
@@ -2370,6 +2372,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
     Handle(StepVisual_DraughtingModel)::DownCast(aDMIA->UsedRepresentation());
   XSAlgo::AlgoContainer()->PrepareForTransfer();
   STEPControl_ActorRead anActor(aTP->Model());
+  anActor.SetDEHealingParameters(theDEParams);
   StepData_Factors aLocalFactors = theLocalFactors;
   anActor.PrepareUnits(aDModel, aTP, aLocalFactors);
   Standard_Real aFact = aLocalFactors.LengthFactor();
@@ -2457,7 +2460,8 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
 void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
   const Handle(Standard_Transient)& theGDT,
   const Handle(XCAFDimTolObjects_DimensionObject)& theDimObject,
-  const StepData_Factors& theLocalFactors)
+  const StepData_Factors& theLocalFactors,
+  DE_ShapeFixParameters::HealingParamMap theDEParams)
 {
   if (theGDT.IsNull() || theDimObject.IsNull())
     return;
@@ -2479,6 +2483,7 @@ void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
   {
     XSAlgo::AlgoContainer()->PrepareForTransfer();
     STEPControl_ActorRead anActor(theTR->Model());
+    anActor.SetDEHealingParameters(theDEParams);
     StepData_Factors aLocalFactors = theLocalFactors;
     anActor.PrepareUnits(aSDR, aTP, aLocalFactors);
     aFact = aLocalFactors.LengthFactor();
@@ -2783,7 +2788,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
     collectShapeAspect(aSAR->RelatingShapeAspect(), theWS, aSAs);
     Handle(StepDimTol_DatumFeature) aDF = Handle(StepDimTol_DatumFeature)::DownCast(aSAR->RelatingShapeAspect());
     if (!aSAR->RelatingShapeAspect()->IsKind(STANDARD_TYPE(StepDimTol_DatumTarget)))
-      readAnnotation(aTR, aSAR->RelatingShapeAspect(), aDatObj, theLocalFactors);
+      readAnnotation(aTR, aSAR->RelatingShapeAspect(), aDatObj, theLocalFactors, myDEParameters);
   }
 
   // Collect shape labels
@@ -2917,6 +2922,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
                   = Handle(StepGeom_Axis2Placement3d)::DownCast(aSRWP->ItemsValue(j));
                 XSAlgo::AlgoContainer()->PrepareForTransfer();
                 STEPControl_ActorRead anActor(aTP->Model());
+                anActor.SetDEHealingParameters(myDEParameters);
                 StepData_Factors aLocalFactors = theLocalFactors;
                 anActor.PrepareUnits(aSRWP, aTP, aLocalFactors);
                 Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(anAx, aLocalFactors);
@@ -2964,7 +2970,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
       aDGTTool->SetDatumToGeomTol(aDatL, theGDTL);
       aDatTargetObj->IsDatumTarget(Standard_True);
       aDatTargetObj->SetDatumTargetNumber(aDT->TargetId()->IntegerValue());
-      readAnnotation(aTR, aDT, aDatTargetObj, theLocalFactors);
+      readAnnotation(aTR, aDT, aDatTargetObj, theLocalFactors, myDEParameters);
       aDat->SetObject(aDatTargetObj);
       isExistDatumTarget = Standard_True;
     }
@@ -2993,7 +2999,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
     aDGTTool->SetDatumToGeomTol(aDatL, theGDTL);
     if (aDatObj->GetPresentation().IsNull()) {
       // Try find annotation connected to datum entity (not right case, according recommended practices)
-      readAnnotation(aTR, theDat, aDatObj, theLocalFactors);
+      readAnnotation(aTR, theDat, aDatObj, theLocalFactors, myDEParameters);
     }
     aDat->SetObject(aDatObj);
   }
@@ -3638,7 +3644,8 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
   const TDF_Label& aDimL,
   const Handle(TDocStd_Document)& theDoc,
   const Handle(XSControl_WorkSession)& theWS,
-  const StepData_Factors& theLocalFactors)
+  const StepData_Factors& theLocalFactors,
+  DE_ShapeFixParameters::HealingParamMap theUseDEHealingParams)
 {
   Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
   Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@@ -4057,8 +4064,8 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
 
     if (aDimL.FindAttribute(XCAFDoc_Dimension::GetID(), aDim))
     {
-      readAnnotation(aTR, theEnt, aDimObj, theLocalFactors);
-      readConnectionPoints(aTR, theEnt, aDimObj, theLocalFactors);
+      readAnnotation(aTR, theEnt, aDimObj, theLocalFactors, theUseDEHealingParams);
+      readConnectionPoints(aTR, theEnt, aDimObj, theLocalFactors, theUseDEHealingParams);
       aDim->SetObject(aDimObj);
     }
   }
@@ -4180,7 +4187,8 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
   const TDF_Label& theTolL,
   const Handle(TDocStd_Document)& theDoc,
   const Handle(XSControl_WorkSession)& theWS,
-  const StepData_Factors& theLocalFactors)
+  const StepData_Factors& theLocalFactors,
+  DE_ShapeFixParameters::HealingParamMap theUseDEHealingParams)
 {
   Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
   Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@@ -4327,7 +4335,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
     aTolObj->SetMaxValueModifier(aVal);
   }
 
-  readAnnotation(aTR, theEnt, aTolObj, theLocalFactors);
+  readAnnotation(aTR, theEnt, aTolObj, theLocalFactors, theUseDEHealingParams);
   aGTol->SetObject(aTolObj);
 }
 
@@ -4361,10 +4369,10 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
       TDF_Label aGDTL = createGDTObjectInXCAF(anEnt, theDoc, theWS, theLocalFactors);
       if (!aGDTL.IsNull()) {
         if (anEnt->IsKind(STANDARD_TYPE(StepDimTol_GeometricTolerance))) {
-          setGeomTolObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors);
+          setGeomTolObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors, myDEParameters);
         }
         else {
-          setDimObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors);
+          setDimObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors, myDEParameters);
         }
       }
     }
@@ -4457,6 +4465,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
       {
         XSAlgo::AlgoContainer()->PrepareForTransfer();
         STEPControl_ActorRead anActor(aModel);
+        anActor.SetDEHealingParameters(myDEParameters);
         Handle(Transfer_TransientProcess) aTP = aTR->TransientProcess();
         anActor.PrepareUnits(aDMIA->UsedRepresentation(), aTP, aLocalFactors);
         aFact = aLocalFactors.LengthFactor();
@@ -4813,6 +4822,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSes
     {
       XSAlgo::AlgoContainer()->PrepareForTransfer();
       STEPControl_ActorRead anActor(aTP->Model());
+      anActor.SetDEHealingParameters(myDEParameters);
       anActor.PrepareUnits(aDModel, aTP, aLocalFactors);
     }
 
index 6ee4433f960f27e26cce143f31a2175d1f8191a3..c84e9d9bde39cc9ed724154e1c6ebf715ee76d15 100644 (file)
@@ -16,6 +16,7 @@
 #ifndef _STEPCAFControl_Reader_HeaderFile
 #define _STEPCAFControl_Reader_HeaderFile
 
+#include <DE_ShapeFixParameters.hxx>
 #include <STEPControl_Reader.hxx>
 #include <StepData_Factors.hxx>
 #include <IFSelect_ReturnStatus.hxx>
@@ -207,6 +208,13 @@ public:
   //! Get View mode
   Standard_EXPORT Standard_Boolean GetViewMode() const;
 
+  //! Returns healing parameters map
+  Standard_EXPORT DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEParameters; }
+
+  //! Sets healing parameters map
+  Standard_EXPORT void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEParameters = theDEHealingParams; }
+
+
   const XCAFDoc_DataMapOfShapeLabel& GetShapeLabelMap() const { return myMap; }
 
 protected:
@@ -375,6 +383,7 @@ private:
   Standard_Boolean myMatMode;
   Standard_Boolean myViewMode;
   NCollection_DataMap<Handle(Standard_Transient), TDF_Label> myGDTMap;
+  DE_ShapeFixParameters::HealingParamMap myDEParameters;
 
 };
 
index 413b6f4f19058899947a9340786c0b9ebe133eb3..d5db6d59d0f26ff9878bdfa7b3237bf230990231 100644 (file)
 #include <UnitsMethods.hxx>
 #include <XSAlgo.hxx>
 #include <XSAlgo_AlgoContainer.hxx>
+#include <XSAlgo_AlgoProcessShape.hxx>
 #include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
 #include <StepRepr_ConstructiveGeometryRepresentation.hxx>
 #include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
@@ -935,11 +936,16 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
 
     Handle(Standard_Transient) info;
     // IMPORTANT: any fixing on non-manifold topology must be done after the shape is transferred from STEP
-    TopoDS_Shape fixedResult = 
-      XSAlgo::AlgoContainer()->ProcessShape( comp, myPrecision, myMaxTol,
-                                             "read.step.resource.name", 
-                                             "read.step.sequence", info,
-                                             aPS1.Next(), Standard_True);
+    XSAlgo_AlgoProcessShape aProcessShape;
+    aProcessShape.SetShape(comp);
+    aProcessShape.SetPrscfile("read.step.resource.name");
+    aProcessShape.SetPseq("read.step.sequence");
+    aProcessShape.SetInfo(info);
+    aProcessShape.SetNonManifold(Standard_True);
+    aProcessShape.SetProgressRange(theProgress);
+    aProcessShape.SetPrecision(myPrecision);
+    aProcessShape.SetMaxTol(myMaxTol);
+    TopoDS_Shape fixedResult = aProcessShape.ProcessShape();
     XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
 
     if (fixedResult.ShapeType() == TopAbs_COMPOUND)
@@ -1555,11 +1561,15 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
     if (isManifold && aHasGeom) 
     {
       Handle(Standard_Transient) info;
-      mappedShape = 
-        XSAlgo::AlgoContainer()->ProcessShape( mappedShape, myPrecision, myMaxTol,
-                                               "read.step.resource.name", 
-                                               "read.step.sequence", info,
-                                               aPS.Next());
+      XSAlgo_AlgoProcessShape aProcessShape;
+      aProcessShape.SetShape(mappedShape);
+      aProcessShape.SetPrscfile("read.step.resource.name");
+      aProcessShape.SetPseq("read.step.sequence");
+      aProcessShape.SetInfo(info);
+      aProcessShape.SetProgressRange(aPS.Next());
+      aProcessShape.SetPrecision(myPrecision);
+      aProcessShape.SetMaxTol(myMaxTol);
+      mappedShape = aProcessShape.ProcessShape();
       XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
     }
   }
@@ -1727,10 +1737,15 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
       TopoDS_Shape S = sb->Result();
 
       Handle(Standard_Transient) info;
-      TopoDS_Shape shape = XSAlgo::AlgoContainer()->ProcessShape(S, myPrecision, myMaxTol,
-        "read.step.resource.name",
-        "read.step.sequence", info,
-        theProgress);
+      XSAlgo_AlgoProcessShape aProcessShape;
+      aProcessShape.SetShape(S);
+      aProcessShape.SetPrscfile("read.step.resource.name");
+      aProcessShape.SetPseq("read.step.sequence");
+      aProcessShape.SetInfo(info);
+      aProcessShape.SetProgressRange(theProgress);
+      aProcessShape.SetPrecision(myPrecision);
+      aProcessShape.SetMaxTol(myMaxTol);
+      TopoDS_Shape shape = aProcessShape.ProcessShape();
       //      TopoDS_Shape shape = XSAlgo::AlgoContainer()->PerformFixShape( S, TP, myPrecision, myMaxTol );
       if (shape != S)
         sb->SetResult(shape);
index d6e4723187b8816d37e3e7c2ce206c730b1f65c2..4675b00a8a3714707c8e0e29b60262a315099858 100644 (file)
@@ -28,6 +28,7 @@
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <Message_ProgressRange.hxx>
 #include <Interface_InterfaceModel.hxx>
+#include <DE_ShapeFixParameters.hxx>
 
 class StepRepr_Representation;
 class Standard_Transient;
@@ -115,7 +116,11 @@ public:
                                                  gp_Trsf& Trsf,
                                                  const StepData_Factors& theLocalFactors = StepData_Factors());
 
+  //! Returns healing parameters map
+  Standard_EXPORT DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEParameters; }
 
+  //! Sets healing parameters map
+  Standard_EXPORT void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEParameters = theDEHealingParams; }
 
 
   DEFINE_STANDARD_RTTIEXT(STEPControl_ActorRead,Transfer_ActorOfTransientProcess)
@@ -226,6 +231,7 @@ private:
   Standard_Real myMaxTol;
   Handle(StepRepr_Representation) mySRContext;
   Handle(Interface_InterfaceModel) myModel;
+  DE_ShapeFixParameters::HealingParamMap myDEParameters;
 
 };
 
index f3256d0146c103474279987bb2f54efb85cdd550..52d029a430dfb371786ad46a73a53a501d89f53d 100644 (file)
@@ -1003,7 +1003,6 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
     if (hasGeometry(aShape)) 
     {
       Standard_Real maxTol = aStepModel->InternalParameters.ReadMaxPrecisionVal;
-
       aShape = XSAlgo::AlgoContainer()->ProcessShape(xShape, Tol, maxTol,
         "write.step.resource.name",
         "write.step.sequence", info,
index a35346360d9660a19bfb87a9cb4b6e6b3a8e8580..4b191ffbd8ec2236238f7f36f795fe75d73f0aac 100644 (file)
@@ -130,7 +130,8 @@ IFSelect_ReturnStatus STEPControl_Reader::ReadFile(const Standard_CString filena
   WS()->InitTransferReader(4);
   return status;
 }
-
+#include <STEPControl_ActorRead.hxx>
+#include <MoniTool_Macros.hxx>
 //=======================================================================
 //function : ReadFile
 //purpose  : 
@@ -164,6 +165,8 @@ IFSelect_ReturnStatus STEPControl_Reader::ReadFile(const Standard_CString filena
   WS()->SetModel(aStepModel);
   WS()->SetLoadedFile(filename);
   WS()->InitTransferReader(4);
+  //DeclareAndCast(STEPControl_ActorRead, anActor, WS()->TransferReader()->Actor());
+  //anActor->SetDEHealingParameters(DEHealingParameters());
   return status;
 }
 
index dfc20b26cb5822631c59bfd6772d37e9496c90cc..6eae4eee7618f73daf28d21f0aa25455205ccdd7 100644 (file)
@@ -67,7 +67,6 @@ IMPLEMENT_STANDARD_RTTIEXT(XSAlgo_AlgoContainer,Standard_Transient)
 //purpose  : 
 //=======================================================================
 XSAlgo_AlgoContainer::XSAlgo_AlgoContainer()
-  : myDEHealingParamsUsage(false)
 {
   myTC = new XSAlgo_ToolContainer;
 }
@@ -107,8 +106,6 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape(const TopoDS_Shape& theShape,
   aProcessShape.SetPrscfile(thePrscfile);
   aProcessShape.SetPseq(thePseq);
   aProcessShape.SetInfo(theInfo);
-  aProcessShape.SetHealingParamsFlag(myDEHealingParamsUsage);
-  aProcessShape.SetHealingParameters(myHealingParameters);
   aProcessShape.SetDetalisationLevel(theDetalisationLevel);
   aProcessShape.SetNonManifold(theNonManifold);
   aProcessShape.SetProgressRange(theProgress);
index 0716afaaf613dbbe64bbe913a2dc544ac0221469..0e79ace5782d09d004d45bc368ab591b06de5eea 100644 (file)
@@ -48,31 +48,6 @@ public:
   
   //! Sets ToolContainer
   void SetToolContainer (const Handle(XSAlgo_ToolContainer)& TC);
-
-  //! Gets healing parameters flag
-  const bool GetHealingParameteresFlag()
-  {
-    return myDEHealingParamsUsage;
-  }
-
-  //! Sets healing parameters flag
-  //! Uses defined DE healing parameters (if true) or parameters from resource file/Static_Interface
-  void SetHealingParametersFlag(const bool theHealingParamsFlag)
-  {
-    myDEHealingParamsUsage = theHealingParamsFlag;
-  }
-
-  //! Gets healing parameters
-  const DE_ShapeFixParameters& GetHealingParameteres()
-  {
-    return myHealingParameters;
-  }
-
-  //! Sets healing parameters
-  void SetHealingParameters(const DE_ShapeFixParameters& theHealingParams)
-  {
-    myHealingParameters = theHealingParams;
-  }
   
   //! Returns ToolContainer
   Handle(XSAlgo_ToolContainer) ToolContainer() const;
@@ -137,8 +112,6 @@ public:
   Standard_EXPORT virtual void MergeTransferInfo (const Handle(Transfer_FinderProcess)& FP, const Handle(Standard_Transient)& info) const;
 
 
-
-
   DEFINE_STANDARD_RTTIEXT(XSAlgo_AlgoContainer,Standard_Transient)
 
 protected:
@@ -148,10 +121,7 @@ protected:
 
 private:
 
-  bool myDEHealingParamsUsage;
   Handle(XSAlgo_ToolContainer) myTC;
-  DE_ShapeFixParameters myHealingParameters;
-
 
 };
 
index 2f895a35bdae217239fff83226874a23aff1aa89..2edba9b911511c041272ddb401e78ce4de813cd5 100644 (file)
@@ -39,7 +39,6 @@ XSAlgo_AlgoProcessShape::XSAlgo_AlgoProcessShape()
   myMaxTol(1.),
   myNonManifold(false),
   myDetalisationLevel(TopAbs_VERTEX),
-  myDEHealingParamsUsage(false),
   myProgressRange(Message_ProgressRange())
 {
 }
@@ -55,18 +54,21 @@ TopoDS_Shape XSAlgo_AlgoProcessShape::ProcessShape()
     return myShape;
   }
 
+  if (myReShape.IsNull())
+  {
+    myReShape = new ShapeBuild_ReShape();
+  }
+
   Standard_CString aRscfile = "";
   Handle(ShapeProcess_ShapeContext) aContext = Handle(ShapeProcess_ShapeContext)::DownCast(myInfo);
   if (aContext.IsNull())
   {
     aRscfile = Interface_Static::CVal(myPrscfile);
     aContext = new ShapeProcess_ShapeContext(myShape, aRscfile);
-    if (myDEHealingParamsUsage)
-    {
-      // Use defined shape healing parameters
-      FillMap(aContext->ResourceManager()->GetMap());
-    }
-    else if (!aContext->ResourceManager()->IsInitialized())
+  }
+  if (myDEParameters.IsEmpty())
+  {
+    if (!aContext->ResourceManager()->IsInitialized())
     {
       // If resource file wasn't found, use static values instead
       Interface_Static::FillMap(aContext->ResourceManager()->GetMap());
@@ -145,64 +147,3 @@ TopoDS_Shape XSAlgo_AlgoProcessShape::ProcessShape()
 
   return aContext->Result();
 }
-
-//=======================================================================
-//function : FillMap
-//purpose  :
-//=======================================================================
-void XSAlgo_AlgoProcessShape::FillMap(NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString>& theMap) const
-{
-  theMap.Clear();
-  theMap.Bind("Tolerance3d", TCollection_AsciiString(myHealingParameters.Tolerance3d));
-  theMap.Bind("MinTolerance3d", TCollection_AsciiString(myHealingParameters.MinTolerance3d));
-  theMap.Bind("MaxTolerance3d", TCollection_AsciiString(myHealingParameters.MaxTolerance3d));
-  theMap.Bind("FixFreeShellMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFreeShellMode)));
-  theMap.Bind("FixFreeFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFreeFaceMode)));
-  theMap.Bind("FixFreeFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFreeFaceMode)));
-  theMap.Bind("FixFreeWireMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFreeWireMode)));
-  theMap.Bind("FixSameParameterMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSameParameterMode)));
-  theMap.Bind("FixSolidMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSolidMode)));
-  theMap.Bind("FixShellOrientationMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixShellOrientationMode)));
-  theMap.Bind("CreateOpenSolidMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.CreateOpenSolidMode)));
-  theMap.Bind("FixShellMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixShellMode)));
-  theMap.Bind("FixFaceOrientationMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFaceOrientationMode)));
-  theMap.Bind("FixFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFaceMode)));
-  theMap.Bind("FixWireMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixWireMode)));
-  theMap.Bind("FixOrientationMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixOrientationMode)));
-  theMap.Bind("FixAddNaturalBoundMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixAddNaturalBoundMode)));
-  theMap.Bind("FixMissingSeamMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixMissingSeamMode)));
-  theMap.Bind("FixSmallAreaWireMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSmallAreaWireMode)));
-  theMap.Bind("RemoveSmallAreaFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.RemoveSmallAreaFaceMode)));
-  theMap.Bind("FixIntersectingWiresMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixIntersectingWiresMode)));
-  theMap.Bind("FixLoopWiresMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixLoopWiresMode)));
-  theMap.Bind("FixSplitFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSplitFaceMode)));
-  theMap.Bind("AutoCorrectPrecisionMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.AutoCorrectPrecisionMode)));
-  theMap.Bind("ModifyTopologyMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.ModifyTopologyMode)));
-  theMap.Bind("ClosedWireMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.ClosedWireMode)));
-  theMap.Bind("PreferencePCurveMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.PreferencePCurveMode)));
-  theMap.Bind("FixReorderMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixReorderMode)));
-  theMap.Bind("FixSmallMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSmallMode)));
-  theMap.Bind("FixConnectedMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixConnectedMode)));
-  theMap.Bind("FixEdgeCurvesMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixEdgeCurvesMode)));
-  theMap.Bind("FixDegeneratedMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixDegeneratedMode)));
-  theMap.Bind("FixLackingMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixLackingMode)));
-  theMap.Bind("FixSelfIntersectionMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSelfIntersectionMode)));
-  theMap.Bind("RemoveLoopMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.RemoveLoopMode)));
-  theMap.Bind("FixReversed2dMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixReversed2dMode)));
-  theMap.Bind("FixRemovePCurveMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixRemovePCurveMode)));
-  theMap.Bind("FixRemoveCurve3dMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixRemoveCurve3dMode)));
-  theMap.Bind("FixAddPCurveMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixAddPCurveMode)));
-  theMap.Bind("FixAddCurve3dMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixAddCurve3dMode)));
-  theMap.Bind("FixSeamMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSeamMode)));
-  theMap.Bind("FixShiftedMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixShiftedMode)));
-  theMap.Bind("FixEdgeSameParameterMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixEdgeSameParameterMode)));
-  theMap.Bind("FixNotchedEdgesMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixNotchedEdgesMode)));
-  theMap.Bind("FixTailMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixTailMode)));
-  theMap.Bind("MaxTailAngle", TCollection_AsciiString(static_cast<int>(myHealingParameters.MaxTailAngle)));
-  theMap.Bind("MaxTailWidth", TCollection_AsciiString(static_cast<int>(myHealingParameters.MaxTailWidth)));
-  theMap.Bind("FixSelfIntersectingEdgeMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSelfIntersectingEdgeMode)));
-  theMap.Bind("FixIntersectingEdgesMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixIntersectingEdgesMode)));
-  theMap.Bind("FixNonAdjacentIntersectingEdgesMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixNonAdjacentIntersectingEdgesMode)));
-  theMap.Bind("FixVertexPositionMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixVertexPositionMode)));
-  theMap.Bind("FixVertexToleranceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixVertexToleranceMode)));
-}
index dc1266616d2e29ffdf186679655061c5cc1fdc30..335261b4dbdf0f528c15035bf7e56ad9befebde7 100644 (file)
@@ -47,9 +47,6 @@ public:
   //! Shape processing with specified tolerances
   Standard_EXPORT TopoDS_Shape ProcessShape();
 
-  //! Fill map from DE shape healing parameters
-  void FillMap(NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString>& theMap) const;
-
   //! Get shape for processing
   const TopoDS_Shape& GetShape() { return myShape; }
 
@@ -74,19 +71,6 @@ public:
   //! Set information to be recorded in the translation map
   void SetInfo(const Handle(Standard_Transient)& theInfo) { myInfo = theInfo; }
 
-  //! Get flag of healing parameters
-  const bool GetHealingParamsFlag() { return myDEHealingParamsUsage; }
-
-  //! Set flag of healing parameters
-  //! Uses defined DE healing parameters (if true) or parameters from resource file/Static_Interface
-  void SetHealingParamsFlag(const bool theHealingParamsFlag) { myDEHealingParamsUsage = theHealingParamsFlag; }
-
-  //! Get healing parameters
-  const DE_ShapeFixParameters& GetHealingParameters() { return myHealingParameters; }
-
-  //! Set healing parameters
-  void SetHealingParameters(const DE_ShapeFixParameters& theHealingParams) { myHealingParameters = theHealingParams; }
-
   //! Get flag to proceed with non-manifold topology
   const bool GetNonManifold() { return myNonManifold; }
 
@@ -123,6 +107,12 @@ public:
   //! Set tool to record the modifications of input shape
   void SetReShape(const Handle(ShapeBuild_ReShape)& theReShape) { myReShape = theReShape; }
 
+  //! Returns healing parameters map
+  DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEParameters; }
+
+  //! Sets healing parameters map
+  void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEParameters = theDEHealingParams; }
+
   DEFINE_STANDARD_RTTIEXT(XSAlgo_AlgoProcessShape, Standard_Transient)
 
 private:
@@ -134,11 +124,10 @@ private:
   double           myMaxTol;
   bool             myNonManifold;
   TopAbs_ShapeEnum myDetalisationLevel;
-  bool myDEHealingParamsUsage;
-  DE_ShapeFixParameters myHealingParameters;
   Message_ProgressRange myProgressRange;
   Handle(Standard_Transient) myInfo;
   Handle(ShapeBuild_ReShape) myReShape;
+  DE_ShapeFixParameters::HealingParamMap myDEParameters;
 
 };
 
index 4a8dc06e0a648d45d2bf996f3e17ac7a0b7b9014..d6e6f7635769dd4a6a917f3b9dc4feab1044bf34 100644 (file)
@@ -21,6 +21,7 @@
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
 
+#include <DE_ShapeFixParameters.hxx>
 #include <TColStd_SequenceOfTransient.hxx>
 #include <TopTools_SequenceOfShape.hxx>
 #include <Standard_CString.hxx>
@@ -260,7 +261,11 @@ public:
   //! Gives statistics about Transfer
   Standard_EXPORT void GetStatsTransfer (const Handle(TColStd_HSequenceOfTransient)& list, Standard_Integer& nbMapped, Standard_Integer& nbWithResult, Standard_Integer& nbWithFail) const;
 
+  //! Returns healing parameters map
+  Standard_EXPORT DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEParameters; }
 
+  //! Sets healing parameters map
+  Standard_EXPORT void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEParameters = theDEHealingParams; }
 
 
 protected:
@@ -280,6 +285,7 @@ private:
 
   Handle(XSControl_WorkSession) thesession;
   TopTools_SequenceOfShape theshapes;
+  DE_ShapeFixParameters::HealingParamMap myDEParameters;
 
 
 };
index 4b8263c4ba91b09d5ca6139e03f0eaa506c40ced..8e0d10d6ea5a0a31aae36c0642eee5fa06fdbf59 100644 (file)
@@ -835,6 +835,11 @@ static Standard_Integer ReadIges(Draw_Interpretor& theDI,
   Standard_Integer onlyVisible = Interface_Static::IVal("read.iges.onlyvisible");
   aReader.SetReadVisible(onlyVisible == 1);
 
+  DE_ShapeFixParameters aParameters;
+  DE_ShapeFixParameters::HealingParamMap aDEHealingParams = aReader.DEHealingParameters();
+  aParameters.FillParamsMap(aDEHealingParams);
+  aReader.SetDEHealingParameters(aDEHealingParams);
+
   if (theNbArgs == 4)
   {
     Standard_Boolean mode = Standard_True;
index 5dcea737045ac9e5b47aba573a39b217a918e822..24f864768630ee6969ba4424249eedee02cf952c 100644 (file)
@@ -17,6 +17,7 @@
 #include <DDF.hxx>
 #include <DDocStd.hxx>
 #include <DDocStd_DrawDocument.hxx>
+#include <DE_ShapeFixParameters.hxx>
 #include <Draw.hxx>
 #include <Draw_Interpretor.hxx>
 #include <Draw_PluginMacro.hxx>
@@ -693,6 +694,11 @@ static Standard_Integer ReadStep(Draw_Interpretor& theDI,
   }
 
   STEPCAFControl_Reader aReader(XSDRAW::Session(), isFileMode);
+  DE_ShapeFixParameters aParameters;
+  DE_ShapeFixParameters::HealingParamMap aDEHealingParams = aReader.ChangeReader().DEHealingParameters();
+  aParameters.FillParamsMap(aDEHealingParams);
+  aReader.ChangeReader().SetDEHealingParameters(aDEHealingParams);
+
   if (!aModeStr.IsEmpty())
   {
     Standard_Boolean aMode = Standard_True;