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
This commit is contained in:
vsr 2012-11-20 15:37:17 +00:00
parent d1371cd825
commit 5ad7147996
2 changed files with 5 additions and 2 deletions

View File

@ -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) {

View File

@ -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 {