| import { Cesium } from '@dc-modules/namespace' | import { Cesium } from '@dc-modules/namespace' | ||||
| import { SceneEventType, TrackEventType } from '@dc-modules/event' | import { SceneEventType, TrackEventType } from '@dc-modules/event' | ||||
| import State from '@dc-modules/state/State' | |||||
| import TrackViewMode from './TrackViewMode' | import TrackViewMode from './TrackViewMode' | ||||
| class TrackController { | class TrackController { | ||||
| this._viewMode = undefined | this._viewMode = undefined | ||||
| this._viewOption = {} | this._viewOption = {} | ||||
| this._stopTime = undefined | this._stopTime = undefined | ||||
| this._state = State.INITIALIZED | |||||
| } | } | ||||
| get delegate() { | get delegate() { | ||||
| return this._delegete.entities | return this._delegete.entities | ||||
| } | } | ||||
| get state() { | |||||
| return this._state | |||||
| } | |||||
| /** | /** | ||||
| * @private | * @private | ||||
| */ | */ | ||||
| this._stopTime = undefined | this._stopTime = undefined | ||||
| this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this) | this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this) | ||||
| this._viewer.on(SceneEventType.POST_RENDER, this._onPostRender, this) | this._viewer.on(SceneEventType.POST_RENDER, this._onPostRender, this) | ||||
| this._state = State.PLAY | |||||
| return this | return this | ||||
| } | } | ||||
| this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY) | this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY) | ||||
| this._viewer.delegate.trackedEntity = undefined | this._viewer.delegate.trackedEntity = undefined | ||||
| this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this) | this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this) | ||||
| this._state = State.PAUSE | |||||
| return this | return this | ||||
| } | } | ||||
| * | * | ||||
| */ | */ | ||||
| restore() { | restore() { | ||||
| if (this._state !== State.PAUSE) { | |||||
| return this | |||||
| } | |||||
| if (this._stopTime) { | if (this._stopTime) { | ||||
| let now = Cesium.JulianDate.now() | let now = Cesium.JulianDate.now() | ||||
| Object.keys(this._cache).forEach(key => { | Object.keys(this._cache).forEach(key => { | ||||
| } | } | ||||
| this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this) | this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this) | ||||
| this._viewer.on(SceneEventType.POST_RENDER, this._onPostRender, this) | this._viewer.on(SceneEventType.POST_RENDER, this._onPostRender, this) | ||||
| this._state = State.PLAY | |||||
| return this | return this | ||||
| } | } | ||||