Delaunay Class

NOTE: This member is now obsolete. Delaunay class is deprecated, please use UtilityEx.Triangulate() method instead.

Triangulation by Delaunay method.

Delaunay class is deprecated, please use Triangulate method instead.

Public Class Delaunay 
Inherits WorkUnit
This language is not supported or no code example is available.
public class Delaunay : WorkUnit
This language is not supported or no code example is available.
Name Description
Public property ExecutionTime Gets the (last) work execution time in milliseconds. (inherited from WorkUnit).
Public property OutputType Gets or sets the triangulation output type.
Public property Result Gets the resulting mesh.
Public property TriangulatingText Gets or sets the progress bar text displayed when executed asynchronously.
Top
Methods
 
Name Description
Internal protected (Protected Friend) method Cancelled(BackgroundWorker, DoWorkEventArgs) Checks if the user has requested cancellation of the background operation. (inherited from WorkUnit).
Internal protected (Protected Friend) method DoWork(BackgroundWorker, DoWorkEventArgs) Does the actual work allowing progress bar update and cancellation.
Public method DoWork() Executes the work synchronously. (inherited from WorkUnit).
Public method Equals(Object) Determines whether the specified object is equal to the current object. (inherited from Object).
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from Object).
Public method GetHashCode Serves as the default hash function. (inherited from Object).
Public method GetType Gets the Type of the current instance. (inherited from Object).
Protected method MakeMesh()
Protected method MemberwiseClone Creates a shallow copy of the current Object. (inherited from Object).
Protected method ProcessContours(IList<Point3D>, IList<Point3D>, IList<IList<Point3D>>, IList<IList<Point3D>>, bool)
Protected method ProcessTriangulation(int, int, string, bool, BackgroundWorker, DoWorkEventArgs) Triangulate the points with indices between startFrom and endAt indices.
Internal protected (Protected Friend) method ResetProgressParallel() Resets the progress bar for a parallel loop. (inherited from WorkUnit).
Internal protected (Protected Friend) method StartContinuousAnimation(string, BackgroundWorker) Start the animation for the continuous progress bar. (inherited from WorkUnit).
Internal protected (Protected Friend) method StopContinuousAnimation(BackgroundWorker) Stop the animation for the continuous progress bar. (inherited from WorkUnit).
Public method ToString Returns a string that represents the current object. (inherited from Object).
Protected method Triangulate(BackgroundWorker, DoWorkEventArgs)
Public method Triangulate(out Point3D[], out IndexTriangle[]) Performs triangulation.
Protected method TriangulateInternal(BackgroundWorker, DoWorkEventArgs)
Internal protected (Protected Friend) method UpdateProgress(double, double, string, BackgroundWorker, bool) Updates the progress bar value.
Internal protected (Protected Friend) method UpdateProgress(int, int, string, BackgroundWorker, bool) Updates the progress bar value.
Internal protected (Protected Friend) method UpdateProgressAndCheckCancelled(int, int, string, BackgroundWorker, DoWorkEventArgs, bool) Updates the progress bar value and checks if the worker thread has been canceled. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressAndCheckCancelledParallel(int, string, BackgroundWorker, DoWorkEventArgs) Updates the progress bar value and checks if the worker thread has been canceled, for a parallel loop. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressParallel(double, string, BackgroundWorker) Updates the progress bar value for a parallel loop. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressTo100(string, BackgroundWorker) Set the progress bar to 100% and forces screen update. (inherited from WorkUnit).
Internal protected (Protected Friend) method WorkCancelled(Environment) Called when the work is cancelled. (inherited from WorkUnit).
Internal protected (Protected Friend) method WorkCompleted(Environment) Called when the work has completed. In the case you are modeling something, the environment parameter allows you to easily add the model to the entities collection. (inherited from WorkUnit).
Internal protected (Protected Friend) method WorkFailed(Environment) Called when the work has failed. (inherited from WorkUnit).
Top
Events
 
Name Description
Public event ProgressChanged Occurs when the DoWork() is called synchronously and the progress has changed. (inherited from WorkUnit).
Top
Classes
 
Name Description
Protected class DelaunayTriangle
Top
Fields
 
Name Description
Protected field adjacency
Protected field brMin Min corner of the problem bounding rectangle.
Protected field brRange Size of the bounding rectangle.
Protected field gridSize
Protected field loops
Protected field triangles
Top
Example
 
The following sample summarizes the steps needed to perform an asynchronous terrain triangulation.
 public partial class Form1 : Form
 {
 
     public Form1()
     {	
         InitializeComponent();
 
         // adds event handler for WorkCompleted event
         viewport1.WorkCompleted += new Viewport.WorkCompletedEventHandler(viewport1_WorkCompleted);
     }
 
     protected override void OnShown(EventArgs e)
     {
 
         viewport1.DisplayMode = displayType.Rendered;
         viewport1.Rendered.ShowSilhouettes = false;
 
         int countPerSide = 100;
         double height = 1;
 
         int len = countPerSide * countPerSide;
 
         Point3D[] coloredPoints = new Point3D[len];
 
         Random rand = new Random(3);
 
         for (int j = 0; j < countPerSide; j++)
 
             for (int i = 0; i < countPerSide; i++)
             {
 
                 double x = rand.NextDouble() * countPerSide;
                 double y = rand.NextDouble() * countPerSide;
                 double z = rand.NextDouble() * height;
 
                 byte R = (byte)(255 * z / height);
 
                 PointRGB pt = new PointRGB(x, y, z, R, 255, 255);
 
                 coloredPoints[i + j * countPerSide] = pt;
 
             }
 
         Delaunay del = new Delaunay(coloredPoints);
 
         del.OutputType = Mesh.natureType.MulticolorPlain;
 
         viewport1.StartWork(del);
 
         base.OnShown(e);
 
     }
 
     public void viewport1_WorkCompleted(object sender, WorkCompletedEventArgs e)
     {
 
         // checks the WorkUnit type, more than one can be present in the same application
         if (e.WorkUnit is Delaunay)
         {
 
             Delaunay del = (Delaunay)e.WorkUnit;
 
             Mesh m = del.Result;
 
             m.EdgeStyle = Mesh.edgeStyleType.Free;
 
             // adds the mesh to the viewport
             viewport1.Entities.Add(m);
 
             viewport1.SetView(viewType.Trimetric);
             viewport1.ZoomFit();
             viewport1.Invalidate();
 
         }
 
     }
 
 }					
This language is not supported or no code example is available.
 Public Partial Class Form1
 	Inherits Form
 
 	Public Sub New()
 
 		InitializeComponent()
 
 		' adds event handler for WorkCompleted event
 		Viewport1.WorkCompleted += New Viewport.WorkCompletedEventHandler(Viewport1_WorkCompleted)
 
 	End Sub
 
 	Protected Overrides Sub OnShown(e As EventArgs)
 
 		Viewport1.DisplayMode = displayType.Rendered
 		Viewport1.Rendered.ShowSilhouettes = False
 
 		Dim countPerSide As Integer = 100
 		Dim height As Double = 1
 
 		Dim len As Integer = countPerSide * countPerSide
 
 		Dim coloredPoints As Point3D() = New Point3D(len - 1) {}
 
 		Dim rand As New Random(3)
 
 		For j As Integer = 0 To countPerSide - 1
 
 			For i As Integer = 0 To countPerSide - 1
 
 				Dim x As Double = rand.NextDouble() * countPerSide
 				Dim y As Double = rand.NextDouble() * countPerSide
 				Dim z As Double = rand.NextDouble() * height
 
 				Dim R As Byte = CByte(Math.Truncate(255 * z / height))
 
 				Dim pt As New PointRGB(x, y, z, R, 255, 255)
 
 				coloredPoints(i + j * countPerSide) = pt
 			Next
 		Next
 
 		Dim del As New Delaunay(coloredPoints)
 
 		del.OutputType = Mesh.natureType.MulticolorPlain
 
 		Viewport1.StartWork(del)
 
 		MyBase.OnShown(e)
 
 	End Sub
 
 	Public Sub Viewport1_WorkCompleted(sender As Object, e As WorkCompletedEventArgs)
 
 		' checks the WorkUnit type, more than one can be present in the same application
 		If TypeOf e.WorkUnit Is Delaunay Then
 
 			Dim del As Delaunay = DirectCast(e.WorkUnit, Delaunay)
 
 			Dim m As Mesh = del.Result
 
 			m.EdgeStyle = Mesh.edgeStyleType.Free
 
 			' adds the mesh to the viewport
 
 			Viewport1.Entities.Add(m)
 
 
             Viewport1.SetView(viewType.Trimetric)
             Viewport1.ZoomFit()
             Viewport1.Invalidate()
 
 		End If
 
 	End Sub
 
 End Class					
This language is not supported or no code example is available.

.NET Framework

Supported in: 4.5, 4.6, 4.7

In this article

Definition