Skip to content

Commit a182792

Browse files
[API-519] Improved the scene controller documentation
1 parent 29f8e5c commit a182792

File tree

1 file changed

+63
-79
lines changed

1 file changed

+63
-79
lines changed

src/scene_controller/__init__.pyi

Lines changed: 63 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,177 +1,161 @@
11
from typing import List
2+
from cadwork.api_types import *
23

34
def add_scene(name: str) -> bool:
4-
"""Adds a new scene
5+
"""Adds a new scene.
56
67
Parameters:
7-
name: name
8+
name: The scene name.
89
910
Returns:
10-
did operation succeed
11+
True if the operation succeeded, false otherwise.
1112
"""
1213

1314
def rename_scene(old_name: str, new_name: str) -> bool:
14-
"""Renames a scene
15+
"""Renames a scene.
1516
1617
Parameters:
17-
old_name: old_name
18-
new_name: new_name
18+
old_name: The old scene name.
19+
new_name: The new scene name.
1920
2021
Returns:
21-
did operation succeed
22+
True if the operation succeeded, false otherwise.
2223
"""
2324

2425
def delete_scene(name: str) -> bool:
25-
"""Deletes a scene
26+
"""Deletes a scene.
2627
2728
Parameters:
28-
name: name
29+
name: The scene name.
2930
3031
Returns:
31-
did operation succeed
32+
True if the operation succeeded, false otherwise.
3233
"""
3334

34-
def add_elements_to_scene(name: str, element_i_ds: List[int]) -> bool:
35-
"""Adds elements to a scene
35+
def add_elements_to_scene(name: str, element_id_list: List[ElementId]) -> bool:
36+
"""Adds elements to a scene.
3637
3738
Parameters:
38-
name: name
39-
element_i_ds: element_i_ds
39+
name: The scene name.
40+
element_id_list:: The element id list.
4041
4142
Returns:
42-
did operation succeed
43+
True if the operation succeeded, false otherwise.
4344
"""
4445

45-
def remove_elements_from_scene(name: str, element_i_ds: List[int]) -> bool:
46-
"""Removes elements from a scene
46+
def remove_elements_from_scene(name: str, element_id_list: List[ElementId]) -> bool:
47+
"""Removes elements from a scene.
4748
4849
Parameters:
49-
name: name
50-
element_i_ds: element_i_ds
50+
name: The scene name.
51+
element_id_list:: The element id list.
5152
5253
Returns:
53-
did operation succeed
54+
True if the operation succeeded, false otherwise.
5455
"""
5556

56-
def get_elements_from_scene(name: str) -> List[int]:
57-
"""Gets the elements from a scene
57+
def get_elements_from_scene(name: str) -> List[ElementId]:
58+
"""Gets the elements from a scene.
5859
5960
Parameters:
60-
name: name
61+
name: The scene name.
6162
6263
Returns:
63-
element ID list
64+
The element id list.
6465
"""
6566

6667
def activate_scene(name: str) -> bool:
67-
"""Activates a scene
68+
"""Activates a scene.
6869
6970
Parameters:
70-
name: name
71+
name: The scene name.
7172
7273
Returns:
73-
did operation succeed
74+
True if the operation succeeded, false otherwise.
7475
"""
7576

7677
def clear_errors() -> None:
77-
"""clear errors
78-
79-
Returns:
80-
None
78+
"""Clears all errors.
8179
"""
8280

8381
def get_scene_list() -> List[str]:
84-
"""get scene list
82+
"""Gets the list of scenes.
8583
8684
Returns:
87-
List[str]
85+
The list of scene names.
8886
"""
8987

90-
91-
def group_scences(scene_names: List[str]) -> int:
92-
"""group scences
88+
def group_scences(scene_names: List[str]) -> UnsignedInt:
89+
"""Groups the scenes to a scene group.
9390
9491
Parameters:
95-
scene_names: scene_names
92+
scene_names: The scene names.
9693
9794
Returns:
98-
int
95+
The index of the new group.
9996
"""
10097

101-
102-
def ungroup_scences(group_index: int) -> None:
103-
"""ungroup scences
98+
def ungroup_scences(group_index: UnsignedInt) -> None:
99+
"""Deletes the group of scenes.
104100
105101
Parameters:
106-
group_index: group_index
107-
108-
Returns:
109-
None
102+
group_index: The index of the group.
110103
"""
111104

112105
def is_scene_present(name: str) -> bool:
113-
"""Queries of scene with name is present
106+
"""Checks if a scene is present.
114107
115108
Parameters:
116-
name: name
109+
name: The name of the scene to check.
117110
118111
Returns:
119-
presence of scene
112+
True if the scene is present, false otherwise.
120113
"""
121114

122115
def set_group_tab_color(scene_group_name: str, red: int, green: int, blue: int) -> None:
123-
"""set group tab color
116+
# TODO : Missing alpha parameter
117+
"""Sets the group tab color.
124118
125119
Parameters:
126-
scene_group_name: scene_group_name
127-
red: red
128-
green: green
129-
blue: blue
130-
131-
Returns:
132-
None
120+
scene_group_name: The name of the scene group.
121+
red: Red component.
122+
green: Green component.
123+
blue: Blue component.
133124
"""
134125

135126
def rename_scene_group(old_name: str, new_name: str) -> None:
136-
"""rename scene group
127+
"""Renames a scene group.
137128
138129
Parameters:
139-
old_name: old_name
140-
new_name: new_name
141-
142-
Returns:
143-
None
130+
old_name: The old scene group name.
131+
new_name: The new scene group name.
144132
"""
145133

146-
def get_group_index_by_name(scene_group_name: str) -> int:
147-
"""get group index by name
134+
def get_group_index_by_name(scene_group_name: str) -> UnsignedInt:
135+
"""Gets the index of a scene group by its name.
148136
149137
Parameters:
150-
scene_group_name: scene_group_name
138+
scene_group_name: The group name.
151139
152140
Returns:
153-
int
141+
The index of the group, or a maximum uint64_t if not found.
154142
"""
155143

156-
def rename_scene_group_by_index(group_index: int, new_name: str) -> None:
157-
"""rename scene group by index
144+
def rename_scene_group_by_index(group_index: UnsignedInt, new_name: str) -> None:
145+
"""Renames a scene group by its index.
158146
159147
Parameters:
160-
group_index: group_index
161-
new_name: new_name
162-
163-
Returns:
164-
None
148+
group_index: The index of the group.
149+
new_name: The new scene group name.
165150
"""
166151

167-
168-
def group_scences_with_name(scene_names: List[str], group_name: str) -> int:
169-
"""group scences with name
152+
def group_scences_with_name(scene_names: List[str], group_name: str) -> UnsignedInt:
153+
"""Groups the scenes to a scene group and sets the name of the new group.
170154
171155
Parameters:
172-
scene_names: scene_names
173-
group_name: group_name
156+
scene_names: The scene names to group.
157+
group_name: The name of the new group.
174158
175159
Returns:
176-
int
160+
The index of the new group.
177161
"""

0 commit comments

Comments
 (0)