Point properties are writable now

git-svn-id: https://triangle.svn.codeplex.com/svn@75299 0e2699bc-83d4-4a8f-98e7-55e24ab8c7a5
This commit is contained in:
SND\wo80_cp
2014-08-27 16:21:47 +00:00
parent acc1353f7b
commit f022884735
8 changed files with 50 additions and 13 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ namespace TriangleNet.Geometry
/// <summary>
/// The triangle id.
/// </summary>
int ID { get; }
int ID { get; set; }
/// <summary>
/// First vertex id of the triangle.
+8 -7
View File
@@ -7,9 +7,6 @@
namespace TriangleNet.Geometry
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// <summary>
/// Represents a 2D point.
@@ -41,35 +38,39 @@ namespace TriangleNet.Geometry
#region Public properties
/// <summary>
/// Gets the vertex id.
/// Gets or sets the vertex id.
/// </summary>
public int ID
{
get { return this.id; }
set { this.id = value; }
}
/// <summary>
/// Gets the vertex x coordinate.
/// Gets or sets the vertex x coordinate.
/// </summary>
public double X
{
get { return this.x; }
set { this.x = value; }
}
/// <summary>
/// Gets the vertex y coordinate.
/// Gets or sets the vertex y coordinate.
/// </summary>
public double Y
{
get { return this.y; }
set { this.y = value; }
}
/// <summary>
/// Gets the vertex boundary mark.
/// Gets or sets the vertex boundary mark.
/// </summary>
public int Boundary
{
get { return this.mark; }
set { this.mark = value; }
}
#endregion
@@ -31,6 +31,7 @@ namespace TriangleNet.IO
public int ID
{
get { return 0; }
set { }
}
/// <summary>
+1 -1
View File
@@ -187,7 +187,7 @@ namespace TriangleNet
behavior.MaxAngle = quality.MaximumAngle;
behavior.MaxArea = quality.MaximumArea;
// TODO: behavior.VarArea = quality.VariableArea;
behavior.VarArea = quality.VariableArea;
this.Refine();
}
+4 -2
View File
@@ -26,6 +26,7 @@ namespace TriangleNet.Topology.DCEL
#endregion
internal int id;
internal int mark;
internal Point generator;
@@ -33,11 +34,12 @@ namespace TriangleNet.Topology.DCEL
internal bool bounded;
/// <summary>
/// Gets the face id.
/// Gets or sets the face id.
/// </summary>
public int ID
{
get { return id; }
set { id = value; }
}
/// <summary>
@@ -81,7 +83,7 @@ namespace TriangleNet.Topology.DCEL
public override string ToString()
{
return string.Format("F-ID {0}", generator.id);
return string.Format("F-ID {0}", generator == null ? id : generator.id);
}
}
}
@@ -9,6 +9,7 @@ namespace TriangleNet.Topology.DCEL
public class HalfEdge
{
internal int id;
internal int mark;
internal Vertex origin;
internal Face face;
@@ -16,11 +17,18 @@ namespace TriangleNet.Topology.DCEL
internal HalfEdge next;
/// <summary>
/// Gets the half-edge id.
/// Gets or sets the half-edge id.
/// </summary>
public int ID
{
get { return id; }
set { id = value; }
}
public int Boundary
{
get { return mark; }
set { mark = value; }
}
/// <summary>
@@ -6,6 +6,8 @@
namespace TriangleNet.Topology.DCEL
{
using System.Collections.Generic;
public class Vertex : TriangleNet.Geometry.Point
{
internal HalfEdge leaving;
@@ -40,5 +42,27 @@ namespace TriangleNet.Topology.DCEL
{
this.leaving = leaving;
}
/// <summary>
/// Enumerates all half-edges leaving this vertex.
/// </summary>
/// <returns></returns>
public IEnumerable<HalfEdge> EnumerateEdges()
{
var edge = this.Leaving;
int first = edge.ID;
do
{
yield return edge;
edge = edge.Twin.Next;
} while (edge.ID != first);
}
public override string ToString()
{
return string.Format("V-ID {0}", base.id);
}
}
}
+2 -1
View File
@@ -106,11 +106,12 @@ namespace TriangleNet.Topology
#region Public properties
/// <summary>
/// Gets the triangle id.
/// Gets or sets the triangle id.
/// </summary>
public int ID
{
get { return this.id; }
set { this.id = value; }
}
/// <summary>