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


C# Poly2Tri.DTSweepConstraint類代碼示例

本文整理匯總了C#中Poly2Tri.DTSweepConstraint的典型用法代碼示例。如果您正苦於以下問題:C# DTSweepConstraint類的具體用法?C# DTSweepConstraint怎麽用?C# DTSweepConstraint使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DTSweepConstraint類屬於Poly2Tri命名空間,在下文中一共展示了DTSweepConstraint類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FillLeftBelowEdgeEvent

		private static void FillLeftBelowEdgeEvent(DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node)
		{
			if (tcx.IsDebugEnabled) tcx.DTDebugContext.ActiveNode = node;

			if (node.Point.X > edge.P.X)
			{
				if (TriangulationUtil.Orient2d(node.Point, node.Prev.Point, node.Prev.Prev.Point) == Orientation.CW)
				{
					// Concave
					FillLeftConcaveEdgeEvent(tcx, edge, node);
				}
				else
				{
					// Convex
					FillLeftConvexEdgeEvent(tcx, edge, node);
					// Retry this one
					FillLeftBelowEdgeEvent(tcx, edge, node);
				}
			}
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:20,代碼來源:DTSweep.cs

示例2: FillLeftAboveEdgeEvent

		private static void FillLeftAboveEdgeEvent(DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node)
		{
			while (node.Prev.Point.X > edge.P.X)
			{
				if (tcx.IsDebugEnabled) tcx.DTDebugContext.ActiveNode = node;
				// Check if next node is below the edge
				Orientation o1 = TriangulationUtil.Orient2d(edge.Q, node.Prev.Point, edge.P);
				if (o1 == Orientation.CW)
				{
					FillLeftBelowEdgeEvent(tcx, edge, node);
				}
				else
				{
					node = node.Prev;
				}
			}
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:17,代碼來源:DTSweep.cs

示例3: FillRightConvexEdgeEvent

		private static void FillRightConvexEdgeEvent(DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node)
		{
			// Next concave or convex?
			if (TriangulationUtil.Orient2d(node.Next.Point, node.Next.Next.Point, node.Next.Next.Next.Point) == Orientation.CCW)
			{
				// Concave
				FillRightConcaveEdgeEvent(tcx, edge, node.Next);
			}
			else
			{
				// Convex
				// Next above or below edge?
				if (TriangulationUtil.Orient2d(edge.Q, node.Next.Next.Point, edge.P) == Orientation.CCW)
				{
					// Below
					FillRightConvexEdgeEvent(tcx, edge, node.Next);
				}
				else
				{
					// Above
				}
			}
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:23,代碼來源:DTSweep.cs

示例4: FillLeftConcaveEdgeEvent

		private static void FillLeftConcaveEdgeEvent(DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node)
		{
			Fill(tcx, node.Prev);
			if (node.Prev.Point != edge.P)
			{
				// Next above or below edge?
				if (TriangulationUtil.Orient2d(edge.Q, node.Prev.Point, edge.P) == Orientation.CW)
				{
					// Below
					if (TriangulationUtil.Orient2d(node.Point, node.Prev.Point, node.Prev.Prev.Point) == Orientation.CW)
					{
						// Next is concave
						FillLeftConcaveEdgeEvent(tcx, edge, node);
					}
					else
					{
						// Next is convex
					}
				}
			}
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:21,代碼來源:DTSweep.cs

示例5: EdgeEvent

		private static void EdgeEvent(DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node)
		{
			try
			{
				tcx.EdgeEvent.ConstrainedEdge = edge;
				tcx.EdgeEvent.Right = edge.P.X > edge.Q.X;

				if (tcx.IsDebugEnabled) { tcx.DTDebugContext.PrimaryTriangle = node.Triangle; }

				if (IsEdgeSideOfTriangle(node.Triangle, edge.P, edge.Q)) return;

				// For now we will do all needed filling
				// TODO: integrate with flip process might give some better performance
				//       but for now this avoid the issue with cases that needs both flips and fills
				FillEdgeEvent(tcx, edge, node);

				EdgeEvent(tcx, edge.P, edge.Q, node.Triangle, edge.Q);
			}
			catch (PointOnEdgeException)
			{
				//Debug.WriteLine( String.Format( "Warning: Skipping Edge: {0}", e.Message ) );
				throw;
			}
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:24,代碼來源:DTSweep.cs

示例6: FillEdgeEvent

		private static void FillEdgeEvent(DTSweepContext tcx, DTSweepConstraint edge, AdvancingFrontNode node)
		{
			if (tcx.EdgeEvent.Right)
			{
				FillRightAboveEdgeEvent(tcx, edge, node);
			}
			else
			{
				FillLeftAboveEdgeEvent(tcx, edge, node);
			}
		}
開發者ID:Altaxo,項目名稱:Altaxo,代碼行數:11,代碼來源:DTSweep.cs

示例7: MarkConstrainedEdge

 public void MarkConstrainedEdge(DTSweepConstraint edge)
 {
     MarkConstrainedEdge(edge.P, edge.Q);
 }
開發者ID:JonathanReid,項目名稱:Unity-JellyPhysics,代碼行數:4,代碼來源:DelaunayTriangle.cs

示例8: GetEdgeCW

        public bool GetEdgeCW(TriangulationPoint p, out DTSweepConstraint edge)
        {
            int pointIndex = IndexOf(p);
            int edgeIdx = (pointIndex + 1) % 3;

            return GetEdge(edgeIdx, out edge);
        }
開發者ID:JonathanReid,項目名稱:Unity-JellyPhysics,代碼行數:7,代碼來源:DelaunayTriangle.cs

示例9: GetEdgeAcross

        public bool GetEdgeAcross(TriangulationPoint p, out DTSweepConstraint edge)
        {
            int pointIndex = IndexOf(p);
            int edgeIdx = pointIndex;

            return GetEdge(edgeIdx, out edge);
        }
開發者ID:JonathanReid,項目名稱:Unity-JellyPhysics,代碼行數:7,代碼來源:DelaunayTriangle.cs

示例10: GetEdge

        public bool GetEdge(int idx, out DTSweepConstraint edge)
        {
            edge = null;
            if (idx < 0 || idx > 2)
            {
                return false;
            }
            TriangulationPoint p1 = Points[(idx + 1) % 3];
            TriangulationPoint p2 = Points[(idx + 2) % 3];
            if (p1.GetEdge(p2, out edge))
            {
                return true;
            }
            else if (p2.GetEdge(p1, out edge))
            {
                return true;
            }

            return false;
        }
開發者ID:JonathanReid,項目名稱:Unity-JellyPhysics,代碼行數:20,代碼來源:DelaunayTriangle.cs

示例11: AddEdge

		public void AddEdge(DTSweepConstraint e) {
			if (Edges == null) Edges = new List<DTSweepConstraint>();
			Edges.Add(e);
		}
開發者ID:iamtanmay,項目名稱:FiberToGraph,代碼行數:4,代碼來源:TriangulationPoint.cs


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