"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SVirtualWallItem = void 0; const lib_1 = require("@persagy-web/draw/lib"); const __1 = require("../.."); const __2 = require("../.."); const lib_2 = require("@persagy-web/graph/lib"); class SVirtualWallItem extends lib_2.SGraphItem { constructor(parent, data) { super(parent); this.minX = Number.MAX_SAFE_INTEGER; this.maxX = Number.MIN_SAFE_INTEGER; this.minY = Number.MAX_SAFE_INTEGER; this.maxY = Number.MIN_SAFE_INTEGER; this.pointArr = []; this.data = data; this.zOrder = __1.ItemOrder.virtualWallOrder; let tempArr = this.data.OutLine; if (tempArr && tempArr.length) { this.minX = tempArr[0][0].X; this.maxX = this.minX; this.minY = -tempArr[0][0].Y; this.maxY = this.minY; this.pointArr = tempArr.map((t) => { return t.map((it) => { let x = it.X, y = -it.Y; if (x < this.minX) { this.minX = x; } if (y < this.minY) { this.minY = y; } if (x > this.maxX) { this.maxX = x; } if (y > this.maxY) { this.maxY = y; } return new lib_1.SPoint(x, y); }); }); } } boundingRect() { return new lib_1.SRect(this.minX, this.minY, this.maxX - this.minX, this.maxY - this.minY); } onDraw(painter) { painter.pen.lineWidth = painter.toPx(1); painter.pen.color = __2.ItemColor.virtualWallColor; painter.pen.lineDash = [20, 20]; this.pointArr.forEach((t) => { painter.drawPolyline(t); }); } } exports.SVirtualWallItem = SVirtualWallItem;