DefaultVoronoiFactory.cs 802 B

1234567891011121314151617181920212223242526272829303132333435
  1. namespace UnityEngine.U2D.Animation.TriangleNet
  2. .Voronoi
  3. {
  4. using System;
  5. using Animation.TriangleNet.Topology.DCEL;
  6. /// <summary>
  7. /// Default factory for Voronoi / DCEL mesh objects.
  8. /// </summary>
  9. internal class DefaultVoronoiFactory : IVoronoiFactory
  10. {
  11. public void Initialize(int vertexCount, int edgeCount, int faceCount)
  12. {
  13. }
  14. public void Reset()
  15. {
  16. }
  17. public Vertex CreateVertex(double x, double y)
  18. {
  19. return new Vertex(x, y);
  20. }
  21. public HalfEdge CreateHalfEdge(Vertex origin, Face face)
  22. {
  23. return new HalfEdge(origin, face);
  24. }
  25. public Face CreateFace(Geometry.Vertex vertex)
  26. {
  27. return new Face(vertex);
  28. }
  29. }
  30. }