mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Reformat BrickSchema UI
This commit is contained in:
@@ -54,6 +54,14 @@ def get_brick_equipment_classes(self, context):
|
|||||||
return BrickschemaData.data["brick_equipment_classes"]
|
return BrickschemaData.data["brick_equipment_classes"]
|
||||||
|
|
||||||
|
|
||||||
|
def get_brick_view_types(self, context):
|
||||||
|
return [("System", "System", ""),
|
||||||
|
("Location", "Location", ""),
|
||||||
|
("Equipment", "Equipment", ""),
|
||||||
|
("Point", "Point", "")
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class Brick(PropertyGroup):
|
class Brick(PropertyGroup):
|
||||||
name: StringProperty(name="Name")
|
name: StringProperty(name="Name")
|
||||||
label: StringProperty(name="Label")
|
label: StringProperty(name="Label")
|
||||||
@@ -73,3 +81,4 @@ class BIMBrickProperties(PropertyGroup):
|
|||||||
new_brick_label: StringProperty(name="New Brick Label")
|
new_brick_label: StringProperty(name="New Brick Label")
|
||||||
new_brick_namespace_alias: StringProperty(name="New Brick Namespace Alias")
|
new_brick_namespace_alias: StringProperty(name="New Brick Namespace Alias")
|
||||||
new_brick_namespace_uri: StringProperty(name="New Brick Namespace URI")
|
new_brick_namespace_uri: StringProperty(name="New Brick Namespace URI")
|
||||||
|
brick_view_type: EnumProperty(name="Brick View Type", items=get_brick_view_types)
|
||||||
@@ -47,21 +47,26 @@ class BIM_PT_brickschema(Panel):
|
|||||||
row.label(text=BrickStore.path, icon="FILEBROWSER")
|
row.label(text=BrickStore.path, icon="FILEBROWSER")
|
||||||
|
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
if len(self.props.brick_breadcrumbs):
|
op = row.operator("bim.serialize_brick", icon="EXPORT", text="Save")
|
||||||
row.operator("bim.rewind_brick_class", text="", icon="FRAME_PREV")
|
op.should_save_as = False
|
||||||
row.label(text=self.props.active_brick_class)
|
op = row.operator("bim.serialize_brick", icon="FILE_TICK", text="Save As")
|
||||||
row.prop(data=self.props, property="brick_settings_toggled", text="", icon="PREFERENCES")
|
op.should_save_as = True
|
||||||
row.operator("bim.refresh_brick_viewer", text="", icon="FILE_REFRESH")
|
|
||||||
row.operator("bim.close_brick_project", text="", icon="CANCEL")
|
row.operator("bim.close_brick_project", text="", icon="CANCEL")
|
||||||
|
|
||||||
|
row = self.layout.row(align=True)
|
||||||
|
row.prop(data=self.props, property="brick_settings_toggled", text="", icon="PREFERENCES")
|
||||||
|
|
||||||
if self.props.brick_settings_toggled:
|
if self.props.brick_settings_toggled:
|
||||||
box = self.layout.box()
|
box = self.layout.box()
|
||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
row.label(text="Active Namespace:")
|
row.label(text="Active Namespace:")
|
||||||
|
|
||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
prop_with_search(row, self.props, "namespace", text="")
|
prop_with_search(row, self.props, "namespace", text="")
|
||||||
|
|
||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
row.label(text="Bind New Namespace:")
|
row.label(text="Bind New Namespace:")
|
||||||
|
|
||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
row.prop(data=self.props, property="new_brick_namespace_alias", text="")
|
row.prop(data=self.props, property="new_brick_namespace_alias", text="")
|
||||||
col = row.column()
|
col = row.column()
|
||||||
@@ -71,6 +76,9 @@ class BIM_PT_brickschema(Panel):
|
|||||||
row.prop(data=self.props, property="new_brick_namespace_uri", text="")
|
row.prop(data=self.props, property="new_brick_namespace_uri", text="")
|
||||||
row.operator("bim.add_brick_namespace", text="", icon="ADD")
|
row.operator("bim.add_brick_namespace", text="", icon="ADD")
|
||||||
|
|
||||||
|
row = box.row(align=True)
|
||||||
|
row.prop(data=self.props, property="brick_view_type", text="List View")
|
||||||
|
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text="Create Entity:")
|
row.label(text="Create Entity:")
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
@@ -79,15 +87,18 @@ class BIM_PT_brickschema(Panel):
|
|||||||
row.operator("bim.add_brick", text="", icon="ADD")
|
row.operator("bim.add_brick", text="", icon="ADD")
|
||||||
|
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.alignment = "RIGHT"
|
col = row.column()
|
||||||
row.operator("bim.add_brick_feed", text="", icon="PLUGIN")
|
col.alignment = "LEFT"
|
||||||
|
if len(self.props.brick_breadcrumbs):
|
||||||
|
row.operator("bim.rewind_brick_class", text="", icon="FRAME_PREV")
|
||||||
|
col = row.column()
|
||||||
|
col.alignment = "RIGHT"
|
||||||
|
# row.operator("bim.add_brick_feed", text="", icon="PLUGIN")
|
||||||
row.operator("bim.remove_brick", text="", icon="X")
|
row.operator("bim.remove_brick", text="", icon="X")
|
||||||
|
# row.operator("bim.refresh_brick_viewer", text="", icon="FILE_REFRESH")
|
||||||
|
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
op = row.operator("bim.serialize_brick", icon="EXPORT", text="Save")
|
row.label(text=self.props.active_brick_class)
|
||||||
op.should_save_as = False
|
|
||||||
op = row.operator("bim.serialize_brick", icon="FILE_TICK", text="Save As")
|
|
||||||
op.should_save_as = True
|
|
||||||
|
|
||||||
self.layout.template_list("BIM_UL_bricks", "", self.props, "bricks", self.props, "active_brick_index")
|
self.layout.template_list("BIM_UL_bricks", "", self.props, "bricks", self.props, "active_brick_index")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user