Skip to content

Commit

Permalink
Data Exchange - STP provider missed parameters Open-Cascade-SAS#257
Browse files Browse the repository at this point in the history
Update STEPCAFControl_Provider and StepData_ConfParameters for improved parameter handling.
Update the default write parameters for WriteMode_Assembly to auto
  • Loading branch information
dpasukhi committed Jan 16, 2025
1 parent fe1382f commit 9a68547
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/STEPCAFControl/STEPCAFControl_ConfigurationNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
8 changes: 4 additions & 4 deletions src/STEPCAFControl/STEPCAFControl_Provider.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/StepData/StepData_ConfParameters.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public:
// Write
WriteMode_PrecisionMode WritePrecisionMode = WriteMode_PrecisionMode_Average; //<! Specifies the mode of writing the resolution value into the STEP file
double WritePrecisionVal = 0.0001; //<! Resolution value for an STEP file when WriteMode_PrecisionMode is Greatest
WriteMode_Assembly WriteAssembly = WriteMode_Assembly_Off; //<! Writing assembly mode
WriteMode_Assembly WriteAssembly = WriteMode_Assembly_Auto; //<! Writing assembly mode
WriteMode_StepSchema WriteSchema = WriteMode_StepSchema_AP214CD; //<! Defines the version of schema used for the output STEP file
RWMode_Tessellated WriteTessellated = RWMode_Tessellated_OnNoBRep; //!< Defines whether tessellated shapes should be translated
TCollection_AsciiString WriteProductName; //<! Defines the text string that will be used for field 'name' of PRODUCT entities written to the STEP file
Expand Down
2 changes: 1 addition & 1 deletion tests/de_wrapper/configuration/A3
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ provider.STEP.OCC.read.props : 1
provider.STEP.OCC.read.metadata : 1
provider.STEP.OCC.write.precision.mode : 0
provider.STEP.OCC.write.precision.val : 0.0001
provider.STEP.OCC.write.assembly : 0
provider.STEP.OCC.write.assembly : 2
provider.STEP.OCC.write.schema : 1
provider.STEP.OCC.write.tessellated : 2
provider.STEP.OCC.write.product.name :
Expand Down
2 changes: 1 addition & 1 deletion tests/de_wrapper/configuration/A4
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ provider.STEP.OCC.read.props : 1
provider.STEP.OCC.read.metadata : 1
provider.STEP.OCC.write.precision.mode : 0
provider.STEP.OCC.write.precision.val : 0.0001
provider.STEP.OCC.write.assembly : 0
provider.STEP.OCC.write.assembly : 2
provider.STEP.OCC.write.schema : 1
provider.STEP.OCC.write.tessellated : 2
provider.STEP.OCC.write.product.name :
Expand Down

0 comments on commit 9a68547

Please sign in to comment.