| 1234567891011121314151617181920212223242526 |
- import { defineStore } from 'pinia'
- import { ref } from 'vue'
- import { enhancementSelection } from '../domain/pipeEnhancement.js'
- import { neighborhoodRadius } from '../domain/pipeNeighborhood.js'
- /** Cesium 与 Three.js 之间共享的局部增强选择态。 */
- export const usePipeEnhancementStore = defineStore('pipeEnhancementStore', () => {
- const selected = ref(null)
- const radiusM = ref(50)
- function setRadius(value) {
- radiusM.value = neighborhoodRadius(value)
- }
- function select(kind, code) {
- selected.value = enhancementSelection(kind, code)
- return selected.value
- }
- function clear() {
- selected.value = null
- radiusM.value = 50
- }
- return { selected, radiusM, setRadius, select, clear }
- })
|