From 940af87f69779befe9cffc735a77589f68c4c642 Mon Sep 17 00:00:00 2001 From: donovaly Date: Tue, 14 Apr 2020 02:45:37 +0200 Subject: [PATCH] [Arch] split IFC dialog --- src/Mod/Arch/InitGui.py | 1 + src/Mod/Arch/Resources/Arch.qrc | 1 + .../Resources/ui/preferences-ifc-export.ui | 359 ++++++++++++++++++ src/Mod/Arch/Resources/ui/preferences-ifc.ui | 298 +-------------- src/Mod/Arch/exportIFC.py | 2 +- src/Mod/Draft/importDXF.py | 2 +- 6 files changed, 375 insertions(+), 288 deletions(-) create mode 100644 src/Mod/Arch/Resources/ui/preferences-ifc-export.ui diff --git a/src/Mod/Arch/InitGui.py b/src/Mod/Arch/InitGui.py index 53d154c1b9..3791fba309 100644 --- a/src/Mod/Arch/InitGui.py +++ b/src/Mod/Arch/InitGui.py @@ -180,6 +180,7 @@ FreeCADGui.addWorkbench(ArchWorkbench) import Arch_rc from PySide.QtCore import QT_TRANSLATE_NOOP FreeCADGui.addPreferencePage(":/ui/preferences-ifc.ui", QT_TRANSLATE_NOOP("Draft", "Import-Export")) +FreeCADGui.addPreferencePage(":/ui/preferences-ifc-export.ui", QT_TRANSLATE_NOOP("Draft", "Import-Export")) FreeCADGui.addPreferencePage(":/ui/preferences-dae.ui", QT_TRANSLATE_NOOP("Draft", "Import-Export")) FreeCAD.__unit_test__ += ["TestArch"] diff --git a/src/Mod/Arch/Resources/Arch.qrc b/src/Mod/Arch/Resources/Arch.qrc index ce9f1a9864..fa7a65c2a0 100644 --- a/src/Mod/Arch/Resources/Arch.qrc +++ b/src/Mod/Arch/Resources/Arch.qrc @@ -112,6 +112,7 @@ ui/preferences-archdefaults.ui ui/preferences-dae.ui ui/preferences-ifc.ui + ui/preferences-ifc-export.ui translations/Arch_af.qm translations/Arch_ar.qm translations/Arch_ca.qm diff --git a/src/Mod/Arch/Resources/ui/preferences-ifc-export.ui b/src/Mod/Arch/Resources/ui/preferences-ifc-export.ui new file mode 100644 index 0000000000..3d1df06a58 --- /dev/null +++ b/src/Mod/Arch/Resources/ui/preferences-ifc-export.ui @@ -0,0 +1,359 @@ + + + Gui::Dialog::DlgSettingsArch + + + + 0 + 0 + 463 + 421 + + + + IFC-Export + + + + 6 + + + 9 + + + 9 + + + 9 + + + 9 + + + + + Show this dialog when exporting + + + ifcShowDialog + + + Mod/Arch + + + + + + + Export options + + + + + + Some IFC viewers don't like objects exported as extrusions. +Use this to force all objects to be exported as BREP geometry. + + + Force export as Brep + + + ifcExportAsBrep + + + Mod/Arch + + + + + + + Use triangulation options set in the DAE options page + + + Use DAE triangulation options + + + ifcUseDaeOptions + + + Mod/Arch + + + + + + + Curved shapes that cannot be represented as curves in IFC +are decomposed into flat facets. +If this is checked, additional calculation is done to join coplanar facets. + + + Join coplanar facets when triangulating + + + ifcJoinCoplanarFacets + + + Mod/Arch + + + + + + + When exporting objects without unique ID (UID), the generated UID +will be stored inside the FreeCAD object for reuse next time that object +is exported. This leads to smaller differences between file versions. + + + Store IFC unique ID in FreeCAD objects + + + true + + + ifcStoreUid + + + Mod/Arch + + + + + + + IFCOpenShell is a library that allows to import IFC files. +Its serializer functionality allows to give it an OCC shape and it will +produce adequate IFC geometry: NURBS, faceted, or anything else. +Note: The serializer is still an experimental feature! + + + Use IfcOpenShell serializer if available + + + ifcSerialize + + + Mod/Arch + + + + + + + 2D objects will be exported as IfcAnnotation + + + Export 2D objects as IfcAnnotations + + + true + + + ifcExport2D + + + Mod/Arch + + + + + + + All FreeCAD object properties will be stored inside the exported objects, +allowing to recreate a full parametric model on reimport. + + + Export full FreeCAD parametric model + + + IfcExportFreeCADProperties + + + Mod/Arch + + + + + + + When possible, similar entities will be used only once in the file if possible. +This can reduce the file size a lot, but will make it less easily readable. + + + Reuse similar entities + + + true + + + ifcCompress + + + Mod/Arch + + + + + + + When possible, IFC objects that are extruded rectangles will be +exported as IfcRectangleProfileDef. +However, some other applications might have problems importing that entity. +If this is your case, you can disable this and then all profiles will be exported as IfcArbitraryClosedProfileDef. + + + Disable IfcRectangleProfileDef + + + DisableIfcRectangleProfileDef + + + Mod/Arch + + + + + + + Some IFC types such as IfcWall or IfcBeam have special standard versions +like IfcWallStandardCase or IfcBeamStandardCase. +If this option is turned on, FreeCAD will automatically export such objects +as standard cases when the necessary conditions are met. + + + Auto-detect and export as standard cases when applicable + + + getStandardCase + + + Mod/Arch + + + + + + + If no site is found in the FreeCAD document, a default one will be added. +A site is not mandatory but a common practice is to have at least one in the file. + + + Add default site if one is not found in the document + + + IfcAddDefaultSite + + + Mod/Arch + + + + + + + If no building is found in the FreeCAD document, a default one will be added. +Warning: The IFC standard asks for at least one building in each file. By turning this option off, you will produce a non-standard IFC file. +However, at FreeCAD, we believe having a building should not be mandatory, and this option is there to have a chance to demonstrate our point of view. + + + Add default building if one is not found in the document (no standard) + + + true + + + IfcAddDefaultBuilding + + + Mod/Arch + + + + + + + If no building storey is found in the FreeCAD document, a default one will be added. +A building storey is not mandatory but a common practice to have at least one in the file. + + + Add default building storey if one is not found in the document + + + IfcAddDefaultStorey + + + Mod/Arch + + + + + + + + + IFC file units + + + + + + + The units you want your IFC file to be exported to. Note that IFC file are ALWAYS written in metric units. Imperial units are only a conversion applied on top of it. But some BIM applications will use this to choose which unit to work with when opening the file. + + + ifcUnit + + + Mod/Arch + + + + Metric + + + + + Imperial + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + qPixmapFromMimeSource + + + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefComboBox + QComboBox +
Gui/PrefWidgets.h
+
+
+ + +
diff --git a/src/Mod/Arch/Resources/ui/preferences-ifc.ui b/src/Mod/Arch/Resources/ui/preferences-ifc.ui index 28835df005..089594c571 100644 --- a/src/Mod/Arch/Resources/ui/preferences-ifc.ui +++ b/src/Mod/Arch/Resources/ui/preferences-ifc.ui @@ -7,7 +7,7 @@ 0 0 463 - 937 + 495 @@ -17,13 +17,22 @@ 6 - + + 9 + + + 9 + + + 9 + + 9 - Show this dialog when importing and exporting + Show this dialog when importing ifcShowDialog @@ -388,289 +397,6 @@ FreeCAD object properties - - - - Export options - - - - - - Some IFC viewers don't like objects exported as extrusions. -Use this to force all objects to be exported as BREP geometry. - - - Force export as Brep - - - ifcExportAsBrep - - - Mod/Arch - - - - - - - Use triangulation options set in the DAE options page - - - Use DAE triangulation options - - - ifcUseDaeOptions - - - Mod/Arch - - - - - - - Curved shapes that cannot be represented as curves in IFC -are decomposed into flat facets. -If this is checked, additional calculation is done to join coplanar facets. - - - Join coplanar facets when triangulating - - - ifcJoinCoplanarFacets - - - Mod/Arch - - - - - - - When exporting objects without unique ID (UID), the generated UID -will be stored inside the FreeCAD object for reuse next time that object -is exported. This leads to smaller differences between file versions. - - - Store IFC unique ID in FreeCAD objects - - - true - - - ifcStoreUid - - - Mod/Arch - - - - - - - IFCOpenShell is a library that allows to import IFC files. -Its serializer functionality allows to give it an OCC shape and it will -produce adequate IFC geometry: NURBS, faceted, or anything else. -Note: The serializer is still an experimental feature! - - - Use IfcOpenShell serializer if available - - - ifcSerialize - - - Mod/Arch - - - - - - - 2D objects will be exported as IfcAnnotation - - - Export 2D objects as IfcAnnotations - - - true - - - ifcExport2D - - - Mod/Arch - - - - - - - All FreeCAD object properties will be stored inside the exported objects, -allowing to recreate a full parametric model on reimport. - - - Export full FreeCAD parametric model - - - IfcExportFreeCADProperties - - - Mod/Arch - - - - - - - When possible, similar entities will be used only once in the file if possible. -This can reduce the file size a lot, but will make it less easily readable. - - - Reuse similar entities - - - true - - - ifcCompress - - - Mod/Arch - - - - - - - When possible, IFC objects that are extruded rectangles will be -exported as IfcRectangleProfileDef. -However, some other applications might have problems importing that entity. -If this is your case, you can disable this and then all profiles will be exported as IfcArbitraryClosedProfileDef. - - - Disable IfcRectangleProfileDef - - - DisableIfcRectangleProfileDef - - - Mod/Arch - - - - - - - Some IFC types such as IfcWall or IfcBeam have special standard versions -like IfcWallStandardCase or IfcBeamStandardCase. -If this option is turned on, FreeCAD will automatically export such objects -as standard cases when the necessary conditions are met. - - - Auto-detect and export as standard cases when applicable - - - getStandardCase - - - Mod/Arch - - - - - - - If no site is found in the FreeCAD document, a default one will be added. -A site is not mandatory but a common practice is to have at least one in the file. - - - Add default site if one is not found in the document - - - IfcAddDefaultSite - - - Mod/Arch - - - - - - - If no building is found in the FreeCAD document, a default one will be added. -Warning: The IFC standard asks for at least one building in each file. By turning this option off, you will produce a non-standard IFC file. -However, at FreeCAD, we believe having a building should not be mandatory, and this option is there to have a chance to demonstrate our point of view. - - - Add default building if one is not found in the document (no standard) - - - true - - - IfcAddDefaultBuilding - - - Mod/Arch - - - - - - - If no building storey is found in the FreeCAD document, a default one will be added. -A building storey is not mandatory but a common practice to have at least one in the file. - - - Add default building storey if one is not found in the document - - - IfcAddDefaultStorey - - - Mod/Arch - - - - - - - - - IFC file units - - - - - - - The units you want your IFC file to be exported to. Note that IFC file are ALWAYS written in metric units. Imperial units are only a conversion applied on top of it. But some BIM applications will use this to choose which unit to work with when opening the file. - - - ifcUnit - - - Mod/Arch - - - - Metric - - - - - Imperial - - - - - - - - - diff --git a/src/Mod/Arch/exportIFC.py b/src/Mod/Arch/exportIFC.py index 596b137331..8baf610739 100644 --- a/src/Mod/Arch/exportIFC.py +++ b/src/Mod/Arch/exportIFC.py @@ -113,7 +113,7 @@ def getPreferences(): if FreeCAD.GuiUp and p.GetBool("ifcShowDialog",False): import FreeCADGui - FreeCADGui.showPreferences("Import-Export",0) + FreeCADGui.showPreferences("Import-Export",1) ifcunit = p.GetInt("ifcUnit",0) f = 0.001 u = "metre" diff --git a/src/Mod/Draft/importDXF.py b/src/Mod/Draft/importDXF.py index 760b3a8654..e972cb8816 100644 --- a/src/Mod/Draft/importDXF.py +++ b/src/Mod/Draft/importDXF.py @@ -4169,7 +4169,7 @@ def readPreferences(): # reading parameters p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft") if FreeCAD.GuiUp and p.GetBool("dxfShowDialog", False): - FreeCADGui.showPreferences("Import-Export", 2) + FreeCADGui.showPreferences("Import-Export", 3) global dxfCreatePart, dxfCreateDraft, dxfCreateSketch global dxfDiscretizeCurves, dxfStarBlocks global dxfMakeBlocks, dxfJoin, dxfRenderPolylineWidth