3using System.Threading.Tasks;
16 private SortedDictionary<ISemanticElement, ChunkedList<ISemanticTriple>> points =
null;
47 this.elements.Add(
new KeyValuePair<ISemanticElement, ISemanticTriple>(Point, Triple));
55 public void Add(IEnumerable<ISemanticTriple> Triples,
int ZIndex)
57 if (!(Triples is
null))
60 this.
Add(Triple[ZIndex], Triple);
70 return new TripleEnumerator(this.elements.GetEnumerator());
77 IEnumerator IEnumerable.GetEnumerator()
79 return new TripleEnumerator(this.elements.GetEnumerator());
82 private class TripleEnumerator : IEnumerator<ISemanticTriple>
84 private readonly IEnumerator<KeyValuePair<ISemanticElement, ISemanticTriple>> e;
86 public TripleEnumerator(IEnumerator<KeyValuePair<ISemanticElement, ISemanticTriple>> e)
91 public ISemanticTriple Current => this.e.Current.Value;
92 object IEnumerator.Current => this.e.Current.Value;
93 public void Dispose() => this.e.Dispose();
94 public bool MoveNext() => this.e.MoveNext();
95 public void Reset() => this.e.Reset();
110 return Task.FromResult<IEnumerable<ISemanticTriple>>(Points);
121 return Task.FromResult<IEnumerator<ISemanticElement>>(this.points.Keys.GetEnumerator());
124 private void CheckOrdered()
126 if (this.points is
null)
128 SortedDictionary<ISemanticElement, ChunkedList<ISemanticTriple>> Ordered =
129 new SortedDictionary<ISemanticElement, ChunkedList<ISemanticTriple>>();
133 foreach (KeyValuePair<ISemanticElement, ISemanticTriple> P
in this.elements)
135 if ((LastPoint is
null || !LastPoint.Equals(P.Key)) &&
136 !Ordered.TryGetValue(P.Key, out Last))
139 Ordered[P.Key] = Last;
145 this.points = Ordered;
Task< IEnumerator< ISemanticElement > > GetValueEnumerator()
Gets an enumerator of all values along the line.
IEnumerator< ISemanticTriple > GetEnumerator()
Gets an enumerator over all elements in plance.
void Add(ISemanticElement Point, ISemanticTriple Triple)
Adds an element to the line.
void Add(IEnumerable< ISemanticTriple > Triples, int ZIndex)
Adds a set of triples to the plane.
ISemanticElement Reference2
Line reference 2.
Task< IEnumerable< ISemanticTriple > > GetTriples(ISemanticElement X)
Gets available triples on the line, having a given coordinate.
InMemorySemanticLine(ISemanticElement Reference1, ISemanticElement Reference2)
In-memory semantic line.
ISemanticElement Reference1
Line reference 1.
A chunked list is a linked list of chunks of objects of type T .
Interface for semantic nodes.
Interface for semantic lines.
Interface for semantic triples.