mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-07 12:56:26 +00:00
bim.edit_style to update representations if Side was edited
Mentioned in #5604. Since IfcSurfaceStyle.Side is used during representation generation, we need to regenerate them if the value was changed. Previously it would require manual update / project reload.
This commit is contained in:
@@ -195,10 +195,28 @@ class TestDisableEditingStyle:
|
||||
|
||||
|
||||
class TestEditStyle:
|
||||
def test_run(self, ifc, style):
|
||||
def test_run_side_attr_updated(self, ifc, style):
|
||||
style.get_currently_edited_material().should_be_called().will_return("obj")
|
||||
style.get_style("obj").should_be_called().will_return("style_element")
|
||||
style.export_surface_attributes().should_be_called().will_return("attributes")
|
||||
style.is_style_side_attribute_edited("style_element", "attributes").should_be_called().will_return(True)
|
||||
ifc.run("style.edit_presentation_style", style="style_element", attributes="attributes").should_be_called()
|
||||
style.disable_editing().should_be_called()
|
||||
style.get_active_style_type().should_be_called().will_return("style_type")
|
||||
|
||||
# Calling core.load_styles.
|
||||
style.import_presentation_styles("style_type").should_be_called()
|
||||
style.enable_editing_styles().should_be_called()
|
||||
|
||||
style.reload_repersentations("style_element").should_be_called()
|
||||
|
||||
subject.edit_style(ifc, style)
|
||||
|
||||
def test_run_side_attr_unchanged(self, ifc, style):
|
||||
style.get_currently_edited_material().should_be_called().will_return("obj")
|
||||
style.get_style("obj").should_be_called().will_return("style_element")
|
||||
style.export_surface_attributes().should_be_called().will_return("attributes")
|
||||
style.is_style_side_attribute_edited("style_element", "attributes").should_be_called().will_return(False)
|
||||
ifc.run("style.edit_presentation_style", style="style_element", attributes="attributes").should_be_called()
|
||||
style.disable_editing().should_be_called()
|
||||
style.get_active_style_type().should_be_called().will_return("style_type")
|
||||
|
||||
Reference in New Issue
Block a user