Fix representation where removing a representation left objects with an empty mesh. Now a proper empty is used.

This commit is contained in:
Dion Moult
2021-11-08 21:04:48 +11:00
parent 0471f17d9a
commit 7fbf317ad2
8 changed files with 175 additions and 32 deletions
@@ -84,6 +84,66 @@ Scenario: Switch representation - existing Blender modifiers must be purged
And I press "bim.switch_representation(obj='IfcWall/Cube', ifc_definition_id={representation})"
Then the object "IfcWall/Cube" has no modifiers
Scenario: Remove representation - remove an active representation
Given an empty IFC project
And I add a cube
And the object "Cube" is selected
And I add an array modifier
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
When the variable "representation" is "{ifc}.by_type('IfcShapeRepresentation')[0].id()"
And I press "bim.remove_representation(representation_id={representation})"
Then the object "IfcWall/Cube" has no data
Scenario: Remove representation - remove an unloaded representation
Given an empty IFC project
And I add a cube
And the object "Cube" is selected
And I add an array modifier
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
When the variable "representation" is "{ifc}.by_type('IfcShapeRepresentation')[1].id()"
And I press "bim.remove_representation(representation_id={representation})"
Then the object "IfcWall/Cube" has data which is an IFC representation
Scenario: Remove representation - remove an instanced representation from an active type object
Given an empty IFC project
And I add a cube
And the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
And I press "bim.assign_class"
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
And I set "scene.BIMModelProperties.relating_type" to "{cube}"
And I press "bim.add_type_instance"
And I press "bim.add_type_instance"
And the object "IfcWallType/Cube" is selected
When the variable "representation" is "{ifc}.by_type('IfcWallType')[0].RepresentationMaps[1].MappedRepresentation.id()"
And I press "bim.remove_representation(representation_id={representation})"
Then the object "IfcWallType/Cube" has no data
Then the object "IfcWall/Instance" has no data
Then the object "IfcWall/Instance.001" has no data
Scenario: Remove representation - remove an instanced representation from an active instance object
Given an empty IFC project
And I add a cube
And the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_product" to "IfcElementType"
And I set "scene.BIMRootProperties.ifc_class" to "IfcWallType"
And I press "bim.assign_class"
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
And the variable "cube" is "{ifc}.by_type('IfcWallType')[0].id()"
And I set "scene.BIMModelProperties.relating_type" to "{cube}"
And I press "bim.add_type_instance"
And I press "bim.add_type_instance"
And the object "IfcWall/Instance" is selected
When the variable "representation" is "{ifc}.by_type('IfcWall')[0].Representation.Representations[1].id()"
And I press "bim.remove_representation(representation_id={representation})"
Then the object "IfcWallType/Cube" has no data
Then the object "IfcWall/Instance" has no data
Then the object "IfcWall/Instance.001" has no data
Scenario: Update representation - updating a tessellation
Given an empty IFC project
And I add a cube
+5
View File
@@ -356,6 +356,11 @@ def the_object_name_is_not_an_ifc_element(name):
assert id == 0, f"The ID is {id}"
@then(parsers.parse('the object "{name}" has no data'))
def the_object_name_has_no_data(name):
assert the_object_name_exists(name).data is None
@then(parsers.parse('the object "{name}" has data which is an IFC representation'))
def the_object_name_is_not_an_ifc_element(name):
id = the_object_name_exists(name).data.BIMMeshProperties.ifc_definition_id