]> OCCT Git - occt.git/commitdiff
Coding - Refactor ShapeHealingMap to NCollection #346
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Sat, 8 Feb 2025 21:01:14 +0000 (22:01 +0100)
committerGitHub <noreply@github.com>
Sat, 8 Feb 2025 21:01:14 +0000 (21:01 +0000)
Update container type to OCCT to avoid allocation on creating.
Refactor shape processing parameter handling to use XSAlgo_ShapeProcessor for consistency.

25 files changed:
src/DE/DE_ShapeFixParameters.hxx
src/IGESControl/IGESControl_Writer.cxx
src/IGESControl/IGESControl_Writer.hxx
src/IGESToBRep/IGESToBRep_Actor.cxx
src/IGESToBRep/IGESToBRep_Reader.cxx
src/IGESToBRep/IGESToBRep_Reader.hxx
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/STEPCAFControl/STEPCAFControl_Reader.hxx
src/STEPCAFControl/STEPCAFControl_Writer.cxx
src/STEPCAFControl/STEPCAFControl_Writer.hxx
src/STEPControl/STEPControl_ActorRead.cxx
src/STEPControl/STEPControl_ActorWrite.cxx
src/STEPControl/STEPControl_Writer.cxx
src/STEPControl/STEPControl_Writer.hxx
src/ShapeProcess/ShapeProcess.cxx
src/Transfer/Transfer_ActorOfFinderProcess.cxx
src/Transfer/Transfer_ActorOfFinderProcess.hxx
src/Transfer/Transfer_ActorOfTransientProcess.cxx
src/Transfer/Transfer_ActorOfTransientProcess.hxx
src/XSAlgo/XSAlgo_ShapeProcessor.cxx
src/XSAlgo/XSAlgo_ShapeProcessor.hxx
src/XSControl/XSControl_Reader.cxx
src/XSControl/XSControl_Reader.hxx
tests/de_wrapper/configuration/A3
tests/de_wrapper/configuration/A4

index 3c9e12af729592e24e872a883158fa6dd53d447b..cc308295a9a1afe7d59951011fd3e494a1c5f16e 100644 (file)
@@ -52,7 +52,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;
index c635ba7e86c2004df1a738f99f35e02c6398368f..ed343961266a596b7a4b7fe9f54fcd606447ce96 100644 (file)
@@ -285,32 +285,28 @@ Standard_Boolean IGESControl_Writer::Write(const Standard_CString file, const St
 
 //=============================================================================
 
-void IGESControl_Writer::SetShapeFixParameters(const ParameterMap& theParameters)
+void IGESControl_Writer::SetShapeFixParameters(
+  const XSAlgo_ShapeProcessor::ParameterMap& theParameters)
 {
   myShapeProcParams = theParameters;
 }
 
 //=============================================================================
 
-void IGESControl_Writer::SetShapeFixParameters(ParameterMap&& theParameters)
+void IGESControl_Writer::SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters)
 {
   myShapeProcParams = std::move(theParameters);
 }
 
 //=============================================================================
 
-void IGESControl_Writer::SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                               const ParameterMap&          theAdditionalParameters)
+void IGESControl_Writer::SetShapeFixParameters(
+  const DE_ShapeFixParameters&               theParameters,
+  const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters)
 {
-  myShapeProcParams.clear();
-  XSAlgo_ShapeProcessor::FillParameterMap(theParameters, true, myShapeProcParams);
-  for (const auto& aParam : theAdditionalParameters)
-  {
-    if (myShapeProcParams.find(aParam.first) == myShapeProcParams.end())
-    {
-      myShapeProcParams[aParam.first] = aParam.second;
-    }
-  }
+  XSAlgo_ShapeProcessor::SetShapeFixParameters(theParameters,
+                                               theAdditionalParameters,
+                                               myShapeProcParams);
 }
 
 //=============================================================================
@@ -325,7 +321,7 @@ void IGESControl_Writer::SetShapeProcessFlags(const ShapeProcess::OperationsFlag
 
 void IGESControl_Writer::InitializeMissingParameters()
 {
-  if (GetShapeFixParameters().empty())
+  if (GetShapeFixParameters().IsEmpty())
   {
     SetShapeFixParameters(DEIGES_Parameters::GetDefaultShapeFixParameters());
   }
index cce6e0e525bab49c15b13060ca0ee541dcfadec9..ec3e224d416ca8e68ee4dc75ea6a4d0780ad2cb4 100644 (file)
@@ -26,8 +26,7 @@
 #include <Standard_CString.hxx>
 #include <Standard_OStream.hxx>
 #include <Message_ProgressRange.hxx>
-
-#include <unordered_map>
+#include <XSAlgo_ShapeProcessor.hxx>
 
 struct DE_ShapeFixParameters;
 class Transfer_FinderProcess;
@@ -51,12 +50,6 @@ class IGESControl_Writer
 public:
   DEFINE_STANDARD_ALLOC
 
-  using ParameterMap = std::unordered_map<std::string, std::string>;
-  // Flags defining operations to be performed on shapes. Since there is no std::optional in C++11,
-  // we use a pair. The first element is the flags, the second element is a boolean value that
-  // indicates whether the flags were set.
-  using ProcessingFlags = std::pair<ShapeProcess::OperationsFlags, bool>;
-
 public:
   //! Creates a writer object with the
   //! default unit (millimeters) and write mode (Face).
@@ -126,12 +119,13 @@ public:
 
   //! Sets parameters for shape processing.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const ParameterMap& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(
+    const XSAlgo_ShapeProcessor::ParameterMap& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters are moved from the input map.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(ParameterMap&& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters from @p theParameters are copied to the internal map.
@@ -139,12 +133,16 @@ public:
   //! if they are not present in @p theParameters.
   //! @param theParameters the parameters for shape processing.
   //! @param theAdditionalParameters the additional parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                             const ParameterMap& theAdditionalParameters = {});
+  Standard_EXPORT void SetShapeFixParameters(
+    const DE_ShapeFixParameters&               theParameters,
+    const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters = {});
 
   //! Returns parameters for shape processing that was set by SetParameters() method.
   //! @return the parameters for shape processing. Empty map if no parameters were set.
-  inline const ParameterMap& GetShapeFixParameters() const { return myShapeProcParams; }
+  inline const XSAlgo_ShapeProcessor::ParameterMap& GetShapeFixParameters() const
+  {
+    return myShapeProcParams;
+  }
 
   //! Sets flags defining operations to be performed on shapes.
   //! @param theFlags The flags defining operations to be performed on shapes.
@@ -168,8 +166,10 @@ private:
   IGESData_BasicEditor           myEditor;
   Standard_Integer               myWriteMode;
   Standard_Boolean               myIsComputed;
-  ParameterMap                   myShapeProcParams; //!< Parameters for shape processing.
-  ProcessingFlags myShapeProcFlags; //!< Flags defining operations to be performed on shapes.
+  // clang-format off
+  XSAlgo_ShapeProcessor::ParameterMap myShapeProcParams;   //!< Parameters for shape processing.
+  XSAlgo_ShapeProcessor::ProcessingFlags myShapeProcFlags; //!< Flags defining operations to be performed on shapes.
+  // clang-format on
 };
 
 #endif // _IGESControl_Writer_HeaderFile
index 250eb79861efca8781e9a6a84a413ceaaa46db3e..563c89cbdc0b70e3b5633ed58149944e54f4381f 100644 (file)
@@ -199,7 +199,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer(const Handle(Standard_Transie
     // Set tolerances for shape processing.
     // These parameters are calculated inside IGESToBRep_Actor::Transfer() and cannot be set from
     // outside.
-    Transfer_ActorOfTransientProcess::ParameterMap aParameters = GetShapeFixParameters();
+    XSAlgo_ShapeProcessor::ParameterMap aParameters = GetShapeFixParameters();
     XSAlgo_ShapeProcessor::SetParameter("FixShape.Tolerance3d", theeps, true, aParameters);
     XSAlgo_ShapeProcessor::SetParameter("FixShape.MaxTolerance3d",
                                         CAS.GetMaxTol(),
index acdb58b8621e8122314ad1489f82600f331a85e2..a8ead9f5741b00c91537d531f1dae686f12f8472 100644 (file)
@@ -617,32 +617,28 @@ TopoDS_Shape IGESToBRep_Reader::OneShape() const
 
 //=============================================================================
 
-void IGESToBRep_Reader::SetShapeFixParameters(const ParameterMap& theParameters)
+void IGESToBRep_Reader::SetShapeFixParameters(
+  const XSAlgo_ShapeProcessor::ParameterMap& theParameters)
 {
   myShapeProcParams = theParameters;
 }
 
 //=============================================================================
 
-void IGESToBRep_Reader::SetShapeFixParameters(ParameterMap&& theParameters)
+void IGESToBRep_Reader::SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters)
 {
   myShapeProcParams = std::move(theParameters);
 }
 
 //=============================================================================
 
-void IGESToBRep_Reader::SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                              const ParameterMap&          theAdditionalParameters)
+void IGESToBRep_Reader::SetShapeFixParameters(
+  const DE_ShapeFixParameters&               theParameters,
+  const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters)
 {
-  myShapeProcParams.clear();
-  XSAlgo_ShapeProcessor::FillParameterMap(theParameters, true, myShapeProcParams);
-  for (const auto& aParam : theAdditionalParameters)
-  {
-    if (myShapeProcParams.find(aParam.first) == myShapeProcParams.end())
-    {
-      myShapeProcParams[aParam.first] = aParam.second;
-    }
-  }
+  XSAlgo_ShapeProcessor::SetShapeFixParameters(theParameters,
+                                               theAdditionalParameters,
+                                               myShapeProcParams);
 }
 
 //=============================================================================
@@ -657,7 +653,7 @@ void IGESToBRep_Reader::SetShapeProcessFlags(const ShapeProcess::OperationsFlags
 
 void IGESToBRep_Reader::InitializeMissingParameters()
 {
-  if (GetShapeFixParameters().empty())
+  if (GetShapeFixParameters().IsEmpty())
   {
     SetShapeFixParameters(DEIGES_Parameters::GetDefaultShapeFixParameters());
   }
index c064cce730c96c22b1f692844490d436c12fd55a..cc56eb5cb9a456c0673c92e35d2bfd0d9c4f4551 100644 (file)
@@ -25,8 +25,7 @@
 #include <Standard_Integer.hxx>
 #include <Standard_CString.hxx>
 #include <TopTools_SequenceOfShape.hxx>
-
-#include <unordered_map>
+#include <XSAlgo_ShapeProcessor.hxx>
 
 struct DE_ShapeFixParameters;
 class IGESData_IGESModel;
@@ -41,12 +40,6 @@ class IGESToBRep_Reader
 public:
   DEFINE_STANDARD_ALLOC
 
-  using ParameterMap = std::unordered_map<std::string, std::string>;
-  // Flags defining operations to be performed on shapes. Since there is no std::optional in C++11,
-  // we use a pair. The first element is the flags, the second element is a boolean value that
-  // indicates whether the flags were set.
-  using ProcessingFlags = std::pair<ShapeProcess::OperationsFlags, bool>;
-
 public:
   //! Creates a Reader
   Standard_EXPORT IGESToBRep_Reader();
@@ -120,12 +113,13 @@ public:
 
   //! Sets parameters for shape processing.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const ParameterMap& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(
+    const XSAlgo_ShapeProcessor::ParameterMap& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters are moved from the input map.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(ParameterMap&& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters from @p theParameters are copied to the internal map.
@@ -133,12 +127,16 @@ public:
   //! if they are not present in @p theParameters.
   //! @param theParameters the parameters for shape processing.
   //! @param theAdditionalParameters the additional parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                             const ParameterMap& theAdditionalParameters = {});
+  Standard_EXPORT void SetShapeFixParameters(
+    const DE_ShapeFixParameters&               theParameters,
+    const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters = {});
 
   //! Returns parameters for shape processing that was set by SetParameters() method.
   //! @return the parameters for shape processing. Empty map if no parameters were set.
-  inline const ParameterMap& GetShapeFixParameters() const { return myShapeProcParams; }
+  inline const XSAlgo_ShapeProcessor::ParameterMap& GetShapeFixParameters() const
+  {
+    return myShapeProcParams;
+  }
 
   //! Sets flags defining operations to be performed on shapes.
   //! @param theFlags The flags defining operations to be performed on shapes.
@@ -161,8 +159,10 @@ private:
   TopTools_SequenceOfShape          theShapes;
   Handle(IGESToBRep_Actor)          theActor;
   Handle(Transfer_TransientProcess) theProc;
-  ParameterMap                      myShapeProcParams; //!< Parameters for shape processing.
-  ProcessingFlags myShapeProcFlags; //!< Flags defining operations to be performed on shapes.
+  // clang-format off
+  XSAlgo_ShapeProcessor::ParameterMap myShapeProcParams; //!< Parameters for shape processing.
+  XSAlgo_ShapeProcessor::ProcessingFlags myShapeProcFlags; //!< Flags defining operations to be performed on shapes.
+  // clang-format on
 };
 
 #endif // _IGESToBRep_Reader_HeaderFile
index abe9db94647e386d435d0f847151c775f512aaf1..fa90a96f3552be8a0635ad6f814b35f7def8b80f 100644 (file)
@@ -5809,29 +5809,32 @@ Standard_Boolean STEPCAFControl_Reader::GetViewMode() const
 
 //=============================================================================
 
-void STEPCAFControl_Reader::SetShapeFixParameters(const ParameterMap& theParameters)
+void STEPCAFControl_Reader::SetShapeFixParameters(
+  const XSAlgo_ShapeProcessor::ParameterMap& theParameters)
 {
   myReader.SetShapeFixParameters(theParameters);
 }
 
 //=============================================================================
 
-void STEPCAFControl_Reader::SetShapeFixParameters(ParameterMap&& theParameters)
+void STEPCAFControl_Reader::SetShapeFixParameters(
+  XSAlgo_ShapeProcessor::ParameterMap&& theParameters)
 {
   myReader.SetShapeFixParameters(std::move(theParameters));
 }
 
 //=============================================================================
 
-void STEPCAFControl_Reader::SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                                  const ParameterMap& theAdditionalParameters)
+void STEPCAFControl_Reader::SetShapeFixParameters(
+  const DE_ShapeFixParameters&               theParameters,
+  const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters)
 {
   myReader.SetShapeFixParameters(theParameters, theAdditionalParameters);
 }
 
 //=============================================================================
 
-const STEPCAFControl_Reader::ParameterMap& STEPCAFControl_Reader::GetShapeFixParameters() const
+const XSAlgo_ShapeProcessor::ParameterMap& STEPCAFControl_Reader::GetShapeFixParameters() const
 {
   return myReader.GetShapeFixParameters();
 }
@@ -5845,7 +5848,7 @@ void STEPCAFControl_Reader::SetShapeProcessFlags(const ShapeProcess::OperationsF
 
 //=============================================================================
 
-const STEPCAFControl_Reader::ProcessingFlags& STEPCAFControl_Reader::GetShapeProcessFlags() const
+const XSAlgo_ShapeProcessor::ProcessingFlags& STEPCAFControl_Reader::GetShapeProcessFlags() const
 {
   return myReader.GetShapeProcessFlags();
 }
index b1a6562cc55fc75cc5443c5347f2dde5651c70ac..85bebe97ba4a044783ae08fc723ab1f4623ed551 100644 (file)
@@ -62,9 +62,6 @@ class STEPCAFControl_Reader
 public:
   DEFINE_STANDARD_ALLOC
 
-  using ParameterMap    = XSControl_Reader::ParameterMap;
-  using ProcessingFlags = XSControl_Reader::ProcessingFlags;
-
 public:
   //! Creates a reader with an empty
   //! STEP model and sets ColorMode, LayerMode, NameMode and
@@ -230,12 +227,13 @@ public:
 
   //! Sets parameters for shape processing.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const ParameterMap& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(
+    const XSAlgo_ShapeProcessor::ParameterMap& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters are moved from the input map.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(ParameterMap&& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters from @p theParameters are copied to the internal map.
@@ -243,12 +241,13 @@ public:
   //! if they are not present in @p theParameters.
   //! @param theParameters the parameters for shape processing.
   //! @param theAdditionalParameters the additional parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                             const ParameterMap& theAdditionalParameters = {});
+  Standard_EXPORT void SetShapeFixParameters(
+    const DE_ShapeFixParameters&               theParameters,
+    const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters = {});
 
   //! Returns parameters for shape processing that was set by SetParameters() method.
   //! @return the parameters for shape processing. Empty map if no parameters were set.
-  Standard_EXPORT const ParameterMap& GetShapeFixParameters() const;
+  Standard_EXPORT const XSAlgo_ShapeProcessor::ParameterMap& GetShapeFixParameters() const;
 
   //! Sets flags defining operations to be performed on shapes.
   //! @param theFlags The flags defining operations to be performed on shapes.
@@ -257,7 +256,7 @@ public:
   //! Returns flags defining operations to be performed on shapes.
   //! @return Pair of values defining operations to be performed on shapes and a boolean value
   //!         that indicates whether the flags were set.
-  Standard_EXPORT const ProcessingFlags& GetShapeProcessFlags() const;
+  Standard_EXPORT const XSAlgo_ShapeProcessor::ProcessingFlags& GetShapeProcessFlags() const;
 
 protected:
   //! Translates STEP file already loaded into the reader
index cc513d913e47666dd8c71ef4b0e6dff82ff649e2..1353c6d338167dd41ca345771c59d7b8874c9274 100644 (file)
@@ -539,29 +539,32 @@ Standard_Boolean STEPCAFControl_Writer::ExternFile(
 
 //=============================================================================
 
-void STEPCAFControl_Writer::SetShapeFixParameters(const ParameterMap& theParameters)
+void STEPCAFControl_Writer::SetShapeFixParameters(
+  const XSAlgo_ShapeProcessor::ParameterMap& theParameters)
 {
   myWriter.SetShapeFixParameters(theParameters);
 }
 
 //=============================================================================
 
-void STEPCAFControl_Writer::SetShapeFixParameters(ParameterMap&& theParameters)
+void STEPCAFControl_Writer::SetShapeFixParameters(
+  XSAlgo_ShapeProcessor::ParameterMap&& theParameters)
 {
   myWriter.SetShapeFixParameters(std::move(theParameters));
 }
 
 //=============================================================================
 
-void STEPCAFControl_Writer::SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                                  const ParameterMap& theAdditionalParameters)
+void STEPCAFControl_Writer::SetShapeFixParameters(
+  const DE_ShapeFixParameters&               theParameters,
+  const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters)
 {
   myWriter.SetShapeFixParameters(theParameters, theAdditionalParameters);
 }
 
 //=============================================================================
 
-const STEPCAFControl_Writer::ParameterMap& STEPCAFControl_Writer::GetShapeFixParameters() const
+const XSAlgo_ShapeProcessor::ParameterMap& STEPCAFControl_Writer::GetShapeFixParameters() const
 {
   return myWriter.GetShapeFixParameters();
 }
@@ -575,7 +578,7 @@ void STEPCAFControl_Writer::SetShapeProcessFlags(const ShapeProcess::OperationsF
 
 //=============================================================================
 
-const STEPCAFControl_Writer::ProcessingFlags& STEPCAFControl_Writer::GetShapeProcessFlags() const
+const XSAlgo_ShapeProcessor::ProcessingFlags& STEPCAFControl_Writer::GetShapeProcessFlags() const
 {
   return myWriter.GetShapeProcessFlags();
 }
index c0bb33c96cf9d6bf4fe7571c7762e5a358b39813..bfc0933e8a825167d35343759e2b35d81178c898 100644 (file)
@@ -52,9 +52,6 @@ class STEPCAFControl_Writer
 public:
   DEFINE_STANDARD_ALLOC
 
-  using ParameterMap    = STEPControl_Writer::ParameterMap;
-  using ProcessingFlags = STEPControl_Writer::ProcessingFlags;
-
 public:
   //! Creates a writer with an empty
   //! STEP model and sets ColorMode, LayerMode, NameMode and
@@ -231,12 +228,13 @@ public:
 
   //! Sets parameters for shape processing.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const ParameterMap& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(
+    const XSAlgo_ShapeProcessor::ParameterMap& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters are moved from the input map.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(ParameterMap&& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters from @p theParameters are copied to the internal map.
@@ -244,12 +242,13 @@ public:
   //! if they are not present in @p theParameters.
   //! @param theParameters the parameters for shape processing.
   //! @param theAdditionalParameters the additional parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                             const ParameterMap& theAdditionalParameters = {});
+  Standard_EXPORT void SetShapeFixParameters(
+    const DE_ShapeFixParameters&               theParameters,
+    const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters = {});
 
   //! Returns parameters for shape processing that was set by SetParameters() method.
   //! @return the parameters for shape processing. Empty map if no parameters were set.
-  Standard_EXPORT const ParameterMap& GetShapeFixParameters() const;
+  Standard_EXPORT const XSAlgo_ShapeProcessor::ParameterMap& GetShapeFixParameters() const;
 
   //! Sets flags defining operations to be performed on shapes.
   //! @param theFlags The flags defining operations to be performed on shapes.
@@ -258,7 +257,7 @@ public:
   //! Returns flags defining operations to be performed on shapes.
   //! @return Pair of values defining operations to be performed on shapes and a boolean value
   //!         that indicates whether the flags were set.
-  Standard_EXPORT const ProcessingFlags& GetShapeProcessFlags() const;
+  Standard_EXPORT const XSAlgo_ShapeProcessor::ProcessingFlags& GetShapeProcessFlags() const;
 
 protected:
   //! Transfers labels to a STEP model
index 8647ec0d71c6e6d67ae6856ab1420fba86b574f3..2f365aac50719d54b0ad1c76c7317b13109694be 100644 (file)
@@ -1000,13 +1000,10 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
     // Set tolerances for shape processing.
     // These parameters are calculated inside STEPControl_ActorRead::Transfer() and cannot be set
     // from outside.
-    Transfer_ActorOfTransientProcess::ParameterMap aParameters = GetShapeFixParameters();
+    XSAlgo_ShapeProcessor::ParameterMap aParameters = GetShapeFixParameters();
     XSAlgo_ShapeProcessor::SetParameter("FixShape.Tolerance3d", myPrecision, true, aParameters);
     XSAlgo_ShapeProcessor::SetParameter("FixShape.MaxTolerance3d", myMaxTol, true, aParameters);
-    XSAlgo_ShapeProcessor::SetParameter("FixShape.NonManifold",
-                                        std::to_string(true),
-                                        true,
-                                        aParameters);
+    XSAlgo_ShapeProcessor::SetParameter("FixShape.NonManifold", "1", true, aParameters);
     XSAlgo_ShapeProcessor aShapeProcessor(aParameters);
     TopoDS_Shape          fixedResult =
       aShapeProcessor.ProcessShape(comp, GetProcessingFlags().first, aPS1.Next());
@@ -1698,7 +1695,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
       // Set tolerances for shape processing.
       // These parameters are calculated inside STEPControl_ActorRead::Transfer() and cannot be set
       // from outside.
-      Transfer_ActorOfTransientProcess::ParameterMap aParameters = GetShapeFixParameters();
+      XSAlgo_ShapeProcessor::ParameterMap aParameters = GetShapeFixParameters();
       XSAlgo_ShapeProcessor::SetParameter("FixShape.Tolerance3d", myPrecision, true, aParameters);
       XSAlgo_ShapeProcessor::SetParameter("FixShape.MaxTolerance3d", myMaxTol, true, aParameters);
       XSAlgo_ShapeProcessor aShapeProcessor(aParameters);
@@ -1885,7 +1882,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
     {
       TopoDS_Shape S = sb->Result();
 
-      Transfer_ActorOfTransientProcess::ParameterMap aParameters = GetShapeFixParameters();
+      XSAlgo_ShapeProcessor::ParameterMap aParameters = GetShapeFixParameters();
       XSAlgo_ShapeProcessor::SetParameter("FixShape.Tolerance3d", myPrecision, true, aParameters);
       XSAlgo_ShapeProcessor::SetParameter("FixShape.MaxTolerance3d", myMaxTol, true, aParameters);
       XSAlgo_ShapeProcessor aShapeProcessor(aParameters);
index 283c43e1b0b2ced981a2ebfd6f8b06ade5bc4db3..4f4b1e0dc161fe75d32db26b8ad84f80e0e75cf4 100644 (file)
@@ -1045,7 +1045,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape(
 
     TopoDS_Shape aShape = xShape;
 
-    Transfer_ActorOfFinderProcess::ParameterMap aParameters = GetShapeFixParameters();
+    XSAlgo_ShapeProcessor::ParameterMap aParameters = GetShapeFixParameters();
     XSAlgo_ShapeProcessor::SetParameter("FixShape.Tolerance3d", Tol, true, aParameters);
     XSAlgo_ShapeProcessor::SetParameter("FixShape.MaxTolerance3d",
                                         aStepModel->InternalParameters.ReadMaxPrecisionVal,
index 2437a66de5f66193bad4a2d67129d522df1ad0b2..6484ec6ff10f8741c00acc6ba82133ef23ce81e9 100644 (file)
@@ -199,7 +199,8 @@ void STEPControl_Writer::PrintStatsTransfer(const Standard_Integer what,
 
 //=============================================================================
 
-void STEPControl_Writer::SetShapeFixParameters(const ParameterMap& theParameters)
+void STEPControl_Writer::SetShapeFixParameters(
+  const XSAlgo_ShapeProcessor::ParameterMap& theParameters)
 {
   if (Handle(Transfer_ActorOfFinderProcess) anActor = GetActor())
   {
@@ -209,7 +210,7 @@ void STEPControl_Writer::SetShapeFixParameters(const ParameterMap& theParameters
 
 //=============================================================================
 
-void STEPControl_Writer::SetShapeFixParameters(ParameterMap&& theParameters)
+void STEPControl_Writer::SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters)
 {
   if (Handle(Transfer_ActorOfFinderProcess) anActor = GetActor())
   {
@@ -219,8 +220,9 @@ void STEPControl_Writer::SetShapeFixParameters(ParameterMap&& theParameters)
 
 //=============================================================================
 
-void STEPControl_Writer::SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                               const ParameterMap&          theAdditionalParameters)
+void STEPControl_Writer::SetShapeFixParameters(
+  const DE_ShapeFixParameters&               theParameters,
+  const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters)
 {
   if (Handle(Transfer_ActorOfFinderProcess) anActor = GetActor())
   {
@@ -230,10 +232,10 @@ void STEPControl_Writer::SetShapeFixParameters(const DE_ShapeFixParameters& theP
 
 //=============================================================================
 
-const STEPControl_Writer::ParameterMap& STEPControl_Writer::GetShapeFixParameters() const
+const XSAlgo_ShapeProcessor::ParameterMap& STEPControl_Writer::GetShapeFixParameters() const
 {
-  static const ParameterMap                   anEmptyMap;
-  const Handle(Transfer_ActorOfFinderProcess) anActor = GetActor();
+  static const XSAlgo_ShapeProcessor::ParameterMap anEmptyMap;
+  const Handle(Transfer_ActorOfFinderProcess)      anActor = GetActor();
   return anActor.IsNull() ? anEmptyMap : anActor->GetShapeFixParameters();
 }
 
@@ -249,10 +251,10 @@ void STEPControl_Writer::SetShapeProcessFlags(const ShapeProcess::OperationsFlag
 
 //=============================================================================
 
-const STEPControl_Writer::ProcessingFlags& STEPControl_Writer::GetShapeProcessFlags() const
+const XSAlgo_ShapeProcessor::ProcessingFlags& STEPControl_Writer::GetShapeProcessFlags() const
 {
-  static const ProcessingFlags                anEmptyFlags;
-  const Handle(Transfer_ActorOfFinderProcess) anActor = GetActor();
+  static const XSAlgo_ShapeProcessor::ProcessingFlags anEmptyFlags;
+  const Handle(Transfer_ActorOfFinderProcess)         anActor = GetActor();
   return anActor.IsNull() ? anEmptyFlags : anActor->GetShapeProcessFlags();
 }
 
@@ -279,7 +281,7 @@ Handle(Transfer_ActorOfFinderProcess) STEPControl_Writer::GetActor() const
 
 void STEPControl_Writer::InitializeMissingParameters()
 {
-  if (GetShapeFixParameters().empty())
+  if (GetShapeFixParameters().IsEmpty())
   {
     SetShapeFixParameters(DESTEP_Parameters::GetDefaultShapeFixParameters());
   }
index 5c7905095d3ad246578e3028971288ae50354199..81c706f6514b8ce30c3ca4b480f88d0e14df2113 100644 (file)
@@ -27,6 +27,7 @@
 #include <STEPControl_StepModelType.hxx>
 #include <Standard_Integer.hxx>
 #include <Message_ProgressRange.hxx>
+#include <XSAlgo_ShapeProcessor.hxx>
 
 #include <unordered_map>
 
@@ -46,12 +47,6 @@ class STEPControl_Writer
 public:
   DEFINE_STANDARD_ALLOC
 
-  using ParameterMap = std::unordered_map<std::string, std::string>;
-  // Flags defining operations to be performed on shapes. Since there is no std::optional in C++11,
-  // we use a pair. The first element is the flags, the second element is a boolean value that
-  // indicates whether the flags were set.
-  using ProcessingFlags = std::pair<ShapeProcess::OperationsFlags, bool>;
-
   //! Creates a Writer from scratch
   Standard_EXPORT STEPControl_Writer();
 
@@ -138,12 +133,13 @@ public:
 
   //! Sets parameters for shape processing.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const ParameterMap& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(
+    const XSAlgo_ShapeProcessor::ParameterMap& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters are moved from the input map.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(ParameterMap&& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters from @p theParameters are copied to the internal map.
@@ -151,12 +147,13 @@ public:
   //! if they are not present in @p theParameters.
   //! @param theParameters the parameters for shape processing.
   //! @param theAdditionalParameters the additional parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                             const ParameterMap& theAdditionalParameters = {});
+  Standard_EXPORT void SetShapeFixParameters(
+    const DE_ShapeFixParameters&               theParameters,
+    const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters = {});
 
   //! Returns parameters for shape processing that was set by SetParameters() method.
   //! @return the parameters for shape processing. Empty map if no parameters were set.
-  Standard_EXPORT const ParameterMap& GetShapeFixParameters() const;
+  Standard_EXPORT const XSAlgo_ShapeProcessor::ParameterMap& GetShapeFixParameters() const;
 
   //! Sets flags defining operations to be performed on shapes.
   //! @param theFlags The flags defining operations to be performed on shapes.
@@ -165,7 +162,7 @@ public:
   //! Returns flags defining operations to be performed on shapes.
   //! @return Pair of values defining operations to be performed on shapes and a boolean value
   //!         that indicates whether the flags were set.
-  Standard_EXPORT const ProcessingFlags& GetShapeProcessFlags() const;
+  Standard_EXPORT const XSAlgo_ShapeProcessor::ProcessingFlags& GetShapeProcessFlags() const;
 
 private:
   //! Returns the Actor for the Transfer of an Entity.
index 4d7fcb670bd8a94861d2391549f4ba80e47266e6..dd56dd78d03dca8ad2b982a4c2023bb05696ab09 100644 (file)
@@ -180,9 +180,9 @@ Standard_Boolean ShapeProcess::Perform(const Handle(ShapeProcess_Context)& conte
 
 //=================================================================================================
 
-Standard_Boolean ShapeProcess::Perform(const Handle(ShapeProcess_Context)& theContext,
-                                       const OperationsFlags&              theOperations,
-                                       const Message_ProgressRange&        theProgress)
+Standard_Boolean ShapeProcess::Perform(const Handle(ShapeProcess_Context)&  theContext,
+                                       const ShapeProcess::OperationsFlags& theOperations,
+                                       const Message_ProgressRange&         theProgress)
 {
   if (!theContext)
   {
@@ -246,7 +246,7 @@ std::pair<ShapeProcess::Operation, bool> ShapeProcess::ToOperationFlag(const cha
 //=================================================================================================
 
 std::vector<std::pair<const char*, Handle(ShapeProcess_Operator)>> ShapeProcess::getOperators(
-  const OperationsFlags& theFlags)
+  const ShapeProcess::OperationsFlags& theFlags)
 {
   std::vector<std::pair<const char*, Handle(ShapeProcess_Operator)>> aResult;
   for (std::underlying_type<Operation>::type anOperation = Operation::First;
index 4e94b8e2b8a95690b518a0dbfc5ce460c0ba5897..c286b0966111d1e1479b801fb9db872877c8a914 100644 (file)
@@ -76,14 +76,16 @@ Handle(Standard_Transient) Transfer_ActorOfFinderProcess::TransferTransient(
 
 //=============================================================================
 
-void Transfer_ActorOfFinderProcess::SetShapeFixParameters(const ParameterMap& theParameters)
+void Transfer_ActorOfFinderProcess::SetShapeFixParameters(
+  const XSAlgo_ShapeProcessor::ParameterMap& theParameters)
 {
   myShapeProcParams = theParameters;
 }
 
 //=============================================================================
 
-void Transfer_ActorOfFinderProcess::SetShapeFixParameters(ParameterMap&& theParameters)
+void Transfer_ActorOfFinderProcess::SetShapeFixParameters(
+  XSAlgo_ShapeProcessor::ParameterMap&& theParameters)
 {
   myShapeProcParams = std::move(theParameters);
 }
@@ -91,18 +93,12 @@ void Transfer_ActorOfFinderProcess::SetShapeFixParameters(ParameterMap&& thePara
 //=============================================================================
 
 void Transfer_ActorOfFinderProcess::SetShapeFixParameters(
-  const DE_ShapeFixParameters& theParameters,
-  const ParameterMap&          theAdditionalParameters)
+  const DE_ShapeFixParameters&               theParameters,
+  const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters)
 {
-  myShapeProcParams.clear();
-  XSAlgo_ShapeProcessor::FillParameterMap(theParameters, true, myShapeProcParams);
-  for (const auto& aParam : theAdditionalParameters)
-  {
-    if (myShapeProcParams.find(aParam.first) == myShapeProcParams.end())
-    {
-      myShapeProcParams[aParam.first] = aParam.second;
-    }
-  }
+  XSAlgo_ShapeProcessor::SetShapeFixParameters(theParameters,
+                                               theAdditionalParameters,
+                                               myShapeProcParams);
 }
 
 //=============================================================================
index 87603c46cb801e9ef14ebb66b64aad96797fe867..be4b675557c4ac48069e968c449972fb416b9ed3 100644 (file)
@@ -20,8 +20,7 @@
 #include <Standard.hxx>
 #include <ShapeProcess.hxx>
 #include <Transfer_ActorOfProcessForFinder.hxx>
-
-#include <unordered_map>
+#include <XSAlgo_ShapeProcessor.hxx>
 
 struct DE_ShapeFixParameters;
 class Transfer_Binder;
@@ -39,13 +38,6 @@ DEFINE_STANDARD_HANDLE(Transfer_ActorOfFinderProcess, Transfer_ActorOfProcessFor
 //! a user. To be interpreted for each norm
 class Transfer_ActorOfFinderProcess : public Transfer_ActorOfProcessForFinder
 {
-public:
-  using ParameterMap = std::unordered_map<std::string, std::string>;
-  // Flags defining operations to be performed on shapes. Since there is no std::optional in C++11,
-  // we use a pair. The first element is the flags, the second element is a boolean value that
-  // indicates whether the flags were set.
-  using ProcessingFlags = std::pair<ShapeProcess::OperationsFlags, bool>;
-
 public:
   Standard_EXPORT Transfer_ActorOfFinderProcess();
 
@@ -69,12 +61,13 @@ public:
 
   //! Sets parameters for shape processing.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const ParameterMap& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(
+    const XSAlgo_ShapeProcessor::ParameterMap& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters are moved from the input map.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(ParameterMap&& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters from @p theParameters are copied to the internal map.
@@ -82,12 +75,16 @@ public:
   //! if they are not present in @p theParameters.
   //! @param theParameters the parameters for shape processing.
   //! @param theAdditionalParameters the additional parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                             const ParameterMap& theAdditionalParameters = {});
+  Standard_EXPORT void SetShapeFixParameters(
+    const DE_ShapeFixParameters&               theParameters,
+    const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters = {});
 
   //! Returns parameters for shape processing that was set by SetParameters() method.
   //! @return the parameters for shape processing. Empty map if no parameters were set.
-  inline const ParameterMap& GetShapeFixParameters() const { return myShapeProcParams; }
+  inline const XSAlgo_ShapeProcessor::ParameterMap& GetShapeFixParameters() const
+  {
+    return myShapeProcParams;
+  }
 
   //! Sets flags defining operations to be performed on shapes.
   //! @param theFlags The flags defining operations to be performed on shapes.
@@ -96,7 +93,10 @@ public:
   //! Returns flags defining operations to be performed on shapes.
   //! @return Pair of values defining operations to be performed on shapes and a boolean value
   //!         that indicates whether the flags were set.
-  inline const ProcessingFlags& GetShapeProcessFlags() const { return myShapeProcFlags; }
+  inline const XSAlgo_ShapeProcessor::ProcessingFlags& GetShapeProcessFlags() const
+  {
+    return myShapeProcFlags;
+  }
 
   DEFINE_STANDARD_RTTIEXT(Transfer_ActorOfFinderProcess, Transfer_ActorOfProcessForFinder)
 
@@ -104,8 +104,10 @@ protected:
   Standard_Integer themodetrans;
 
 private:
-  ParameterMap    myShapeProcParams; //!< Parameters for shape processing.
-  ProcessingFlags myShapeProcFlags;  //!< Flags defining operations to be performed on shapes.
+  // clang-format off
+  XSAlgo_ShapeProcessor::ParameterMap myShapeProcParams;   //!< Parameters for shape processing.
+  XSAlgo_ShapeProcessor::ProcessingFlags myShapeProcFlags; //!< Flags defining operations to be performed on shapes.
+  // clang-format on
 };
 
 #endif // _Transfer_ActorOfFinderProcess_HeaderFile
index 520beabbfe9ba300de85517c615b32b590e490d1..163c7b83660c9bb46cb61677c3beae8220e05932 100644 (file)
@@ -58,14 +58,16 @@ Handle(Standard_Transient) Transfer_ActorOfTransientProcess::TransferTransient(
 
 //=============================================================================
 
-void Transfer_ActorOfTransientProcess::SetShapeFixParameters(const ParameterMap& theParameters)
+void Transfer_ActorOfTransientProcess::SetShapeFixParameters(
+  const XSAlgo_ShapeProcessor::ParameterMap& theParameters)
 {
   myShapeProcParams = theParameters;
 }
 
 //=============================================================================
 
-void Transfer_ActorOfTransientProcess::SetShapeFixParameters(ParameterMap&& theParameters)
+void Transfer_ActorOfTransientProcess::SetShapeFixParameters(
+  XSAlgo_ShapeProcessor::ParameterMap&& theParameters)
 {
   myShapeProcParams = std::move(theParameters);
 }
@@ -73,18 +75,12 @@ void Transfer_ActorOfTransientProcess::SetShapeFixParameters(ParameterMap&& theP
 //=============================================================================
 
 void Transfer_ActorOfTransientProcess::SetShapeFixParameters(
-  const DE_ShapeFixParameters& theParameters,
-  const ParameterMap&          theAdditionalParameters)
+  const DE_ShapeFixParameters&               theParameters,
+  const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters)
 {
-  myShapeProcParams.clear();
-  XSAlgo_ShapeProcessor::FillParameterMap(theParameters, true, myShapeProcParams);
-  for (const auto& aParam : theAdditionalParameters)
-  {
-    if (myShapeProcParams.find(aParam.first) == myShapeProcParams.end())
-    {
-      myShapeProcParams[aParam.first] = aParam.second;
-    }
-  }
+  XSAlgo_ShapeProcessor::SetShapeFixParameters(theParameters,
+                                               theAdditionalParameters,
+                                               myShapeProcParams);
 }
 
 //=============================================================================
index c226423abbea3c5e1148890e9cc47804fea5ae5b..650c48d8da39c76189bf631dc5e6b46601a100f6 100644 (file)
@@ -20,8 +20,7 @@
 #include <ShapeProcess.hxx>
 #include <Standard.hxx>
 #include <Transfer_ActorOfProcessForTransient.hxx>
-
-#include <unordered_map>
+#include <XSAlgo_ShapeProcessor.hxx>
 
 struct DE_ShapeFixParameters;
 class Transfer_Binder;
@@ -35,13 +34,6 @@ DEFINE_STANDARD_HANDLE(Transfer_ActorOfTransientProcess, Transfer_ActorOfProcess
 //! The original class was renamed. Compatibility only
 class Transfer_ActorOfTransientProcess : public Transfer_ActorOfProcessForTransient
 {
-public:
-  using ParameterMap = std::unordered_map<std::string, std::string>;
-  // Flags defining operations to be performed on shapes. Since there is no std::optional in C++11,
-  // we use a pair. The first element is the flags, the second element is a boolean value that
-  // indicates whether the flags were set.
-  using ProcessingFlags = std::pair<ShapeProcess::OperationsFlags, bool>;
-
 public:
   Standard_EXPORT Transfer_ActorOfTransientProcess();
 
@@ -62,12 +54,13 @@ public:
 
   //! Sets parameters for shape processing.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const ParameterMap& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(
+    const XSAlgo_ShapeProcessor::ParameterMap& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters are moved from the input map.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(ParameterMap&& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters from @p theParameters are copied to the internal map.
@@ -75,12 +68,16 @@ public:
   //! if they are not present in @p theParameters.
   //! @param theParameters the parameters for shape processing.
   //! @param theAdditionalParameters the additional parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                             const ParameterMap& theAdditionalParameters = {});
+  Standard_EXPORT void SetShapeFixParameters(
+    const DE_ShapeFixParameters&               theParameters,
+    const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters = {});
 
   //! Returns parameters for shape processing that was set by SetParameters() method.
   //! @return the parameters for shape processing. Empty map if no parameters were set.
-  inline const ParameterMap& GetShapeFixParameters() const { return myShapeProcParams; }
+  inline const XSAlgo_ShapeProcessor::ParameterMap& GetShapeFixParameters() const
+  {
+    return myShapeProcParams;
+  }
 
   //! Sets flags defining operations to be performed on shapes.
   //! @param theFlags The flags defining operations to be performed on shapes.
@@ -90,13 +87,18 @@ public:
   //! @return Pair: the flags defining operations to be performed on shapes and a boolean value that
   //! indicates
   //!         whether the flags were set.
-  inline const ProcessingFlags& GetProcessingFlags() const { return myShapeProcFlags; }
+  inline const XSAlgo_ShapeProcessor::ProcessingFlags& GetProcessingFlags() const
+  {
+    return myShapeProcFlags;
+  }
 
   DEFINE_STANDARD_RTTIEXT(Transfer_ActorOfTransientProcess, Transfer_ActorOfProcessForTransient)
 
 private:
-  ParameterMap    myShapeProcParams; //!< Parameters for shape processing.
-  ProcessingFlags myShapeProcFlags;  //!< Flags defining operations to be performed on shapes.
+  // clang-format off
+  XSAlgo_ShapeProcessor::ParameterMap myShapeProcParams; //!< Parameters for shape processing.
+  XSAlgo_ShapeProcessor::ProcessingFlags myShapeProcFlags; //!< Flags defining operations to be performed on shapes.
+  // clang-format on
 };
 
 #endif // _Transfer_ActorOfTransientProcess_HeaderFile
index f8dc1210976c67a4dd2dee366051ac95a57b1cc4..511bb08b3a13096eee073c54541daad85b045623 100644 (file)
 #include <sstream>
 #include <unordered_set>
 
-namespace
-{
-//! Function to split a string based on multiple delimiters.
-//! @param aString String to split.
-//! @param delimiters Set of delimiters.
-//! @return Vector of tokens.
-std::vector<std::string> splitString(const std::string&              aString,
-                                     const std::unordered_set<char>& delimiters)
-{
-  std::vector<std::string> aResult;
-  std::string              aCurrentToken;
-
-  for (char aCurrentCharacter : aString)
-  {
-    if (delimiters.find(aCurrentCharacter) != delimiters.end())
-    {
-      if (!aCurrentToken.empty())
-      {
-        aResult.emplace_back(std::move(aCurrentToken));
-        aCurrentToken.clear();
-      }
-    }
-    else
-    {
-      aCurrentToken += aCurrentCharacter;
-    }
-  }
-
-  if (!aCurrentToken.empty())
-  {
-    aResult.emplace_back(std::move(aCurrentToken));
-  }
-
-  return aResult;
-}
-} // namespace
-
 //=============================================================================
 
-XSAlgo_ShapeProcessor::XSAlgo_ShapeProcessor(const ParameterMap&          theParameters,
-                                             const DE_ShapeFixParameters& theShapeFixParameters)
+XSAlgo_ShapeProcessor::XSAlgo_ShapeProcessor(
+  const XSAlgo_ShapeProcessor::ParameterMap& theParameters,
+  const DE_ShapeFixParameters&               theShapeFixParameters)
     : myParameters(theParameters)
 {
   FillParameterMap(theShapeFixParameters, false, myParameters);
@@ -89,16 +53,16 @@ XSAlgo_ShapeProcessor::XSAlgo_ShapeProcessor(const ParameterMap&          thePar
 
 XSAlgo_ShapeProcessor::XSAlgo_ShapeProcessor(const DE_ShapeFixParameters& theParameters)
 {
-  ParameterMap aMap;
+  XSAlgo_ShapeProcessor::ParameterMap aMap;
   FillParameterMap(theParameters, false, aMap);
   myParameters = aMap;
 }
 
 //=============================================================================
 
-TopoDS_Shape XSAlgo_ShapeProcessor::ProcessShape(const TopoDS_Shape&          theShape,
-                                                 const OperationsFlags&       theOperations,
-                                                 const Message_ProgressRange& theProgress)
+TopoDS_Shape XSAlgo_ShapeProcessor::ProcessShape(const TopoDS_Shape&                  theShape,
+                                                 const ShapeProcess::OperationsFlags& theOperations,
+                                                 const Message_ProgressRange&         theProgress)
 {
   if (theShape.IsNull())
   {
@@ -115,24 +79,25 @@ TopoDS_Shape XSAlgo_ShapeProcessor::ProcessShape(const TopoDS_Shape&          th
 void XSAlgo_ShapeProcessor::initializeContext(const TopoDS_Shape& theShape)
 {
   myContext = new ShapeProcess_ShapeContext(theShape, nullptr);
-  for (const auto& aParameter : myParameters)
+  for (XSAlgo_ShapeProcessor::ParameterMap::Iterator aParameterIter(myParameters);
+       aParameterIter.More();
+       aParameterIter.Next())
   {
-    myContext->ResourceManager()->SetResource(aParameter.first.c_str(), aParameter.second.c_str());
+    myContext->ResourceManager()->SetResource(aParameterIter.Key().ToCString(),
+                                              aParameterIter.Value().ToCString());
   }
   // Read and set detalization level.
-  auto aDetalizationLevelPtr = myParameters.find("DetalizationLevel");
-  if (aDetalizationLevelPtr != myParameters.end())
+  TCollection_AsciiString aResult;
+  if (myParameters.Find("DetalizationLevel", aResult) && aResult.IsIntegerValue())
   {
     const TopAbs_ShapeEnum aDetalizationLevel =
-      static_cast<TopAbs_ShapeEnum>(std::stoi(aDetalizationLevelPtr->second.c_str()));
+      static_cast<TopAbs_ShapeEnum>(aResult.IntegerValue());
     myContext->SetDetalisation(aDetalizationLevel);
   }
   // Read and set non-manifold flag.
-  auto aNonManifoldPtr = myParameters.find("NonManifold");
-  if (aNonManifoldPtr != myParameters.end())
+  if (myParameters.Find("NonManifold", aResult) && aResult.IsIntegerValue())
   {
-    const Standard_Boolean aNonManifold =
-      static_cast<Standard_Boolean>(std::stoi(aNonManifoldPtr->second.c_str()));
+    const Standard_Boolean aNonManifold = static_cast<Standard_Boolean>(aResult.IntegerValue());
     myContext->SetNonManifold(aNonManifold);
   }
 }
@@ -547,10 +512,10 @@ Standard_Boolean XSAlgo_ShapeProcessor::CheckPCurve(const TopoDS_Edge&     theEd
 //=============================================================================
 
 XSAlgo_ShapeProcessor::ProcessingData XSAlgo_ShapeProcessor::ReadProcessingData(
-  const std::string& theFileResourceName,
-  const std::string& theScopeResourceName)
+  const TCollection_AsciiString& theFileResourceName,
+  const TCollection_AsciiString& theScopeResourceName)
 {
-  const Standard_CString            aFileName = Interface_Static::CVal(theFileResourceName.c_str());
+  const Standard_CString aFileName = Interface_Static::CVal(theFileResourceName.ToCString());
   Handle(ShapeProcess_ShapeContext) aContext =
     new ShapeProcess_ShapeContext(TopoDS_Shape(), aFileName);
   if (!aContext->ResourceManager()->IsInitialized())
@@ -558,45 +523,49 @@ XSAlgo_ShapeProcessor::ProcessingData XSAlgo_ShapeProcessor::ReadProcessingData(
     // If resource file wasn't found, use static values instead
     Interface_Static::FillMap(aContext->ResourceManager()->GetMap());
   }
-  const std::string aScope = Interface_Static::CVal(theScopeResourceName.c_str());
+  const TCollection_AsciiString aScope = Interface_Static::CVal(theScopeResourceName.ToCString());
 
   // Copy parameters to the result.
-  ParameterMap                                    aResultParameters;
-  OperationsFlags                                 aResultFlags;
+  XSAlgo_ShapeProcessor::ParameterMap             aResultParameters;
+  ShapeProcess::OperationsFlags                   aResultFlags;
   const Resource_DataMapOfAsciiStringAsciiString& aMap = aContext->ResourceManager()->GetMap();
-  using RMapIter = Resource_DataMapOfAsciiStringAsciiString::Iterator;
-  for (RMapIter anIter(aMap); anIter.More(); anIter.Next())
+
+  for (Resource_DataMapOfAsciiStringAsciiString::Iterator anIter(aMap); anIter.More();
+       anIter.Next())
   {
-    std::string  aKey           = anIter.Key().ToCString();
-    const size_t aScopePosition = aKey.find(aScope);
-    if (aScopePosition != 0)
+    TCollection_AsciiString aKey = anIter.Key();
+    if (!aKey.StartsWith(aScope))
     {
       // Ignore all parameters that don't start with the specified scope.
       continue;
     }
-    // Remove the scope from the key + 1 for the dot.
+
+    // Remove scope prefix and dot
     // "FromIGES.FixShape.FixFreeFaceMode" -> "FixShape.FixFreeFaceMode"
-    aKey.erase(0, aScope.size() + 1);
-    if (aKey != "exec.op")
-    {
-      // If it is not an operation flag, add it to the parameters.
-      aResultParameters[aKey] = anIter.Value().ToCString();
-    }
-    else
+    aKey = aKey.SubString(aScope.Length() + 2, aKey.Length());
+
+    if (aKey.IsEqual("exec.op"))
     {
-      // Parse operations flags.
-      const std::vector<std::string> anOperationStrings =
-        splitString(anIter.Value().ToCString(), {' ', '\t', ',', ';'});
-      for (const auto& anOperationString : anOperationStrings)
+      // Parse operation flags using Token method
+      Standard_Integer              aTokenCount = 1;
+      TCollection_AsciiString       aToken;
+      const TCollection_AsciiString aSeparators(" \t,;");
+
+      while (!(aToken = anIter.Value().Token(aSeparators.ToCString(), aTokenCount)).IsEmpty())
       {
-        std::pair<ShapeProcess::Operation, bool> anOperationFlag =
-          ShapeProcess::ToOperationFlag(anOperationString.c_str());
+        std::pair<ShapeProcess::Operation, Standard_Boolean> anOperationFlag =
+          ShapeProcess::ToOperationFlag(aToken.ToCString());
         if (anOperationFlag.second)
         {
           aResultFlags.set(anOperationFlag.first);
         }
+        aTokenCount++;
       }
     }
+    else
+    {
+      aResultParameters.Bind(aKey, anIter.Value());
+    }
   }
   return {aResultParameters, aResultFlags};
 }
@@ -611,10 +580,13 @@ void XSAlgo_ShapeProcessor::FillParameterMap(const DE_ShapeFixParameters&
   SetParameter("FixShape.MaxTolerance3d", theParameters.MaxTolerance3d, theIsReplace, theMap);
   SetParameter("FixShape.MinTolerance3d", theParameters.MinTolerance3d, theIsReplace, theMap);
   SetParameter("DetalizationLevel",
-               std::to_string(theParameters.DetalizationLevel),
+               TCollection_AsciiString(static_cast<int>(theParameters.DetalizationLevel)),
+               theIsReplace,
+               theMap);
+  SetParameter("NonManifold",
+               TCollection_AsciiString(static_cast<int>(theParameters.NonManifold)),
                theIsReplace,
                theMap);
-  SetParameter("NonManifold", std::to_string(theParameters.NonManifold), theIsReplace, theMap);
   SetParameter("FixShape.FixFreeShellMode", theParameters.FixFreeShellMode, theIsReplace, theMap);
   SetParameter("FixShape.FixFreeFaceMode", theParameters.FixFreeFaceMode, theIsReplace, theMap);
   SetParameter("FixShape.FixFreeWireMode", theParameters.FixFreeWireMode, theIsReplace, theMap);
@@ -743,48 +715,66 @@ void XSAlgo_ShapeProcessor::FillParameterMap(const DE_ShapeFixParameters&
 
 //=============================================================================
 
-void XSAlgo_ShapeProcessor::SetParameter(const char*                    theKey,
-                                         DE_ShapeFixParameters::FixMode theValue,
-                                         const bool                     theIsReplace,
-                                         ParameterMap&                  theMap)
+void XSAlgo_ShapeProcessor::SetShapeFixParameters(
+  const DE_ShapeFixParameters&               theParameters,
+  const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters,
+  XSAlgo_ShapeProcessor::ParameterMap&       theTargetParameterMap)
 {
-  SetParameter(theKey,
-               std::to_string(
-                 static_cast<std::underlying_type<DE_ShapeFixParameters::FixMode>::type>(theValue)),
-               theIsReplace,
-               theMap);
+  theTargetParameterMap.Clear();
+  XSAlgo_ShapeProcessor::FillParameterMap(theParameters, true, theTargetParameterMap);
+  for (XSAlgo_ShapeProcessor::ParameterMap::Iterator aParamIter(theAdditionalParameters);
+       aParamIter.More();
+       aParamIter.Next())
+  {
+    if (!theTargetParameterMap.IsBound(aParamIter.Key()))
+    {
+      theTargetParameterMap.Bind(aParamIter.Key(), aParamIter.Value());
+    }
+  }
 }
 
 //=============================================================================
 
-void XSAlgo_ShapeProcessor::SetParameter(const char*   theKey,
-                                         double        theValue,
-                                         const bool    theIsReplace,
-                                         ParameterMap& theMap)
+void XSAlgo_ShapeProcessor::SetParameter(const char*                          theKey,
+                                         const DE_ShapeFixParameters::FixMode theValue,
+                                         const bool                           theIsReplace,
+                                         XSAlgo_ShapeProcessor::ParameterMap& theMap)
 {
-  // Note that conversion with std::to_string() here is not possible, since it normally preserves
-  // only first 6 digits (before C++26). As a result, any value of 1e-7 or below will turn into 0.
-  // By using std::ostringstream with std::setprecision(6) formatting we will preserve first 6
-  // SIGNIFICANT digits.
-  std::ostringstream aStrStream;
-  aStrStream << std::setprecision(6) << theValue;
-  SetParameter(theKey, aStrStream.str(), theIsReplace, theMap);
+  SetParameter(
+    theKey,
+    TCollection_AsciiString(static_cast<int>(
+      static_cast<std::underlying_type<DE_ShapeFixParameters::FixMode>::type>(theValue))),
+    theIsReplace,
+    theMap);
 }
 
 //=============================================================================
 
-void XSAlgo_ShapeProcessor::SetParameter(const char*   theKey,
-                                         std::string&& theValue,
-                                         const bool    theIsReplace,
-                                         ParameterMap& theMap)
+void XSAlgo_ShapeProcessor::SetParameter(const char*                          theKey,
+                                         const double                         theValue,
+                                         const bool                           theIsReplace,
+                                         XSAlgo_ShapeProcessor::ParameterMap& theMap)
+{
+  SetParameter(theKey, TCollection_AsciiString(theValue), theIsReplace, theMap);
+}
+
+//=============================================================================
+
+void XSAlgo_ShapeProcessor::SetParameter(const char*                          theKey,
+                                         const TCollection_AsciiString&       theValue,
+                                         const bool                           theIsReplace,
+                                         XSAlgo_ShapeProcessor::ParameterMap& theMap)
 {
   if (theIsReplace)
   {
-    theMap[theKey] = std::move(theValue);
+    theMap.Bind(theKey, theValue);
   }
   else
   {
-    theMap.emplace(theKey, std::move(theValue));
+    if (!theMap.IsBound(theKey))
+    {
+      theMap.Bind(theKey, theValue);
+    }
   }
 }
 
index e9f13144b5e972aaa0d9b8544d2f231a876ae119..58b81fb7b79e9f166e8fb45777f6b35915c4e788 100644 (file)
@@ -21,8 +21,6 @@
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Face.hxx>
 
-#include <unordered_map>
-
 class ShapeProcess_ShapeContext;
 class ShapeExtend_MsgRegistrator;
 class Transfer_TransientProcess;
@@ -34,9 +32,12 @@ class Transfer_Binder;
 class XSAlgo_ShapeProcessor
 {
 public:
-  using OperationsFlags = ShapeProcess::OperationsFlags;
-  using ParameterMap    = std::unordered_map<std::string, std::string>;
-  using ProcessingData  = std::pair<ParameterMap, OperationsFlags>;
+  using ParameterMap   = NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString>;
+  using ProcessingData = std::pair<ParameterMap, ShapeProcess::OperationsFlags>;
+  // Flags defining operations to be performed on shapes. Since there is no std::optional in C++11,
+  // we use a pair. The first element is the flags, the second element is a boolean value that
+  // indicates whether the flags were set.
+  using ProcessingFlags = std::pair<ShapeProcess::OperationsFlags, bool>;
 
 public:
   //! Constructor.
@@ -56,9 +57,9 @@ public:
   //! @param theOperations Operations to be performed.
   //! @param theProgress Progress indicator.
   //! @return Processed shape. May be the same as the input shape if no modifications were made.
-  Standard_EXPORT TopoDS_Shape ProcessShape(const TopoDS_Shape&          theShape,
-                                            const OperationsFlags&       theOperations,
-                                            const Message_ProgressRange& theProgress);
+  Standard_EXPORT TopoDS_Shape ProcessShape(const TopoDS_Shape&                  theShape,
+                                            const ShapeProcess::OperationsFlags& theOperations,
+                                            const Message_ProgressRange&         theProgress);
 
   //! Get the context of the last processing.
   //! Only valid after the ProcessShape() method was called.
@@ -96,8 +97,9 @@ public:
   //!        of the scope. For example, parameter "read.iges.sequence" may contain string
   //!        "FromIGES".
   //! @return Read parameter map.
-  Standard_EXPORT static ProcessingData ReadProcessingData(const std::string& theFileResourceName,
-                                                           const std::string& theScopeResourceName);
+  Standard_EXPORT static ProcessingData ReadProcessingData(
+    const TCollection_AsciiString& theFileResourceName,
+    const TCollection_AsciiString& theScopeResourceName);
 
   //! Fill the parameter map with the values from the specified parameters.
   //! @param theParameters Parameters to be used in the processing.
@@ -108,16 +110,27 @@ public:
                                                const bool                   theIsReplace,
                                                ParameterMap&                theMap);
 
+  //! Sets parameters for shape processing.
+  //! Parameters from @p theParameters are copied to the output map.
+  //! Parameters from @p theAdditionalParameters are copied to the output map
+  //! if they are not present in @p theParameters.
+  //! @param theParameters the parameters for shape processing.
+  //! @param theAdditionalParameters the additional parameters for shape processing.
+  //! @param theTargetParameterMap Map to set the parameters in.
+  Standard_EXPORT static void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
+                                                    const ParameterMap& theAdditionalParameters,
+                                                    ParameterMap&       theTargetParameterMap);
+
   //! Set the parameter in the map.
   //! @param theKey Key of the parameter.
   //! @param theValue Value of the parameter.
   //! @param theIsReplace Flag indicating whether parameter should be replaced if it already exists
   //! in the map.
   //! @param theMap Map to set the parameter in.
-  Standard_EXPORT static void SetParameter(const char*                    theKey,
-                                           DE_ShapeFixParameters::FixMode theValue,
-                                           const bool                     theIsReplace,
-                                           ParameterMap&                  theMap);
+  Standard_EXPORT static void SetParameter(const char*                          theKey,
+                                           const DE_ShapeFixParameters::FixMode theValue,
+                                           const bool                           theIsReplace,
+                                           XSAlgo_ShapeProcessor::ParameterMap& theMap);
 
   //! Set the parameter in the map.
   //! @param theKey Key of the parameter.
@@ -126,7 +139,7 @@ public:
   //! in the map.
   //! @param theMap Map to set the parameter in.
   Standard_EXPORT static void SetParameter(const char*   theKey,
-                                           double        theValue,
+                                           const double  theValue,
                                            const bool    theIsReplace,
                                            ParameterMap& theMap);
 
@@ -136,10 +149,10 @@ public:
   //! @param theIsReplace Flag indicating whether parameter should be replaced if it already exists
   //! in the map.
   //! @param theMap Map to set the parameter in.
-  Standard_EXPORT static void SetParameter(const char*   theKey,
-                                           std::string&& theValue,
-                                           const bool    theIsReplace,
-                                           ParameterMap& theMap);
+  Standard_EXPORT static void SetParameter(const char*                    theKey,
+                                           const TCollection_AsciiString& theValue,
+                                           const bool                     theIsReplace,
+                                           ParameterMap&                  theMap);
 
   //! The function is designed to set the length unit for the application before performing a
   //! transfer operation. It ensures that the length unit is correctly configured based on the
index 911ac72604cd5895dd70e68e87d4e0e17ae220a1..bccb1f5e7b89400766c0a72be08e10dbcae03c3a 100644 (file)
@@ -413,7 +413,8 @@ void XSControl_Reader::GetStatsTransfer(const Handle(TColStd_HSequenceOfTransien
 
 //=============================================================================
 
-void XSControl_Reader::SetShapeFixParameters(const ParameterMap& theParameters)
+void XSControl_Reader::SetShapeFixParameters(
+  const XSAlgo_ShapeProcessor::ParameterMap& theParameters)
 {
   if (Handle(Transfer_ActorOfTransientProcess) anActor = GetActor())
   {
@@ -423,7 +424,7 @@ void XSControl_Reader::SetShapeFixParameters(const ParameterMap& theParameters)
 
 //=============================================================================
 
-void XSControl_Reader::SetShapeFixParameters(ParameterMap&& theParameters)
+void XSControl_Reader::SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters)
 {
   if (Handle(Transfer_ActorOfTransientProcess) anActor = GetActor())
   {
@@ -433,8 +434,9 @@ void XSControl_Reader::SetShapeFixParameters(ParameterMap&& theParameters)
 
 //=============================================================================
 
-void XSControl_Reader::SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                             const ParameterMap&          theAdditionalParameters)
+void XSControl_Reader::SetShapeFixParameters(
+  const DE_ShapeFixParameters&               theParameters,
+  const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters)
 {
   if (Handle(Transfer_ActorOfTransientProcess) anActor = GetActor())
   {
@@ -444,10 +446,10 @@ void XSControl_Reader::SetShapeFixParameters(const DE_ShapeFixParameters& thePar
 
 //=============================================================================
 
-const XSControl_Reader::ParameterMap& XSControl_Reader::GetShapeFixParameters() const
+const XSAlgo_ShapeProcessor::ParameterMap& XSControl_Reader::GetShapeFixParameters() const
 {
-  static const ParameterMap                      anEmptyMap;
-  const Handle(Transfer_ActorOfTransientProcess) anActor = GetActor();
+  static const XSAlgo_ShapeProcessor::ParameterMap anEmptyMap;
+  const Handle(Transfer_ActorOfTransientProcess)   anActor = GetActor();
   return anActor.IsNull() ? anEmptyMap : anActor->GetShapeFixParameters();
 }
 
@@ -463,10 +465,10 @@ void XSControl_Reader::SetShapeProcessFlags(const ShapeProcess::OperationsFlags&
 
 //=============================================================================
 
-const XSControl_Reader::ProcessingFlags& XSControl_Reader::GetShapeProcessFlags() const
+const XSAlgo_ShapeProcessor::ProcessingFlags& XSControl_Reader::GetShapeProcessFlags() const
 {
-  static const ProcessingFlags                   anEmptyFlags;
-  const Handle(Transfer_ActorOfTransientProcess) anActor = GetActor();
+  static const XSAlgo_ShapeProcessor::ProcessingFlags anEmptyFlags;
+  const Handle(Transfer_ActorOfTransientProcess)      anActor = GetActor();
   return anActor.IsNull() ? anEmptyFlags : anActor->GetProcessingFlags();
 }
 
@@ -493,7 +495,7 @@ Handle(Transfer_ActorOfTransientProcess) XSControl_Reader::GetActor() const
 
 void XSControl_Reader::InitializeMissingParameters()
 {
-  if (GetShapeFixParameters().empty())
+  if (GetShapeFixParameters().IsEmpty())
   {
     SetShapeFixParameters(GetDefaultShapeFixParameters());
   }
index c051d0a93e302908edf378912c3839d6d8b0a5cb..db6fe26af21517da63f3afff4662f6010a91cf01 100644 (file)
@@ -30,8 +30,7 @@
 #include <Standard_Integer.hxx>
 #include <IFSelect_PrintCount.hxx>
 #include <Message_ProgressRange.hxx>
-
-#include <unordered_map>
+#include <XSAlgo_ShapeProcessor.hxx>
 
 class XSControl_WorkSession;
 class Interface_InterfaceModel;
@@ -75,12 +74,6 @@ class XSControl_Reader
 public:
   DEFINE_STANDARD_ALLOC
 
-  using ParameterMap = std::unordered_map<std::string, std::string>;
-  // Flags defining operations to be performed on shapes. Since there is no std::optional in C++11,
-  // we use a pair. The first element is the flags, the second element is a boolean value that
-  // indicates whether the flags were set.
-  using ProcessingFlags = std::pair<ShapeProcess::OperationsFlags, bool>;
-
   //! Creates a Reader from scratch (creates an empty WorkSession)
   //! A WorkSession or a Controller must be provided before running
   Standard_EXPORT XSControl_Reader();
@@ -295,12 +288,13 @@ public:
 
   //! Sets parameters for shape processing.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const ParameterMap& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(
+    const XSAlgo_ShapeProcessor::ParameterMap& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters are moved from the input map.
   //! @param theParameters the parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(ParameterMap&& theParameters);
+  Standard_EXPORT void SetShapeFixParameters(XSAlgo_ShapeProcessor::ParameterMap&& theParameters);
 
   //! Sets parameters for shape processing.
   //! Parameters from @p theParameters are copied to the internal map.
@@ -308,12 +302,13 @@ public:
   //! if they are not present in @p theParameters.
   //! @param theParameters the parameters for shape processing.
   //! @param theAdditionalParameters the additional parameters for shape processing.
-  Standard_EXPORT void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
-                                             const ParameterMap& theAdditionalParameters = {});
+  Standard_EXPORT void SetShapeFixParameters(
+    const DE_ShapeFixParameters&               theParameters,
+    const XSAlgo_ShapeProcessor::ParameterMap& theAdditionalParameters = {});
 
   //! Returns parameters for shape processing that was set by SetParameters() method.
   //! @return the parameters for shape processing. Empty map if no parameters were set.
-  Standard_EXPORT const ParameterMap& GetShapeFixParameters() const;
+  Standard_EXPORT const XSAlgo_ShapeProcessor::ParameterMap& GetShapeFixParameters() const;
 
   //! Sets flags defining operations to be performed on shapes.
   //! @param theFlags The flags defining operations to be performed on shapes.
@@ -322,7 +317,7 @@ public:
   //! Returns flags defining operations to be performed on shapes.
   //! @return Pair of values defining operations to be performed on shapes and a boolean value
   //!         that indicates whether the flags were set.
-  Standard_EXPORT const ProcessingFlags& GetShapeProcessFlags() const;
+  Standard_EXPORT const XSAlgo_ShapeProcessor::ProcessingFlags& GetShapeProcessFlags() const;
 
 protected:
   //! Returns a sequence of produced shapes
index 56e1f3e443e814febd336092d0a83da2c6ed6758..da78eeeae4af95c6736191cefcea3d424921ee9e 100644 (file)
@@ -71,7 +71,7 @@ provider.IGES.OCC.healing.remove.small.area.face :     -1
 provider.IGES.OCC.healing.intersecting.wires :  -1
 provider.IGES.OCC.healing.loop.wires :  -1
 provider.IGES.OCC.healing.split.face :  -1
-provider.IGES.OCC.healing.auto.correct.precision :      -1
+provider.IGES.OCC.healing.auto.correct.precision :      1
 provider.IGES.OCC.healing.modify.topology :     0
 provider.IGES.OCC.healing.modify.geometry :     1
 provider.IGES.OCC.healing.closed.wire :         1
@@ -217,7 +217,7 @@ provider.STEP.OCC.healing.remove.small.area.face :   -1
 provider.STEP.OCC.healing.intersecting.wires :  -1
 provider.STEP.OCC.healing.loop.wires :  -1
 provider.STEP.OCC.healing.split.face :  -1
-provider.STEP.OCC.healing.auto.correct.precision :      -1
+provider.STEP.OCC.healing.auto.correct.precision :      1
 provider.STEP.OCC.healing.modify.topology :     0
 provider.STEP.OCC.healing.modify.geometry :     1
 provider.STEP.OCC.healing.closed.wire :         1
index 105b3448176242b3ccede6442d19dbcfbe7df75c..acb048a1757a35fdfb72a75fc2ebc2c6cffd848c 100644 (file)
@@ -65,7 +65,7 @@ provider.IGES.OCC.healing.remove.small.area.face :     -1
 provider.IGES.OCC.healing.intersecting.wires :  -1
 provider.IGES.OCC.healing.loop.wires :  -1
 provider.IGES.OCC.healing.split.face :  -1
-provider.IGES.OCC.healing.auto.correct.precision :      -1
+provider.IGES.OCC.healing.auto.correct.precision :      1
 provider.IGES.OCC.healing.modify.topology :     0
 provider.IGES.OCC.healing.modify.geometry :     1
 provider.IGES.OCC.healing.closed.wire :         1
@@ -162,7 +162,7 @@ provider.STEP.OCC.healing.remove.small.area.face :   -1
 provider.STEP.OCC.healing.intersecting.wires :  -1
 provider.STEP.OCC.healing.loop.wires :  -1
 provider.STEP.OCC.healing.split.face :  -1
-provider.STEP.OCC.healing.auto.correct.precision :      -1
+provider.STEP.OCC.healing.auto.correct.precision :      1
 provider.STEP.OCC.healing.modify.topology :     0
 provider.STEP.OCC.healing.modify.geometry :     1
 provider.STEP.OCC.healing.closed.wire :         1