haojianlong 5 лет назад
Родитель
Сommit
54502b555e

+ 8 - 8
package-lock.json

@@ -1,6 +1,6 @@
 {
     "name": "cad-engine",
-    "version": "2.0.23",
+    "version": "2.0.46",
     "lockfileVersion": 1,
     "requires": true,
     "dependencies": {
@@ -30,20 +30,20 @@
             "integrity": "sha512-cYHF8tm/uIwMHRKGp+whO6/juVCyarNqrUq4nsHL22iV8pFOe5lDI8duc4Glg9Ar5dLdzNOdTIoYilmctJOOhQ=="
         },
         "@sybotan-web/draw": {
-            "version": "2.0.111",
-            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/draw/-/draw-2.0.111.tgz",
-            "integrity": "sha512-8jAw7PbUU9D192NrEDzqn4q/Qgc7SxMVSn33TemL+icP3sSld8n2iUp8XnSEql0cnbm4nIT0dErx5bJeiyMQQw==",
+            "version": "2.0.128",
+            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/draw/-/draw-2.0.128.tgz",
+            "integrity": "sha512-ok8iRMQclXRCIKKgHcUjyT0Q1jRU4qkcAdqIYztd5ucYrkrFGctnf+8QJtkt8Oj9Y3Sz/7ZDZvX6LcrkgRSqbw==",
             "requires": {
                 "@sybotan-web/base": "^2.0.54"
             }
         },
         "@sybotan-web/graphy": {
-            "version": "2.0.90",
-            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/graphy/-/graphy-2.0.90.tgz",
-            "integrity": "sha512-4egeDHD5VGLWd4Mo4YDnkqhEp/tkKVpDlX8zT/8bOe9TCGTOVW3hQba6Keth69WTbhmfxav8vY4dbVzoqlkb6w==",
+            "version": "2.0.93",
+            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/graphy/-/graphy-2.0.93.tgz",
+            "integrity": "sha512-USIDTKv2fQCtc7mkt56jDCs/688xYIxhgGRc4beh37+q+bUP5HOR6JU7UpBnmeV6+2rFm45Gqeo6UjKwptnkOg==",
             "requires": {
                 "@sybotan-web/base": "^2.0.54",
-                "@sybotan-web/draw": "^2.0.111"
+                "@sybotan-web/draw": "^2.0.117"
             }
         },
         "@types/eslint-visitor-keys": {

+ 3 - 3
package.json

@@ -1,6 +1,6 @@
 {
     "name": "cad-engine",
-    "version": "2.0.35",
+    "version": "2.0.47",
     "description": "上格云 CAD图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -32,8 +32,8 @@
     },
     "dependencies": {
         "@sybotan-web/base": "2.0.54",
-        "@sybotan-web/draw": "2.0.111",
-        "@sybotan-web/graphy": "2.0.90",
+        "@sybotan-web/draw": "2.0.128",
+        "@sybotan-web/graphy": "2.0.93",
         "axios": "^0.18.0",
         "pako": "^1.0.10"
     }

+ 34 - 7
src/FloorScene.ts

@@ -205,7 +205,7 @@ export class FloorScene extends SGraphyScene {
                 let binaryString = readerEvt.target.result;
                 //解压数据
                 let base64Data = btoa(binaryString);
-                let unGzipData = pako.unzip(base64Data);
+                let unGzipData = that.unzipBase64(base64Data);
                 that.data = unGzipData.EntityList[0].Elements;
                 resolve(unGzipData);
             };
@@ -268,7 +268,7 @@ export class FloorScene extends SGraphyScene {
      *  @param  space   空间list
      */
     addSpace(space: Space): void {
-        let item = new SpaceItem(space);
+        let item = new SpaceItem(null, space);
         item.zOrder = 2;
         item.visible = this.isShowSpace;
         this.spaceList.push(item);
@@ -281,7 +281,7 @@ export class FloorScene extends SGraphyScene {
      *  @param  column   柱子list
      */
     addColumn(column: Column): void {
-        let item = new ColumnItem(column);
+        let item = new ColumnItem(null, column);
         item.visible = this.isShowColumn;
         this.columnList.push(item);
         this.addItem(item);
@@ -293,7 +293,7 @@ export class FloorScene extends SGraphyScene {
      *  @param  wall   墙list
      */
     addWall(wall: Wall): void {
-        let item = new WallItem(wall);
+        let item = new WallItem(null, wall);
         item.visible = this.isShowWall;
         this.wallList.push(item);
         this.addItem(item);
@@ -305,7 +305,7 @@ export class FloorScene extends SGraphyScene {
      *  @param  virtualWall   虚拟墙list
      */
     addVirtualWall(virtualWall: VirtualWall): void {
-        let item = new VirtualWallItem(virtualWall);
+        let item = new VirtualWallItem(null, virtualWall);
         item.visible = this.isShowVirtualWall;
         this.virtualWallList.push(item);
         this.addItem(item);
@@ -317,7 +317,7 @@ export class FloorScene extends SGraphyScene {
      *  @param  doors   门list
      */
     addDoor(door: Door): void {
-        let item = new DoorItem(door);
+        let item = new DoorItem(null, door);
         item.zOrder = 1;
         item.visible = this.isShowDoor;
         this.doorList.push(item);
@@ -330,12 +330,13 @@ export class FloorScene extends SGraphyScene {
      *  @param  windows   窗户list
      */
     addCasement(casement: Casement): void {
-        let item = new WindowItem(casement);
+        let item = new WindowItem(null, casement);
         item.zOrder = 1;
         item.visible = this.isShowWindow;
         this.casementList.push(item);
         this.addItem(item);
     } // Function addCasement
+
     /**
      *  扩大数组中相应字段一定倍数
      *
@@ -361,4 +362,30 @@ export class FloorScene extends SGraphyScene {
         });
         return data;
     } // Function changeMap
+
+    /**
+     *  解压文件
+     *
+     *  @param  b64Data    base64数据
+     */
+    private unzipBase64(b64Data: any) {
+        let strData = atob(b64Data);
+        let charData = strData.split("").map(function(x) {
+            return x.charCodeAt(0);
+        });
+        let binData = new Uint8Array(charData);
+        let data = pako.inflate(binData, { to: "string" });
+        return eval("(" + data + ")");
+    } // Function unzipBase64
+
+    /**
+     *  压缩文件
+     *
+     *  @param  str    被压缩的数据
+     */
+    private zip(str: any) {
+        //escape(str)  --->压缩前编码,防止中午乱码
+        let binaryString = pako.gzip(escape(str), { to: "string" });
+        return binaryString;
+    } // Function zip
 } // Class FloorScene

+ 1 - 1
src/LocationPointScene.ts

@@ -58,7 +58,7 @@ export class LocationPointScene extends FloorScene {
      * @param   marker  标志对象
      */
     addMarker(marker: Marker) {
-        let flag = new MarkerItem(marker);
+        let flag = new MarkerItem(null, marker);
         flag.moveTo(marker.X, marker.Y);
         flag.zOrder = 9999999;
         this.markerList.push(marker);

+ 15 - 10
src/items/ColumnItem.ts

@@ -32,19 +32,22 @@ export class ColumnItem extends SGraphyItem {
     /** 柱子数据    */
     data: Column;
     /** 柱子轮廓线坐标list  */
-    private readonly pointArr: SPoint[];
+    private readonly pointArr: SPoint[] = [];
 
     /**
      * 构造函数
      *
-     * @param data
+     * @param parent    指向父对象
+     * @param data      柱子数据
      */
-    constructor(data: Column) {
-        super();
+    constructor(parent: SGraphyItem | null, data: Column) {
+        super(parent);
         this.data = data;
-        this.pointArr = this.data.OutLine[0].map(t => {
-            return new SPoint(t.X, t.Y);
-        });
+        if (this.data.OutLine.length) {
+            this.pointArr = this.data.OutLine[0].map(t => {
+                return new SPoint(t.X, t.Y);
+            });
+        }
     } // Constructor
 
     /**
@@ -54,8 +57,10 @@ export class ColumnItem extends SGraphyItem {
      * @param   rect          绘制区域
      */
     onDraw(painter: SPainter, rect?: SRect): void {
-        painter.pen.color = SColor.Transparent;
-        painter.brush.color = Opt.columnColor;
-        painter.drawPolygon(this.pointArr);
+        if (this.visible) {
+            painter.pen.color = SColor.Transparent;
+            painter.brush.color = Opt.columnColor;
+            painter.drawPolygon(this.pointArr);
+        }
     } // Function onDraw()
 } // Class ColumnItem

+ 53 - 76
src/items/DoorItem.ts

@@ -32,89 +32,59 @@ export class DoorItem extends SGraphyItem {
     /** 门数据 */
     data: Door;
     /** 门轮廓线坐标list  */
-    private readonly pointArr: SPoint[];
+    private readonly pointArr: SPoint[] = [];
+    /** 门长度 */
+    private r: number = 0;
+    /** 角度  */
+    private ang: number = 0;
+    /** 旋转点 */
+    private p: SPoint = new SPoint(0, 0);
+    /** 旋转起始角度 */
+    private startAng: number = -Math.PI / 2;
+    /** 旋转结束角度 */
+    private endAng: number = 0;
 
     /**
      * 构造函数
      *
-     * @param data
+     * @param parent    指向父对象
+     * @param data      门数据
      */
-    constructor(data: Door) {
-        super();
+    constructor(parent: SGraphyItem | null, data: Door) {
+        super(parent);
         this.data = data;
-        this.pointArr = this.data.OutLine[0].map(t => {
-            return new SPoint(t.X, t.Y);
-        });
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        let pointArr = this.data.OutLine[0];
-        let minX = pointArr[0].X;
-        let maxX = minX;
-        let minY = pointArr[0].Y;
-        let maxY = minY;
-        for (let i = 1; i < pointArr.length; i++) {
-            if (pointArr[i].X < minX) {
-                minX = pointArr[i].Y;
-            }
-            if (pointArr[i].Y < minY) {
-                minY = pointArr[i].Y;
-            }
-            if (pointArr[i].X > maxX) {
-                maxX = pointArr[i].X;
-            }
-            if (pointArr[i].Y > maxY) {
-                maxY = pointArr[i].Y;
-            }
-        }
-
-        return new SRect(minX, minY, maxX - minX, maxY - minY);
-    } // Function boundingRect()
+        if (this.data.OutLine.length) {
+            this.pointArr = this.data.OutLine[0].map(t => {
+                return new SPoint(t.X, t.Y);
+            });
 
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x
-     * @param y
-     */
-    contains(x: number, y: number): boolean {
-        let nCross = 0,
-            point = [x, y],
-            APoints = this.data.OutLine[0],
-            length = APoints.length,
-            p1,
-            p2,
-            i,
-            xinters;
-        p1 = APoints[0];
-        for (i = 1; i <= length; i++) {
-            p2 = APoints[i % length];
-            if (
-                point[0] > Math.min(p1.X, p2.X) &&
-                point[0] <= Math.max(p1.X, p2.X)
-            ) {
-                if (point[1] <= Math.max(p1.Y, p2.Y)) {
-                    if (p1.X != p2.X) {
-                        //计算位置信息
-                        xinters =
-                            ((point[0] - p1.X) * (p2.Y - p1.Y)) /
-                                (p2.X - p1.X) +
-                            p1.Y;
-                        if (p1.Y == p2.Y || point[1] <= xinters) {
-                            nCross++;
-                        }
-                    }
+            let p1 = this.pointArr[0];
+            let p2 = this.pointArr[1];
+            let fo = Math.atan(
+                this.data.FaceDirection.Y / this.data.FaceDirection.X
+            );
+            // 两点间距离
+            this.r = Math.sqrt(
+                Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)
+            );
+            // 门朝向角度
+            this.ang = this.data.FaceDirection.X > 0 ? fo : fo + Math.PI;
+            // 旋转点
+            if (this.data.HandDirection.X > this.data.HandDirection.Y) {
+                if (this.data.HandDirection.X > 0) {
+                    this.p = p1.x > p2.x ? p1 : p2;
+                } else {
+                    this.p = p1.x < p2.x ? p1 : p2;
+                }
+            } else {
+                if (this.data.HandDirection.Y > 0) {
+                    this.p = p1.y > p2.y ? p1 : p2;
+                } else {
+                    this.p = p1.y < p2.y ? p1 : p2;
                 }
             }
-            p1 = p2;
         }
-        return nCross % 2 === 1;
-    } // Function contains()
+    } // Constructor
 
     /**
      * Item绘制操作
@@ -123,8 +93,15 @@ export class DoorItem extends SGraphyItem {
      * @param   rect          绘制区域
      */
     onDraw(painter: SPainter, rect?: SRect): void {
-        painter.pen.color = Opt.doorColor;
-        painter.pen.lineWidth = 400;
-        painter.drawPolyline(this.pointArr);
+        if (this.visible) {
+            painter.translate(this.p.x, this.p.y);
+            painter.rotate(this.ang);
+            painter.pen.lineWidth = 50;
+            painter.pen.color = Opt.doorColor;
+            painter.drawLine(0, 0, this.r, 0);
+
+            painter.pen.lineDash = [10, 10];
+            painter.drawArc(0, 0, this.r, this.r, this.startAng, this.endAng);
+        }
     } // Function onDraw()
 } // Class DoorItem

+ 11 - 7
src/items/MarkItem.ts

@@ -29,9 +29,9 @@ import { Marker } from "../types/Marker";
  */
 export class MarkerItem extends SGraphyItem {
     /** 标志宽度 */
-    private width: number = 4200;
+    private width: number = 28;
     /** 标志高度 */
-    private height: number = 5550;
+    private height: number = 37;
     /** 标志 */
     data: Marker;
     /** 标志路径 */
@@ -44,13 +44,15 @@ export class MarkerItem extends SGraphyItem {
     /**
      * 构造函数
      *
-     * @param data
+     * @param parent    指向父对象
+     * @param data      标志数据
      */
-    constructor(data: Marker) {
-        super();
+    constructor(parent: SGraphyItem | null, data: Marker) {
+        super(parent);
         this.data = data;
         this.Img = new Image();
         this.Img.src = MarkerItem.imgSource;
+        this.isTransform = false;
     } // Constructor
 
     /**
@@ -59,7 +61,7 @@ export class MarkerItem extends SGraphyItem {
      * @return	SRect
      */
     boundingRect(): SRect {
-        return new SRect(0, 0, this.width, this.height);
+        return new SRect(-14, -33, this.width, this.height);
     } // Function boundingRect()
 
     /**
@@ -80,6 +82,8 @@ export class MarkerItem extends SGraphyItem {
      * @param   rect          绘制区域
      */
     onDraw(painter: SPainter, rect?: SRect): void {
-        painter.drawImage(this.Img, 0, 0, this.width, this.height);
+        if (this.visible) {
+            painter.drawImage(this.Img, -14, -33, this.width, this.height);
+        }
     } // Function onDraw()
 } // Class MarkerItem

+ 42 - 29
src/items/SpaceItem.ts

@@ -32,19 +32,47 @@ export class SpaceItem extends SGraphyItem {
     /** 空间所有数据  */
     data: Space;
     /** 空间轮廓线坐标list  */
-    private readonly pointArr: SPoint[];
-
+    private readonly pointArr: SPoint[] = [];
+    /** X坐标最小值  */
+    private minX = 0;
+    /** X坐标最大值  */
+    private maxX = 0;
+    /** Y坐标最小值  */
+    private minY = 0;
+    /** Y坐标最大值  */
+    private maxY = 0;
     /**
      * 构造函数
      *
-     * @param data
+     * @param parent    指向父对象
+     * @param data      空间数据
      */
-    constructor(data: Space) {
-        super();
+    constructor(parent: SGraphyItem | null, data: Space) {
+        super(parent);
         this.data = data;
-        this.pointArr = this.data.OutLine[0].map(t => {
-            return new SPoint(t.X, t.Y);
-        });
+        if (this.data.OutLine.length) {
+            this.pointArr = this.data.OutLine[0].map(t => {
+                return new SPoint(t.X, t.Y);
+            });
+        }
+        this.minX = this.pointArr[0].x;
+        this.maxX = this.minX;
+        this.minY = this.pointArr[0].y;
+        this.maxY = this.minY;
+        for (let i = 1; i < this.pointArr.length; i++) {
+            if (this.pointArr[i].x < this.minX) {
+                this.minX = this.pointArr[i].x;
+            }
+            if (this.pointArr[i].y < this.minY) {
+                this.minY = this.pointArr[i].y;
+            }
+            if (this.pointArr[i].x > this.maxX) {
+                this.maxX = this.pointArr[i].x;
+            }
+            if (this.pointArr[i].y > this.maxY) {
+                this.maxY = this.pointArr[i].y;
+            }
+        }
     } // Constructor
 
     /**
@@ -53,27 +81,12 @@ export class SpaceItem extends SGraphyItem {
      * @return SRect
      */
     boundingRect(): SRect {
-        let pointArr = this.data.OutLine[0];
-        let minX = pointArr[0].X;
-        let maxX = minX;
-        let minY = pointArr[0].Y;
-        let maxY = minY;
-        for (let i = 1; i < pointArr.length; i++) {
-            if (pointArr[i].X < minX) {
-                minX = pointArr[i].Y;
-            }
-            if (pointArr[i].Y < minY) {
-                minY = pointArr[i].Y;
-            }
-            if (pointArr[i].X > maxX) {
-                maxX = pointArr[i].X;
-            }
-            if (pointArr[i].Y > maxY) {
-                maxY = pointArr[i].Y;
-            }
-        }
-
-        return new SRect(minX, minY, maxX - minX, maxY - minY);
+        return new SRect(
+            this.minX,
+            this.minY,
+            this.maxX - this.minX,
+            this.maxY - this.minY
+        );
     } // Function boundingRect()
 
     /**

+ 15 - 10
src/items/VirtualWallItem.ts

@@ -32,19 +32,22 @@ export class VirtualWallItem extends SGraphyItem {
     /** 虚拟墙数据   */
     data: VirtualWall;
     /** 虚拟墙轮廓线坐标list  */
-    private readonly pointArr: SPoint[];
+    private readonly pointArr: SPoint[] = [];
 
     /**
      * 构造函数
      *
-     * @param data
+     * @param parent    指向父对象
+     * @param data      虚拟墙数据
      */
-    constructor(data: VirtualWall) {
-        super();
+    constructor(parent: SGraphyItem | null, data: VirtualWall) {
+        super(parent);
         this.data = data;
-        this.pointArr = this.data.OutLine[0].map(t => {
-            return new SPoint(t.X, t.Y);
-        });
+        if (this.data.OutLine.length) {
+            this.pointArr = this.data.OutLine[0].map(t => {
+                return new SPoint(t.X, t.Y);
+            });
+        }
     } // Constructor
 
     /**
@@ -54,8 +57,10 @@ export class VirtualWallItem extends SGraphyItem {
      * @param   rect          绘制区域
      */
     onDraw(painter: SPainter, rect?: SRect): void {
-        painter.pen.lineWidth = 100;
-        painter.pen.color = Opt.virtualWallColor;
-        painter.drawPolyline(this.pointArr);
+        if (this.visible) {
+            painter.pen.lineWidth = 100;
+            painter.pen.color = Opt.virtualWallColor;
+            painter.drawPolyline(this.pointArr);
+        }
     } // Function onDraw()
 } // Class VirtualWall

+ 16 - 11
src/items/WallItem.ts

@@ -32,19 +32,22 @@ export class WallItem extends SGraphyItem {
     /** 墙数据 */
     data: Wall;
     /** 墙轮廓线坐标list  */
-    private readonly pointArr: SPoint[];
+    private readonly pointArr: SPoint[] = [];
 
     /**
      * 构造函数
      *
-     * @param PolygonItemData
+     * @param parent    指向父对象
+     * @param data      墙数据
      */
-    constructor(data: Wall) {
-        super();
+    constructor(parent: SGraphyItem | null, data: Wall) {
+        super(parent);
         this.data = data;
-        this.pointArr = this.data.OutLine[0].map(t => {
-            return new SPoint(t.X, t.Y);
-        });
+        if (this.data.OutLine.length) {
+            this.pointArr = this.data.OutLine[0].map(t => {
+                return new SPoint(t.X, t.Y);
+            });
+        }
     } // Constructor
 
     /**
@@ -54,9 +57,11 @@ export class WallItem extends SGraphyItem {
      * @param   rect          绘制区域
      */
     onDraw(painter: SPainter, rect?: SRect): void {
-        painter.pen.color = Opt.wallColor;
-        painter.pen.lineWidth = 4;
-        painter.brush.color = Opt.wallColor;
-        painter.drawPolygon(this.pointArr);
+        if (this.visible) {
+            painter.pen.color = Opt.wallColor;
+            painter.pen.lineWidth = 4;
+            painter.brush.color = Opt.wallColor;
+            painter.drawPolygon(this.pointArr);
+        }
     } // Function onDraw()
 } // Class WallItem

+ 15 - 79
src/items/WindowItem.ts

@@ -32,89 +32,23 @@ export class WindowItem extends SGraphyItem {
     /** 窗户数据    */
     data: Casement;
     /** 窗户轮廓线坐标list  */
-    private readonly pointArr: SPoint[];
+    private readonly pointArr: SPoint[] = [];
 
     /**
      * 构造函数
      *
-     * @param data
+     * @param parent    指向父对象
+     * @param data      窗户数据
      */
-    constructor(data: Casement) {
-        super();
+    constructor(parent: SGraphyItem | null, data: Casement) {
+        super(parent);
         this.data = data;
-        this.pointArr = this.data.OutLine[0].map(t => {
-            return new SPoint(t.X, t.Y);
-        });
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        let pointArr = this.data.OutLine[0];
-        let minX = pointArr[0].X;
-        let maxX = minX;
-        let minY = pointArr[0].Y;
-        let maxY = minY;
-        for (let i = 1; i < pointArr.length; i++) {
-            if (pointArr[i].X < minX) {
-                minX = pointArr[i].Y;
-            }
-            if (pointArr[i].Y < minY) {
-                minY = pointArr[i].Y;
-            }
-            if (pointArr[i].X > maxX) {
-                maxX = pointArr[i].X;
-            }
-            if (pointArr[i].Y > maxY) {
-                maxY = pointArr[i].Y;
-            }
+        if (this.data.OutLine.length) {
+            this.pointArr = this.data.OutLine[0].map(t => {
+                return new SPoint(t.X, t.Y);
+            });
         }
-
-        return new SRect(minX, minY, maxX - minX, maxY - minY);
-    } // Function boundingRect()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x
-     * @param y
-     */
-    contains(x: number, y: number): boolean {
-        let nCross = 0,
-            point = [x, y],
-            APoints = this.data.OutLine[0],
-            length = APoints.length,
-            p1,
-            p2,
-            i,
-            xinters;
-        p1 = APoints[0];
-        for (i = 1; i <= length; i++) {
-            p2 = APoints[i % length];
-            if (
-                point[0] > Math.min(p1.X, p2.X) &&
-                point[0] <= Math.max(p1.X, p2.X)
-            ) {
-                if (point[1] <= Math.max(p1.Y, p2.Y)) {
-                    if (p1.X != p2.X) {
-                        //计算位置信息
-                        xinters =
-                            ((point[0] - p1.X) * (p2.Y - p1.Y)) /
-                                (p2.X - p1.X) +
-                            p1.Y;
-                        if (p1.Y == p2.Y || point[1] <= xinters) {
-                            nCross++;
-                        }
-                    }
-                }
-            }
-            p1 = p2;
-        }
-        return nCross % 2 === 1;
-    } // Function contains()
+    } // Constructor
 
     /**
      * Item绘制操作
@@ -123,8 +57,10 @@ export class WindowItem extends SGraphyItem {
      * @param   rect          绘制区域
      */
     onDraw(painter: SPainter, rect?: SRect): void {
-        painter.pen.color = Opt.windowColor;
-        painter.pen.lineWidth = 400;
-        painter.drawPolyline(this.pointArr);
+        if (this.visible) {
+            painter.pen.color = Opt.windowColor;
+            painter.pen.lineWidth = 400;
+            painter.drawPolyline(this.pointArr);
+        }
     } // Function onDraw()
 } // Class WindowItem