IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
PointXYZI.cs
Go to the documentation of this file.
2
8public class PointXYZI
9{
22 public PointXYZI(float x, float y, float z, ushort intensity)
23 {
24 X = x;
25 Y = y;
26 Z = z;
27 Intensity = intensity;
28 }
29
34 public float X { get; set; }
35
40 public float Y { get; set; }
41
46 public float Z { get; set; }
47
52 public ushort Intensity { get; set; }
53
58 public static IEqualityComparer<PointXYZI> Comparer { get; } = new PointXYZIEqualityComparer();
59
60
67 public override string ToString()
68 {
69 return $"X: {X}, Y: {Y}, Z: {Z}, Intensity: {Intensity}";
70 }
71
72 private sealed class PointXYZIEqualityComparer : IEqualityComparer<PointXYZI>
73 {
74 public bool Equals(PointXYZI x, PointXYZI y)
75 {
76 if (ReferenceEquals(x, y))
77 {
78 return true;
79 }
80
81 if (ReferenceEquals(x, null))
82 {
83 return false;
84 }
85
86 if (ReferenceEquals(y, null))
87 {
88 return false;
89 }
90
91 return x.X.Equals(y.X) && x.Y.Equals(y.Y) && x.Z.Equals(y.Z) && x.Intensity.Equals(y.Intensity);
92 }
93
94 public int GetHashCode(PointXYZI obj)
95 {
96 return (obj.X, obj.Y, obj.Z, obj.Intensity).GetHashCode();
97 }
98 }
99}
Represents a 3D point with floating-point coordinates (X, Y, Z) and intensity value.
Definition PointXYZI.cs:9
ushort Intensity
Gets or sets the intensity of the point.
Definition PointXYZI.cs:52
PointXYZI(float x, float y, float z, ushort intensity)
Initializes a new instance of the PointXYZI class with specified coordinates.
Definition PointXYZI.cs:22
float Z
Gets or sets the Z coordinate of the point.
Definition PointXYZI.cs:46
override string ToString()
Returns a string representation of the point.
Definition PointXYZI.cs:67
float X
Gets or sets the X coordinate of the point.
Definition PointXYZI.cs:34
static IEqualityComparer< PointXYZI > Comparer
Gets a default equality comparer for comparing PointXYZI data values.
Definition PointXYZI.cs:58
float Y
Gets or sets the Y coordinate of the point.
Definition PointXYZI.cs:40