-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSimplePoint.cs
60 lines (57 loc) · 1.79 KB
/
SimplePoint.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//-----------------------------------------------------------------------
// <copyright file="SimplePoint.cs" company="Studio A&T s.r.l.">
// Copyright (c) Studio A&T s.r.l. All rights reserved.
// </copyright>
// <author>Nicogis</author>
//-----------------------------------------------------------------------
namespace Studioat.ArcGIS.Voronoi
{
using System;
/// <summary>
/// class Triangulation
/// </summary>
public partial class Triangulation
{
/// <summary>
/// Define a simple point structure
/// </summary>
private struct SimplePoint : IComparable
{
/// <summary>
/// coordinate X and Y
/// </summary>
public double X, Y;
/// <summary>
/// Initializes a new instance of the <see cref="SimplePoint"/> struct
/// </summary>
/// <param name="x">coordinate X</param>
/// <param name="y">coordinate Y</param>
public SimplePoint(double x, double y)
{
this.X = x;
this.Y = y;
}
/// <summary>
/// Implement IComparable CompareTo method to enable sorting
/// </summary>
/// <param name="obj">object simple point</param>
/// <returns>value of compare</returns>
int IComparable.CompareTo(object obj)
{
SimplePoint other = (SimplePoint)obj;
if (this.X > other.X)
{
return 1;
}
else if (this.X < other.X)
{
return -1;
}
else
{
return 0;
}
}
}
}
}