Update libraries to use Plan/Body/PLAN_VIEW instead of annotations.

This commit is contained in:
Dion Moult
2023-02-04 14:09:35 +11:00
parent 6bab10d2ac
commit a7cc58fb50
11 changed files with 1225 additions and 1118 deletions
@@ -19,10 +19,10 @@ Scenario: Add representation
And I press "bim.assign_class"
And the object "IfcWall/Cube" is selected
Then the object "IfcWall/Cube" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW"
When the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.TargetView == 'PLAN_VIEW'][0].id()"
When the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.ContextType == 'Plan' and c.ContextIdentifier == 'Body' and c.TargetView == 'PLAN_VIEW'][0].id()"
And I set "scene.BIMRootProperties.contexts" to "{context}"
And I press "bim.add_representation"
Then the object "IfcWall/Cube" data is a "Annotation2D" representation of "Plan/Annotation/PLAN_VIEW"
Then the object "IfcWall/Cube" data is a "Annotation2D" representation of "Plan/Body/PLAN_VIEW"
Scenario: Add representation - add a new representation to a typed instance
Given an empty IFC project
@@ -36,11 +36,11 @@ Scenario: Add representation - add a new representation to a typed instance
Then the object "IfcWall/Wall" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW"
And the object "IfcWall/Wall.001" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW"
When the object "IfcWall/Wall" is selected
And the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.TargetView == 'PLAN_VIEW'][0].id()"
And the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.ContextType == 'Plan' and c.ContextIdentifier == 'Body' and c.TargetView == 'PLAN_VIEW'][0].id()"
And I set "scene.BIMRootProperties.contexts" to "{context}"
And I press "bim.add_representation"
Then the object "IfcWall/Wall" data is a "Annotation2D" representation of "Plan/Annotation/PLAN_VIEW"
And the object "IfcWall/Wall.001" data is a "Annotation2D" representation of "Plan/Annotation/PLAN_VIEW"
Then the object "IfcWall/Wall" data is a "Annotation2D" representation of "Plan/Body/PLAN_VIEW"
And the object "IfcWall/Wall.001" data is a "Annotation2D" representation of "Plan/Body/PLAN_VIEW"
Scenario: Add representation - add a representation with a scale factor applied
Given an empty IFC project
@@ -79,7 +79,7 @@ Scenario: Switch representation - current edited representation is updated prior
And the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
And the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.ContextIdentifier=='Annotation'][0].id()"
And the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.ContextType == 'Plan' and c.ContextIdentifier=='Annotation'][0].id()"
And I set "scene.BIMRootProperties.contexts" to "{context}"
And I press "bim.add_representation"
When the object "IfcWall/Cube" is scaled to "2"
@@ -40,13 +40,13 @@ Scenario: Add type instance - add a mesh where existing instances have changed c
And I press "bim.add_constr_type_instance"
And the object "IfcWall/Wall" data is a "Tessellation" representation of "Model/Body/MODEL_VIEW"
And the object "IfcWall/Wall" is selected
And the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.TargetView == 'PLAN_VIEW'][0].id()"
And the variable "context" is "[c for c in {ifc}.by_type('IfcGeometricRepresentationSubContext') if c.ContextType == 'Plan' and c.ContextIdentifier == 'Body' and c.TargetView == 'PLAN_VIEW'][0].id()"
And I set "scene.BIMRootProperties.contexts" to "{context}"
And I press "bim.add_representation"
And the object "IfcWall/Wall" data is a "Annotation2D" representation of "Plan/Annotation/PLAN_VIEW"
And the object "IfcWall/Wall" data is a "Annotation2D" representation of "Plan/Body/PLAN_VIEW"
When I press "bim.add_constr_type_instance"
Then the object "IfcWall/Wall" data is a "Annotation2D" representation of "Plan/Annotation/PLAN_VIEW"
And the object "IfcWall/Wall.001" data is a "Annotation2D" representation of "Plan/Annotation/PLAN_VIEW"
Then the object "IfcWall/Wall" data is a "Annotation2D" representation of "Plan/Body/PLAN_VIEW"
And the object "IfcWall/Wall.001" data is a "Annotation2D" representation of "Plan/Body/PLAN_VIEW"
Scenario: Add one type from the Construction Type Browser
Given an empty IFC project
+27 -18
View File
@@ -50,21 +50,24 @@ class TestCreateProject:
project.run_context_add_context(
context_type="Model", context_identifier="Box", target_view="MODEL_VIEW", parent="model"
).should_be_called()
project.run_context_add_context(
context_type="Model", context_identifier="Annotation", target_view="SECTION_VIEW", parent="model"
).should_be_called()
project.run_context_add_context(
context_type="Model", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent="model"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="", target_view="", parent=0
).should_be_called().will_return("plan")
project.run_context_add_context(
context_type="Plan", context_identifier="Axis", target_view="GRAPH_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Body", target_view="PLAN_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="PLAN_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="SECTION_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent="plan"
).should_be_called()
project.run_root_assign_class(obj="site", ifc_class="IfcSite", context="body").should_be_called()
project.run_root_assign_class(obj="building", ifc_class="IfcBuilding", context="body").should_be_called()
@@ -107,21 +110,24 @@ class TestCreateProject:
project.run_context_add_context(
context_type="Model", context_identifier="Box", target_view="MODEL_VIEW", parent="model"
).should_be_called()
project.run_context_add_context(
context_type="Model", context_identifier="Annotation", target_view="SECTION_VIEW", parent="model"
).should_be_called()
project.run_context_add_context(
context_type="Model", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent="model"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="", target_view="", parent=0
).should_be_called().will_return("plan")
project.run_context_add_context(
context_type="Plan", context_identifier="Axis", target_view="GRAPH_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Body", target_view="PLAN_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="PLAN_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="SECTION_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent="plan"
).should_be_called()
project.run_root_assign_class(obj="site", ifc_class="IfcSite", context="body").should_be_called()
project.run_root_assign_class(obj="building", ifc_class="IfcBuilding", context="body").should_be_called()
@@ -173,21 +179,24 @@ class TestCreateProject:
project.run_context_add_context(
context_type="Model", context_identifier="Box", target_view="MODEL_VIEW", parent="model"
).should_be_called()
project.run_context_add_context(
context_type="Model", context_identifier="Annotation", target_view="SECTION_VIEW", parent="model"
).should_be_called()
project.run_context_add_context(
context_type="Model", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent="model"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="", target_view="", parent=0
).should_be_called().will_return("plan")
project.run_context_add_context(
context_type="Plan", context_identifier="Axis", target_view="GRAPH_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Body", target_view="PLAN_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="PLAN_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="SECTION_VIEW", parent="plan"
).should_be_called()
project.run_context_add_context(
context_type="Plan", context_identifier="Annotation", target_view="ELEVATION_VIEW", parent="plan"
).should_be_called()
project.run_root_assign_class(obj="site", ifc_class="IfcSite", context="body").should_be_called()
project.run_root_assign_class(obj="building", ifc_class="IfcBuilding", context="body").should_be_called()