MonotoneChainSelectAction.js 547 B

123456789101112131415161718
  1. import LineSegment from '../../geom/LineSegment'
  2. export default class MonotoneChainSelectAction {
  3. constructor() {
  4. MonotoneChainSelectAction.constructor_.apply(this, arguments)
  5. }
  6. static constructor_() {
  7. this.selectedSegment = new LineSegment()
  8. }
  9. select() {
  10. if (arguments.length === 1) {
  11. const seg = arguments[0]
  12. } else if (arguments.length === 2) {
  13. const mc = arguments[0], startIndex = arguments[1]
  14. mc.getLineSegment(startIndex, this.selectedSegment)
  15. this.select(this.selectedSegment)
  16. }
  17. }
  18. }