|
@@ -774,232 +774,6 @@ export default class Draw {
|
|
|
this.context.restore()
|
|
|
}
|
|
|
|
|
|
- drawBeam(geometry, styleType) {
|
|
|
- let points2d = geometry.points2d
|
|
|
- let points = []
|
|
|
- for (let i = 0; i < points2d.length; ++i) {
|
|
|
- points[i] = coordinate.getScreenXY({ x: points2d[i].x, y: points2d[i].y })
|
|
|
- }
|
|
|
-
|
|
|
- this.context.save()
|
|
|
-
|
|
|
- this.context.lineWidth = Style.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.Component.strokeStyle
|
|
|
-
|
|
|
- let isFill = false
|
|
|
-
|
|
|
- if (styleType) {
|
|
|
- if (styleType == 'style-1') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style1.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style1.Component.strokeStyle
|
|
|
- } else if (styleType == 'style-2') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style2.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style2.Component.strokeStyle
|
|
|
- } else if (styleType == 'style-3') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style3.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style3.Component.strokeStyle
|
|
|
- } else if (styleType == 'style-4') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style4.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style4.Component.strokeStyle
|
|
|
- }
|
|
|
- } else {
|
|
|
- const selectItem = stateService.getSelectItem()
|
|
|
- const draggingItem = stateService.getDraggingItem()
|
|
|
- const focusItem = stateService.getFocusItem()
|
|
|
-
|
|
|
- if (selectItem && selectItem.type == VectorType.Beam) {
|
|
|
- if (geometry.vectorId == selectItem.vectorId) {
|
|
|
- this.context.strokeStyle = Style.Select.Component.strokeStyle
|
|
|
- this.context.fillStyle = Style.Select.Component.fillStyle
|
|
|
- isFill = true
|
|
|
- }
|
|
|
- } else if (draggingItem && draggingItem.type == VectorType.Beam) {
|
|
|
- if (geometry.vectorId == draggingItem.vectorId) {
|
|
|
- this.context.strokeStyle = Style.Select.Component.strokeStyle
|
|
|
- this.context.fillStyle = Style.Select.Component.fillStyle
|
|
|
- isFill = true
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (focusItem && focusItem.type == VectorType.Beam) {
|
|
|
- if (geometry.vectorId == focusItem.vectorId) {
|
|
|
- this.context.strokeStyle = Style.Focus.Component.strokeStyle
|
|
|
- this.context.fillStyle = Style.Focus.Component.fillStyle
|
|
|
- isFill = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- this.context.beginPath()
|
|
|
- this.context.moveTo(points[0].x, points[0].y)
|
|
|
- this.context.lineTo(points[1].x, points[1].y)
|
|
|
- this.context.lineTo(points[2].x, points[2].y)
|
|
|
- this.context.lineTo(points[3].x, points[3].y)
|
|
|
- this.context.closePath()
|
|
|
- this.context.stroke()
|
|
|
- if (isFill) {
|
|
|
- this.context.fill()
|
|
|
- }
|
|
|
-
|
|
|
- //this.context.beginPath()
|
|
|
- this.context.moveTo(points[0].x, points[0].y)
|
|
|
- this.context.lineTo(points[2].x, points[2].y)
|
|
|
- //this.context.stroke()
|
|
|
-
|
|
|
- //this.context.beginPath()
|
|
|
- this.context.moveTo(points[1].x, points[1].y)
|
|
|
- this.context.lineTo(points[3].x, points[3].y)
|
|
|
- this.context.stroke()
|
|
|
- this.context.restore()
|
|
|
- }
|
|
|
-
|
|
|
- drawFlue(geometry, styleType) {
|
|
|
- let points2d = geometry.points2d
|
|
|
- let points = []
|
|
|
- for (let i = 0; i < points2d.length; ++i) {
|
|
|
- points[i] = coordinate.getScreenXY({ x: points2d[i].x, y: points2d[i].y })
|
|
|
- }
|
|
|
-
|
|
|
- this.context.save()
|
|
|
-
|
|
|
- this.context.lineWidth = Style.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.Component.strokeStyle
|
|
|
-
|
|
|
- let isFill = false
|
|
|
-
|
|
|
- if (styleType) {
|
|
|
- if (styleType == 'style-1') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style1.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style1.Component.strokeStyle
|
|
|
- } else if (styleType == 'style-2') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style2.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style2.Component.strokeStyle
|
|
|
- } else if (styleType == 'style-3') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style3.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style3.Component.strokeStyle
|
|
|
- } else if (styleType == 'style-4') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style4.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style4.Component.strokeStyle
|
|
|
- }
|
|
|
- } else {
|
|
|
- const selectItem = stateService.getSelectItem()
|
|
|
- const draggingItem = stateService.getDraggingItem()
|
|
|
- const focusItem = stateService.getFocusItem()
|
|
|
-
|
|
|
- if (selectItem && selectItem.type == VectorType.Flue) {
|
|
|
- if (geometry.vectorId == selectItem.vectorId) {
|
|
|
- this.context.strokeStyle = Style.Select.Component.strokeStyle
|
|
|
- this.context.fillStyle = Style.Select.Component.fillStyle
|
|
|
- isFill = true
|
|
|
- }
|
|
|
- } else if (draggingItem && draggingItem.type == VectorType.Flue) {
|
|
|
- if (geometry.vectorId == draggingItem.vectorId) {
|
|
|
- this.context.strokeStyle = Style.Select.Component.strokeStyle
|
|
|
- this.context.fillStyle = Style.Select.Component.fillStyle
|
|
|
- isFill = true
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (focusItem && focusItem.type == VectorType.Flue) {
|
|
|
- if (geometry.vectorId == focusItem.vectorId) {
|
|
|
- this.context.strokeStyle = Style.Focus.Component.strokeStyle
|
|
|
- this.context.fillStyle = Style.Focus.Component.fillStyle
|
|
|
- isFill = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- this.context.beginPath()
|
|
|
- this.context.moveTo(points[0].x, points[0].y)
|
|
|
- this.context.lineTo(points[1].x, points[1].y)
|
|
|
- this.context.lineTo(points[2].x, points[2].y)
|
|
|
- this.context.lineTo(points[3].x, points[3].y)
|
|
|
- this.context.closePath()
|
|
|
- this.context.stroke()
|
|
|
- if (isFill) {
|
|
|
- this.context.fill()
|
|
|
- }
|
|
|
-
|
|
|
- this.context.beginPath()
|
|
|
- this.context.moveTo(points[4].x, points[4].y)
|
|
|
- this.context.lineTo(points[5].x, points[5].y)
|
|
|
- this.context.lineTo(points[6].x, points[6].y)
|
|
|
- this.context.lineTo(points[7].x, points[7].y)
|
|
|
- this.context.closePath()
|
|
|
- this.context.stroke()
|
|
|
-
|
|
|
- this.context.moveTo(points[4].x, points[4].y)
|
|
|
- this.context.lineTo(points[8].x, points[8].y)
|
|
|
- this.context.lineTo(points[6].x, points[6].y)
|
|
|
- this.context.stroke()
|
|
|
-
|
|
|
- this.context.restore()
|
|
|
- }
|
|
|
-
|
|
|
- drawCorridor(geometry, styleType) {
|
|
|
- let points2d = geometry.points2d
|
|
|
- let points = []
|
|
|
- for (let i = 0; i < points2d.length; ++i) {
|
|
|
- points[i] = coordinate.getScreenXY({ x: points2d[i].x, y: points2d[i].y })
|
|
|
- }
|
|
|
-
|
|
|
- this.context.save()
|
|
|
-
|
|
|
- this.context.lineWidth = Style.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.Component.strokeStyle
|
|
|
-
|
|
|
- if (styleType) {
|
|
|
- if (styleType == 'style-1') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style1.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style1.Component.strokeStyle
|
|
|
- } else if (styleType == 'style-2') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style2.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style2.Component.strokeStyle
|
|
|
- } else if (styleType == 'style-3') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style3.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style3.Component.strokeStyle
|
|
|
- } else if (styleType == 'style-4') {
|
|
|
- this.context.lineWidth = Style.DownLoad.style4.Component.lineWidth * coordinate.ratio
|
|
|
- this.context.strokeStyle = Style.DownLoad.style4.Component.strokeStyle
|
|
|
- }
|
|
|
- } else {
|
|
|
- const selectItem = stateService.getSelectItem()
|
|
|
- const draggingItem = stateService.getDraggingItem()
|
|
|
- const focusItem = stateService.getFocusItem()
|
|
|
-
|
|
|
- if (selectItem && selectItem.type == VectorType.Corridor) {
|
|
|
- if (geometry.vectorId == selectItem.vectorId) {
|
|
|
- this.context.strokeStyle = Style.Select.Component.strokeStyle
|
|
|
- }
|
|
|
- } else if (draggingItem && draggingItem.type == VectorType.Corridor) {
|
|
|
- if (geometry.vectorId == draggingItem.vectorId) {
|
|
|
- this.context.strokeStyle = Style.Select.Component.strokeStyle
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (focusItem && focusItem.type == VectorType.Corridor) {
|
|
|
- if (geometry.vectorId == focusItem.vectorId) {
|
|
|
- this.context.strokeStyle = Style.Focus.Component.strokeStyle
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- this.context.beginPath()
|
|
|
- this.context.moveTo(points[0].x, points[0].y)
|
|
|
- this.context.lineTo(points[1].x, points[1].y)
|
|
|
- this.context.lineTo(points[2].x, points[2].y)
|
|
|
- this.context.lineTo(points[3].x, points[3].y)
|
|
|
- this.context.closePath()
|
|
|
- this.context.stroke()
|
|
|
-
|
|
|
- for (let i = 4; i < points.length - 1; i += 2) {
|
|
|
- this.context.moveTo(points[i].x, points[i].y)
|
|
|
- this.context.lineTo(points[i + 1].x, points[i + 1].y)
|
|
|
- }
|
|
|
- this.context.stroke()
|
|
|
- this.context.restore()
|
|
|
- }
|
|
|
-
|
|
|
drawTag(geometry, styleType, hide) {
|
|
|
this.context.save()
|
|
|
|