{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/graphics/plane/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-06 11:35:50\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\graphics\\plane\\index.ts\n */\nimport { createCommentVNode, defineComponent, getCurrentInstance, PropType } from 'vue'\nimport type {\n  VcCallbackPropertyFunction,\n  VcCartesian2,\n  VcColor,\n  VcComponentInternalInstance,\n  VcComponentPublicInstance,\n  VcDistanceDisplayCondition,\n  VcMaterial,\n  VcPlane,\n  VcReadyObject\n} from 'casc-cesium-utils/types'\nimport { makeCartesian2 } from 'casc-cesium-utils/cesium-helpers'\nimport { useGraphics } from 'casc-cesium-composables'\nimport { show, fill, material, outline, outlineColor, outlineWidth, shadows, distanceDisplayCondition, plane } from 'casc-cesium-utils/cesium-props'\nimport { kebabCase } from 'casc-cesium-utils/util'\nimport { commonEmits } from 'casc-cesium-utils/emits'\nexport const planeGraphicsProps = {\n  ...show,\n  ...plane,\n  // 和 BoxGraphics.dimensions 区分\n  dimensions: {\n    type: [Object, Array, Function] as PropType<VcCartesian2>,\n    watcherOptions: {\n      cesiumObjectBuilder: makeCartesian2\n    }\n  },\n  ...fill,\n  ...material,\n  ...outline,\n  ...outlineColor,\n  ...outlineWidth,\n  ...shadows,\n  ...distanceDisplayCondition\n}\nexport default defineComponent({\n  name: 'VcGraphicsPlane',\n  props: planeGraphicsProps,\n  emits: commonEmits,\n  setup(props, ctx) {\n    // state\n    const instance = getCurrentInstance() as VcComponentInternalInstance\n    instance.cesiumClass = 'PlaneGraphics'\n    useGraphics(props, ctx, instance)\n\n    return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || 'v-if'))\n  }\n})\n\nexport type VcGraphicsPlaneProps = {\n  /**\n   * A boolean Property specifying the visibility of the plane.\n   * Default value: true\n   */\n  show?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * A VcPlane Property specifying the normal and distance for the plane.\n   */\n  plane?: VcPlane\n  /**\n   * A VcCartesian2 Property specifying the width and height of the plane.\n   */\n  dimensions?: VcCartesian2\n  /**\n   * A boolean Property specifying whether the plane is filled with the provided material.\n   * Default Value: true\n   */\n  fill?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * A Property specifying the material used to fill the plane.\n   * Default value: white\n   */\n  material?: VcMaterial\n  /**\n   * A boolean Property specifying whether the plane is outlined.\n   * Default value: false\n   */\n  outline?: boolean | Cesium.CallbackProperty | VcCallbackPropertyFunction<boolean>\n  /**\n   * A Property specifying the Color of the outline.\n   * Default value: black\n   */\n  outlineColor?: VcColor\n  /**\n   * A numeric Property specifying the width of the outline.\n   * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n   * Default value: 1.0\n   */\n  outlineWidth?: number | Cesium.CallbackProperty | VcCallbackPropertyFunction<number>\n  /**\n   * An enum Property specifying whether the plane casts or receives shadows from light sources.\n   * Default value: ShadowMode.DISABLED\n   */\n  shadows?: number | Cesium.ShadowMode | VcCallbackPropertyFunction<number>\n  /**\n   * A Property specifying at what distance from the camera that this plane will be displayed.\n   */\n  distanceDisplayCondition?: VcDistanceDisplayCondition\n  /**\n   * Triggers before the VcGraphicsPlane is loaded.\n   */\n  onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n  /**\n   * Triggers when the VcGraphicsPlane 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 VcGraphicsPlane 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 VcGraphicsPlaneRef = VcComponentPublicInstance<VcGraphicsPlaneProps>\n"],"names":[],"mappings":";;;;;;;;AAMY,MAAC,kBAAkB,GAAG;AAClC,EAAE,GAAG,IAAI;AACT,EAAE,GAAG,KAAK;AACV,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC;AACnC,IAAI,cAAc,EAAE;AACpB,MAAM,mBAAmB,EAAE,cAAc;AACzC,KAAK;AACL,GAAG;AACH,EAAE,GAAG,IAAI;AACT,EAAE,GAAG,QAAQ;AACb,EAAE,GAAG,OAAO;AACZ,EAAE,GAAG,YAAY;AACjB,EAAE,GAAG,YAAY;AACjB,EAAE,GAAG,OAAO;AACZ,EAAE,GAAG,wBAAwB;AAC7B,EAAE;AACF,oBAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,iBAAiB;AACzB,EAAE,KAAK,EAAE,kBAAkB;AAC3B,EAAE,KAAK,EAAE,WAAW;AACpB,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE;AACpB,IAAI,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC;AAC1C,IAAI,QAAQ,CAAC,WAAW,GAAG,eAAe,CAAC;AAC3C,IAAI,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AACtC,IAAI,OAAO,MAAM;AACjB,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC;AAClH,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC;;;;"}