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


C# DelaunayTriangle.EdgeIndex方法代码示例

本文整理汇总了C#中DelaunayTriangle.EdgeIndex方法的典型用法代码示例。如果您正苦于以下问题:C# DelaunayTriangle.EdgeIndex方法的具体用法?C# DelaunayTriangle.EdgeIndex怎么用?C# DelaunayTriangle.EdgeIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DelaunayTriangle的用法示例。


在下文中一共展示了DelaunayTriangle.EdgeIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NextFlipTriangle

 /// <summary>
 /// After a flip we have two triangles and know that only one will still be
 /// intersecting the edge. So decide which to contiune with and legalize the other
 /// </summary>
 /// <param name="tcx"></param>
 /// <param name="o">should be the result of an TriangulationUtil.orient2d( eq, op, ep )</param>
 /// <param name="t">triangle 1</param>
 /// <param name="ot">triangle 2</param>
 /// <param name="p">a point shared by both triangles</param>
 /// <param name="op">another point shared by both triangles</param>
 /// <returns>returns the triangle still intersecting the edge</returns>
 private static DelaunayTriangle NextFlipTriangle(DTSweepContext tcx, Orientation o, DelaunayTriangle t, DelaunayTriangle ot, TriangulationPoint p, TriangulationPoint op)
 {
     int edgeIndex;
     if (o == Orientation.CCW)
     {
         // ot is not crossing edge after flip
         edgeIndex = ot.EdgeIndex(p, op);
         ot.EdgeIsDelaunay[edgeIndex] = true;
         Legalize(tcx, ot);
         ot.EdgeIsDelaunay.Clear();
         return t;
     }
     // t is not crossing edge after flip
     edgeIndex = t.EdgeIndex(p, op);
     t.EdgeIsDelaunay[edgeIndex] = true;
     Legalize(tcx, t);
     t.EdgeIsDelaunay.Clear();
     return ot;
 }
开发者ID:Daramkun,项目名称:Misty,代码行数:30,代码来源:DTSweep.cs

示例2: IsEdgeSideOfTriangle

 private static bool IsEdgeSideOfTriangle(DelaunayTriangle triangle, TriangulationPoint ep, TriangulationPoint eq)
 {
     int index = triangle.EdgeIndex(ep, eq);
     if (index != -1)
     {
         triangle.MarkConstrainedEdge(index);
         triangle = triangle.Neighbors[index];
         if (triangle != null)
         {
             triangle.MarkConstrainedEdge(ep, eq);
         }
         return true;
     }
     return false;
 }
开发者ID:Daramkun,项目名称:Misty,代码行数:15,代码来源:DTSweep.cs


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