CameraProjectionTool.js 832 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * CameraProjectionTool.js
  3. *
  4. * @author realor
  5. */
  6. import { Tool } from './Tool.js'
  7. import { I18N } from '../i18n/I18N.js'
  8. class CameraProjectionTool extends Tool {
  9. constructor(application, options) {
  10. super(application)
  11. this.name = 'projection_type'
  12. this.label = 'tool.projection_type.label'
  13. this.help = 'tool.projection_type.help'
  14. this.className = 'projection_type'
  15. this.immediate = true
  16. this.setOptions(options)
  17. }
  18. execute() {
  19. const application = this.application
  20. if (this.type === 'orthographic') {
  21. application.activateCamera(application.orthographicCamera)
  22. } else {
  23. application.activateCamera(application.perspectiveCamera)
  24. }
  25. }
  26. }
  27. export { CameraProjectionTool }