CloneTool.js 692 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * CloneTool.js
  3. *
  4. * @author realor
  5. */
  6. import { Tool } from './Tool.js'
  7. class CloneTool extends Tool {
  8. constructor(application, options) {
  9. super(application)
  10. this.name = 'clone'
  11. this.label = 'tool.clone.label'
  12. this.help = 'tool.clone.help'
  13. this.className = 'clone'
  14. this.immediate = true
  15. this.dynamic = false
  16. this.setOptions(options)
  17. }
  18. execute() {
  19. const application = this.application
  20. let objects = application.selection.roots
  21. for (let object of objects) {
  22. application.cloneObject(object, this.dynamic)
  23. }
  24. }
  25. }
  26. export { CloneTool }