Debian Codegraph @

src/bonsai/test/bim/feature/style.feature

raw
1 @style
2 Feature: Style
3
4
5 Scenario: Unlink style
6 Given an empty IFC project
7 And I add a cube
8 And the object "Cube" is selected
9 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
10 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
11 And I press "bim.assign_class"
12 And the object "IfcWall/Cube" is selected
13 And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
14 And I press "bim.enable_adding_presentation_style"
15 And I set "scene.BIMStylesProperties.style_name" to "Style"
16 And I press "bim.add_presentation_style"
17 And the variable "style" is "{ifc}.by_type('IfcSurfaceStyle')[0].id()"
18 And I press "bim.assign_style_to_selected(style_id={style})"
19 When I press "bim.unlink_style(blender_material='Style')"
20 Then the material "Style" is not an IFC style
21
22 Scenario: Add a new style
23 Given an empty IFC project
24 And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
25 And I press "bim.enable_adding_presentation_style"
26 And I set "scene.BIMStylesProperties.style_name" to "Style"
27 And I set "scene.BIMStylesProperties.surface_colour" to "[1.0,0.0,0.0]"
28 When I press "bim.add_presentation_style"
29 Then the material "Style" colour is "1,0,0,1"
30 And the material "Style" is an IFC style
31
32 Scenario: Disable adding a new style
33 Given an empty IFC project
34 And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
35 And I press "bim.enable_adding_presentation_style"
36 When I press "bim.disable_adding_presentation_style"
37 Then nothing happens
38
39 Scenario: Remove style
40 Given an empty IFC project
41 And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
42 And I press "bim.enable_adding_presentation_style"
43 And I set "scene.BIMStylesProperties.style_name" to "Style"
44 And I set "scene.BIMStylesProperties.surface_colour" to "[1.0,0.0,0.0]"
45 And I press "bim.add_presentation_style"
46 And the variable "style" is "{ifc}.by_type('IfcSurfaceStyle')[0].id()"
47 When I press "bim.remove_style(style={style})"
48 Then the material "Style" does not exist
49
50 Scenario: Edit style
51 Given an empty IFC project
52 And I look at the "Styles" panel
53 And I click "IMPORT"
54 And I click "ADD"
55 And I set the "Name" property to "Style"
56 And I click "Save New Style"
57 And the variable "style" is "{ifc}.by_type('IfcSurfaceStyle')[0].id()"
58 And I click "GREASEPENCIL"
59 And I set the "Name" property to "NewStyle"
60 When I click "Save Attributes"
61 Then the material "Style" does not exist
62 And the material "NewStyle" exists
63
64 Scenario: Disable editing style
65 Given an empty IFC project
66 And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
67 And I press "bim.enable_adding_presentation_style"
68 And I set "scene.BIMStylesProperties.style_name" to "Style"
69 And I press "bim.add_presentation_style"
70 And the variable "style" is "{ifc}.by_type('IfcSurfaceStyle')[0].id()"
71 And I press "bim.enable_editing_style(style={style})"
72 And I set "scene.BIMStylesProperties.attributes[0].string_value" to "NewStyle"
73 When I press "bim.disable_editing_style"
74 Then the material "NewStyle" does not exist
75 And the material "Style" exists
76
77 Scenario: Load styles
78 Given an empty IFC project
79 When I press "bim.load_styles(style_type='IfcSurfaceStyle')"
80 Then nothing happens
81
82 Scenario: Disable editing styles
83 Given an empty IFC project
84 And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
85 When I press "bim.disable_editing_styles"
86 Then nothing happens
87
88 Scenario: Assign style to selected
89 Given an empty IFC project
90 And I add a cube
91 And the object "Cube" is selected
92 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
93 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
94 And I press "bim.assign_class"
95 And the object "IfcWall/Cube" is selected
96 And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
97 And I press "bim.enable_adding_presentation_style"
98 And I set "scene.BIMStylesProperties.style_name" to "Style"
99 And I press "bim.add_presentation_style"
100 And the variable "style" is "{ifc}.by_type('IfcSurfaceStyle')[0].id()"
101 When I press "bim.assign_style_to_selected(style_id={style})"
102 Then the object "IfcWall/Cube" has the material "Style"
103
104 Scenario: Select by style
105 Given an empty IFC project
106 And I add a cube
107 And the object "Cube" is selected
108 And I set "scene.BIMRootProperties.ifc_product" to "IfcElement"
109 And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
110 And I press "bim.assign_class"
111 And the object "IfcWall/Cube" is selected
112 And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
113 And I press "bim.enable_adding_presentation_style"
114 And I set "scene.BIMStylesProperties.style_name" to "Style"
115 And I press "bim.add_presentation_style"
116 And the variable "style" is "{ifc}.by_type('IfcSurfaceStyle')[0].id()"
117 And I press "bim.assign_style_to_selected(style_id={style})"
118 And the variable "style" is "{ifc}.by_type('IfcSurfaceStyle')[0].id()"
119 When I deselect all objects
120 And I press "bim.select_by_style(style={style})"
121 Then the object "IfcWall/Cube" is selected