本文整理汇总了C#中IEdge.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# IEdge.GetValue方法的具体用法?C# IEdge.GetValue怎么用?C# IEdge.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEdge
的用法示例。
在下文中一共展示了IEdge.GetValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
VerifyOriginalEdgeMetadata
(
IEdge oEdge1,
IEdge oEdge2,
IEdge oEdge3,
IEdge oEdge4
)
{
Assert.IsFalse( oEdge1.ContainsKey(
ReservedMetadataKeys.SavedVisibility) );
Assert.IsFalse( oEdge1.ContainsKey(
ReservedMetadataKeys.Visibility) );
Assert.IsFalse( oEdge2.ContainsKey(
ReservedMetadataKeys.SavedVisibility) );
Assert.IsTrue( oEdge2.ContainsKey(
ReservedMetadataKeys.Visibility) );
Assert.AreEqual( VisibilityKeyValue.Filtered,
oEdge2.GetValue(ReservedMetadataKeys.Visibility) );
Assert.IsFalse( oEdge3.ContainsKey(
ReservedMetadataKeys.SavedVisibility) );
Assert.IsFalse( oEdge3.ContainsKey(
ReservedMetadataKeys.Visibility) );
Assert.IsFalse( oEdge4.ContainsKey(
ReservedMetadataKeys.SavedVisibility) );
Assert.IsFalse( oEdge4.ContainsKey(
ReservedMetadataKeys.Visibility) );
}
示例2: AddExistingData
/// <summary>
/// Collects data from the specified edge.
/// Used for edges that already have control points metadata.
/// </summary>
///
/// <param name="e">
/// Edge to collect data from
/// </param>
private void AddExistingData(IEdge e)
{
EdgeGroupData ed;
KeyPair key = new KeyPair(e.Vertices[0].ID, e.Vertices[1].ID);
edgeGroupData.TryGetValue(key, out ed);
if (ed == null)
{
PointF p1 = e.Vertices[0].Location;
PointF p2 = e.Vertices[1].Location;
ed = new EdgeGroupData();
ed.v1 = p1;
ed.v2 = p2;
ed.id = key;
PointF mid = VectorTools.MidPoint(p1, p2);
ed.middle = mid;
ed.length = VectorTools.Distance(p1, p2);
ed.controlPoints = (PointF[])e.GetValue(ReservedMetadataKeys.PerEdgeIntermediateCurvePoints);
if (subdivisionPoints == 0) subdivisionPoints = ed.controlPoints.Length;
ed.newControlPoints = new PointF[subdivisionPoints];
ed.k = springConstant * (subdivisionPoints + 1) / ed.length;
if (ed.k > 0.5f) ed.k = 0.5f;
//ed.edges = new HashSet<int>();
ed.edgeCount = 0;
ed.compatibleGroups = new Dictionary<KeyPair, GroupPairData>();
edgeGroupData.Add(key, ed);
}
//ed.edges.Add(e.ID);
ed.edgeCount++;
}