From 0a610f88e02b979b1dc3f3691c4c6d1e071e854a Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 29 Oct 2019 18:13:10 +1100 Subject: [PATCH] New UI to set features dir and diff JSON file --- .../io_export_ifc/__init__.py | 4 ++ .../io_export_ifc/operator.py | 26 ++++++++++++ src/ifcblenderexport/io_export_ifc/ui.py | 42 +++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/src/ifcblenderexport/io_export_ifc/__init__.py b/src/ifcblenderexport/io_export_ifc/__init__.py index 26b9ab02cc..bd47d3bcba 100644 --- a/src/ifcblenderexport/io_export_ifc/__init__.py +++ b/src/ifcblenderexport/io_export_ifc/__init__.py @@ -18,6 +18,8 @@ classes = ( operator.AssignClass, operator.SelectClass, operator.SelectType, + operator.SelectFeaturesDir, + operator.SelectDiffJsonFile, operator.SelectDataDir, operator.SelectSchemaDir, operator.ExportIFC, @@ -53,6 +55,8 @@ classes = ( ui.BIMMeshProperties, ui.GISPanel, ui.BIMPanel, + ui.QAPanel, + ui.DiffPanel, ui.MVDPanel, ui.MaterialPanel, ui.MeshPanel, diff --git a/src/ifcblenderexport/io_export_ifc/operator.py b/src/ifcblenderexport/io_export_ifc/operator.py index cda5499700..5a22150088 100644 --- a/src/ifcblenderexport/io_export_ifc/operator.py +++ b/src/ifcblenderexport/io_export_ifc/operator.py @@ -384,6 +384,32 @@ class SelectExternalMaterialDir(bpy.types.Operator): context.window_manager.fileselect_add(self) return {'RUNNING_MODAL'} +class SelectDiffJsonFile(bpy.types.Operator): + bl_idname = "bim.select_diff_json_file" + bl_label = "Select Diff JSON File" + filepath: bpy.props.StringProperty(subtype="FILE_PATH") + + def execute(self, context): + bpy.context.scene.BIMProperties.diff_json_file = self.filepath + return {'FINISHED'} + + def invoke(self, context, event): + context.window_manager.fileselect_add(self) + return {'RUNNING_MODAL'} + +class SelectFeaturesDir(bpy.types.Operator): + bl_idname = "bim.select_features_dir" + bl_label = "Select Features Directory" + filepath: bpy.props.StringProperty(subtype="FILE_PATH") + + def execute(self, context): + bpy.context.scene.BIMProperties.features_dir = self.filepath + return {'FINISHED'} + + def invoke(self, context, event): + context.window_manager.fileselect_add(self) + return {'RUNNING_MODAL'} + class SelectDataDir(bpy.types.Operator): bl_idname = "bim.select_data_dir" bl_label = "Select Data Directory" diff --git a/src/ifcblenderexport/io_export_ifc/ui.py b/src/ifcblenderexport/io_export_ifc/ui.py index ecc09eaabd..93e04bf28d 100644 --- a/src/ifcblenderexport/io_export_ifc/ui.py +++ b/src/ifcblenderexport/io_export_ifc/ui.py @@ -49,6 +49,8 @@ class BIMProperties(bpy.types.PropertyGroup): pset_file: bpy.props.EnumProperty(items=getPsetFiles, name="Pset File") has_georeferencing: bpy.props.BoolProperty(name="Has Georeferencing", default=False) global_id: bpy.props.StringProperty(name="GlobalId") + features_dir: bpy.props.StringProperty(default='', name="Features Directory") + diff_json_file: bpy.props.StringProperty(default='', name="Diff JSON File") class MapConversion(bpy.types.PropertyGroup): eastings: bpy.props.StringProperty(name="Eastings") @@ -301,6 +303,26 @@ class BIMPanel(bpy.types.Panel): row.operator("bim.assign_pset") row.operator("bim.unassign_pset") +class QAPanel(bpy.types.Panel): + bl_label = "BIMTester Quality Auditing" + bl_idname = "BIM_PT_qa" + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "scene" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + scene = context.scene + bim_properties = bpy.context.scene.BIMProperties + + layout.label(text="Gherkin Setup:") + + row = layout.row(align=True) + row.prop(bim_properties, "features_dir") + row.operator("bim.select_features_dir", icon="FILE_FOLDER", text="") + layout.label(text="Quality Auditing:") row = layout.row() @@ -319,6 +341,26 @@ class BIMPanel(bpy.types.Panel): row = layout.row() row.operator("bim.select_audited") +class DiffPanel(bpy.types.Panel): + bl_label = "IFC Diff" + bl_idname = "BIM_PT_diff" + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "scene" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + scene = context.scene + bim_properties = bpy.context.scene.BIMProperties + + layout.label(text="IFC Diff Setup:") + + row = layout.row(align=True) + row.prop(bim_properties, "diff_json_file") + row.operator("bim.select_diff_json_file", icon="FILE_FOLDER", text="") + class MVDPanel(bpy.types.Panel): bl_label = "Model View Definitions" bl_idname = "BIM_PT_mvd"