1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Data Exchange - DE Wrapper Shape Healing Parameters #282

Propagate shape healing parameters to STP and IGES nodes.
Update naming to avoid misunderstanding.
This commit is contained in:
dpasukhi
2025-01-23 22:50:41 +00:00
parent f5a02d2b0c
commit 1e0d8c3f1e
41 changed files with 792 additions and 701 deletions

View File

@@ -935,7 +935,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 = GetParameters();
Transfer_ActorOfTransientProcess::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);
@@ -1559,7 +1559,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 = GetParameters();
Transfer_ActorOfTransientProcess::ParameterMap aParameters = GetShapeFixParameters();
XSAlgo_ShapeProcessor::SetParameter("FixShape.Tolerance3d", myPrecision, true, aParameters);
XSAlgo_ShapeProcessor::SetParameter("FixShape.MaxTolerance3d", myMaxTol, true, aParameters);
XSAlgo_ShapeProcessor aShapeProcessor(aParameters);
@@ -1731,7 +1731,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
{
TopoDS_Shape S = sb->Result();
Transfer_ActorOfTransientProcess::ParameterMap aParameters = GetParameters();
Transfer_ActorOfTransientProcess::ParameterMap aParameters = GetShapeFixParameters();
XSAlgo_ShapeProcessor::SetParameter("FixShape.Tolerance3d", myPrecision, true, aParameters);
XSAlgo_ShapeProcessor::SetParameter("FixShape.MaxTolerance3d", myMaxTol, true, aParameters);
XSAlgo_ShapeProcessor aShapeProcessor(aParameters);

View File

@@ -962,7 +962,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
TopoDS_Shape aShape = xShape;
Transfer_ActorOfFinderProcess::ParameterMap aParameters = GetParameters();
Transfer_ActorOfFinderProcess::ParameterMap aParameters = GetShapeFixParameters();
XSAlgo_ShapeProcessor::SetParameter("FixShape.Tolerance3d", Tol, true, aParameters);
XSAlgo_ShapeProcessor::SetParameter("FixShape.MaxTolerance3d",
aStepModel->InternalParameters.ReadMaxPrecisionVal,

View File

@@ -654,9 +654,9 @@ inline static TCollection_AsciiString getSiName(const Handle(StepBasic_SiUnit)&
//=================================================================================================
DE_ShapeFixParameters STEPControl_Reader::GetDefaultParameters() const
DE_ShapeFixParameters STEPControl_Reader::GetDefaultShapeFixParameters() const
{
return DESTEP_Parameters::GetDefaultReadingParamsSTEP();
return DESTEP_Parameters::GetDefaultShapeFixParameters();
}
//=================================================================================================

View File

@@ -130,7 +130,7 @@ protected:
//! Returns default parameters for shape fixing.
//! This method is used by the base class to get default parameters for shape fixing.
//! @return default parameters for shape fixing.
Standard_EXPORT virtual DE_ShapeFixParameters GetDefaultParameters() const Standard_OVERRIDE;
Standard_EXPORT virtual DE_ShapeFixParameters GetDefaultShapeFixParameters() const Standard_OVERRIDE;
//! Returns default flags for shape processing.
//! @return Default flags for shape processing.

View File

@@ -219,42 +219,42 @@ void STEPControl_Writer::PrintStatsTransfer
}
//=============================================================================
void STEPControl_Writer::SetParameters(const ParameterMap& theParameters)
void STEPControl_Writer::SetShapeFixParameters(const ParameterMap& theParameters)
{
if (Handle(Transfer_ActorOfFinderProcess) anActor = GetActor())
{
anActor->SetParameters(theParameters);
anActor->SetShapeFixParameters(theParameters);
}
}
//=============================================================================
void STEPControl_Writer::SetParameters(ParameterMap&& theParameters)
void STEPControl_Writer::SetShapeFixParameters(ParameterMap&& theParameters)
{
if (Handle(Transfer_ActorOfFinderProcess) anActor = GetActor())
{
anActor->SetParameters(std::move(theParameters));
anActor->SetShapeFixParameters(std::move(theParameters));
}
}
//=============================================================================
void STEPControl_Writer::SetParameters(const DE_ShapeFixParameters& theParameters,
void STEPControl_Writer::SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
const ParameterMap& theAdditionalParameters)
{
if (Handle(Transfer_ActorOfFinderProcess) anActor = GetActor())
{
anActor->SetParameters(theParameters, theAdditionalParameters);
anActor->SetShapeFixParameters(theParameters, theAdditionalParameters);
}
}
//=============================================================================
const STEPControl_Writer::ParameterMap& STEPControl_Writer::GetParameters() const
const STEPControl_Writer::ParameterMap& STEPControl_Writer::GetShapeFixParameters() const
{
static const ParameterMap anEmptyMap;
const Handle(Transfer_ActorOfFinderProcess) anActor = GetActor();
return anActor.IsNull() ? anEmptyMap : anActor->GetParameters();
return anActor.IsNull() ? anEmptyMap : anActor->GetShapeFixParameters();
}
//=============================================================================
@@ -299,9 +299,9 @@ Handle(Transfer_ActorOfFinderProcess) STEPControl_Writer::GetActor() const
void STEPControl_Writer::InitializeMissingParameters()
{
if (GetParameters().empty())
if (GetShapeFixParameters().empty())
{
SetParameters(DESTEP_Parameters::GetDefaultWritingParamsSTEP());
SetShapeFixParameters(DESTEP_Parameters::GetDefaultShapeFixParameters());
}
if (GetShapeProcessFlags().second == false)
{

View File

@@ -135,12 +135,12 @@ public:
//! Sets parameters for shape processing.
//! @param theParameters the parameters for shape processing.
Standard_EXPORT void SetParameters(const ParameterMap& theParameters);
Standard_EXPORT void SetShapeFixParameters(const ParameterMap& theParameters);
//! Sets parameters for shape processing.
//! Parameters are moved from the input map.
//! @param theParameters the parameters for shape processing.
Standard_EXPORT void SetParameters(ParameterMap&& theParameters);
Standard_EXPORT void SetShapeFixParameters(ParameterMap&& theParameters);
//! Sets parameters for shape processing.
//! Parameters from @p theParameters are copied to the internal map.
@@ -148,12 +148,12 @@ 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 SetParameters(const DE_ShapeFixParameters& theParameters,
const ParameterMap& theAdditionalParameters = {});
Standard_EXPORT void SetShapeFixParameters(const DE_ShapeFixParameters& theParameters,
const 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& GetParameters() const;
Standard_EXPORT const ParameterMap& GetShapeFixParameters() const;
//! Sets flags defining operations to be performed on shapes.
//! @param theFlags The flags defining operations to be performed on shapes.
@@ -171,7 +171,7 @@ private:
Handle(Transfer_ActorOfFinderProcess) GetActor() const;
//! If parameters haven't yet been provided, initializes them with default values
//! provided by GetDefaultParameters() method.
//! provided by GetDefaultShapeFixParameters() method.
void InitializeMissingParameters();
private: