복시도, 실측치 모듈 크기 수정
This commit is contained in:
parent
bb85d2ed6b
commit
3c8dbf634d
@ -72,7 +72,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
|
|
||||||
const placementRef = {
|
const placementRef = {
|
||||||
isChidori: useRef('false'),
|
isChidori: useRef('false'),
|
||||||
setupLocation: useRef('center'),
|
setupLocation: useRef('eaves'),
|
||||||
isMaxSetup: useRef('false'),
|
isMaxSetup: useRef('false'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { useState } from 'react'
|
|||||||
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
||||||
import { canvasSettingState, canvasState, checkedModuleState, isManualModuleSetupState } from '@/store/canvasAtom'
|
import { canvasSettingState, canvasState, checkedModuleState, isManualModuleSetupState } from '@/store/canvasAtom'
|
||||||
import { rectToPolygon, polygonToTurfPolygon, calculateVisibleModuleHeight, getDegreeByChon } from '@/util/canvas-util'
|
import { rectToPolygon, polygonToTurfPolygon, calculateVisibleModuleHeight, getDegreeByChon } from '@/util/canvas-util'
|
||||||
import { basicSettingState, roofDisplaySelector } from '@/store/settingAtom'
|
import { addedRoofsState, basicSettingState, roofDisplaySelector } from '@/store/settingAtom'
|
||||||
import offsetPolygon, { calculateAngle } from '@/util/qpolygon-utils'
|
import offsetPolygon, { calculateAngle } from '@/util/qpolygon-utils'
|
||||||
import { QPolygon } from '@/components/fabric/QPolygon'
|
import { QPolygon } from '@/components/fabric/QPolygon'
|
||||||
import { moduleSetupSurfaceState, moduleIsSetupState } from '@/store/canvasAtom'
|
import { moduleSetupSurfaceState, moduleIsSetupState } from '@/store/canvasAtom'
|
||||||
@ -48,11 +48,9 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// console.log('basicSetting', basicSetting)
|
// console.log('basicSetting', basicSetting)
|
||||||
if (canvas) {
|
if (canvas) {
|
||||||
canvas.selection = true
|
//드래그 여부
|
||||||
canvas.selectionFullyContained = true
|
// canvas.selection = true
|
||||||
// canvas.on('selection:created', (e) => {
|
// canvas.selectionFullyContained = true
|
||||||
// console.log('selection:created', e.selected)
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
@ -191,7 +189,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let offsetLength = canvasSetting.roofSizeSet === 3 ? -90 : (trestleDetail.eaveIntvl / 10) * -1
|
let offsetLength = canvasSetting.roofSizeSet === '3' ? -90 : (trestleDetail.eaveIntvl / 10) * -1
|
||||||
setSurfaceShapePattern(roof, roofDisplay.column, true) //패턴 변경
|
setSurfaceShapePattern(roof, roofDisplay.column, true) //패턴 변경
|
||||||
const offsetPoints = offsetPolygon(roof.points, offsetLength) //안쪽 offset
|
const offsetPoints = offsetPolygon(roof.points, offsetLength) //안쪽 offset
|
||||||
//모듈설치영역?? 생성
|
//모듈설치영역?? 생성
|
||||||
@ -401,12 +399,11 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
const moduleHeight = Number(checkedModule[0].shortAxis) / 10
|
const moduleHeight = Number(checkedModule[0].shortAxis) / 10
|
||||||
let tmpWidth = flowDirection === 'south' || flowDirection === 'north' ? moduleWidth : moduleHeight
|
let tmpWidth = flowDirection === 'south' || flowDirection === 'north' ? moduleWidth : moduleHeight
|
||||||
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
|
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
|
||||||
let { width, height } = calculateVisibleModuleHeight(
|
|
||||||
tmpWidth,
|
let { width, height } =
|
||||||
tmpHeight,
|
canvasSetting.roofSizeSet === '1'
|
||||||
getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch),
|
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection)
|
||||||
flowDirection,
|
: { width: tmpWidth, height: tmpHeight }
|
||||||
) //각도 적용
|
|
||||||
|
|
||||||
const points = [
|
const points = [
|
||||||
{ x: mousePoint.x - width / 2, y: mousePoint.y - height / 2 },
|
{ x: mousePoint.x - width / 2, y: mousePoint.y - height / 2 },
|
||||||
@ -823,17 +820,16 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
: Number(module.longAxis)) / 10
|
: Number(module.longAxis)) / 10
|
||||||
}
|
}
|
||||||
|
|
||||||
return calculateVisibleModuleHeight(
|
console.log(canvasSetting)
|
||||||
tmpWidth,
|
|
||||||
tmpHeight,
|
return canvasSetting.roofSizeSet === '1'
|
||||||
getDegreeByChon(moduleSetupSurface.roofMaterial.pitch),
|
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurface.roofMaterial.pitch), moduleSetupSurface.flowDirection)
|
||||||
moduleSetupSurface.flowDirection,
|
: { width: tmpWidth, height: tmpHeight }
|
||||||
) //각도 적
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFlowLines = (moduleSetupSurface, module) => {
|
const getFlowLines = (moduleSetupSurface, module) => {
|
||||||
let flowLines = {}
|
let flowLines = {}
|
||||||
if (canvasSetting.roofSizeSet !== 3) {
|
if (canvasSetting.roofSizeSet !== '3') {
|
||||||
flowLines = {
|
flowLines = {
|
||||||
bottom: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'bottom'),
|
bottom: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'bottom'),
|
||||||
top: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'top'),
|
top: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'top'),
|
||||||
|
|||||||
@ -5,10 +5,8 @@ import { useMasterController } from '@/hooks/common/useMasterController'
|
|||||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
||||||
import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { isObjectNotEmpty, isEqualObjects } from '@/util/common-utils'
|
import { isObjectNotEmpty, isEqualObjects } from '@/util/common-utils'
|
||||||
import { addedRoofsState } from '@/store/settingAtom'
|
|
||||||
|
|
||||||
export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) {
|
export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) {
|
||||||
const addRoofsArray = useRecoilValue(addedRoofsState)
|
|
||||||
const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트
|
const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트
|
||||||
|
|
||||||
const { findCommonCode } = useCommonCode()
|
const { findCommonCode } = useCommonCode()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user