InputTriangle.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // -----------------------------------------------------------------------
  2. // <copyright file="InputTriangle.cs" company="">
  3. // Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
  4. // </copyright>
  5. // -----------------------------------------------------------------------
  6. namespace UnityEngine.U2D.Animation.TriangleNet
  7. .IO
  8. {
  9. using Animation.TriangleNet.Topology;
  10. using Animation.TriangleNet.Geometry;
  11. /// <summary>
  12. /// Simple triangle class for input.
  13. /// </summary>
  14. internal class InputTriangle : ITriangle
  15. {
  16. internal int[] vertices;
  17. internal int label;
  18. internal double area;
  19. public InputTriangle(int p0, int p1, int p2)
  20. {
  21. this.vertices = new int[] { p0, p1, p2 };
  22. }
  23. #region Public properties
  24. /// <summary>
  25. /// Gets the triangle id.
  26. /// </summary>
  27. public int ID
  28. {
  29. get { return 0; }
  30. set {}
  31. }
  32. /// <summary>
  33. /// Region ID the triangle belongs to.
  34. /// </summary>
  35. public int Label
  36. {
  37. get { return label; }
  38. set { label = value; }
  39. }
  40. /// <summary>
  41. /// Gets the triangle area constraint.
  42. /// </summary>
  43. public double Area
  44. {
  45. get { return area; }
  46. set { area = value; }
  47. }
  48. /// <summary>
  49. /// Gets the specified corners vertex.
  50. /// </summary>
  51. public Vertex GetVertex(int index)
  52. {
  53. return null; // TODO: throw NotSupportedException?
  54. }
  55. public int GetVertexID(int index)
  56. {
  57. return vertices[index];
  58. }
  59. public ITriangle GetNeighbor(int index)
  60. {
  61. return null;
  62. }
  63. public int GetNeighborID(int index)
  64. {
  65. return -1;
  66. }
  67. public ISegment GetSegment(int index)
  68. {
  69. return null;
  70. }
  71. #endregion
  72. }
  73. }