From 368a824418911593e34c47ec49d03260eea4f911 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 1 Nov 2012 08:24:37 +0000 Subject: [PATCH 1/1] Mantis issue 0021511: EDF 2153 GEOM: Choose to take units into account or not when importing a STEP file --- doc/salome/gui/GEOM/images/iges_unit.png | Bin 6488 -> 10444 bytes doc/salome/gui/GEOM/input/import_export.doc | 8 +-- idl/GEOM_Gen.idl | 5 +- src/GEOMImpl/GEOMImpl_IInsertOperations.cxx | 23 ++++-- src/GEOMToolsGUI/GEOMToolsGUI.cxx | 2 +- src/GEOM_SWIG/GEOM_TestOthers.py | 17 +++-- src/GEOM_SWIG/geompyDC.py | 76 ++++++++++++-------- src/IGESImport/IGESImport.cxx | 8 +-- src/STEPImport/STEPImport.cxx | 8 +-- 9 files changed, 95 insertions(+), 52 deletions(-) diff --git a/doc/salome/gui/GEOM/images/iges_unit.png b/doc/salome/gui/GEOM/images/iges_unit.png index 60aba603ad83270687dedd20473e3b4036efca92..cb74fb319fb952aabef33c434e827b0b76a211e5 100644 GIT binary patch literal 10444 zcmb_?byyYQx9)(nARyf!-O}CN-672eq`N~xxG8Lq`NmM-AIGf9e>X`_x^pK zb3PuJ*?cpzzgTO%?|Ronsw&H%p%9_~0DvYZE2$0uFdg8zI}$ATw@tiH6g(h1$?CZR zz?+}{eqmA=-w=WSWOS3#b(6GoHFvRbaEV_o~1O$mwI6Clv*Ke=>>%ws=LDJ*-{cMA8u3i0{AK;MmGH>=1%8BCHM#6FSk^_6h>vbgbB$ z;+n4PkjFb7PIBj8QkE0}Tvf0I)1i0}d+DA{J1|=K3y{mg>CzVT=iR7t$FH}sCI!(6~MeN3Gdx}uvUZ?Kf>!N z>_0dOH-Kx*;$WZpcz3qwp!RHEc%Y}{7d#Vn?+gT`5Y>H1nQdwPQ>=^x4^TZhMe++W z%rf)mrxXauu;}dVM#ts)GwGDV04GrXtLR%7mxd_}Lbb5tl^yHARaQhmwGjq*?(mQ^ zm;j$=qK$1SUZ(06?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rTA`|ZOP*+Aiy8zJRolzg=)Is;o(6oEZkliAhvZYTnHy5 z!4?(Gnh%nB%5bkBDP5FtbaIl)()2W@L-KMP{g1p+cW}@d5%m%+9q?(pDHTezdBA8A zFQn}Dw@QS_=d7r&*ev(=F#JxEmEt!2hn=Z@aHPriE`nyh3sf__?n*)6F^z9lRJ-L5Q$JBDe zPc?4(sXju8D@jLVBeExNwtZ2T5@`9IS^jZSWD0ee3W4x{+GU||)9llJYfVAmzo!7? wT4+4YlJYO!hoTGJObject Browser. -\note If the selected file is in IGES format and the length is not -expressed in meters, it will be suggested to scale the model into the -metric system (see the picture below). This feature can be helpful if -some wrong units have been written to the IGES file by a +\note If the selected file is in IGES or in STEP format and the length +is not expressed in meters, it will be asked to take or not these +units into account (see the picture below). This feature can be +helpful if some wrong units have been written to the IGES file by a 3rd-party software. \image html iges_unit.png diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 9c6896aad..4a05f783b 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -3289,8 +3289,9 @@ module GEOM * \param theFileName The file, containing the shape. * \param theFormatName Specify format for the file reading. * Available formats can be obtained with ImportTranslators() method. - * If format 'IGES_SCALE' is used instead 'IGES' length unit will be - * set to 'meter' and result model will be scaled. + * If format 'IGES_SCALE' is used instead of 'IGES' or + * format 'STEP_SCALE' is used instead of 'STEP', + * file length unit will be ignored (set to 'meter') and result model will be scaled. * \return New GEOM_Object, containing the imported shape. */ GEOM_Object ImportFile (in string theFileName, in string theFormatName); diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx index 6aca179a1..4fecfbca9 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx @@ -246,9 +246,22 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::Import } //Make a Python command - if( theFormatName != "IGES_UNIT" ) { - GEOM::TPythonDump(aFunction) << result << " = geompy.ImportFile(\"" - << theFileName.ToCString() << "\", \"" << theFormatName.ToCString() << "\")"; + if (theFormatName != "IGES_UNIT") { + GEOM::TPythonDump pd (aFunction); + if (theFormatName == "BREP") + pd << result << " = geompy.ImportBREP(\"" << theFileName.ToCString() << "\")"; + else if (theFormatName == "IGES") + pd << result << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\")"; + else if (theFormatName == "IGES_SCALE") + pd << result << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\", True)"; + else if (theFormatName == "STEP") + pd << result << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\")"; + else if (theFormatName == "STEP_SCALE") + pd << result << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\", True)"; + else { + pd << result << " = geompy.ImportFile(\"" + << theFileName.ToCString() << "\", \"" << theFormatName.ToCString() << "\")"; + } } SetErrorCode(OK); @@ -260,9 +273,9 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::Import gp_Pnt P = BRep_Tool::Pnt(V); double scale = P.X(); TCollection_AsciiString aUnitName = "UNIT_M"; - if( fabs(scale-0.01) < 1.e-6 ) + if (fabs(scale-0.01) < 1.e-6) aUnitName = "UNIT_CM"; - else if( fabs(scale-0.001) < 1.e-6 ) + else if (fabs(scale-0.001) < 1.e-6) aUnitName = "UNIT_MM"; //cout<<"IIO: aUnitName = "<ReadValue(fileN, fileT, "LEN_UNITS"); TCollection_AsciiString aUnitsStr (aUnits.in()); bool needConvert = true; - if (aUnitsStr.IsEmpty() || aUnitsStr == "UNIT_M") + if (aUnitsStr.IsEmpty() || aUnitsStr == "M") needConvert = false; if (needConvert) { diff --git a/src/GEOM_SWIG/GEOM_TestOthers.py b/src/GEOM_SWIG/GEOM_TestOthers.py index 4db5841a0..4f85d8183 100644 --- a/src/GEOM_SWIG/GEOM_TestOthers.py +++ b/src/GEOM_SWIG/GEOM_TestOthers.py @@ -78,16 +78,25 @@ def TestExportImport (geompy, shape): # Import Import = geompy.ImportFile(fileExportImport, "BREP") - id_Import = geompy.addToStudy(Import, "Import") + geompy.addToStudy(Import, "Import") # ImportBREP, ImportIGES, ImportSTEP ImportBREP = geompy.ImportBREP(fileExportImportBREP) ImportIGES = geompy.ImportIGES(fileExportImportIGES) ImportSTEP = geompy.ImportSTEP(fileExportImportSTEP) - id_ImportBREP = geompy.addToStudy(ImportBREP, "ImportBREP") - id_ImportIGES = geompy.addToStudy(ImportIGES, "ImportIGES") - id_ImportSTEP = geompy.addToStudy(ImportSTEP, "ImportSTEP") + geompy.addToStudy(ImportBREP, "ImportBREP") + geompy.addToStudy(ImportIGES, "ImportIGES") + geompy.addToStudy(ImportSTEP, "ImportSTEP") + + # GetIGESUnit and GetSTEPUnit + if geompy.GetIGESUnit(fileExportImportIGES) != "M": + ImportIGES_scaled = geompy.ImportIGES(fileExportImportIGES, True) + geompy.addToStudy(ImportIGES_scaled, "ImportIGES_scaled") + + if geompy.GetSTEPUnit(fileExportImportSTEP) != "M": + ImportSTEP_scaled = geompy.ImportSTEP(fileExportImportSTEP, True) + geompy.addToStudy(ImportSTEP_scaled, "ImportSTEP_scaled") # Remove files for Export/Import testing os.remove(fileExportImport) diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 8833a4de9..1fb5f2560 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -7321,12 +7321,13 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @param theFileName The file, containing the shape. # @param theFormatName Specify format for the file reading. # Available formats can be obtained with InsertOp.ImportTranslators() method. - # If format 'IGES_SCALE' is used instead 'IGES' length unit will be - # set to 'meter' and result model will be scaled. + # If format 'IGES_SCALE' is used instead of 'IGES' or + # format 'STEP_SCALE' is used instead of 'STEP', + # length unit will be set to 'meter' and result model will be scaled. # @return New GEOM.GEOM_Object, containing the imported shape. # # @ref swig_Import_Export "Example" - def ImportFile(self,theFileName, theFormatName): + def ImportFile(self, theFileName, theFormatName): """ Import a shape from the BREP or IGES or STEP file (depends on given format) with given name. @@ -7334,9 +7335,10 @@ class geompyDC(GEOM._objref_GEOM_Gen): Parameters: theFileName The file, containing the shape. theFormatName Specify format for the file reading. - Available formats can be obtained with geompy.InsertOp.ImportTranslators() method. - If format 'IGES_SCALE' is used instead 'IGES' length unit will be - set to 'meter' and result model will be scaled. + Available formats can be obtained with geompy.InsertOp.ImportTranslators() method. + If format 'IGES_SCALE' is used instead of 'IGES' or + format 'STEP_SCALE' is used instead of 'STEP', + length unit will be set to 'meter' and result model will be scaled. Returns: New GEOM.GEOM_Object, containing the imported shape. @@ -7347,7 +7349,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): return anObj ## Deprecated analog of ImportFile() - def Import(self,theFileName, theFormatName): + def Import(self, theFileName, theFormatName): """ Deprecated analog of geompy.ImportFile """ @@ -7359,7 +7361,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): ## Shortcut to ImportFile() for BREP format # # @ref swig_Import_Export "Example" - def ImportBREP(self,theFileName): + def ImportBREP(self, theFileName): """ geompy.ImportFile(...) function for BREP format """ @@ -7367,49 +7369,67 @@ class geompyDC(GEOM._objref_GEOM_Gen): return self.ImportFile(theFileName, "BREP") ## Shortcut to ImportFile() for IGES format + # @param doScale If True, file length units will be ignored (set to 'meter') + # and result model will be scaled. + # If False (default), file length units will be taken into account. # # @ref swig_Import_Export "Example" - def ImportIGES(self,theFileName): + def ImportIGES(self, theFileName, doScale = False): """ geompy.ImportFile(...) function for IGES format + + Parameters: + doScale If True, file length units will be ignored (set to 'meter') + and result model will be scaled. + If False (default), file length units will be taken into account. """ # Example: see GEOM_TestOthers.py + if doScale: + return self.ImportFile(theFileName, "IGES_SCALE") return self.ImportFile(theFileName, "IGES") ## Return length unit from given IGES file + # @param doScale If True, file length units will be ignored (set to 'meter') + # and result model will be scaled. + # If False (default), file length units will be taken into account. # # @ref swig_Import_Export "Example" - def GetIGESUnit(self,theFileName): + def GetIGESUnit(self, theFileName, doScale = False): """ - Return length unit from given IGES file + Return length units from given IGES file """ # Example: see GEOM_TestOthers.py - anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT") - #RaiseIfFailed("Import", self.InsertOp) - # recieve name using returned vertex - UnitName = "M" - if anObj.GetShapeType() == GEOM.VERTEX: - vertices = [anObj] - else: - vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"]) - if len(vertices)>0: - p = self.PointCoordinates(vertices[0]) - if abs(p[0]-0.01) < 1.e-6: - UnitName = "CM" - elif abs(p[0]-0.001) < 1.e-6: - UnitName = "MM" - return UnitName + aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS") + return aUnitName ## Shortcut to ImportFile() for STEP format # # @ref swig_Import_Export "Example" - def ImportSTEP(self,theFileName): + def ImportSTEP(self, theFileName, doScale = False): """ geompy.ImportFile(...) function for STEP format + + Parameters: + doScale If True, file length units will be ignored (set to 'meter') + and result model will be scaled. + If False (default), file length units will be taken into account. """ # Example: see GEOM_TestOthers.py + if doScale: + return self.ImportFile(theFileName, "STEP_SCALE") return self.ImportFile(theFileName, "STEP") + ## Return length unit from given IGES or STEP file + # + # @ref swig_Import_Export "Example" + def GetSTEPUnit(self, theFileName): + """ + Return length units from given STEP file + """ + # Example: see GEOM_TestOthers.py + aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS") + return aUnitName + ## Read a shape from the binary stream, containing its bounding representation (BRep). # @note This method will not be dumped to the python script by DumpStudy functionality. # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream. @@ -7442,7 +7462,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # Available formats can be obtained with InsertOp.ImportTranslators() method. # # @ref swig_Import_Export "Example" - def Export(self,theObject, theFileName, theFormatName): + def Export(self, theObject, theFileName, theFormatName): """ Export the given shape into a file with given name. diff --git a/src/IGESImport/IGESImport.cxx b/src/IGESImport/IGESImport.cxx index e9c73ac4a..3eba47108 100644 --- a/src/IGESImport/IGESImport.cxx +++ b/src/IGESImport/IGESImport.cxx @@ -108,10 +108,10 @@ extern "C" if (!aModel.IsNull()) { aValue = aModel->GlobalSection().UnitName(); - if (!aValue.IsNull()) { - Handle(TCollection_HAsciiString) aPrefix = new TCollection_HAsciiString ("UNIT_"); - aValue->Prepend(aPrefix); - } + //if (!aValue.IsNull()) { + // Handle(TCollection_HAsciiString) aPrefix = new TCollection_HAsciiString ("UNIT_"); + // aValue->Prepend(aPrefix); + //} } } else { diff --git a/src/STEPImport/STEPImport.cxx b/src/STEPImport/STEPImport.cxx index 8a4015043..9b5f1e996 100644 --- a/src/STEPImport/STEPImport.cxx +++ b/src/STEPImport/STEPImport.cxx @@ -124,13 +124,13 @@ extern "C" if (anUnitLengthNames.Length() > 0) { TCollection_AsciiString aLenUnits = anUnitLengthNames.First(); if (aLenUnits == "millimetre") - aValue = new TCollection_HAsciiString ("UNIT_MM"); + aValue = new TCollection_HAsciiString ("MM"); else if (aLenUnits == "centimetre") - aValue = new TCollection_HAsciiString ("UNIT_CM"); + aValue = new TCollection_HAsciiString ("CM"); else if (aLenUnits == "metre") - aValue = new TCollection_HAsciiString ("UNIT_M"); + aValue = new TCollection_HAsciiString ("M"); else if (aLenUnits == "INCH") - aValue = new TCollection_HAsciiString ("UNIT_INCH"); + aValue = new TCollection_HAsciiString ("INCH"); // TODO //else if (aLenUnits == "") // aValue = new TCollection_HAsciiString (""); -- 2.39.2