UNPKG

jsts

Version:

A JavaScript library of spatial predicates and functions for processing geometry

33 lines (32 loc) 773 B
import Vertex from './quadedge/Vertex.js' export default class ConstraintVertex extends Vertex { constructor() { super() ConstraintVertex.constructor_.apply(this, arguments) } static constructor_() { this._isOnConstraint = null this._constraint = null const p = arguments[0] Vertex.constructor_.call(this, p) } getConstraint() { return this._constraint } setOnConstraint(isOnConstraint) { this._isOnConstraint = isOnConstraint } setConstraint(constraint) { this._isOnConstraint = true this._constraint = constraint } merge(other) { if (other._isOnConstraint) { this._isOnConstraint = true this._constraint = other._constraint } } isOnConstraint() { return this._isOnConstraint } }