UNPKG

vue-cesium

Version:
1 lines 8.39 kB
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/graphics/model/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-06 11:11:16\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\graphics\\model\\index.ts\n */\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport type {\n VcCallbackPropertyFunction,\n VcCartesian2,\n VcColor,\n VcComponentInternalInstance,\n VcComponentPublicInstance,\n VcDistanceDisplayCondition,\n VcReadyObject\n} from '@vue-cesium/utils/types'\nimport { useGraphics } from '@vue-cesium/composables'\nimport {\n show,\n uri,\n scale,\n minimumPixelSize,\n maximumScale,\n incrementallyLoadTextures,\n runAnimations,\n clampAnimations,\n shadows,\n heightReference,\n silhouetteColor,\n silhouetteSize,\n color,\n colorBlendMode,\n colorBlendAmount,\n imageBasedLightingFactor,\n lightColor,\n distanceDisplayCondition,\n nodeTransformations,\n articulations,\n clippingPlanes\n} from '@vue-cesium/utils/cesium-props'\nimport { kebabCase } from '@vue-cesium/utils/util'\nimport { commonEmits } from '@vue-cesium/utils/emits'\nexport const modelGraphicsProps = {\n ...show,\n ...uri,\n ...scale,\n ...minimumPixelSize,\n ...maximumScale,\n ...incrementallyLoadTextures,\n ...runAnimations,\n ...clampAnimations,\n ...shadows,\n ...heightReference,\n ...silhouetteColor,\n ...silhouetteSize,\n ...color,\n ...colorBlendMode,\n ...colorBlendAmount,\n ...imageBasedLightingFactor,\n ...lightColor,\n ...distanceDisplayCondition,\n ...nodeTransformations,\n ...articulations,\n ...clippingPlanes\n}\nexport default defineComponent({\n name: 'VcGraphicsModel',\n props: modelGraphicsProps,\n emits: commonEmits,\n setup(props, ctx) {\n // state\n const instance = getCurrentInstance() as VcComponentInternalInstance\n instance.cesiumClass = 'ModelGraphics'\n useGraphics(props, ctx, instance)\n\n return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || 'v-if'))\n }\n})\n\nexport type VcGraphicsModelProps = {\n /**\n * A boolean Property specifying the visibility of the model.\n * Default value: true\n */\n show?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n /**\n * A string or Resource Property specifying the URI of the glTF asset.\n */\n uri?: string | Cesium.Resource | Cesium.CallbackProperty | VcCallbackPropertyFunction<string>\n /**\n * A numeric Property specifying a uniform linear scale.\n * Default value: 1.0\n */\n scale?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.\n * Default value: 0.0\n */\n minimumPixelSize?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * The maximum scale size of a model. An upper limit for minimumPixelSize.\n */\n maximumScale?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * Determine if textures may continue to stream in after the model is loaded.\n * Default value: true\n */\n incrementallyLoadTextures?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n /**\n * A boolean Property specifying if glTF animations specified in the model should be started.\n * Default value: true\n */\n runAnimations?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n /**\n * A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.\n * Default value: true\n */\n clampAnimations?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n /**\n * An enum Property specifying whether the model casts or receives shadows from light sources.\n */\n shadows?: number | Cesium.ShadowMode | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A Property specifying what the height is relative to.\n * Default value: HeightReference.NONE\n */\n heightReference?: number | Cesium.HeightReference | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A Property specifying the VcColor of the silhouette.\n */\n silhouetteColor?: VcColor\n /**\n * A numeric Property specifying the size of the silhouette in pixels.\n * Default value: 0.0\n */\n silhouetteSize?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A Property specifying the Color that blends with the model's rendered color.\n * Default value: white\n */\n color?: VcColor\n /**\n * An enum Property specifying how the color blends with the model.\n * Default value: Cesium.ColorBlendMode.HIGHLIGHT\n */\n colorBlendMode?: number | Cesium.ColorBlendMode | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A numeric Property specifying the color strength when the colorBlendMode is MIX. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.\n * Default value: 0.5\n */\n colorBlendAmount?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n /**\n * A property specifying the contribution from diffuse and specular image-based lighting.\n * Default value: [1.0, 1.0]\n */\n imageBasedLightingFactor?: VcCartesian2\n /**\n * A property specifying the light color when shading the model. When undefined the scene's light color is used instead.\n */\n lightColor?: VcColor\n /**\n * A Property specifying at what distance from the camera that this model will be displayed.\n */\n distanceDisplayCondition?: VcDistanceDisplayCondition\n /**\n * An object, where keys are names of nodes, and values are TranslationRotationScale Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.\n */\n nodeTransformations?: Cesium.TranslationRotationScale\n /**\n * An object, where keys are composed of an articulation name, a single space, and a stage name, and the values are numeric properties.\n */\n articulations?: any\n /**\n * A property specifying the ClippingPlaneCollection used to selectively disable rendering the model.\n */\n clippingPlanes?: Cesium.ClippingPlaneCollection | VcCallbackPropertyFunction<Cesium.ClippingPlaneCollection>\n /**\n * Triggers before the VcGraphicsModel is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcGraphicsModel 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 VcGraphicsModel is destroyed.\n */\n onDestroyed?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when a property or sub-property is changed or modified.\n */\n onDefinitionChanged?: (property: Cesium.Property) => void\n}\n\nexport type VcGraphicsModelRef = VcComponentPublicInstance<VcGraphicsModelProps>\n"],"names":[],"mappings":";;;;;;;;AA4CO,MAAM,kBAAqB,GAAA;AAAA,EAChC,GAAG,IAAA;AAAA,EACH,GAAG,GAAA;AAAA,EACH,GAAG,KAAA;AAAA,EACH,GAAG,gBAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,yBAAA;AAAA,EACH,GAAG,aAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,OAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,KAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,gBAAA;AAAA,EACH,GAAG,wBAAA;AAAA,EACH,GAAG,UAAA;AAAA,EACH,GAAG,wBAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,aAAA;AAAA,EACH,GAAG,cAAA;AACL,EAAA;AACA,oBAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,iBAAA;AAAA,EACN,KAAO,EAAA,kBAAA;AAAA,EACP,KAAO,EAAA,WAAA;AAAA,EACP,KAAA,CAAM,OAAO,GAAK,EAAA;AAEhB,IAAA,MAAM,WAAW,kBAAmB,EAAA,CAAA;AACpC,IAAA,QAAA,CAAS,WAAc,GAAA,eAAA,CAAA;AACvB,IAAY,WAAA,CAAA,KAAA,EAAO,KAAK,QAAQ,CAAA,CAAA;AAEhC,IAAA,OAAO,MAAG;AA7Ed,MAAA,IAAA,EAAA,CAAA;AA6EiB,MAAA,OAAA,kBAAA,CAAmB,YAAU,EAAS,GAAA,QAAA,CAAA,KAAA,KAAT,mBAAgB,QAAS,CAAA,IAAA,KAAQ,MAAM,CAAC,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GACpF;AACF,CAAC,CAAA;;;;"}