UNPKG

vue-cesium

Version:
1 lines 6.53 kB
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/primitives/time-dynamic-point-cloud/index.ts"],"sourcesContent":["import { createCommentVNode, defineComponent, getCurrentInstance, PropType } from 'vue'\nimport type { VcComponentInternalInstance, VcComponentPublicInstance, VcPickEvent, VcReadyObject } from '@vue-cesium/utils/types'\nimport { usePrimitives } from '@vue-cesium/composables'\nimport { clock, show, modelMatrix, shadows, maximumMemoryUsage, tileStyle, clippingPlanes, enableMouseEvent } from '@vue-cesium/utils/cesium-props'\nimport { kebabCase } from '@vue-cesium/utils/util'\nimport { primitiveEmits } from '@vue-cesium/utils/emits'\n\nexport const timeDynamicPointCloudProps = {\n ...clock,\n intervals: Object as PropType<Cesium.TimeIntervalCollection>,\n ...show,\n ...modelMatrix,\n ...shadows,\n ...maximumMemoryUsage,\n shading: Object,\n ...tileStyle,\n ...clippingPlanes,\n ...enableMouseEvent\n}\nexport default defineComponent({\n name: 'VcPrimitiveTimeDynamicPointCloud',\n props: timeDynamicPointCloudProps,\n emits: {\n ...primitiveEmits,\n frameChanged: (evt: Cesium.TimeDynamicPointCloud) => true,\n frameFailed: (evt: Error) => true\n },\n setup(props, ctx) {\n // state\n const instance = getCurrentInstance() as VcComponentInternalInstance\n instance.cesiumClass = 'VcPrimitiveTimeDynamicPointCloud'\n instance.cesiumEvents = ['frameChanged', 'frameFailed']\n const primitivesState = usePrimitives(props, ctx, instance)\n // methods\n instance.createCesiumObject = async () => {\n const options: any = primitivesState?.transformProps(props)\n options.style = options.tileStyle\n delete options.tileStyle\n return new Cesium.TimeDynamicPointCloud(options)\n }\n return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || ''))\n }\n})\n\nexport type VcPrimitiveTimeDynamicPointCloudProps = {\n /**\n * A Clock instance that is used when determining the value for the time dimension.\n */\n clock: Cesium.Clock\n /**\n * A TimeIntervalCollection with its data property being an object containing a uri to a 3D Tiles Point Cloud tile and an optional transform.\n */\n intervals: Cesium.TimeIntervalCollection\n /**\n * Determines if the point cloud will be shown.\n * Default value: true\n */\n show?: boolean\n /**\n * A 4x4 transformation matrix that transforms the point cloud.\n */\n modelMatrix?: Cesium.Matrix4\n /**\n * Determines whether the point cloud casts or receives shadows from light sources.\n * Default value: Cesium.ShadowMode.ENABLED\n */\n shadows?: number | Cesium.ShadowMode\n /**\n * The maximum amount of memory in MB that can be used by the point cloud.\n * Default value: 256\n */\n maximumMemoryUsage?: number\n /**\n * Options for constructing a PointCloudShading object to control point attenuation and eye dome lighting.\n */\n shading?: any\n /**\n * The style, defined using the 3D Tiles Styling language, applied to each point in the point cloud.\n */\n tileStyle?: Cesium.Cesium3DTileStyle\n /**\n * The ClippingPlaneCollection used to selectively disable rendering the point cloud.\n */\n clippingPlanes?: Cesium.ClippingPlaneCollection\n /**\n * Specifies whether to respond to mouse pick events.\n * Default Value: true\n */\n enableMouseEvent?: boolean\n /**\n * Triggers before the component is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the component is successfully loaded.\n */\n onReady?: (readyObject: VcReadyObject) => void\n /**\n * Triggers when the component load failed.\n */\n onUnready?: (e: any) => void\n /**\n * Triggers when the component is destroyed.\n */\n onDestroyed?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the mouse is pressed on this primitive.\n */\n onMousedown?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse bounces up on this primitive.\n */\n onMouseup?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse clicks on this primitive.\n */\n onClick?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse clicks outside this primitive.\n */\n onClickout?: (evt: VcPickEvent) => void\n /**\n * Triggers when the left mouse button double-clicks this primitive.\n */\n onDblclick?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse moves on this primitive.\n */\n onMousemove?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse moves over to this primitive.\n */\n onMouseover?: (evt: VcPickEvent) => void\n /**\n * Triggers when the mouse moves out of this primitive.\n */\n onMouseout?: (evt: VcPickEvent) => void\n /**\n * Triggers when the primitive is ready to render.\n */\n onReadyPromise?: (primitive: Cesium.Primitive, viewer: Cesium.Viewer, instance: VcComponentPublicInstance) => void\n /**\n * Triggers when a new frame was rendered.\n */\n frameChanged?: (evt: Cesium.TimeDynamicPointCloud) => void\n /**\n * Triggers when a frame failed to load.\n */\n frameFailed?: (evt: Error) => void\n}\n\nexport type VcPrimitiveTimeDynamicPointCloudRef = VcComponentPublicInstance<VcPrimitiveTimeDynamicPointCloudProps>\n"],"names":[],"mappings":";;;;;;;;AAOO,MAAM,0BAA6B,GAAA;AAAA,EACxC,GAAG,KAAA;AAAA,EACH,SAAW,EAAA,MAAA;AAAA,EACX,GAAG,IAAA;AAAA,EACH,GAAG,WAAA;AAAA,EACH,GAAG,OAAA;AAAA,EACH,GAAG,kBAAA;AAAA,EACH,OAAS,EAAA,MAAA;AAAA,EACT,GAAG,SAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,gBAAA;AACL,EAAA;AACA,qCAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,kCAAA;AAAA,EACN,KAAO,EAAA,0BAAA;AAAA,EACP,KAAO,EAAA;AAAA,IACL,GAAG,cAAA;AAAA,IACH,YAAA,EAAc,CAAC,GAAsC,KAAA,IAAA;AAAA,IACrD,WAAA,EAAa,CAAC,GAAe,KAAA,IAAA;AAAA,GAC/B;AAAA,EACA,KAAA,CAAM,OAAO,GAAK,EAAA;AAEhB,IAAA,MAAM,WAAW,kBAAmB,EAAA,CAAA;AACpC,IAAA,QAAA,CAAS,WAAc,GAAA,kCAAA,CAAA;AACvB,IAAS,QAAA,CAAA,YAAA,GAAe,CAAC,cAAA,EAAgB,aAAa,CAAA,CAAA;AACtD,IAAA,MAAM,eAAkB,GAAA,aAAA,CAAc,KAAO,EAAA,GAAA,EAAK,QAAQ,CAAA,CAAA;AAE1D,IAAA,QAAA,CAAS,qBAAqB,YAAY;A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