black format

This commit is contained in:
Andrej730
2024-09-09 17:59:48 +05:00
parent e87faa167c
commit e7ad71b51d
3 changed files with 82 additions and 217 deletions
+1 -3
View File
@@ -647,9 +647,7 @@ class MEPAddObstruction(bpy.types.Operator, tool.Ifc.Operator):
class MEPAddTransition(bpy.types.Operator, tool.Ifc.Operator): class MEPAddTransition(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.mep_add_transition" bl_idname = "bim.mep_add_transition"
bl_label = "Add Transition" bl_label = "Add Transition"
bl_description = ( bl_description = "Adds transition between two selected MEP Elements"
"Adds transition between two selected MEP Elements"
)
bl_options = {"REGISTER", "UNDO"} bl_options = {"REGISTER", "UNDO"}
start_length: bpy.props.FloatProperty( start_length: bpy.props.FloatProperty(
name="Start Length", description="Transition start length in SI units", default=0.1, subtype="DISTANCE", min=0 name="Start Length", description="Transition start length in SI units", default=0.1, subtype="DISTANCE", min=0
+80 -213
View File
@@ -370,11 +370,7 @@ class BimToolUI:
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl2", text="RL") row.prop(data=cls.props, property="rl2", text="RL")
elif cls.props.ifc_class in ("IfcSpaceType"): elif cls.props.ifc_class in ("IfcSpaceType"):
add_layout_hotkey_operator( add_layout_hotkey_operator(cls.layout, "Generate", "S_G", "Generate a space at the cursor position")
cls.layout,
"Generate",
"S_G",
"Generate a space at the cursor position")
else: else:
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl_mode", text="RL") row.prop(data=cls.props, property="rl_mode", text="RL")
@@ -400,12 +396,7 @@ class BimToolUI:
cls.layout.separator() cls.layout.separator()
add_layout_hotkey_operator( add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Element", ui_context)
cls.layout,
"Regen",
"S_G",
"Regenerate selected Element",
ui_context)
cls.layout.separator() cls.layout.separator()
@@ -437,48 +428,36 @@ class BimToolUI:
) )
cls.layout.separator() cls.layout.separator()
add_layout_hotkey_operator( add_layout_hotkey_operator(cls.layout, "Merge", "S_M", "Merge selected Elements", ui_context)
cls.layout,
"Merge",
"S_M",
"Merge selected Elements",
ui_context)
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout,
"Split", "Split",
"S_K", "S_K",
"Split selected Element into two Elements at the cursor location", "Split selected Element into two Elements at the cursor location",
ui_context) ui_context,
)
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Rotate 90", "S_R", "Rotate the selected Element by 90 degrees", ui_context
"Rotate 90", )
"S_R",
"Rotate the selected Element by 90 degrees",
ui_context)
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Flip", "S_F", "Flip Element about its local axes, keep the position", ui_context
"Flip", )
"S_F",
"Flip Element about its local axes, keep the position",
ui_context)
# row.operator("bim.unjoin_walls", icon="X", text="") # row.operator("bim.unjoin_walls", icon="X", text="")
elif AuthoringData.data["active_material_usage"] == "LAYER3": elif AuthoringData.data["active_material_usage"] == "LAYER3":
if len(context.selected_objects) == 1: if len(context.selected_objects) == 1:
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Edit Profile", "S_E", "Edit associated Profile Element", ui_context
"Edit Profile", )
"S_E",
"Edit associated Profile Element",
ui_context)
elif "LAYER2" in AuthoringData.data["selected_material_usages"]: elif "LAYER2" in AuthoringData.data["selected_material_usages"]:
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout,
"Extend Wall To Slab", "Extend Wall To Slab",
"S_E", "S_E",
"Extend the selected Wall to the selected Slab", "Extend the selected Wall to the selected Slab",
ui_context) ui_context,
)
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
row.prop(data=cls.props, property="x_angle", text="Angle") row.prop(data=cls.props, property="x_angle", text="Angle")
@@ -507,11 +486,8 @@ class BimToolUI:
ui_context, ui_context,
) )
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Flip", "S_F", "Flip object about its local axes, keep the position", ui_context
"Flip", )
"S_F",
"Flip object about its local axes, keep the position",
ui_context)
if AuthoringData.data["active_class"] in ( if AuthoringData.data["active_class"] in (
"IfcCableCarrierSegment", "IfcCableCarrierSegment",
@@ -525,7 +501,8 @@ class BimToolUI:
"Add Fitting", "Add Fitting",
"S_Y", "S_Y",
"Add a Fitting based on currently selected Elements and cursor", "Add a Fitting based on currently selected Elements and cursor",
ui_context) ui_context,
)
cls.layout.operator("bim.mep_add_bend") cls.layout.operator("bim.mep_add_bend")
cls.layout.operator("bim.mep_add_transition") cls.layout.operator("bim.mep_add_transition")
cls.layout.operator("bim.mep_add_obstruction") cls.layout.operator("bim.mep_add_obstruction")
@@ -553,18 +530,9 @@ class BimToolUI:
ui_context, ui_context,
) )
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Rotate 90", "S_R", "Rotate the selected element by 90 degrees", ui_context
"Rotate 90",
"S_R",
"Rotate the selected element by 90 degrees",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Regen",
"S_G",
"Regenerate selected element",
ui_context
) )
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected element", ui_context)
row.operator("bim.extend_profile", icon="X", text="").join_type = "" row.operator("bim.extend_profile", icon="X", text="").join_type = ""
elif ( elif (
@@ -589,35 +557,19 @@ class BimToolUI:
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl1", text="RL") row.prop(data=cls.props, property="rl1", text="RL")
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Element", ui_context)
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Flip", "S_F", "Flip object about its local axes, keep the position", ui_context
"Regen", )
"S_G",
"Regenerate selected Element",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Flip",
"S_F",
"Flip object about its local axes, keep the position",
ui_context)
elif AuthoringData.data["active_representation_type"] == "SweptSolid": elif AuthoringData.data["active_representation_type"] == "SweptSolid":
if not tool.Model.is_parametric_window_active() and not tool.Model.is_parametric_door_active(): if not tool.Model.is_parametric_window_active() and not tool.Model.is_parametric_door_active():
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Edit Profile", "S_E", "Edit assosiated Profile Element", ui_context
"Edit Profile", )
"S_E",
"Edit assosiated Profile Element",
ui_context)
elif AuthoringData.data["active_class"] in ("IfcSpace",): elif AuthoringData.data["active_class"] in ("IfcSpace",):
add_layout_hotkey_operator( add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Space", ui_context)
cls.layout,
"Regen",
"S_G",
"Regenerate selected Space",
ui_context)
elif tool.Model.is_parametric_roof_active() and not context.active_object.BIMRoofProperties.is_editing_path: elif tool.Model.is_parametric_roof_active() and not context.active_object.BIMRoofProperties.is_editing_path:
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
@@ -630,7 +582,7 @@ class BimToolUI:
"Regen MEP", "Regen MEP",
"S_G", "S_G",
"Regenerates the positions and segment lengths of a distribution element and all connected elements", "Regenerates the positions and segment lengths of a distribution element and all connected elements",
ui_context ui_context,
) )
cls.layout.operator("bim.mep_connect_elements") cls.layout.operator("bim.mep_connect_elements")
@@ -665,54 +617,39 @@ class BimToolUI:
"Exterior", "Exterior",
"S_X", "S_X",
"Align selected Elements to the Exterior of the last selected object", "Align selected Elements to the Exterior of the last selected object",
ui_context) ui_context,
)
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout,
"Centerline", "Centerline",
"S_C", "S_C",
"Align selected Elements to the Centerline of the last selected object", "Align selected Elements to the Centerline of the last selected object",
ui_context) ui_context,
)
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout,
"Interior", "Interior",
"S_V", "S_V",
"Align selected Elements to the Interior of the last selected object", "Align selected Elements to the Interior of the last selected object",
ui_context) ui_context,
)
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout,
"Mirror", "Mirror",
"S_M", "S_M",
"Mirrors the selected Elements along a mirror plane set by the last selected object", "Mirrors the selected Elements along a mirror plane set by the last selected object",
ui_context) ui_context,
)
cls.layout.row(align=True).label(text="Mode") cls.layout.row(align=True).label(text="Mode")
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Opening", "A_O", "Toggle display of Openings in the selected Elements", ui_context
"Opening", )
"A_O", add_layout_hotkey_operator(cls.layout, "Decomposition", "A_D", "Select decomposition", ui_context)
"Toggle display of Openings in the selected Elements",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Decomposition",
"A_D",
"Select decomposition",
ui_context)
cls.layout.row(align=True).label(text="Aggregation") cls.layout.row(align=True).label(text="Aggregation")
add_layout_hotkey_operator( add_layout_hotkey_operator(cls.layout, "Assign", "C_P", "Assign element to Aggregation", ui_context)
cls.layout, add_layout_hotkey_operator(cls.layout, "Unassign", "A_P", "Unassign element from Aggregation", ui_context)
"Assign",
"C_P",
"Assign element to Aggregation",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Unassign",
"A_P",
"Unassign element from Aggregation",
ui_context
)
cls.layout.row(align=True).label(text="Qto") cls.layout.row(align=True).label(text="Qto")
add_layout_hotkey_operator( add_layout_hotkey_operator(
@@ -720,7 +657,7 @@ class BimToolUI:
"Perform Quantity Take-off", "Perform Quantity Take-off",
"S_Q", "S_Q",
"Perform a quantity take off on selected objects based of a QTO rule configuration", "Perform a quantity take off on selected objects based of a QTO rule configuration",
ui_context ui_context,
) )
@classmethod @classmethod
@@ -743,12 +680,7 @@ class BimToolUI:
op.x_angle = cls.props.x_angle op.x_angle = cls.props.x_angle
row = cls.layout.row() row = cls.layout.row()
add_layout_hotkey_operator( add_layout_hotkey_operator(row, "Regen", "S_G", "Regenerate selected Element", ui_context)
row,
"Regen",
"S_G",
"Regenerate selected Element",
ui_context)
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
add_layout_hotkey_operator( add_layout_hotkey_operator(
@@ -775,46 +707,28 @@ class BimToolUI:
row.operator("bim.unjoin_walls", text="", icon_value=custom_icon_previews["UNJOIN_WALLS"].icon_id) row.operator("bim.unjoin_walls", text="", icon_value=custom_icon_previews["UNJOIN_WALLS"].icon_id)
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
add_layout_hotkey_operator(row, "Merge", "S_M", "Merge selected Elements", ui_context)
add_layout_hotkey_operator( add_layout_hotkey_operator(
row, row, "Split", "S_K", "Split selected Element into two Elements at the cursor location", ui_context
"Merge", )
"S_M", add_layout_hotkey_operator(row, "Rotate 90", "S_R", "Rotate the selected Element by 90 degrees", ui_context)
"Merge selected Elements",
ui_context)
add_layout_hotkey_operator( add_layout_hotkey_operator(
row, row, "Flip", "S_F", "Flip Element about its local axes, keep the position", ui_context
"Split", )
"S_K",
"Split selected Element into two Elements at the cursor location",
ui_context)
add_layout_hotkey_operator(
row,
"Rotate 90",
"S_R",
"Rotate the selected Element by 90 degrees",
ui_context)
add_layout_hotkey_operator(
row,
"Flip",
"S_F",
"Flip Element about its local axes, keep the position",
ui_context)
elif AuthoringData.data["active_material_usage"] == "LAYER3": elif AuthoringData.data["active_material_usage"] == "LAYER3":
if len(context.selected_objects) == 1: if len(context.selected_objects) == 1:
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Edit Profile", "S_E", "Edit associated Profile Element", ui_context
"Edit Profile", )
"S_E",
"Edit associated Profile Element",
ui_context)
elif "LAYER2" in AuthoringData.data["selected_material_usages"]: elif "LAYER2" in AuthoringData.data["selected_material_usages"]:
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout,
"Extend Wall To Slab", "Extend Wall To Slab",
"S_E", "S_E",
"Extend the selected Wall to the selected Slab", "Extend the selected Wall to the selected Slab",
ui_context) ui_context,
)
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
row.prop(data=cls.props, property="x_angle", text="Angle") row.prop(data=cls.props, property="x_angle", text="Angle")
@@ -843,11 +757,8 @@ class BimToolUI:
ui_context, ui_context,
) )
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Flip", "S_F", "Flip object about its local axes, keep the position", ui_context
"Flip", )
"S_F",
"Flip object about its local axes, keep the position",
ui_context)
if AuthoringData.data["active_class"] in ( if AuthoringData.data["active_class"] in (
"IfcCableCarrierSegment", "IfcCableCarrierSegment",
@@ -861,7 +772,8 @@ class BimToolUI:
"Add Fitting", "Add Fitting",
"S_Y", "S_Y",
"Add a Fitting based on currently selected Elements and cursor", "Add a Fitting based on currently selected Elements and cursor",
ui_context) ui_context,
)
if context.region.type != "TOOL_HEADER": if context.region.type != "TOOL_HEADER":
cls.layout.operator("bim.mep_add_bend") cls.layout.operator("bim.mep_add_bend")
cls.layout.operator("bim.mep_add_transition") cls.layout.operator("bim.mep_add_transition")
@@ -890,18 +802,9 @@ class BimToolUI:
ui_context, ui_context,
) )
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Rotate 90", "S_R", "Rotate the selected element by 90 degrees", ui_context
"Rotate 90",
"S_R",
"Rotate the selected element by 90 degrees",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Regen",
"S_G",
"Regenerate selected element",
ui_context
) )
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected element", ui_context)
row.operator("bim.extend_profile", icon="X", text="").join_type = "" row.operator("bim.extend_profile", icon="X", text="").join_type = ""
elif ( elif (
@@ -926,35 +829,19 @@ class BimToolUI:
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl1", text="RL") row.prop(data=cls.props, property="rl1", text="RL")
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Element", ui_context)
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Flip", "S_F", "Flip object about its local axes, keep the position", ui_context
"Regen", )
"S_G",
"Regenerate selected Element",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Flip",
"S_F",
"Flip object about its local axes, keep the position",
ui_context)
elif AuthoringData.data["active_representation_type"] == "SweptSolid": elif AuthoringData.data["active_representation_type"] == "SweptSolid":
if not tool.Model.is_parametric_window_active() and not tool.Model.is_parametric_door_active(): if not tool.Model.is_parametric_window_active() and not tool.Model.is_parametric_door_active():
add_layout_hotkey_operator( add_layout_hotkey_operator(
cls.layout, cls.layout, "Edit Profile", "S_E", "Edit assosiated Profile Element", ui_context
"Edit Profile", )
"S_E",
"Edit assosiated Profile Element",
ui_context)
elif AuthoringData.data["active_class"] in ("IfcSpace",): elif AuthoringData.data["active_class"] in ("IfcSpace",):
add_layout_hotkey_operator( add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Space", ui_context)
cls.layout,
"Regen",
"S_G",
"Regenerate selected Space",
ui_context)
elif tool.Model.is_parametric_roof_active() and not context.active_object.BIMRoofProperties.is_editing_path: elif tool.Model.is_parametric_roof_active() and not context.active_object.BIMRoofProperties.is_editing_path:
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
@@ -967,7 +854,8 @@ class BimToolUI:
"Regen MEP", "Regen MEP",
"S_G", "S_G",
"Regenerates the positions and segment lengths of a distribution element and all connected elements", "Regenerates the positions and segment lengths of a distribution element and all connected elements",
ui_context) ui_context,
)
cls.layout.operator("bim.mep_connect_elements") cls.layout.operator("bim.mep_connect_elements")
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
@@ -993,57 +881,35 @@ class BimToolUI:
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
add_layout_hotkey_operator( add_layout_hotkey_operator(
row, row, "Exterior", "S_X", "Align selected Elements to the Exterior of the last selected object", ui_context
"Exterior", )
"S_X",
"Align selected Elements to the Exterior of the last selected object",
ui_context)
add_layout_hotkey_operator( add_layout_hotkey_operator(
row, row,
"Centerline", "Centerline",
"S_C", "S_C",
"Align selected Elements to the Centerline of the last selected object", "Align selected Elements to the Centerline of the last selected object",
ui_context) ui_context,
)
add_layout_hotkey_operator( add_layout_hotkey_operator(
row, row, "Interior", "S_V", "Align selected Elements to the Interior of the last selected object", ui_context
"Interior", )
"S_V",
"Align selected Elements to the Interior of the last selected object",
ui_context)
add_layout_hotkey_operator( add_layout_hotkey_operator(
row, row,
"Mirror", "Mirror",
"S_M", "S_M",
"Mirrors the selected Elements along a mirror plane set by the last selected object", "Mirrors the selected Elements along a mirror plane set by the last selected object",
ui_context) ui_context,
)
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
add_layout_hotkey_operator( add_layout_hotkey_operator(
row, row, "Opening", "A_O", "Toggle display of Openings in the selected Elements", ui_context
"Opening", )
"A_O", add_layout_hotkey_operator(row, "Decomposition", "A_D", "Select decomposition", ui_context)
"Toggle display of Openings in the selected Elements",
ui_context)
add_layout_hotkey_operator(
row,
"Decomposition",
"A_D",
"Select decomposition",
ui_context)
row = cls.layout.row(align=True) row = cls.layout.row(align=True)
add_layout_hotkey_operator( add_layout_hotkey_operator(row, "Assign", "C_P", "Assign element to Aggregation", ui_context)
row, add_layout_hotkey_operator(row, "Unassign", "A_P", "Unassign element from Aggregation", ui_context)
"Assign",
"C_P",
"Assign element to Aggregation",
ui_context)
add_layout_hotkey_operator(
row,
"Unassign",
"A_P",
"Unassign element from Aggregation",
ui_context)
row = cls.layout.row() row = cls.layout.row()
add_layout_hotkey_operator( add_layout_hotkey_operator(
@@ -1051,7 +917,8 @@ class BimToolUI:
"Perform Quantity Take-off", "Perform Quantity Take-off",
"S_Q", "S_Q",
"Perform a quantity take off on selected objects based of a QTO rule configuration", "Perform a quantity take off on selected objects based of a QTO rule configuration",
ui_context) ui_context,
)
@classmethod @classmethod
def draw_container(cls, context): def draw_container(cls, context):
@@ -33,7 +33,7 @@ class AddOpening(bpy.types.Operator, tool.Ifc.Operator):
bl_label = "Apply Opening" bl_label = "Apply Opening"
bl_options = {"REGISTER", "UNDO"} bl_options = {"REGISTER", "UNDO"}
bl_description = ( bl_description = (
"Apply an Opening object on an Element. " "Apply an Opening object on an Element. "
"The Element and the Opening to be applied should be selected. The order of selection is not important" "The Element and the Opening to be applied should be selected. The order of selection is not important"
) )