Minor fixes and improvements
git-svn-id: https://triangle.svn.codeplex.com/svn@78020 0e2699bc-83d4-4a8f-98e7-55e24ab8c7a5
This commit is contained in:
@@ -257,7 +257,7 @@ namespace TriangleNet
|
||||
this.locator = new TriangleLocator(this, predicates);
|
||||
}
|
||||
|
||||
public void Refine(QualityOptions quality)
|
||||
public void Refine(QualityOptions quality, bool delaunay = false)
|
||||
{
|
||||
invertices = vertices.Count;
|
||||
|
||||
@@ -268,8 +268,13 @@ namespace TriangleNet
|
||||
|
||||
Reset();
|
||||
|
||||
if (qualityMesher == null)
|
||||
{
|
||||
qualityMesher = new QualityMesher(this, new Configuration());
|
||||
}
|
||||
|
||||
// Enforce angle and area constraints.
|
||||
qualityMesher.Apply(quality);
|
||||
qualityMesher.Apply(quality, delaunay);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,9 +6,12 @@ namespace TriangleNet.Meshing
|
||||
/// </summary>
|
||||
public class ConstraintOptions
|
||||
{
|
||||
// TODO: remove ConstraintOptions.UseRegions
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to use regions.
|
||||
/// </summary>
|
||||
[System.Obsolete("Not used anywhere, will be removed in beta 4.")]
|
||||
public bool UseRegions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -48,6 +48,10 @@ namespace TriangleNet.Meshing
|
||||
/// <summary>
|
||||
/// Refine the mesh.
|
||||
/// </summary>
|
||||
void Refine(QualityOptions quality);
|
||||
/// <param name="quality">The quality constraints.</param>
|
||||
/// <param name="conforming">
|
||||
/// A value indicating, if the refined mesh should be Conforming Delaunay.
|
||||
/// </param>
|
||||
void Refine(QualityOptions quality, bool delaunay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,8 @@ namespace TriangleNet.Meshing
|
||||
/// Apply quality constraints to a mesh.
|
||||
/// </summary>
|
||||
/// <param name="quality">The quality constraints.</param>
|
||||
public void Apply(QualityOptions quality)
|
||||
/// <param name="delaunay">A value indicating, if the refined mesh should be Conforming Delaunay.</param>
|
||||
public void Apply(QualityOptions quality, bool delaunay = false)
|
||||
{
|
||||
// Copy quality options
|
||||
if (quality != null)
|
||||
@@ -69,6 +70,8 @@ namespace TriangleNet.Meshing
|
||||
behavior.UserTest = quality.UserTest;
|
||||
behavior.VarArea = quality.VariableArea;
|
||||
|
||||
behavior.ConformingDelaunay = behavior.ConformingDelaunay || delaunay;
|
||||
|
||||
mesh.steinerleft = quality.SteinerPoints == 0 ? -1 : quality.SteinerPoints;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,8 @@ namespace TriangleNet.Tools
|
||||
|
||||
// Set up the adj adjacency array.
|
||||
this.irow = AdjacencySet(mesh, this.pcol);
|
||||
|
||||
SortIndices();
|
||||
}
|
||||
|
||||
public AdjacencyMatrix(int[] pcol, int[] irow)
|
||||
@@ -260,17 +262,22 @@ namespace TriangleNet.Tools
|
||||
}
|
||||
}
|
||||
|
||||
int k1, k2;
|
||||
return list;
|
||||
}
|
||||
|
||||
public void SortIndices()
|
||||
{
|
||||
int k1, k2, n = N;
|
||||
|
||||
int[] list = this.irow;
|
||||
|
||||
// Ascending sort the entries for each column.
|
||||
for (i = 0; i < n; i++)
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
k1 = pcol[i];
|
||||
k2 = pcol[i + 1];
|
||||
Array.Sort(list, k1, k2 - k1);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user