From 5ad7147996a7b6f11f2153b1e073538935ba482c Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 20 Nov 2012 15:37:17 +0000 Subject: [PATCH] 0021511: EDF 2153 GEOM: Choose to take units into account or not when importing a STEP file - Additional change: return native units as they are read from the STEP file --- src/GEOMToolsGUI/GEOMToolsGUI.cxx | 2 +- src/STEPImport/STEPImport.cxx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index ceca9830c..01f2c182f 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -651,7 +651,7 @@ bool GEOMToolsGUI::Import() CORBA::String_var aUnits = aInsOp->ReadValue(fileN, fileT, "LEN_UNITS"); QString aUnitsStr (aUnits.in()); bool needConvert = true; - if (aUnitsStr.isEmpty() || aUnitsStr == "M") + if (aUnitsStr.isEmpty() || aUnitsStr == "M" || aUnitsStr.toLower() == "metre") needConvert = false; if (needConvert) { diff --git a/src/STEPImport/STEPImport.cxx b/src/STEPImport/STEPImport.cxx index b82765339..7ad825833 100644 --- a/src/STEPImport/STEPImport.cxx +++ b/src/STEPImport/STEPImport.cxx @@ -122,6 +122,8 @@ extern "C" TColStd_SequenceOfAsciiString anUnitSolidAngleNames; aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames); if (anUnitLengthNames.Length() > 0) { + aValue = new TCollection_HAsciiString( anUnitLengthNames.First() ); + /* TCollection_AsciiString aLenUnits = anUnitLengthNames.First(); if (aLenUnits == "millimetre") aValue = new TCollection_HAsciiString ("MM"); @@ -141,6 +143,7 @@ extern "C" // std::cout << ", " << anUnitLengthNames.Value(ii); //std::cout << std::endl; // tmp end + */ } } else { @@ -207,7 +210,7 @@ extern "C" } // TODO (for other units than mm, cm, m or inch) //else if (aLenUnits == "") - // Interface_Static::SetCVal("xstep.cascade.unit", ""); + // Interface_Static::SetCVal("xstep.cascade.unit", "???"); } } else { -- 2.39.2