示例#1
0
 /// <summary>
 /// Finds compatible edges for the specified set of edges
 /// </summary>
 /// <param name="edgeSet">
 ///     Edges for which we should find compatible edges
 /// </param>
 /// <param name="cancellationToken"></param>
 private void FindCompatibleEdges(Dictionary <KeyPair, EdgeGroupData> edgeSet, CancellationToken cancellationToken)
 {
     foreach (var p1 in edgeSet)
     {
         if (p1.Value.Length < 50)
         {
             continue;                      //??????
         }
         foreach (var p2 in _edgeGroupData)
         {
             if (p2.Value.Length < 50)
             {
                 continue;                      //??????
             }
             if (((p1.Key.K1 == p2.Key.K1) && (p1.Key.K2 == p2.Key.K2)) ||
                 (p1.Value.CompatibleGroups.ContainsKey(p2.Key)))
             {
                 continue;
             }
             //if ((((p1.Value.v1 == p2.Value.v1) && (p1.Value.v1.Y == p2.Value.v1.Y)) && (p1.Value.v2.X == p2.Value.v2.X) && (p1.Value.v2.Y == p2.Value.v2.Y)) ||
             //(((p1.Value.v1.X == p2.Value.v2.X) && (p1.Value.v1.Y == p2.Value.v2.Y)) && (p1.Value.v2.X == p2.Value.v1.X) && (p1.Value.v2.Y == p2.Value.v1.Y)))
             //    continue;
             var c = CalculateCompatibility(p1.Value, p2.Value);
             if (c == 0)
             {
                 continue;
             }
             var d   = CalculateDirectedness(p1.Value, p2.Value);
             var epd = new GroupPairData(c, p1.Value, p2.Value, d);
             p1.Value.CompatibleGroups.Add(p2.Key, epd);
             p2.Value.CompatibleGroups.Add(p1.Key, epd);
         }
     }
 }
示例#2
0
 /// <summary>
 /// Finds compatible edges for the specified set of edges
 /// </summary>
 ///
 /// <param name="edgeSet">
 /// Edges for which we should find compatible edges
 /// </param>
 private void FindCompatibleEdges(Dictionary <KeyPair, EdgeGroupData> edgeSet)
 {
     foreach (KeyValuePair <KeyPair, EdgeGroupData> p1 in edgeSet)
     {
         if (p1.Value.length < 50)
         {
             continue;                      //??????
         }
         foreach (KeyValuePair <KeyPair, EdgeGroupData> p2 in edgeGroupData)
         {
             if (p2.Value.length < 50)
             {
                 continue;                      //??????
             }
             if (((p1.Key.k1 == p2.Key.k1) && (p1.Key.k2 == p2.Key.k2)) ||
                 (p1.Value.compatibleGroups.ContainsKey(p2.Key)))
             {
                 continue;
             }
             //if ((((p1.Value.v1 == p2.Value.v1) && (p1.Value.v1.Y == p2.Value.v1.Y)) && (p1.Value.v2.X == p2.Value.v2.X) && (p1.Value.v2.Y == p2.Value.v2.Y)) ||
             //(((p1.Value.v1.X == p2.Value.v2.X) && (p1.Value.v1.Y == p2.Value.v2.Y)) && (p1.Value.v2.X == p2.Value.v1.X) && (p1.Value.v2.Y == p2.Value.v1.Y)))
             //    continue;
             float c = CalculateCompatibility(p1.Value, p2.Value);
             if (c == 0)
             {
                 continue;
             }
             bool          d   = CalculateDirectedness(p1.Value, p2.Value);
             GroupPairData epd = new GroupPairData(c, p1.Value, p2.Value, d);
             p1.Value.compatibleGroups.Add(p2.Key, epd);
             p2.Value.compatibleGroups.Add(p1.Key, epd);
         }
     }
 }
 /// <summary>
 /// Finds compatible edges for the specified set of edges
 /// </summary>
 /// 
 /// <param name="edgeSet">
 /// Edges for which we should find compatible edges
 /// </param>
 private void FindCompatibleEdges(Dictionary<KeyPair, EdgeGroupData> edgeSet)
 {
     foreach (KeyValuePair<KeyPair, EdgeGroupData> p1 in edgeSet)
     {
         if (p1.Value.length < 50) continue;//??????
         foreach (KeyValuePair<KeyPair, EdgeGroupData> p2 in edgeGroupData)
         {
             if (p2.Value.length < 50) continue;//??????
             if (((p1.Key.k1 == p2.Key.k1) && (p1.Key.k2 == p2.Key.k2))
                 || (p1.Value.compatibleGroups.ContainsKey(p2.Key)))
                 continue;
             //if ((((p1.Value.v1 == p2.Value.v1) && (p1.Value.v1.Y == p2.Value.v1.Y)) && (p1.Value.v2.X == p2.Value.v2.X) && (p1.Value.v2.Y == p2.Value.v2.Y)) ||
             //(((p1.Value.v1.X == p2.Value.v2.X) && (p1.Value.v1.Y == p2.Value.v2.Y)) && (p1.Value.v2.X == p2.Value.v1.X) && (p1.Value.v2.Y == p2.Value.v1.Y)))
             //    continue;
             float c = CalculateCompatibility(p1.Value, p2.Value);
             if (c == 0) continue;
             bool d = CalculateDirectedness(p1.Value, p2.Value);
             GroupPairData epd = new GroupPairData(c, p1.Value, p2.Value, d);
             p1.Value.compatibleGroups.Add(p2.Key, epd);
             p2.Value.compatibleGroups.Add(p1.Key, epd);
         }
     }
 }