From 9a6854774d1b6db6e8f3cf1096b88366d3e9be8d Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Wed, 15 Jan 2025 16:31:15 +0000 Subject: [PATCH] Data Exchange - STP provider missed parameters #257 Update STEPCAFControl_Provider and StepData_ConfParameters for improved parameter handling. Update the default write parameters for WriteMode_Assembly to auto --- src/STEPCAFControl/STEPCAFControl_ConfigurationNode.cxx | 2 +- src/STEPCAFControl/STEPCAFControl_Provider.cxx | 8 ++++---- src/StepData/StepData_ConfParameters.hxx | 2 +- tests/de_wrapper/configuration/A3 | 2 +- tests/de_wrapper/configuration/A4 | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/STEPCAFControl/STEPCAFControl_ConfigurationNode.cxx b/src/STEPCAFControl/STEPCAFControl_ConfigurationNode.cxx index f93174e070..702a06193b 100644 --- a/src/STEPCAFControl/STEPCAFControl_ConfigurationNode.cxx +++ b/src/STEPCAFControl/STEPCAFControl_ConfigurationNode.cxx @@ -397,7 +397,7 @@ TCollection_AsciiString STEPCAFControl_ConfigurationNode::Save() const aResult += "!\n"; aResult += "!Writing assembly mode\n"; - aResult += "!Default value: 0(\"Off\"). Available values: 0(\"Off\"), 1(\"On\"), 2(\"Auto\")\n"; + aResult += "!Default value: 2(\"Auto\"). Available values: 0(\"Off\"), 1(\"On\"), 2(\"Auto\")\n"; aResult += aScope + "write.assembly :\t " + InternalParameters.WriteAssembly + "\n"; aResult += "!\n"; diff --git a/src/STEPCAFControl/STEPCAFControl_Provider.cxx b/src/STEPCAFControl/STEPCAFControl_Provider.cxx index f66a70900a..127db75e1a 100644 --- a/src/STEPCAFControl/STEPCAFControl_Provider.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Provider.cxx @@ -75,7 +75,7 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath, aReader.SetMetaMode(aNode->InternalParameters.ReadMetadata); IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid; - StepData_ConfParameters aParams; + StepData_ConfParameters aParams = aNode->InternalParameters; aReadStat = aReader.ReadFile(thePath.ToCString(), aParams); if (aReadStat != IFSelect_RetDone) { @@ -119,7 +119,7 @@ bool STEPCAFControl_Provider::Write(const TCollection_AsciiString& thePath, aWriter.SetNameMode(aNode->InternalParameters.WriteName); aWriter.SetLayerMode(aNode->InternalParameters.WriteLayer); aWriter.SetPropsMode(aNode->InternalParameters.WriteProps); - StepData_ConfParameters aParams; + StepData_ConfParameters aParams = aNode->InternalParameters; Standard_Real aScaleFactorMM = 1.; if (XCAFDoc_DocumentTool::GetLengthUnit(theDocument, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter)) { @@ -209,7 +209,7 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath, STEPControl_Reader aReader; aReader.SetWS(theWS); IFSelect_ReturnStatus aReadstat = IFSelect_RetVoid; - StepData_ConfParameters aParams; + StepData_ConfParameters aParams = aNode->InternalParameters; aReadstat = aReader.ReadFile(thePath.ToCString(), aParams); Handle(StepData_StepModel) aModel = aReader.StepModel(); if (aReadstat != IFSelect_RetDone) @@ -251,7 +251,7 @@ bool STEPCAFControl_Provider::Write(const TCollection_AsciiString& thePath, aWriter.SetWS(theWS); IFSelect_ReturnStatus aWritestat = IFSelect_RetVoid; Handle(StepData_StepModel) aModel = aWriter.Model();; - StepData_ConfParameters aParams; + StepData_ConfParameters aParams = aNode->InternalParameters; aModel->SetLocalLengthUnit(aNode->GlobalParameters.SystemUnit); UnitsMethods_LengthUnit aTargetUnit = UnitsMethods::GetLengthUnitByFactorValue(aNode->GlobalParameters.LengthUnit, UnitsMethods_LengthUnit_Millimeter); aParams.WriteUnit = aTargetUnit; diff --git a/src/StepData/StepData_ConfParameters.hxx b/src/StepData/StepData_ConfParameters.hxx index 6228cb3f40..a63ebf0295 100644 --- a/src/StepData/StepData_ConfParameters.hxx +++ b/src/StepData/StepData_ConfParameters.hxx @@ -171,7 +171,7 @@ public: // Write WriteMode_PrecisionMode WritePrecisionMode = WriteMode_PrecisionMode_Average; //