Skip to content

Commit dfc4c71

Browse files
authored
Merge pull request #252 from cwapi3d/feature/add-missing-types
Add rgb_color class and update type hints in various functions
2 parents 8309875 + 136e038 commit dfc4c71

File tree

7 files changed

+108
-4
lines changed

7 files changed

+108
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cwapi3d"
3-
version = "32.246.0"
3+
version = "32.261.0"
44
authors = [{ name = "Cadwork", email = "it@cadwork.ca" }]
55
requires-python = ">= 3.12"
66
description = 'Python bindings for CwAPI3D'

src/cadwork/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from cadwork.rgb_color import rgb_color
12
from .attribute_display_settings import attribute_display_settings
23
from .bim_team_upload_result import bim_team_upload_result
34
from .bim_team_upload_result_code import bim_team_upload_result_code
@@ -112,6 +113,7 @@ hit_result = hit_result
112113
dimension_base_format = dimension_base_format
113114
dxf_layer_format_type = dxf_layer_format_type
114115
dxf_export_version = dxf_export_version
116+
rgb_color = rgb_color
115117

116118

117119
def get_auto_attribute_elements() -> List[int]:

src/cadwork/facet_list.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class facet_list:
1111
int
1212
"""
1313

14-
def at(self, index: int) -> point_3d:
14+
def at(self, index: int) -> vertex_list:
1515
"""at
1616
1717
Parameters:

src/cadwork/point_3d.pyi

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,99 @@ class point_3d:
6363
'point_3d'
6464
"""
6565

66+
def __sub__(self, other: 'point_3d') -> 'point_3d':
67+
"""sub
68+
69+
Parameters:
70+
other: other
71+
72+
Returns:
73+
'point_3d'
74+
"""
75+
76+
def __truediv__(self, other: float) -> 'point_3d':
77+
"""truediv
78+
79+
Parameters:
80+
other: other
81+
82+
Returns:
83+
'point_3d'
84+
"""
85+
86+
def __iadd__(self, other: 'point_3d') -> 'point_3d':
87+
"""iadd
88+
89+
Parameters:
90+
other: other
91+
92+
Returns:
93+
'point_3d'
94+
"""
95+
96+
def __isub__(self, other: 'point_3d') -> 'point_3d':
97+
"""isub
98+
99+
Parameters:
100+
other: other
101+
102+
Returns:
103+
'point_3d'
104+
"""
105+
106+
def __imul__(self, other: float) -> 'point_3d':
107+
"""imul
108+
109+
Parameters:
110+
other: other
111+
112+
Returns:
113+
'point_3d'
114+
"""
115+
116+
def __itruediv__(self, other: float) -> 'point_3d':
117+
"""itruediv
118+
119+
Parameters:
120+
other: other
121+
122+
Returns:
123+
'point_3d'
124+
"""
125+
126+
def __neg__(self) -> 'point_3d':
127+
"""neg
128+
129+
Returns:
130+
'point_3d'
131+
"""
132+
133+
def __eq__(self, other: object) -> bool:
134+
"""eq
135+
136+
Parameters:
137+
other: other
138+
139+
Returns:
140+
bool
141+
"""
142+
143+
def __ne__(self, other: object) -> bool:
144+
"""neg
145+
146+
Parameters:
147+
other: other
148+
149+
Returns:
150+
bool
151+
"""
152+
153+
def __add__(self, other: 'point_3d') -> 'point_3d':
154+
"""add
155+
156+
Parameters:
157+
other: other
158+
159+
Returns:
160+
'point_3d'
161+
"""

src/cadwork/rgb_color.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class rgb_color:
2+
def __init__(self, r, g, b):
3+
self.r = r
4+
self.g = g
5+
self.b = b

src/utility_controller/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ def get_language() -> str:
7272
"""
7373

7474

75-
def print_message(message: str, column: int) -> None:
75+
def print_message(message: str, row: int, column: int) -> None:
7676
"""Prints a message
7777
7878
Parameters:
7979
message: message
80+
row: row
8081
column: column
8182
8283
Returns:

src/visualization_controller/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def get_material(element_id: int) -> int:
453453
"""
454454

455455

456-
def get_rgb_from_cadwork_color_id(color_id: None) -> 'rgb_color':
456+
def get_rgb_from_cadwork_color_id(color_id: int) -> 'rgb_color':
457457
"""get rgb from cadwork color id
458458
459459
Parameters:

0 commit comments

Comments
 (0)