Edge.d.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import Node from "./Node";
  2. import EdgeRing from "./EdgeRing";
  3. /**
  4. * This class is inspired by GEOS's geos::operation::polygonize::PolygonizeDirectedEdge
  5. */
  6. export default class Edge {
  7. label?: number;
  8. symetric?: Edge;
  9. from: Node;
  10. to: Node;
  11. next?: Edge;
  12. ring?: EdgeRing;
  13. /**
  14. * Creates or get the symetric Edge.
  15. *
  16. * @returns {Edge} - Symetric Edge.
  17. */
  18. getSymetric(): Edge;
  19. /**
  20. * @param {Node} from - start node of the Edge
  21. * @param {Node} to - end node of the edge
  22. */
  23. constructor(from: Node, to: Node);
  24. /**
  25. * Removes edge from from and to nodes.
  26. */
  27. deleteEdge(): void;
  28. /**
  29. * Compares Edge equallity.
  30. *
  31. * An edge is equal to another, if the from and to nodes are the same.
  32. *
  33. * @param {Edge} edge - Another Edge
  34. * @returns {boolean} - True if Edges are equal, False otherwise
  35. */
  36. isEqual(edge: Edge): boolean;
  37. toString(): string;
  38. /**
  39. * Returns a LineString representation of the Edge
  40. *
  41. * @returns {Feature<LineString>} - LineString representation of the Edge
  42. */
  43. toLineString(): import("@turf/helpers").Feature<import("@turf/helpers").LineString, import("@turf/helpers").Properties>;
  44. /**
  45. * Comparator of two edges.
  46. *
  47. * Implementation of geos::planargraph::DirectedEdge::compareTo.
  48. *
  49. * @param {Edge} edge - Another edge to compare with this one
  50. * @returns {number} -1 if this Edge has a greater angle with the positive x-axis than b,
  51. * 0 if the Edges are colinear,
  52. * 1 otherwise
  53. */
  54. compareTo(edge: Edge): number;
  55. }