Revize 2c9afc72
Přidáno uživatelem Vojtěch Bartička před asi 2 roky(ů)
Backend/Core/GraphUtils/Intersections.cs | ||
---|---|---|
4 | 4 |
{ |
5 | 5 |
public class Intersections |
6 | 6 |
{ |
7 |
public static Dictionary<AnnotationTag, List<AnnotationTag>> FindIntersections(List<AnnotationTag> tags)
|
|
7 |
public static Dictionary<AnnotationTagGeneric, List<AnnotationTagGeneric>> FindIntersections(List<AnnotationTagGeneric> tags)
|
|
8 | 8 |
{ |
9 |
var intersections = new Dictionary<AnnotationTag, List<AnnotationTag>>();
|
|
9 |
var intersections = new Dictionary<AnnotationTagGeneric, List<AnnotationTagGeneric>>();
|
|
10 | 10 |
|
11 | 11 |
for (int i = 0; i < tags.Count; i++) |
12 | 12 |
{ |
... | ... | |
27 | 27 |
return intersections; |
28 | 28 |
} |
29 | 29 |
|
30 |
public static Dictionary<AnnotationTag, int> ColorGraph(Dictionary<AnnotationTag, List<AnnotationTag>> source)
|
|
30 |
public static Dictionary<AnnotationTagGeneric, int> ColorGraph(Dictionary<AnnotationTagGeneric, List<AnnotationTagGeneric>> source)
|
|
31 | 31 |
{ |
32 | 32 |
var res = ConvertToMatrix(source); |
33 | 33 |
var matrix = res.Item1; |
... | ... | |
47 | 47 |
colors[coloredNode] = GetLowestUnusedColor(neighbourColors); |
48 | 48 |
} |
49 | 49 |
|
50 |
var coloring = new Dictionary<AnnotationTag, int>(); |
|
50 |
var coloring = new Dictionary<AnnotationTagGeneric, int>();
|
|
51 | 51 |
for (int i = 0; i < colors.Length; i++) |
52 | 52 |
{ |
53 | 53 |
coloring[intToTagDict[i]] = colors[i]; |
... | ... | |
104 | 104 |
return neighbours; |
105 | 105 |
} |
106 | 106 |
|
107 |
private static (int[,], Dictionary<AnnotationTag, int>, Dictionary<int, AnnotationTag>) ConvertToMatrix(Dictionary<AnnotationTag, List<AnnotationTag>> source)
|
|
107 |
private static (int[,], Dictionary<AnnotationTagGeneric, int>, Dictionary<int, AnnotationTagGeneric>) ConvertToMatrix(Dictionary<AnnotationTagGeneric, List<AnnotationTagGeneric>> source)
|
|
108 | 108 |
{ |
109 | 109 |
int[,] matrix = new int[source.Count, source.Count]; |
110 | 110 |
for (int i = 0; i < source.Count; i++) |
... | ... | |
115 | 115 |
} |
116 | 116 |
} |
117 | 117 |
|
118 |
var tagToIntDict = new Dictionary<AnnotationTag, int>(); |
|
119 |
var intToTagDict = new Dictionary<int, AnnotationTag>(); |
|
118 |
var tagToIntDict = new Dictionary<AnnotationTagGeneric, int>();
|
|
119 |
var intToTagDict = new Dictionary<int, AnnotationTagGeneric>();
|
|
120 | 120 |
|
121 | 121 |
int k = 0; |
122 | 122 |
foreach (var key in source.Keys) |
Také k dispozici: Unified diff
Moved HTML processing to HTMLService, inheritance changes in entities