qcast-front/src/store/canvasAtom.js
2024-09-11 10:48:45 +09:00

187 lines
3.9 KiB
JavaScript

import { atom } from 'recoil'
export const canvasState = atom({
key: 'canvasState',
default: null,
dangerouslyAllowMutability: true,
})
export const textState = atom({
key: 'textState',
default: 'test text',
})
export const modeState = atom({
key: 'modeState',
default: 'default',
})
export const guideModeLineState = atom({
key: 'guideLineModeState',
default: false,
})
export const fontSizeState = atom({
key: 'fontSizeState',
default: 16,
})
export const canvasSizeState = atom({
key: 'canvasSize',
default: {
vertical: 1500,
horizontal: 1500,
},
})
export const sortedPolygonArray = atom({
key: 'sortedArray',
default: [],
dangerouslyAllowMutability: true,
})
export const roofState = atom({
key: 'roof',
default: {},
dangerouslyAllowMutability: true,
})
export const wallState = atom({
key: 'wall',
default: {},
dangerouslyAllowMutability: true,
})
export const roofPolygonPatternArrayState = atom({
key: 'roofPolygonPattern',
default: {}, //object ex) big, mid, sht = {point : [{x1, y1}, {x2, y1}], direction : left or right or top or bottom}
dangerouslyAllowMutability: true,
})
export const roofPolygonArrayState = atom({
key: 'roofPolygonArray',
default: [],
dangerouslyAllowMutability: true,
})
export const templateTypeState = atom({
key: 'templateType',
default: 0, //1:모임지붕, 2:A타입, 3:B타입
dangerouslyAllowMutability: true,
})
//셀 그린 이후에 생성하는 state
export const drewRoofCellsState = atom({
key: 'drewRoofCells',
default: [],
dangerouslyAllowMutability: true,
})
// 지붕재 width, height, rafter(서까래), roofStyle을 갖고있고 roofStyle 1은 정방향, 2는 지그재그
export const roofMaterialState = atom({
key: 'roofMaterial',
default: { width: 20, height: 10, rafter: 0, roofStyle: 2 },
dangerouslyAllowMutability: true,
})
export const compassState = atom({
key: 'compass',
default: undefined,
dangerouslyAllowMutability: true,
})
export const guideLineState = atom({
key: 'guideLine',
default: {},
dangerouslyAllowMutability: true,
})
export const currentObjectState = atom({
key: 'currentObject',
default: null,
dangerouslyAllowMutability: true,
})
export const horiGuideLinesState = atom({
key: 'horiGuideLines',
default: [],
// dangerouslyAllowMutability: true,
})
export const vertGuideLinesState = atom({
key: 'vertGuideLines',
default: [],
})
export const canvasSettingState = atom({
key: 'canvasSetting',
default: {},
dangerouslyAllowMutability: true,
})
// 현재 지붕 패턴
export const currentPatternState = atom({
key: 'currentPattern',
default: {},
dangerouslyAllowMutability: true,
})
// 설정
export const customSettingsState = atom({
key: 'customSettings',
default: {},
dangerouslyAllowMutability: true,
})
// cad 도면 파일 사용 여부
export const useCadFileState = atom({
key: 'useCadFile',
default: false,
})
// cad 도면 파일 이름
export const cadFileNameState = atom({
key: 'cadFileName',
default: '',
})
// cad 도면 파일 조정 완료
export const cadFileCompleteState = atom({
key: 'cadFileComplete',
default: false,
})
export const useGoogleMapFileState = atom({
key: 'useGoogleMapFile',
default: false,
})
// 구글맵 저장 이미지 파일 이름
export const googleMapFileNameState = atom({
key: 'googleMapFileName',
default: '',
})
export const globalCompassState = atom({
key: 'globalCompass',
default: 0,
dangerouslyAllowMutability: true,
})
// 면형상 배치 모드
export const surfacePlacementModeState = atom({
key: 'surfacePlacementMode',
default: { width: 0, height: 0, areaBoundary: true, inputType: 'free' },
})
// 오브젝트 배치 모드
export const objectPlacementModeState = atom({
key: 'objectPlacementMode',
default: { width: 0, height: 0, areaBoundary: false, inputType: 'free', batchType: 'opening' },
})
export const stepState = atom({
key: 'step',
default: 0,
})