本文整理汇总了C#中System.Point.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Point.Select方法的具体用法?C# Point.Select怎么用?C# Point.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Point
的用法示例。
在下文中一共展示了Point.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OneIteration
/// <summary>
/// Does one iterations in which a miniminum spanning tree is
/// determined on the delaunay triangulation and finally the tree is exanded to resolve the overlaps.
/// </summary>
/// <param name="nodePositions"></param>
/// <param name="nodeSizes"></param>
/// <param name="scanlinePhase"></param>
/// <returns></returns>
bool OneIteration(Point[] nodePositions, Size[] nodeSizes, bool scanlinePhase) {
var cdt = new Cdt(nodePositions.Select((p, index) => Tuple.Create(p, (object) index)));
cdt.Run();
var siteIndex = new Dictionary<CdtSite, int>();
for (int i = 0; i < nodePositions.Length; i++)
siteIndex[cdt.PointsToSites[nodePositions[i]]] = i;
int numCrossings = 0;
List<Tuple<int, int, double, double, double>> proximityEdges =
new List<Tuple<int, int, double, double, double>>();
foreach (var site in cdt.PointsToSites.Values)
foreach (var edge in site.Edges) {
Point point1 = edge.upperSite.Point;
Point point2 = edge.lowerSite.Point;
var nodeId1 = siteIndex[edge.upperSite];
var nodeId2 = siteIndex[edge.lowerSite];
Debug.Assert(ApproximateComparer.Close(point1, nodePositions[nodeId1]));
Debug.Assert(ApproximateComparer.Close(point2, nodePositions[nodeId2]));
var tuple = GetIdealEdgeLength(nodeId1, nodeId2, point1, point2, nodeSizes, _overlapForLayers);
proximityEdges.Add(tuple);
if (tuple.Item3 > 1) numCrossings++;
}
if (numCrossings == 0 || scanlinePhase) {
int additionalCrossings = FindProximityEdgesWithSweepLine(proximityEdges, nodeSizes, nodePositions);
if (numCrossings == 0 && additionalCrossings == 0) {
// if(nodeSizes.Length>100)
// ShowAndMoveBoxesRemoveLater(null, proximityEdges, nodeSizes, nodePositions, -1);
return false;
}
if (numCrossings == 0 && !scanlinePhase) return false;
}
var treeEdges = MstOnDelaunayTriangulation.GetMstOnTuple(proximityEdges, nodePositions.Length);
int rootId = treeEdges.First().Item1;
// if (nodeSizes.Length > 100)
// ShowAndMoveBoxesRemoveLater(treeEdges, proximityEdges, nodeSizes, nodePositions, rootId);
MoveNodePositions(treeEdges, nodePositions, rootId);
return true;
}