UNPKG

node-red-contrib-tak-registration

Version:

A Node-RED node to register to TAK and to help wrap files as datapackages to send to TAK

23 lines (20 loc) 853 B
import DirectedEdge from '../../planargraph/DirectedEdge' import Assert from '../../util/Assert' export default class LineMergeDirectedEdge extends DirectedEdge { constructor() { super() LineMergeDirectedEdge.constructor_.apply(this, arguments) } static constructor_() { const from = arguments[0], to = arguments[1], directionPt = arguments[2], edgeDirection = arguments[3] DirectedEdge.constructor_.call(this, from, to, directionPt, edgeDirection) } getNext() { if (this.getToNode().getDegree() !== 2) return null if (this.getToNode().getOutEdges().getEdges().get(0) === this.getSym()) return this.getToNode().getOutEdges().getEdges().get(1) Assert.isTrue(this.getToNode().getOutEdges().getEdges().get(1) === this.getSym()) return this.getToNode().getOutEdges().getEdges().get(0) } }