本文整理汇总了C#中IEdge.GetAdjacentVertex方法的典型用法代码示例。如果您正苦于以下问题:C# IEdge.GetAdjacentVertex方法的具体用法?C# IEdge.GetAdjacentVertex怎么用?C# IEdge.GetAdjacentVertex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEdge
的用法示例。
在下文中一共展示了IEdge.GetAdjacentVertex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: return
IncidentEdgeShouldBeHidden
(
IEdge oIncidentEdge,
IVertex oVertex,
Int32 iGroupIndex,
Dictionary<Int32, Int32> oGroupIndexDictionary
)
{
Debug.Assert(oIncidentEdge != null);
Debug.Assert(oVertex != null);
Debug.Assert(iGroupIndex >= 0);
Debug.Assert(oGroupIndexDictionary != null);
Int32 iOtherGroupIndex = oGroupIndexDictionary[
oIncidentEdge.GetAdjacentVertex(oVertex).ID];
return (
// The edge's vertices are not in the same group.
iOtherGroupIndex != iGroupIndex
&&
// The edge has not already been hidden.
!oIncidentEdge.ContainsKey(ReservedMetadataKeys.SavedVisibility)
);
}
示例2: AssertValid
IncidentEdgeShouldBeCounted
(
IEdge oIncidentEdge,
IVertex oVertexInGroup1,
Int32 iGroup1Index,
Dictionary<Int32, Int32> oGroupIndexDictionary,
Boolean bUseDirectedness,
Boolean bGraphIsDirected,
out Int32 iGroup2Index
)
{
Debug.Assert(oIncidentEdge != null);
Debug.Assert(oVertexInGroup1 != null);
Debug.Assert(iGroup1Index >= 0);
Debug.Assert(oGroupIndexDictionary != null);
AssertValid();
IVertex oVertex2 = oIncidentEdge.GetAdjacentVertex(oVertexInGroup1);
if ( !oGroupIndexDictionary.TryGetValue(
oVertex2.ID, out iGroup2Index) )
{
// The edge's second vertex is not in a group.
return (false);
}
Boolean bEdgesFirstVertexIsVertexInGroup1 =
(oIncidentEdge.Vertex1 == oVertexInGroup1);
if (iGroup1Index == iGroup2Index)
{
// The edge's vertices are in the same group. Count the edge only
// if its first vertex is oVertexInGroup1. That way, when the same
// edge is passed to this method again as an incident edge of the
// edge's second vertex, it won't be counted again.
return (bEdgesFirstVertexIsVertexInGroup1);
}
else if (!bUseDirectedness || !bGraphIsDirected)
{
// All edges between group 1 and group 2 should be counted in a
// single IntergroupEdgeInfo object. Count the edge only if its
// second vertex is in a group whose index is greater than or equal
// to the group index of its first vertex. (The equal case handles
// edges whose vertices are within the same group, including
// self-loops.) That way, when the same edge is passed to this
// method again as an incident edge of the edge's second vertex, it
// won't be counted again.
return (iGroup2Index >= iGroup1Index);
}
else
{
// Edges from group 1 to group 2 should be returned in one object,
// and edges from group 2 to group 1 should be returned in another
// IntergroupEdgeInfo object. Count the edge only if its first
// vertex is in group 1. That way, when the same edge is passed to
// this method again as an incident edge of the edge's second
// vertex, it won't be counted again.
return (bEdgesFirstVertexIsVertexInGroup1);
}
}