mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Renaming constr_type back to relating_type
This commit is contained in:
@@ -31,8 +31,8 @@ Scenario: Add representation - add a new representation to a typed instance
|
||||
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 press "bim.add_constr_type"
|
||||
And I press "bim.add_constr_type"
|
||||
And I press "bim.add_relating_type"
|
||||
And I press "bim.add_relating_type"
|
||||
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
|
||||
@@ -146,9 +146,9 @@ Scenario: Remove representation - remove an instanced representation from an act
|
||||
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.constr_type_id" to "{cube}"
|
||||
And I press "bim.add_constr_type"
|
||||
And I press "bim.add_constr_type"
|
||||
And I set "scene.BIMModelProperties.relating_type_id" to "{cube}"
|
||||
And I press "bim.add_relating_type"
|
||||
And I press "bim.add_relating_type"
|
||||
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})"
|
||||
@@ -165,9 +165,9 @@ Scenario: Remove representation - remove an instanced representation from an act
|
||||
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.constr_type_id" to "{cube}"
|
||||
And I press "bim.add_constr_type"
|
||||
And I press "bim.add_constr_type"
|
||||
And I set "scene.BIMModelProperties.relating_type_id" to "{cube}"
|
||||
And I press "bim.add_relating_type"
|
||||
And I press "bim.add_relating_type"
|
||||
And the object "IfcWall/Wall" 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})"
|
||||
@@ -339,8 +339,8 @@ Scenario: Override duplicate move - copying a type instance with a representatio
|
||||
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.constr_type_id" to "{cube}"
|
||||
And I press "bim.add_constr_type"
|
||||
And I set "scene.BIMModelProperties.relating_type_id" to "{cube}"
|
||||
And I press "bim.add_relating_type"
|
||||
And the object "IfcWall/Wall" is selected
|
||||
When I press "object.duplicate_move"
|
||||
Then the object "IfcWall/Wall.001" exists
|
||||
|
||||
@@ -10,8 +10,8 @@ Scenario: Add type instance - add from a mesh
|
||||
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.constr_type_id" to "{cube}"
|
||||
When I press "bim.add_constr_type"
|
||||
And I set "scene.BIMModelProperties.relating_type_id" to "{cube}"
|
||||
When I press "bim.add_relating_type"
|
||||
Then the object "IfcWall/Wall" exists
|
||||
|
||||
Scenario: Add type instance - add from an empty
|
||||
@@ -23,8 +23,8 @@ Scenario: Add type instance - add from an empty
|
||||
And I press "bim.assign_class"
|
||||
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
|
||||
And the variable "empty" is "{ifc}.by_type('IfcWallType')[0].id()"
|
||||
And I set "scene.BIMModelProperties.constr_type_id" to "{empty}"
|
||||
When I press "bim.add_constr_type"
|
||||
And I set "scene.BIMModelProperties.relating_type_id" to "{empty}"
|
||||
When I press "bim.add_relating_type"
|
||||
Then the object "IfcWall/Wall" exists
|
||||
|
||||
Scenario: Add type instance - add a mesh where existing instances have changed context
|
||||
@@ -36,15 +36,15 @@ Scenario: Add type instance - add a mesh where existing instances have changed c
|
||||
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.constr_type_id" to "{cube}"
|
||||
And I press "bim.add_constr_type"
|
||||
And I set "scene.BIMModelProperties.relating_type_id" to "{cube}"
|
||||
And I press "bim.add_relating_type"
|
||||
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 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"
|
||||
When I press "bim.add_constr_type"
|
||||
When I press "bim.add_relating_type"
|
||||
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"
|
||||
|
||||
@@ -54,7 +54,7 @@ Scenario: Preview one type on the Construction Type Browser
|
||||
When I display the construction type browser
|
||||
And I preview only one asset on the construction type browser
|
||||
And I set "scene.BIMModelProperties.ifc_class_browser" to "IfcColumnType"
|
||||
And I set "scene.BIMModelProperties.constr_type_browser" to "DEMO2"
|
||||
And I set "scene.BIMModelProperties.relating_type_browser" to "DEMO2"
|
||||
And I select the browser construction type
|
||||
Then "scene.BIMModelProperties.ifc_class" is "IfcColumnType"
|
||||
And construction type is DEMO2
|
||||
@@ -77,7 +77,7 @@ Scenario: Add one type from the Construction Type Browser
|
||||
When I display the construction type browser
|
||||
And I preview only one asset on the construction type browser
|
||||
And I set "scene.BIMModelProperties.ifc_class_browser" to "IfcColumnType"
|
||||
And I set "scene.BIMModelProperties.constr_type_browser" to "DEMO2"
|
||||
And I set "scene.BIMModelProperties.relating_type_browser" to "DEMO2"
|
||||
And I add the browser construction type
|
||||
Then the object "IfcColumn/Column" exists
|
||||
|
||||
|
||||
@@ -575,27 +575,27 @@ def the_object_name_has_no_modifiers(name):
|
||||
assert len(the_object_name_exists(name).modifiers) == 0
|
||||
|
||||
|
||||
@then(parsers.parse('the construction type "{ifc_class}"/"{constr_type}" has a preview'))
|
||||
def the_construction_type_has_a_preview(ifc_class, constr_type):
|
||||
@then(parsers.parse('the construction type "{ifc_class}"/"{relating_type}" has a preview'))
|
||||
def the_construction_type_has_a_preview(ifc_class, relating_type):
|
||||
if "preview_constr_types" not in AuthoringData.data:
|
||||
assert False, 'There are no previews loaded'
|
||||
preview_constr_types = AuthoringData.data["preview_constr_types"]
|
||||
if ifc_class not in preview_constr_types:
|
||||
assert False, f'Construction class {ifc_class} has no available previews'
|
||||
constr_type_id = AuthoringData.constr_type_id_by_name(ifc_class, constr_type)
|
||||
if constr_type_id is None:
|
||||
assert False, f'No construction type {ifc_class}/{constr_type} was found'
|
||||
if constr_type_id not in preview_constr_types[ifc_class]:
|
||||
assert False, f'Construction type {ifc_class}/{constr_type} has no available previews'
|
||||
preview_data = preview_constr_types[ifc_class][constr_type_id]
|
||||
relating_type_id = AuthoringData.relating_type_id_by_name(ifc_class, relating_type)
|
||||
if relating_type_id is None:
|
||||
assert False, f'No construction type {ifc_class}/{relating_type} was found'
|
||||
if relating_type_id not in preview_constr_types[ifc_class]:
|
||||
assert False, f'Construction type {ifc_class}/{relating_type} has no available previews'
|
||||
preview_data = preview_constr_types[ifc_class][relating_type_id]
|
||||
if 'icon_id' not in preview_data:
|
||||
assert False, f'Construction type {ifc_class}/{constr_type} has a preview, but no assigned icon_id'
|
||||
assert False, f'Construction type {ifc_class}/{relating_type} has a preview, but no assigned icon_id'
|
||||
icon_id = preview_data["icon_id"]
|
||||
if not isinstance(icon_id, int):
|
||||
assert False, f'Construction type {ifc_class}/{constr_type} has an invalid icon_id {icon_id}'
|
||||
assert False, f'Construction type {ifc_class}/{relating_type} has an invalid icon_id {icon_id}'
|
||||
# Note: icon_id must be > 0 in UI mode, but asset_generate_preview() doesn't work headlessly -> skipping for now
|
||||
# if icon_id == 0:
|
||||
# assert False, f'Construction type {ifc_class}/{constr_type} has the default null value for icon_id'
|
||||
# assert False, f'Construction type {ifc_class}/{relating_type} has the default null value for icon_id'
|
||||
assert True
|
||||
|
||||
|
||||
@@ -627,19 +627,19 @@ def i_add_a_construction_library():
|
||||
@given("I display the construction type browser")
|
||||
@when("I display the construction type browser")
|
||||
def i_display_the_construction_type_browser():
|
||||
bpy.ops.bim.display_constr_types('INVOKE_DEFAULT')
|
||||
bpy.ops.bim.display_relating_types('INVOKE_DEFAULT')
|
||||
|
||||
|
||||
@given("I preview only one asset on the construction type browser")
|
||||
@when("I preview only one asset on the construction type browser")
|
||||
def i_preview_one_construction_type():
|
||||
bpy.context.scene.BIMModelProperties.unfold_constr_types = False
|
||||
bpy.context.scene.BIMModelProperties.unfold_relating_types = False
|
||||
|
||||
|
||||
@given("I preview all available assets on the construction type browser")
|
||||
@when("I preview all available assets on the construction type browser")
|
||||
def i_preview_all_construction_types():
|
||||
bpy.context.scene.BIMModelProperties.unfold_constr_types = True
|
||||
bpy.context.scene.BIMModelProperties.unfold_relating_types = True
|
||||
|
||||
|
||||
@given("I select the browser construction type")
|
||||
@@ -647,7 +647,7 @@ def i_preview_all_construction_types():
|
||||
def i_select_the_active_construction_type():
|
||||
props = bpy.context.scene.BIMModelProperties
|
||||
bpy.ops.bim.select_construction_type(
|
||||
ifc_class=props.ifc_class_browser, constr_type_id=props.constr_type_id_browser
|
||||
ifc_class=props.ifc_class_browser, relating_type_id=props.relating_type_id_browser
|
||||
)
|
||||
|
||||
|
||||
@@ -655,24 +655,24 @@ def i_select_the_active_construction_type():
|
||||
@when("I add the browser construction type")
|
||||
def i_add_the_active_construction_type():
|
||||
props = bpy.context.scene.BIMModelProperties
|
||||
bpy.ops.bim.add_constr_type(
|
||||
ifc_class=props.ifc_class_browser, constr_type_id=int(props.constr_type_id_browser)
|
||||
bpy.ops.bim.add_relating_type(
|
||||
ifc_class=props.ifc_class_browser, relating_type_id=int(props.relating_type_id_browser)
|
||||
)
|
||||
|
||||
|
||||
@then(parsers.parse("browser construction type is {constr_type_name}"))
|
||||
def browser_construction_type(constr_type_name):
|
||||
@then(parsers.parse("browser construction type is {relating_type_name}"))
|
||||
def browser_construction_type(relating_type_name):
|
||||
props = bpy.context.scene.BIMModelProperties
|
||||
constr_type_browser = AuthoringData.constr_type_name_by_id(props.ifc_class_browser, props.constr_type_id_browser)
|
||||
assert constr_type_browser == constr_type_name, (f"Construction Type is a {constr_type_browser}, not " +
|
||||
f"a {constr_type_name}")
|
||||
relating_type_browser = AuthoringData.relating_type_name_by_id(props.ifc_class_browser, props.relating_type_id_browser)
|
||||
assert relating_type_browser == relating_type_name, (f"Construction Type is a {relating_type_browser}, not " +
|
||||
f"a {relating_type_name}")
|
||||
|
||||
|
||||
@then(parsers.parse("construction type is {constr_type_name}"))
|
||||
def construction_type(constr_type_name):
|
||||
@then(parsers.parse("construction type is {relating_type_name}"))
|
||||
def construction_type(relating_type_name):
|
||||
props = bpy.context.scene.BIMModelProperties
|
||||
constr_type = AuthoringData.constr_type_name_by_id(props.ifc_class, props.constr_type_id)
|
||||
assert constr_type == constr_type_name, f"Construction Type is a {constr_type}, not a {constr_type_name}"
|
||||
relating_type = AuthoringData.relating_type_name_by_id(props.ifc_class, props.relating_type_id)
|
||||
assert relating_type == relating_type_name, f"Construction Type is a {relating_type}, not a {relating_type_name}"
|
||||
|
||||
|
||||
@when("I move the cursor to the bottom left corner")
|
||||
|
||||
Reference in New Issue
Block a user