@@ -40,55 +40,63 @@ def draw(self, context):
4040 layout .use_property_split = True
4141
4242 scene = context .scene
43- bim_properties = scene .DiffProperties
43+ props = scene .DiffProperties
4444
4545 layout .label (text = "IFC Diff Setup:" )
4646
4747 row = layout .row (align = True )
48- row .prop (bim_properties , "diff_old_file " )
48+ row .prop (props , "old_file " )
4949 row .operator ("bim.select_diff_old_file" , icon = "FILE_FOLDER" , text = "" )
5050
5151 row = layout .row (align = True )
52- row .prop (bim_properties , "diff_new_file " )
52+ row .prop (props , "new_file " )
5353 row .operator ("bim.select_diff_new_file" , icon = "FILE_FOLDER" , text = "" )
5454
5555 row = layout .row (align = True )
56- row .prop (bim_properties , "diff_relationships" )
57- row .context_pointer_set ("bim_prop_group" , bim_properties )
56+ row .prop (props , "diff_relationships" )
57+ row .context_pointer_set ("bim_prop_group" , props )
5858 add = row .operator ("bim.edit_blender_collection" , icon = "ADD" , text = "" )
5959 add .option = "add"
6060 add .collection = "diff_relationships"
61-
62- for index , r in enumerate (bim_properties .diff_relationships ):
61+
62+ for index , r in enumerate (props .diff_relationships ):
6363 row = layout .row (align = True )
64- row .context_pointer_set ("bim_prop_group" , bim_properties )
64+ row .context_pointer_set ("bim_prop_group" , props )
6565 row .prop (r , "relationship" , text = " " )
6666 remove = row .operator ("bim.edit_blender_collection" , icon = "REMOVE" , text = "" )
6767 remove .option = "remove"
6868 remove .collection = "diff_relationships"
6969 remove .index = index
70-
70+
7171 row = layout .row (align = True )
72- row .prop (bim_properties , "diff_filter_elements" )
72+ row .prop (props , "diff_filter_elements" )
7373 row .operator ("bim.ifc_selector" , icon = "FILTER" , text = "" )
7474
7575 row = layout .row ()
7676 row .operator ("bim.execute_ifc_diff" )
77- if bim_properties .diff_result :
78- row = layout .row ()
79- row .alignment = "CENTER"
80- row .label (text = bim_properties .diff_result )
8177
82- # TODO: show if there ifc diff operation is sucessful
8378 row = layout .row (align = True )
84- row .prop (bim_properties , "diff_json_file" )
79+ row .prop (props , "diff_json_file" )
8580 row .operator ("bim.select_diff_json_file" , icon = "FILE_FOLDER" , text = "" )
8681 row .operator ("bim.visualise_diff" , icon = "HIDE_OFF" , text = "" )
87-
88- if DiffData .data ["changes " ]:
82+
83+ if DiffData .data ["diff_json " ]:
8984 row = layout .row ()
90- row .label (text = "Diff Results:" )
85+ row .alignment = "CENTER"
86+ row .label (text = f"{ DiffData .data ['total_added' ]} added" )
87+ row .label (text = f"{ DiffData .data ['total_deleted' ]} deleted" )
88+ row .label (text = f"{ DiffData .data ['total_changed' ]} changed" )
89+
90+ if DiffData .data ["changes" ]:
91+ box = layout .box ()
92+ row = box .row ()
93+ row .label (text = "Active Object Changes:" )
9194 for key , value in DiffData .data ["changes" ].items ():
92- row = layout .row ()
93- row .label (text = key )
94- row .label (text = value )
95+ row = box .row ()
96+ if key == "Added" :
97+ icon = "ADD"
98+ elif key == "Deleted" :
99+ icon = "X"
100+ else :
101+ icon = "GREASEPENCIL"
102+ row .label (text = key , icon = icon )
0 commit comments