deprecate geometry.is_edited

in favor of ifc.is_edited
This commit is contained in:
Andrej730
2024-10-22 12:05:07 +05:00
parent 76869b0b02
commit 8372e12f88
7 changed files with 20 additions and 24 deletions
+3 -3
View File
@@ -195,7 +195,7 @@ class TestAddRepresentation:
class TestSwitchRepresentation:
def test_switching_to_a_representation(self, ifc, geometry):
geometry.is_edited("obj").should_be_called().will_return(False)
ifc.is_edited("obj").should_be_called().will_return(False)
geometry.get_object_data("obj").should_be_called().will_return("current_obj_data")
geometry.reimport_element_representations("obj", "mapped_rep", apply_openings=True).should_be_called()
subject.switch_representation(
@@ -210,7 +210,7 @@ class TestSwitchRepresentation:
)
def test_updating_a_representation_if_the_blender_object_has_been_edited_prior_to_switching(self, ifc, geometry):
geometry.is_edited("obj").should_be_called().will_return(True)
ifc.is_edited("obj").should_be_called().will_return(True)
geometry.is_box_representation("mapped_rep").should_be_called().will_return(False)
geometry.get_representation_id("mapped_rep").should_be_called().will_return("representation_id")
geometry.run_geometry_update_representation(obj="obj").should_be_called()
@@ -228,7 +228,7 @@ class TestSwitchRepresentation:
)
def test_not_switching_if_an_updated_representation_is_the_same_one_we_were_going_to_switch_to(self, geometry):
geometry.is_edited("obj").should_be_called().will_return(True)
ifc.is_edited("obj").should_be_called().will_return(True)
geometry.is_box_representation("mapped_rep").should_be_called().will_return(False)
geometry.get_representation_id("mapped_rep").should_be_called().will_return("representation_id")
geometry.run_geometry_update_representation(obj="obj").should_be_called()
-12
View File
@@ -298,18 +298,6 @@ class TestIsBoxRepresentation(NewFile):
assert subject.is_box_representation(representation) is False
class TestIsEdited(NewFile):
def test_run(self):
obj = bpy.data.objects.new("Object", bpy.data.meshes.new("Mesh"))
assert subject.is_edited(obj) is False
obj.scale[0] = 2
assert subject.is_edited(obj) is True
obj.scale[0] = 1
assert subject.is_edited(obj) is False
tool.Ifc.edit(obj)
assert subject.is_edited(obj) is True
class TestIsMappedRepresentation(NewFile):
def test_run(self):
ifc = ifcopenshell.file()
+12
View File
@@ -66,6 +66,18 @@ class TestGetSchema(test.bim.bootstrap.NewFile):
assert subject.get_schema() == "IFC4"
class TestIsEdited(test.bim.bootstrap.NewFile):
def test_run(self):
obj = bpy.data.objects.new("Object", bpy.data.meshes.new("Mesh"))
assert subject.is_edited(obj) is False
obj.scale[0] = 2
assert subject.is_edited(obj) is True
obj.scale[0] = 1
assert subject.is_edited(obj) is False
tool.Ifc.edit(obj)
assert subject.is_edited(obj) is True
class TestIsMoved(test.bim.bootstrap.NewFile):
def test_run(self):
ifc = ifcopenshell.file()