當前位置: 首頁>>代碼示例>>C#>>正文


C# DelaunayTriangle.EdgeIndex方法代碼示例

本文整理匯總了C#中Poly2Tri.DelaunayTriangle.EdgeIndex方法的典型用法代碼示例。如果您正苦於以下問題:C# DelaunayTriangle.EdgeIndex方法的具體用法?C# DelaunayTriangle.EdgeIndex怎麽用?C# DelaunayTriangle.EdgeIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Poly2Tri.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:Altaxo,項目名稱:Altaxo,代碼行數:30,代碼來源:DTSweep.cs

示例2: IsEdgeSideOfTriangle

		private static bool IsEdgeSideOfTriangle(DelaunayTriangle triangle, TriangulationPoint ep, TriangulationPoint eq)
		{
			int index = triangle.EdgeIndex(ep, eq);
			if (index == -1) return false;
			triangle.MarkConstrainedEdge(index);
			triangle = triangle.Neighbors[index];
			if (triangle != null) triangle.MarkConstrainedEdge(ep, eq);
			return true;
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:9,代碼來源:DTSweep.cs


注:本文中的Poly2Tri.DelaunayTriangle.EdgeIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。