1from __future__
import annotations
8 Represents a point in 3D space.
11 @ingroup ids_peak_icv_python_types_geometry
12 @since ids_peak_icv 1.1
15 def __init__(self, x: float, y: float, z: float) ->
None:
18 Creates a point with x, y and z float channels.
20 @param x: x coordinate
21 @param y: y coordinate
22 @param z: z coordinate
24 @since ids_peak_icv 1.1
26 self.
xx = np.float32(x)
27 self.
y = np.float32(y)
28 self.
z = np.float32(z)
30 def __eq__(self, other: object) -> bool:
33 Check if two points of type PointXYZ are equal.
35 @param other: Another PointXYZ object OR List of coordinates [x, y, z] OR Tuple of coordinates (x, y, z)
37 @return True if points are equal, False otherwise
39 @since ids_peak_icv 1.1
41 from typing
import cast
43 if isinstance(other, PointXYZ):
44 other = cast(PointXYZ, other)
45 return bool(self.
xx == other.x
and self.
y == other.y
and self.
z == other.z)
46 if isinstance(other, list)
or isinstance(other, tuple):
49 other = cast(list | tuple, other)
51 return bool(self.
xx == other[0]
and self.
y == other[1]
and self.
z == other[2])
55 def __ne__(self, other: object) -> bool:
58 Check if two points of type PointXYZ are not equal.
60 @param other: Another PointXYZ
62 @return True if points are not equal, False otherwise
64 @since ids_peak_icv 1.1
66 return not self.
__eq__(other)
68 def __gt__(self, other: object) -> bool:
71 Check if a point of type PointXYZ is greater than another point of type PointXYZ.
73 @param other: Another peak_icv_point_xyz
75 @return True if point of type PointXYZ is greater than, False otherwise
77 @since ids_peak_icv 1.1
80 def gt_point(x: np.float32, y: np.float32, z: np.float32) -> bool:
91 return bool(self.
z > z)
93 if isinstance(other, PointXYZ):
94 return gt_point(other.x, other.y, other.z)
96 if isinstance(other, list)
or isinstance(other, tuple):
99 return gt_point(other[0], other[1], other[2])
109 Get a string representation of the PointXYZ.
111 @return String representation of the PointXYZ
113 @since ids_peak_icv 1.1
115 return f
"({self.x:.3f}, {self.y:.3f}, {self.z:.3f})"
Represents a point in 3D space.
bool __lt__(self, object other)
bool __eq__(self, object other)
Check if two points of type PointXYZ are equal.
str __str__(self)
Get a string representation of the PointXYZ.
bool __ne__(self, object other)
Check if two points of type PointXYZ are not equal.
bool __gt__(self, object other)
Check if a point of type PointXYZ is greater than another point of type PointXYZ.
None __init__(self, float x, float y, float z)
Creates a point with x, y and z float channels.