-
Notifications
You must be signed in to change notification settings - Fork 310
/
TaggedLineSegment.cs
47 lines (42 loc) · 1.25 KB
/
TaggedLineSegment.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
using NetTopologySuite.Geometries;
namespace NetTopologySuite.Simplify
{
/// <summary>
/// A LineSegment which is tagged with its location in a <c>Geometry</c>.
/// Used to index the segments in a point and recover the segment locations
/// from the index.
/// </summary>
public class TaggedLineSegment : LineSegment
{
private readonly Geometry _parent;
private readonly int _index;
/// <summary>
///
/// </summary>
/// <param name="p0"></param>
/// <param name="p1"></param>
/// <param name="parent"></param>
/// <param name="index"></param>
public TaggedLineSegment(Coordinate p0, Coordinate p1, Geometry parent, int index)
: base(p0, p1)
{
_parent = parent;
_index = index;
}
/// <summary>
///
/// </summary>
/// <param name="p0"></param>
/// <param name="p1"></param>
public TaggedLineSegment(Coordinate p0, Coordinate p1)
: this(p0, p1, null, -1) { }
/// <summary>
///
/// </summary>
public Geometry Parent => _parent;
/// <summary>
///
/// </summary>
public int Index => _index;
}
}