ITriangle.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // -----------------------------------------------------------------------
  2. // <copyright file="ITriangle.cs" company="">
  3. // Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
  4. // </copyright>
  5. // -----------------------------------------------------------------------
  6. namespace UnityEngine.U2D.Animation.TriangleNet
  7. .Geometry
  8. {
  9. using Animation.TriangleNet.Topology;
  10. /// <summary>
  11. /// Triangle interface.
  12. /// </summary>
  13. internal interface ITriangle
  14. {
  15. /// <summary>
  16. /// Gets or sets the triangle ID.
  17. /// </summary>
  18. int ID { get; set; }
  19. /// <summary>
  20. /// Gets or sets a general-purpose label.
  21. /// </summary>
  22. /// <remarks>
  23. /// This is used for region information.
  24. /// </remarks>
  25. int Label { get; set; }
  26. /// <summary>
  27. /// Gets or sets the triangle area constraint.
  28. /// </summary>
  29. double Area { get; set; }
  30. /// <summary>
  31. /// Gets the vertex at given index.
  32. /// </summary>
  33. /// <param name="index">The local index (0, 1 or 2).</param>
  34. /// <returns>The vertex.</returns>
  35. Vertex GetVertex(int index);
  36. /// <summary>
  37. /// Gets the ID of the vertex at given index.
  38. /// </summary>
  39. /// <param name="index">The local index (0, 1 or 2).</param>
  40. /// <returns>The vertex ID.</returns>
  41. int GetVertexID(int index);
  42. /// <summary>
  43. /// Gets the neighbor triangle at given index.
  44. /// </summary>
  45. /// <param name="index">The local index (0, 1 or 2).</param>
  46. /// <returns>The neighbor triangle.</returns>
  47. ITriangle GetNeighbor(int index);
  48. /// <summary>
  49. /// Gets the ID of the neighbor triangle at given index.
  50. /// </summary>
  51. /// <param name="index">The local index (0, 1 or 2).</param>
  52. /// <returns>The neighbor triangle ID.</returns>
  53. int GetNeighborID(int index);
  54. /// <summary>
  55. /// Gets the segment at given index.
  56. /// </summary>
  57. /// <param name="index">The local index (0, 1 or 2).</param>
  58. /// <returns>The segment.</returns>
  59. ISegment GetSegment(int index);
  60. }
  61. }