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.
Name | Description | |
---|---|---|
Delaunay() | ||
Delaunay(IList<Point3D>, IList<IList<Point3D>>) | Loops only constructor. | |
Delaunay(IList<Point3D>) | Points only constructor. | |
Delaunay(IList<Point3D>, IList<Point3D>, IList<IList<Point3D>>) | Points/loops constructor. | |
Delaunay(IList<Point3D>, IList<Point3D>, IList<IList<Point3D>>, IList<IList<Point3D>>) | Points/loops constructor. |
Name | Description | |
---|---|---|
ExecutionTime | Gets the (last) work execution time in milliseconds. (inherited from WorkUnit). | |
OutputType | Gets or sets the triangulation output type. | |
Result | Gets the resulting mesh. | |
TriangulatingText | Gets or sets the progress bar text displayed when executed asynchronously. |
Name | Description | |
---|---|---|
Cancelled(BackgroundWorker, DoWorkEventArgs) | Checks if the user has requested cancellation of the background operation. (inherited from WorkUnit). | |
DoWork(BackgroundWorker, DoWorkEventArgs) | Does the actual work allowing progress bar update and cancellation. | |
DoWork() | Executes the work synchronously. (inherited from WorkUnit). | |
Equals(Object) | Determines whether the specified object is equal to the current object. (inherited from Object). | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from Object). | |
GetHashCode | Serves as the default hash function. (inherited from Object). | |
GetType | Gets the Type of the current instance. (inherited from Object). | |
MakeMesh() | ||
MemberwiseClone | Creates a shallow copy of the current Object. (inherited from Object). | |
ProcessContours(IList<Point3D>, IList<Point3D>, IList<IList<Point3D>>, IList<IList<Point3D>>, bool) | ||
ProcessTriangulation(int, int, string, bool, BackgroundWorker, DoWorkEventArgs) | Triangulate the points with indices between startFrom and endAt indices. | |
ResetProgressParallel() | Resets the progress bar for a parallel loop. (inherited from WorkUnit). | |
StartContinuousAnimation(string, BackgroundWorker) | Start the animation for the continuous progress bar. (inherited from WorkUnit). | |
StopContinuousAnimation(BackgroundWorker) | Stop the animation for the continuous progress bar. (inherited from WorkUnit). | |
ToString | Returns a string that represents the current object. (inherited from Object). | |
Triangulate(BackgroundWorker, DoWorkEventArgs) | ||
Triangulate(out Point3D[], out IndexTriangle[]) | Performs triangulation. | |
TriangulateInternal(BackgroundWorker, DoWorkEventArgs) | ||
UpdateProgress(double, double, string, BackgroundWorker, bool) | Updates the progress bar value. | |
UpdateProgress(int, int, string, BackgroundWorker, bool) | Updates the progress bar value. | |
UpdateProgressAndCheckCancelled(int, int, string, BackgroundWorker, DoWorkEventArgs, bool) | Updates the progress bar value and checks if the worker thread has been canceled. (inherited from WorkUnit). | |
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). | |
UpdateProgressParallel(double, string, BackgroundWorker) | Updates the progress bar value for a parallel loop. (inherited from WorkUnit). | |
UpdateProgressTo100(string, BackgroundWorker) | Set the progress bar to 100% and forces screen update. (inherited from WorkUnit). | |
WorkCancelled(Environment) | Called when the work is cancelled. (inherited from WorkUnit). | |
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). | |
WorkFailed(Environment) | Called when the work has failed. (inherited from WorkUnit). |
Name | Description | |
---|---|---|
ProgressChanged | Occurs when the DoWork() is called synchronously and the progress has changed. (inherited from WorkUnit). |
Name | Description | |
---|---|---|
DelaunayTriangle |
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.
devDept.Eyeshot.Triangulation.Delaunay