UNPKG

@shapediver/viewer.viewport

Version:

This is the npm package for the ShapeDiver Viewer Viewport API. For more information on ShapeDiver, please visit our [homepage](https://shapediver.com/).

476 lines 34 kB
"use strict"; var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; }; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var _AbstractCameraApi_camera, _AbstractCameraApi_inputValidator, _AbstractCameraApi_logger, _AbstractCameraApi_validateOptions, _AbstractCameraApi_viewportApi; Object.defineProperty(exports, "__esModule", { value: true }); exports.AbstractCameraApi = void 0; const viewer_shared_math_1 = require("@shapediver/viewer.shared.math"); const viewer_shared_services_1 = require("@shapediver/viewer.shared.services"); class AbstractCameraApi { // #endregion Properties (6) // #region Constructors (1) constructor(viewportApi, camera) { // #region Properties (6) _AbstractCameraApi_camera.set(this, void 0); _AbstractCameraApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance); _AbstractCameraApi_logger.set(this, viewer_shared_services_1.Logger.instance); _AbstractCameraApi_validateOptions.set(this, (scope, options) => { __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, options, "object", false); const prop = Object.assign({}, options); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, prop.easing, "string", false); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, prop.duration, "number", false); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, prop.coordinates, "string", false); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, prop.interpolation, "string", false); }); _AbstractCameraApi_viewportApi.set(this, void 0); this.scope = "AbstractCameraApi"; __classPrivateFieldSet(this, _AbstractCameraApi_viewportApi, viewportApi, "f"); __classPrivateFieldSet(this, _AbstractCameraApi_camera, camera, "f"); } // #endregion Constructors (1) // #region Public Getters And Setters (74) get autoAdjust() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").autoAdjust; } set autoAdjust(value) { const scope = "autoAdjust"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").autoAdjust = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get autoRotationSpeed() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.autoRotationSpeed; } set autoRotationSpeed(value) { const scope = "autoRotationSpeed"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.autoRotationSpeed = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get cameraMovementDuration() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").cameraMovementDuration; } set cameraMovementDuration(value) { const scope = "cameraMovementDuration"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").cameraMovementDuration = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get cubePositionRestriction() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.cubePositionRestriction; } set cubePositionRestriction(value) { const scope = "cubePositionRestriction"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "object"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.min, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.max, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.cubePositionRestriction = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get cubeTargetRestriction() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.cubeTargetRestriction; } set cubeTargetRestriction(value) { const scope = "cubeTargetRestriction"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "object"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.min, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.max, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.cubeTargetRestriction = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get damping() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.damping; } set damping(value) { const scope = "damping"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.damping = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get defaultPosition() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").defaultPosition; } set defaultPosition(value) { const scope = "defaultPosition"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").defaultPosition = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get defaultTarget() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").defaultTarget; } set defaultTarget(value) { const scope = "defaultTarget"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").defaultTarget = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enableAutoRotation() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableAutoRotation; } set enableAutoRotation(value) { const scope = "enableAutoRotation"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableAutoRotation = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enableAzimuthRotation() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableAzimuthRotation; } set enableAzimuthRotation(value) { const scope = "enableAzimuthRotation"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableAzimuthRotation = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enableKeyPan() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableKeyPan; } set enableKeyPan(value) { const scope = "enableKeyPan"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableKeyPan = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enableObjectControls() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableObjectControls; } set enableObjectControls(value) { const scope = "enableObjectControls"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableObjectControls = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enablePan() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enablePan; } set enablePan(value) { const scope = "enablePan"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enablePan = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enablePolarRotation() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enablePolarRotation; } set enablePolarRotation(value) { const scope = "enablePolarRotation"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enablePolarRotation = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enableRotation() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableRotation; } set enableRotation(value) { const scope = "enableRotation"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableRotation = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enableTurntableControls() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableTurntableControls; } set enableTurntableControls(value) { const scope = "enableTurntableControls"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableTurntableControls = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enableZoom() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableZoom; } set enableZoom(value) { const scope = "enableZoom"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enableZoom = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get enabled() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enabled; } set enabled(value) { const scope = "enabled"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.enabled = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get id() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").id; } get isDefault() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").isDefault; } get keyPanSpeed() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.keyPanSpeed; } set keyPanSpeed(value) { const scope = "keyPanSpeed"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.keyPanSpeed = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get movementSmoothness() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.movementSmoothness; } set movementSmoothness(value) { const scope = "movementSmoothness"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.movementSmoothness = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get name() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").name; } set name(value) { const scope = "name"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "string", false); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").name = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get objectControlsCenter() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.objectControlsCenter; } set objectControlsCenter(value) { const scope = "objectControlsCenter"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.objectControlsCenter = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get order() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").order; } set order(value) { const scope = "order"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number", false); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").order = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get panSpeed() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.panSpeed; } set panSpeed(value) { const scope = "panSpeed"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.panSpeed = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get position() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").position; } set position(value) { const scope = "position"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").position = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get revertAtMouseUp() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").revertAtMouseUp; } set revertAtMouseUp(value) { const scope = "revertAtMouseUp"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "boolean"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").revertAtMouseUp = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get revertAtMouseUpDuration() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").revertAtMouseUpDuration; } set revertAtMouseUpDuration(value) { const scope = "revertAtMouseUpDuration"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").revertAtMouseUpDuration = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get rotationRestriction() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.rotationRestriction; } set rotationRestriction(value) { const scope = "rotationRestriction"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "object"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.minAzimuthAngle, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.maxAzimuthAngle, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.minPolarAngle, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.maxPolarAngle, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.rotationRestriction = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get rotationSpeed() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.rotationSpeed; } set rotationSpeed(value) { const scope = "rotationSpeed"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.rotationSpeed = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get spherePositionRestriction() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.spherePositionRestriction; } set spherePositionRestriction(value) { const scope = "spherePositionRestriction"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "object"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.center, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.radius, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.spherePositionRestriction = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get sphereTargetRestriction() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.sphereTargetRestriction; } set sphereTargetRestriction(value) { const scope = "sphereTargetRestriction"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "object"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.center, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.radius, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.sphereTargetRestriction = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get target() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").target; } set target(value) { const scope = "target"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").target = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get turntableCenter() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.turntableCenter; } set turntableCenter(value) { const scope = "turntableCenter"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.turntableCenter = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get type() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").type; } get zoomRestriction() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.zoomRestriction; } set zoomRestriction(value) { const scope = "zoomRestriction"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "object"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.minDistance, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value.maxDistance, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.zoomRestriction = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get zoomSpeed() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.zoomSpeed; } set zoomSpeed(value) { const scope = "zoomSpeed"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").controls.zoomSpeed = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } get zoomToFactor() { return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").zoomExtentsFactor; } set zoomToFactor(value) { const scope = "zoomToFactor"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, "number"); __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").zoomExtentsFactor = value; __classPrivateFieldGet(this, _AbstractCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`); __classPrivateFieldGet(this, _AbstractCameraApi_viewportApi, "f").update(); } // #endregion Public Getters And Setters (74) // #region Public Methods (7) animate(path, options) { const scope = "animate"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, path, "array"); for (let i = 0; i < path.length; i++) { __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, path[i].position, "vec3"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, path[i].target, "vec3"); } __classPrivateFieldGet(this, _AbstractCameraApi_validateOptions, "f").call(this, scope, options); return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").animate(path, options); } calculateZoomTo(zoomTarget, startingPosition, startingTarget) { const scope = "calculateZoomTo"; if (zoomTarget !== undefined && !(zoomTarget instanceof viewer_shared_math_1.Box)) throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${zoomTarget} is not of type Box.`, zoomTarget, "Box"); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, startingPosition, "vec3", false); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, startingTarget, "vec3", false); return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").calculateZoomTo(zoomTarget, startingPosition, startingTarget); } project(p) { const scope = "project"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, p, "vec3"); return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").project(p); } reset(options) { const scope = "reset"; __classPrivateFieldGet(this, _AbstractCameraApi_validateOptions, "f").call(this, scope, options); return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").reset(options); } set(position, target, options) { const scope = "set"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, position, "vec3", false); __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, target, "vec3", false); __classPrivateFieldGet(this, _AbstractCameraApi_validateOptions, "f").call(this, scope, options); return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").set(position, target, options); } unproject(p) { const scope = "unproject"; __classPrivateFieldGet(this, _AbstractCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, p, "vec3", false); return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").unproject(p); } zoomTo(zoomTarget, options) { const scope = "zoomTo"; if (zoomTarget !== undefined && !(zoomTarget instanceof viewer_shared_math_1.Box)) throw new viewer_shared_services_1.ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${zoomTarget} is not of type Box.`, zoomTarget, "Box"); __classPrivateFieldGet(this, _AbstractCameraApi_validateOptions, "f").call(this, scope, options); return __classPrivateFieldGet(this, _AbstractCameraApi_camera, "f").zoomTo(zoomTarget, options); } } exports.AbstractCameraApi = AbstractCameraApi; _AbstractCameraApi_camera = new WeakMap(), _AbstractCameraApi_inputValidator = new WeakMap(), _AbstractCameraApi_logger = new WeakMap(), _AbstractCameraApi_validateOptions = new WeakMap(), _AbstractCameraApi_viewportApi = new WeakMap(); //# sourceMappingURL=AbstractCameraApi.js.map