当前位置: 首页>>代码示例>>C#>>正文


C# IEdge.GetValue方法代码示例

本文整理汇总了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) );
    }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:35,代码来源:GroupMetadataManagerTest.cs

示例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++;
        }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:41,代码来源:EdgeBundler.cs


注:本文中的IEdge.GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。