Pārlūkot izejas kodu

Merge branch 'master' of http://39.106.8.246:3003/web/persagy-web

YaolongHan 4 gadi atpakaļ
vecāks
revīzija
5dfc40a434

+ 2 - 2
persagy-web-big/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@persagy-web/big",
-    "version": "2.2.1",
+    "version": "2.2.5",
     "description": "博锐尚格建筑信息化库",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -41,6 +41,6 @@
         "typescript": "^3.9.3"
     },
     "dependencies": {
-        "@persagy-web/graph": "2.2.1"
+        "@persagy-web/graph": "2.2.7"
     }
 }

+ 30 - 6
persagy-web-big/src/items/SIconTextItem.ts

@@ -33,7 +33,14 @@ import {
 } from "@persagy-web/graph";
 import { SItemStatus, ItemOrder } from "..";
 import { SMouseEvent } from "@persagy-web/base";
-import { SSize, SRect, SPainter, SColor, SFont, SPoint } from "@persagy-web/draw";
+import {
+    SSize,
+    SRect,
+    SPainter,
+    SColor,
+    SFont,
+    SPoint
+} from "@persagy-web/draw";
 import { Anchor } from "../types/topology/Anchor";
 
 /**
@@ -155,7 +162,10 @@ export class SIconTextItem extends SObjectItem {
     }
     set sWidth(v: number) {
         this.img.width = v;
-        this.img.origin = new SPoint(this.img.width * 0.5, this.img.height * 0.5);
+        this.img.origin = new SPoint(
+            this.img.width * 0.5,
+            this.img.height * 0.5
+        );
         this.changeAnchorPoint();
         this.update();
     }
@@ -166,7 +176,10 @@ export class SIconTextItem extends SObjectItem {
     }
     set sHeight(v: number) {
         this.img.height = v;
-        this.img.origin = new SPoint(this.img.width * 0.5, this.img.height * 0.5);
+        this.img.origin = new SPoint(
+            this.img.width * 0.5,
+            this.img.height * 0.5
+        );
         this.changeAnchorPoint();
         this.update();
     }
@@ -222,7 +235,10 @@ export class SIconTextItem extends SObjectItem {
         super(parent);
         this.img.width = 32;
         this.img.height = 32;
-        this.img.origin = new SPoint(this.img.width * 0.5, this.img.height * 0.5);
+        this.img.origin = new SPoint(
+            this.img.width * 0.5,
+            this.img.height * 0.5
+        );
         this.img.connect("onMove", this, this.changeAnchorPoint.bind(this));
         let anchorPoint;
         if (data && data.length) {
@@ -372,9 +388,17 @@ export class SIconTextItem extends SObjectItem {
                 painter.shadow.shadowColor = this.activeColor;
                 painter.shadow.shadowOffsetX = 5;
                 painter.shadow.shadowOffsetY = 5;
-                painter.drawCircle(this.img.x, this.img.y, (this.sWidth / 2.0 + 3) * 1.25);
+                painter.drawCircle(
+                    this.img.x,
+                    this.img.y,
+                    (this.sWidth / 2.0 + 3) * 1.25
+                );
             } else {
-                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0 + 3);
+                painter.drawCircle(
+                    this.img.x,
+                    this.img.y,
+                    this.sWidth / 2.0 + 3
+                );
             }
         } else {
             if (this.selected) {

+ 3 - 3
persagy-web-big/src/items/floor/SBoardItem.ts

@@ -24,7 +24,7 @@
  * *********************************************************************************************************************
  */
 
-import { SPainter, SPath2D, SPoint } from "@persagy-web/draw";
+import { SPainter, SPath, SPoint } from "@persagy-web/draw";
 import { Zone } from "../../types/floor/Zone";
 import { ItemColor } from "../..";
 import { SGraphItem } from "@persagy-web/graph";
@@ -40,7 +40,7 @@ export class SBoardItem extends SGraphItem {
     /** 空间轮廓线坐标list */
     readonly pointArr: SPoint[][][] = [];
     /** path数组 */
-    private pathList: SPath2D[] = [];
+    private pathList: SPath[] = [];
 
     /**
      * 构造函数
@@ -59,7 +59,7 @@ export class SBoardItem extends SGraphItem {
         ) {
             let tempArr = this.data.OutLine;
             this.pointArr = tempArr.map((t): SPoint[][] => {
-                let sPath = new SPath2D();
+                let sPath = new SPath();
                 let tempArr = t.map((it): SPoint[] => {
                     let array = it.map(
                         (item): SPoint => {

+ 16 - 51
persagy-web-big/src/items/floor/SSpaceItem.ts

@@ -27,6 +27,7 @@
 import {
     SColor,
     SPainter,
+    SPath,
     SPoint,
     SPolygonUtil,
     SRect,
@@ -42,21 +43,21 @@ import { SGraphItem } from "@persagy-web/graph";
  * @author  郝建龙
  */
 export class SSpaceItem extends SGraphItem {
-    /** 空间所有数据  */
+    /** 空间所有数据 */
     data: Space;
-    /** 空间轮廓线坐标list  */
+    /** 空间轮廓线坐标list */
     readonly pointArr: SPoint[][] = [];
-    /** X坐标最小值  */
+    /** X坐标最小值 */
     minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
+    /** X坐标最大值 */
     maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
+    /** Y坐标最小值 */
     minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
+    /** Y坐标最大值 */
     maxY = Number.MIN_SAFE_INTEGER;
-    /** path对象      */
-    // private path = new SPath2D();
-    /** 高亮状态    */
+    /** path对象 */
+    private path = new SPath();
+    /** 高亮状态 */
     private _highLightFlag: boolean = false;
     get highLightFlag(): boolean {
         return this._highLightFlag;
@@ -65,7 +66,7 @@ export class SSpaceItem extends SGraphItem {
         this._highLightFlag = value;
         this.update();
     } // Set highLightFlag
-    /** 是否显示名字  */
+    /** 是否显示名字 */
     private _showBaseName: boolean = false;
     get showBaseName(): boolean {
         return this._showBaseName;
@@ -74,7 +75,7 @@ export class SSpaceItem extends SGraphItem {
         this._showBaseName = value;
         this.update();
     } // Set showBaseName
-    /** 是否名字大小  */
+    /** 是否名字大小 */
     private _nameSize: number = 10;
     get nameSize(): number {
         return this._nameSize;
@@ -83,7 +84,7 @@ export class SSpaceItem extends SGraphItem {
         this._nameSize = value;
         this.update();
     } // Set nameSize
-    /** 名字是否缩放  */
+    /** 名字是否缩放 */
     private _nameTransform: boolean = false;
     get nameTransform(): boolean {
         return this._nameTransform;
@@ -92,7 +93,7 @@ export class SSpaceItem extends SGraphItem {
         this._nameTransform = value;
         this.update();
     } // Set nameTransform
-    /** 名字颜色    */
+    /** 名字颜色 */
     private _nameColor: string = "#000000";
     get nameColor(): string {
         return this._nameColor;
@@ -139,7 +140,7 @@ export class SSpaceItem extends SGraphItem {
                         return new SPoint(x, y);
                     }
                 );
-                // this.path.polygon(temp);
+                this.path.polygon(temp);
                 return temp;
             });
         }
@@ -159,38 +160,6 @@ export class SSpaceItem extends SGraphItem {
         );
     } // Function boundingRect()
 
-    // /**
-    //  * 鼠标单击事件
-    //  *
-    //  * @param	event         事件参数
-    //  * @return	boolean
-    //  */
-    // onMouseDown(event: SMouseEvent): boolean {
-    //     console.log("spaceDown");
-    //     this.$emit("click", event);
-    //     return true;
-    // } // Function onMouseDown()
-
-    // /**
-    //  * 鼠标移动事件
-    //  *
-    //  * @param event 事件参数
-    //  */
-    // onMouseMove(event: SMouseEvent): boolean {
-    //     return false;
-    // } // Function onMouseMove()
-
-    // /**
-    //  * 鼠标抬起事件
-    //  *
-    //  * @param	event         事件参数
-    //  * @return	boolean
-    //  */
-    // onMouseUp(event: SMouseEvent): boolean {
-    //     console.log("spaceUp");
-    //     return false;
-    // } // Function onClick()
-
     /**
      * 判断点是否在区域内
      *
@@ -226,10 +195,7 @@ export class SSpaceItem extends SGraphItem {
             painter.brush.color = ItemColor.spaceColor;
         }
         painter.pen.lineWidth = painter.toPx(1);
-        // painter.drawPath(this.path);
-        if (this.pointArr.length) {
-            painter.drawPolygon(this.pointArr[0]);
-        }
+        painter.drawPath(this.path);
 
         if (this.showBaseName) {
             if (this.name && this.name != "null") {
@@ -239,7 +205,6 @@ export class SSpaceItem extends SGraphItem {
                 } else {
                     painter.font.size = painter.toPx(this.nameSize);
                 }
-                // painter.font.size = 500;
                 painter.font.textAlign = STextAlign.Center;
                 painter.drawText(
                     this.name,

+ 50 - 16
persagy-web-big/src/items/floor/SSpaceItemSS.ts

@@ -27,7 +27,6 @@
 import {
     SColor,
     SPainter,
-    SPath2D,
     SPoint,
     SPolygonUtil,
     SRect,
@@ -43,21 +42,21 @@ import { SGraphItem } from "@persagy-web/graph";
  * @author  郝建龙
  */
 export class SSpaceItem extends SGraphItem {
-    /** 空间所有数据 */
+    /** 空间所有数据  */
     data: Space;
-    /** 空间轮廓线坐标list */
+    /** 空间轮廓线坐标list  */
     readonly pointArr: SPoint[][] = [];
-    /** X坐标最小值 */
+    /** X坐标最小值  */
     minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值 */
+    /** X坐标最大值  */
     maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值 */
+    /** Y坐标最小值  */
     minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值 */
+    /** Y坐标最大值  */
     maxY = Number.MIN_SAFE_INTEGER;
-    /** path对象 */
-    private path = new SPath2D();
-    /** 高亮状态 */
+    /** path对象      */
+    // private path = new SPath2D();
+    /** 高亮状态    */
     private _highLightFlag: boolean = false;
     get highLightFlag(): boolean {
         return this._highLightFlag;
@@ -66,7 +65,7 @@ export class SSpaceItem extends SGraphItem {
         this._highLightFlag = value;
         this.update();
     } // Set highLightFlag
-    /** 是否显示名字 */
+    /** 是否显示名字  */
     private _showBaseName: boolean = false;
     get showBaseName(): boolean {
         return this._showBaseName;
@@ -75,7 +74,7 @@ export class SSpaceItem extends SGraphItem {
         this._showBaseName = value;
         this.update();
     } // Set showBaseName
-    /** 是否名字大小 */
+    /** 是否名字大小  */
     private _nameSize: number = 10;
     get nameSize(): number {
         return this._nameSize;
@@ -84,7 +83,7 @@ export class SSpaceItem extends SGraphItem {
         this._nameSize = value;
         this.update();
     } // Set nameSize
-    /** 名字是否缩放 */
+    /** 名字是否缩放  */
     private _nameTransform: boolean = false;
     get nameTransform(): boolean {
         return this._nameTransform;
@@ -93,7 +92,7 @@ export class SSpaceItem extends SGraphItem {
         this._nameTransform = value;
         this.update();
     } // Set nameTransform
-    /** 名字颜色 */
+    /** 名字颜色    */
     private _nameColor: string = "#000000";
     get nameColor(): string {
         return this._nameColor;
@@ -140,7 +139,7 @@ export class SSpaceItem extends SGraphItem {
                         return new SPoint(x, y);
                     }
                 );
-                this.path.polygon(temp);
+                // this.path.polygon(temp);
                 return temp;
             });
         }
@@ -160,6 +159,38 @@ export class SSpaceItem extends SGraphItem {
         );
     } // Function boundingRect()
 
+    // /**
+    //  * 鼠标单击事件
+    //  *
+    //  * @param	event         事件参数
+    //  * @return	boolean
+    //  */
+    // onMouseDown(event: SMouseEvent): boolean {
+    //     console.log("spaceDown");
+    //     this.$emit("click", event);
+    //     return true;
+    // } // Function onMouseDown()
+
+    // /**
+    //  * 鼠标移动事件
+    //  *
+    //  * @param event 事件参数
+    //  */
+    // onMouseMove(event: SMouseEvent): boolean {
+    //     return false;
+    // } // Function onMouseMove()
+
+    // /**
+    //  * 鼠标抬起事件
+    //  *
+    //  * @param	event         事件参数
+    //  * @return	boolean
+    //  */
+    // onMouseUp(event: SMouseEvent): boolean {
+    //     console.log("spaceUp");
+    //     return false;
+    // } // Function onClick()
+
     /**
      * 判断点是否在区域内
      *
@@ -195,7 +226,10 @@ export class SSpaceItem extends SGraphItem {
             painter.brush.color = ItemColor.spaceColor;
         }
         painter.pen.lineWidth = painter.toPx(1);
-        painter.drawPath(this.path);
+        // painter.drawPath(this.path);
+        if (this.pointArr.length) {
+            painter.drawPolygon(this.pointArr[0]);
+        }
 
         if (this.showBaseName) {
             if (this.name && this.name != "null") {

+ 23 - 54
persagy-web-big/src/items/floor/SWallItem.ts

@@ -24,7 +24,7 @@
  * *********************************************************************************************************************
  */
 
-import { SPainter, SPath2D, SPoint, SRect } from "@persagy-web/draw";
+import { SPainter, SPoint, SRect, SPath } from "@persagy-web/draw";
 import { Wall } from "../../types/floor/Wall";
 import { ItemOrder, ItemColor } from "../..";
 import { SGraphItem } from "@persagy-web/graph";
@@ -47,10 +47,8 @@ export class SWallItem extends SGraphItem {
     private maxY = Number.MIN_SAFE_INTEGER;
     /** 墙轮廓线坐标list */
     private readonly pointArr: SPoint[][] = [];
-    /** 墙内轮廓线坐标list */
-    private readonly holesArr: SPoint[][] = [];
     /** path对象 */
-    private path = new SPath2D();
+    private path = new SPath();
 
     /**
      * 构造函数
@@ -63,62 +61,33 @@ export class SWallItem extends SGraphItem {
         this.data = data;
         this.zOrder = ItemOrder.wallOrder;
         let tempArr = this.data.OutLine;
-        let holes = data.Holes;
         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 = [];
-            let WLine = tempArr[0].map(
-                (it): SPoint => {
-                    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 SPoint(x, y);
-                }
-            );
-            // 外轮廓
-            this.path.polygon(WLine);
-            // 外轮廓
-            this.pointArr.push(WLine);
-            // 内轮廓
-            if (holes && holes.length) {
-                this.holesArr = holes.map(t => {
-                    let temp = t.map(
-                        (it): SPoint => {
-                            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 SPoint(x, y);
+            tempArr.forEach((t): void => {
+                const temp = t.map(
+                    (it): SPoint => {
+                        let x = it.X,
+                            y = -it.Y;
+                        if (x < this.minX) {
+                            this.minX = x;
                         }
-                    );
-                    this.path.polygon(temp);
-                    return temp;
-                });
-            }
+                        if (y < this.minY) {
+                            this.minY = y;
+                        }
+                        if (x > this.maxX) {
+                            this.maxX = x;
+                        }
+                        if (y > this.maxY) {
+                            this.maxY = y;
+                        }
+                        return new SPoint(x, y);
+                    }
+                );
+                this.path.polygon(temp);
+            });
         }
     } // Constructor
 

+ 54 - 23
persagy-web-big/src/items/floor/SWallItemSS.ts

@@ -24,7 +24,7 @@
  * *********************************************************************************************************************
  */
 
-import { SPainter, SPoint, SRect, SPath2D } from "@persagy-web/draw";
+import { SPainter, SPath, SPoint, SRect } from "@persagy-web/draw";
 import { Wall } from "../../types/floor/Wall";
 import { ItemOrder, ItemColor } from "../..";
 import { SGraphItem } from "@persagy-web/graph";
@@ -47,8 +47,10 @@ export class SWallItem extends SGraphItem {
     private maxY = Number.MIN_SAFE_INTEGER;
     /** 墙轮廓线坐标list */
     private readonly pointArr: SPoint[][] = [];
+    /** 墙内轮廓线坐标list */
+    private readonly holesArr: SPoint[][] = [];
     /** path对象 */
-    private path = new SPath2D();
+    private path = new SPath();
 
     /**
      * 构造函数
@@ -61,33 +63,62 @@ export class SWallItem extends SGraphItem {
         this.data = data;
         this.zOrder = ItemOrder.wallOrder;
         let tempArr = this.data.OutLine;
+        let holes = data.Holes;
         if (tempArr && tempArr.length) {
             this.minX = tempArr[0][0].X;
             this.maxX = this.minX;
             this.minY = -tempArr[0][0].Y;
             this.maxY = this.minY;
-            tempArr.forEach((t): void => {
-                const temp = t.map(
-                    (it): SPoint => {
-                        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 SPoint(x, y);
+            this.pointArr = [];
+            let WLine = tempArr[0].map(
+                (it): SPoint => {
+                    let x = it.X,
+                        y = -it.Y;
+                    if (x < this.minX) {
+                        this.minX = x;
                     }
-                );
-                this.path.polygon(temp);
-            });
+                    if (y < this.minY) {
+                        this.minY = y;
+                    }
+                    if (x > this.maxX) {
+                        this.maxX = x;
+                    }
+                    if (y > this.maxY) {
+                        this.maxY = y;
+                    }
+                    return new SPoint(x, y);
+                }
+            );
+            // 外轮廓
+            this.path.polygon(WLine);
+            // 外轮廓
+            this.pointArr.push(WLine);
+            // 内轮廓
+            if (holes && holes.length) {
+                this.holesArr = holes.map(t => {
+                    let temp = t.map(
+                        (it): SPoint => {
+                            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 SPoint(x, y);
+                        }
+                    );
+                    this.path.polygon(temp);
+                    return temp;
+                });
+            }
         }
     } // Constructor
 

+ 3 - 3
persagy-web-big/src/items/floor/ZoneItem.ts

@@ -27,7 +27,7 @@
 import {
     SColor,
     SPainter,
-    SPath2D,
+    SPath,
     SPoint,
     SPolygonUtil,
     SRect
@@ -56,7 +56,7 @@ export class SZoneItem extends SGraphItem {
     /** Y坐标最大值 */
     private maxY = Number.MIN_SAFE_INTEGER;
     /** path */
-    private pathList: SPath2D[] = [];
+    private pathList: SPath[] = [];
     /** 点击位置坐标 */
     private clickPoint: SPoint | undefined;
     /** 选中时的颜色 */
@@ -120,7 +120,7 @@ export class SZoneItem extends SGraphItem {
             this.maxY = this.minY;
             // 处理轮廓点数组,同时计算最大最小值
             this.pointArr = tempArr.map((t): SPoint[][] => {
-                let sPath = new SPath2D();
+                let sPath = new SPath();
                 let tempArr = t.map((it): SPoint[] => {
                     let array = it.map(
                         (item): SPoint => {

+ 1 - 1
persagy-web-draw/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@persagy-web/draw",
-    "version": "2.2.3",
+    "version": "2.2.4",
     "description": "博锐尚格绘制引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",

+ 67 - 16
persagy-web-draw/src/SPainter.ts

@@ -346,22 +346,73 @@ export class SPainter extends SObject {
         }
     } // Function drawRect()
 
-    // /**
-    //  * 绘制带导角空心矩形
-    //  *
-    //  * @param   x           X坐标
-    //  * @param   y           Y坐标
-    //  * @param   w           宽度
-    //  * @param   h           高度
-    //  * @param   r           导角半径
-    //  */
-    // drawRoundedRect(
-    //     x: number,
-    //     y: number,
-    //     w: number,
-    //     h: number,
-    //     r: number
-    // ): void {} // Function drawRoundedRect()
+    /**
+     * 绘制带导角矩形
+     *
+     * @param   rect        矩形
+     * @param   r           导角半径
+     */
+    drawRoundRect(rect: SRect, r: number): void;
+
+    /**
+     * 绘制带导角矩形
+     *
+     * @param   pos         左上角位置
+     * @param   size        大小
+     * @param   r           导角半径
+     */
+    drawRoundRect(pos: SPoint, size: SSize, r: number): void;
+
+    /**
+     * 绘制带导角矩形
+     *
+     * @param   x           X坐标
+     * @param   y           Y坐标
+     * @param   w           宽度
+     * @param   h           高度
+     * @param   r           导角半径
+     */
+    drawRoundRect(x: number, y: number, w: number, h: number, r: number): void;
+
+    /**
+     * 绘制带导角矩形
+     *
+     * @param   x           X坐标
+     * @param   y           Y坐标
+     * @param   w           宽度
+     * @param   h           高度
+     * @param   radius      导角半径
+     */
+    drawRoundRect(
+        x: number | SPoint | SRect,
+        y: number | SSize,
+        w?: number,
+        h?: number,
+        radius?: number
+    ): void {
+        let rect: SRect | null;
+        let r: number | null;
+
+        if (x instanceof SRect) {
+            rect = x;
+            r = y as number;
+        } else if (x instanceof SPoint && y instanceof SSize) {
+            rect = new SRect(x, y);
+            r = w as number;
+        } else {
+            rect = new SRect(
+                x as number,
+                y as number,
+                w as number,
+                h as number
+            );
+            r = radius as number;
+        }
+
+        if (rect != null && r != null) {
+            this.engine.drawRoundRect(rect, r);
+        }
+    } // Function drawRoundRect()
 
     /**
      * 绘制圆形

+ 73 - 23
persagy-web-draw/src/engines/SCanvasPaintEngine.ts

@@ -360,29 +360,79 @@ export class SCanvasPaintEngine extends SPaintEngine {
         return this._canvas.measureText(text).width;
     } // Function textWidth()
 
-    // /**
-    //  * 绘制带导角空心矩形
-    //  *
-    //  * @param   x           X坐标
-    //  * @param   y           Y坐标
-    //  * @param   w           宽度
-    //  * @param   h           高度
-    //  * @param   r           导角半径
-    //  */
-    // drawRoundedRect(x: number, y: number, w: number, h: number, r: number): void {
-    //     this.canvas.beginPath();
-    //     this.canvas.moveTo(x, y + r);
-    //     this.canvas.lineTo(x, y + h - r);
-    //     this.canvas.quadraticCurveTo(x, y + h, x + r, y + h);
-    //     this.canvas.lineTo(x + w - r,y + h);
-    //     this.canvas.quadraticCurveTo(x + w, y + h, x + w, y + h - r);
-    //     this.canvas.lineTo(x + w, y + r);
-    //     this.canvas.quadraticCurveTo(x + w, y, x + w - r, y);
-    //     this.canvas.lineTo(x + r, y);
-    //     this.canvas.quadraticCurveTo(x, y, x,y + r);
-    //     this.canvas.fill();
-    //     this.canvas.stroke();
-    // } // Function drawRoundedRect()
+    /**
+     * 绘制二次贝塞尔曲线
+     *
+     * @param   cp1x    控制点X坐标
+     * @param   cp1y    控制点Y坐标
+     * @param   x       结束点X坐标
+     * @param   y       结束点Y坐标
+     */
+    quadraticCurveTo(cp1x: number, cp1y: number, x: number, y: number): void {
+        this._canvas.quadraticCurveTo(cp1x, cp1y, x, y);
+    } // Function quadraticCurveTo()
+
+    /**
+     * 绘制三次贝塞尔曲线
+     *
+     * @param   cp1x    起始点控制点X坐标
+     * @param   cp1y    起始点控制点Y坐标
+     * @param   cp2x    结束点控制点X坐标
+     * @param   cp2y    结束点控制点Y坐标
+     * @param   x       结束点X坐标
+     * @param   y       结束点Y坐标
+     */
+    bezierCurveTo(
+        cp1x: number,
+        cp1y: number,
+        cp2x: number,
+        cp2y: number,
+        x: number,
+        y: number
+    ): void {
+        this._canvas.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
+    } // Function bezierCurveTo()
+
+    /**
+     * 绘制带导角空心矩形
+     *
+     * @param   rect    矩形
+     * @param   r       导角半径
+     */
+    drawRoundRect(rect: SRect, r: number): void {
+        this.setMatrix();
+        this.setPen();
+        this.setBrush();
+        this.setComposite();
+        this.setShadow();
+        this._canvas.beginPath();
+        this._canvas.moveTo(rect.x, rect.y + r);
+        this._canvas.lineTo(rect.x, rect.bottom - r);
+        this._canvas.quadraticCurveTo(
+            rect.x,
+            rect.bottom,
+            rect.x + r,
+            rect.bottom
+        );
+        this._canvas.lineTo(rect.right - r, rect.bottom);
+        this._canvas.quadraticCurveTo(
+            rect.right,
+            rect.bottom,
+            rect.right,
+            rect.bottom - r
+        );
+        this._canvas.lineTo(rect.right, rect.y + r);
+        this._canvas.quadraticCurveTo(
+            rect.right,
+            rect.y,
+            rect.right - r,
+            rect.y
+        );
+        this._canvas.lineTo(rect.x + r, rect.y);
+        this._canvas.quadraticCurveTo(rect.x, rect.y, rect.x, rect.y + r);
+        this._canvas.fill();
+        this._canvas.stroke();
+    } // Function drawRoundRect()
 
     /**
      * 设置字体

+ 8 - 0
persagy-web-draw/src/engines/SPaintEngine.ts

@@ -257,4 +257,12 @@ export abstract class SPaintEngine {
      * @param   font    字体
      * */
     abstract changeFont(font: SFont): void;
+
+    /**
+     * 绘制带导角空心矩形
+     *
+     * @param   rect    矩形
+     * @param   r       导角半径
+     */
+    abstract drawRoundRect(rect: SRect, r: number): void;
 } // class SPaintEngine

+ 5 - 0
persagy-web-draw/src/engines/SSvgPaintEngine.ts

@@ -337,4 +337,9 @@ export class SSvgPaintEngine extends SPaintEngine {
         builder.append('"');
         return builder.toString("");
     } // Get penStyle
+
+    /**
+     * 绘制圆角矩形
+     * */
+    drawRoundRect(){} // Function drawRoundRect()
 } // Class SSvgPaintEngine

+ 2 - 2
persagy-web-graph/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@persagy-web/graph",
-    "version": "2.2.4",
+    "version": "2.2.7",
     "description": "博锐尚格二维图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -40,7 +40,7 @@
         "typescript": "^3.5.3"
     },
     "dependencies": {
-        "@persagy-web/draw": "2.2.3",
+        "@persagy-web/draw": "2.2.4",
         "@types/uuid": "^8.0.0"
     }
 }

+ 15 - 1
persagy-web-graph/src/index.ts

@@ -48,6 +48,13 @@ import { STextOrigin } from "./enums/STextOrigin";
 import { SGraphStyle } from "./types/SGraphStyle";
 import { Style } from "./types/Style";
 import { SGraphShape } from "./items/SGraphShape";
+import { SGraphAreaGroupItem } from "./items/SGraphAreaGroupItem";
+import { SGraphPolyGroupItem } from "./items/SGraphPolyGroupItem";
+import { AreaGroup } from "./types/AreaGroup";
+import { PolyGroup } from "./types/PolyGroup";
+import { Point } from "./types/Point";
+import { SGraphRectItem } from "./items/SGraphRectItem";
+import { SGraphRect } from "./types/SGraphRect";
 
 export {
     SGraphItem,
@@ -71,5 +78,12 @@ export {
     STextOrigin,
     SGraphStyle,
     Style,
-    SGraphShape
+    SGraphShape,
+    SGraphAreaGroupItem,
+    SGraphPolyGroupItem,
+    AreaGroup,
+    PolyGroup,
+    Point,
+    SGraphRect,
+    SGraphRectItem
 };

+ 159 - 0
persagy-web-graph/src/items/SGraphAreaGroupItem.ts

@@ -0,0 +1,159 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SGraphItem } from "../SGraphItem";
+import {
+    SPainter,
+    SPath,
+    SPoint,
+    SPolygonUtil,
+    SRect
+} from "@persagy-web/draw/lib";
+import { SGraphShape } from "./SGraphShape";
+import { AreaGroup } from "../types/AreaGroup";
+
+/**
+ * 区域组
+ *
+ * @author  郝建龙
+ */
+export class SGraphAreaGroupItem extends SGraphShape {
+    /** X坐标最小值 */
+    private minX = Number.MAX_SAFE_INTEGER;
+    /** X坐标最大值 */
+    private maxX = Number.MIN_SAFE_INTEGER;
+    /** Y坐标最小值 */
+    private minY = Number.MAX_SAFE_INTEGER;
+    /** Y坐标最大值 */
+    private maxY = Number.MIN_SAFE_INTEGER;
+    /** 墙轮廓线坐标list */
+    private readonly pointList: SPoint[][][] = [];
+    /** path对象 */
+    private pathList: SPath[] = [];
+
+    /**
+     * 构造函数
+     *
+     * @param   parent  父类
+     * @param   data    轮廓线及风格数据
+     * */
+    constructor(parent: SGraphItem | null, data: AreaGroup) {
+        super(parent, data.Style);
+        if (data.OutLine.length && data.OutLine[0] && data.OutLine[0].length) {
+            let tempArr = data.OutLine;
+            this.minX = tempArr[0][0][0].X;
+            this.maxX = this.minX;
+            this.minY = -tempArr[0][0][0].Y;
+            this.maxY = this.minY;
+            // 处理轮廓点数组,同时计算最大最小值
+            this.pointList = tempArr.map((t): SPoint[][] => {
+                let sPath = new SPath();
+                let tempArr = t.map((it): SPoint[] => {
+                    let array = it.map(
+                        (item): SPoint => {
+                            let x = item.X,
+                                y = -item.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 SPoint(x, y);
+                        }
+                    );
+                    sPath.polygon(array);
+                    return array;
+                });
+                this.pathList.push(sPath);
+                return tempArr;
+            });
+        }
+    } // Constructor
+
+    /**
+     * Item对象边界区域
+     *
+     * @return SRect
+     */
+    boundingRect(): SRect {
+        return new SRect(
+            this.minX,
+            this.minY,
+            this.maxX - this.minX,
+            this.maxY - this.minY
+        );
+    } // Function boundingRect()
+
+    /**
+     * 判断点是否在区域内
+     *
+     * @param x
+     * @param y
+     * @return boolean
+     */
+    contains(x: number, y: number): boolean {
+        for (let j = 0; j < this.pointList.length; j++) {
+            let arr = this.pointList[j];
+            if (arr.length < 1 || !SPolygonUtil.pointIn(x, y, arr[0])) {
+                continue;
+            }
+            if (arr.length == 1) {
+                return true;
+            }
+            let flag = false;
+            for (let i = 1; i < arr.length; i++) {
+                if (SPolygonUtil.pointIn(x, y, arr[i])) {
+                    flag = true;
+                    break;
+                }
+            }
+            if (flag) {
+                continue;
+            }
+            return true;
+        }
+        return false;
+    } // Function contains()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   painter       painter对象
+     */
+    onDraw(painter: SPainter): void {
+        super.onDraw(painter);
+        this.pathList.forEach((t): void => {
+            painter.drawPath(t);
+        });
+    } // Function onDraw()
+} // Class SGraphAreaGroupItem

+ 126 - 0
persagy-web-graph/src/items/SGraphPolyGroupItem.ts

@@ -0,0 +1,126 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SGraphItem } from "../SGraphItem";
+import { SPainter, SPoint, SPolygonUtil, SRect } from "@persagy-web/draw/lib";
+import { SGraphShape } from "./SGraphShape";
+import { PolyGroup } from "..";
+
+/**
+ * 多边形组
+ *
+ * @author  郝建龙
+ */
+export class SGraphPolyGroupItem extends SGraphShape {
+    /** X坐标最小值 */
+    private minX = Number.MAX_SAFE_INTEGER;
+    /** X坐标最大值 */
+    private maxX = Number.MIN_SAFE_INTEGER;
+    /** Y坐标最小值 */
+    private minY = Number.MAX_SAFE_INTEGER;
+    /** Y坐标最大值 */
+    private maxY = Number.MIN_SAFE_INTEGER;
+    /** 墙轮廓线坐标list */
+    private readonly pointList: SPoint[][] = [];
+
+    /**
+     * 构造函数
+     *
+     * @param   parent  父类
+     * @param   data    轮廓线及风格数据
+     * */
+    constructor(parent: SGraphItem | null, data: PolyGroup) {
+        super(parent, data.Style);
+        this.minX = data.Outline[0][0].X;
+        this.maxX = this.minX;
+        this.minY = -data.Outline[0][0].Y;
+        this.maxY = this.minY;
+        this.pointList = data.Outline.map((t): SPoint[] => {
+            return t.map(
+                (it): SPoint => {
+                    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 SPoint(x, y);
+                }
+            );
+        });
+    } // Constructor
+
+    /**
+     * Item对象边界区域
+     *
+     * @return SRect
+     */
+    boundingRect(): SRect {
+        return new SRect(
+            this.minX,
+            this.minY,
+            this.maxX - this.minX,
+            this.maxY - this.minY
+        );
+    } // Function boundingRect()
+
+    /**
+     * 判断点是否在区域内
+     *
+     * @param x
+     * @param y
+     * @return boolean
+     */
+    contains(x: number, y: number): boolean {
+        let arr = this.pointList;
+        for (let i = 0; i < arr.length; i++) {
+            if (SPolygonUtil.pointIn(x, y, arr[i])) {
+                return true;
+            }
+        }
+        return false;
+    } // Function contains()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   painter       painter对象
+     */
+    onDraw(painter: SPainter): void {
+        super.onDraw(painter);
+        this.pointList.forEach((t): void => {
+            painter.drawPolygon(t);
+        });
+    } // Function onDraw()
+} // Class SGraphPolyGroupItem

+ 149 - 0
persagy-web-graph/src/items/SGraphRectItem.ts

@@ -0,0 +1,149 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SGraphShape } from "./SGraphShape";
+import { SGraphItem } from "../SGraphItem";
+import { SPainter, SRect } from "@persagy-web/draw";
+import { SGraphRect } from "..";
+
+/**
+ * 矩形(包含圆角矩形)item
+ *
+ * @author 郝建龙
+ * */
+export class SGraphRectItem extends SGraphShape {
+    /** item左上角X坐标 */
+    private _leftTopY: number = 0;
+    get leftTopY(): number {
+        return this._leftTopY;
+    } // Get leftTopY
+    set leftTopY(v: number) {
+        if (v == this._leftTopY) {
+            return;
+        }
+        this._leftTopY = v;
+        this.update();
+    } // Set leftTopY
+    /** item左上角Y坐标 */
+    private _leftTopX: number = 0;
+    get leftTopX(): number {
+        return this._leftTopX;
+    } // Get leftTopX
+    set leftTopX(v: number) {
+        if (v == this._leftTopX) {
+            return;
+        }
+        this._leftTopX = v;
+        this.update();
+    } // Set leftTopX
+    /** item宽 */
+    private _width: number = 0;
+    get width(): number {
+        return this._width;
+    } // Get width
+    set width(v: number) {
+        if (v == this._width) {
+            return;
+        }
+        this._width = v;
+        this.update();
+    } // Set width
+    /** item高 */
+    private _height: number = 0;
+    get height(): number {
+        return this._height;
+    } // Get height
+    set height(v: number) {
+        if (v == this._height) {
+            return;
+        }
+        this._height = v;
+        this.update();
+    } // Set height
+    /** 绘制矩形的圆角半径 */
+    private _radius: number = 0;
+    get radius(): number {
+        return this._radius;
+    } // Get radius
+    set radius(v: number) {
+        if (v == this._radius) {
+            return;
+        }
+        this._radius = v;
+        this.update();
+    } // Set radius
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      矩形数据
+     */
+    constructor(parent: SGraphItem | null, data: SGraphRect) {
+        super(parent, data.Style);
+        this.leftTopX = data.X;
+        this.leftTopY = data.Y;
+        this.width = data.Width;
+        this.height = data.Height;
+        if (data.Radius && !isNaN(data.Radius)) {
+            this.radius = Number(data.Radius);
+        }
+    } // Constructor
+
+    /**
+     * Item对象边界区域
+     *
+     * @return	SRect
+     */
+    boundingRect(): SRect {
+        return new SRect(this.leftTopX, this.leftTopY, this.width, this.height);
+    } // Function boundingRect()
+
+    /**
+     * 绘制
+     *
+     * @param   painter painter对象
+     * */
+    onDraw(painter: SPainter): void {
+        super.onDraw(painter);
+        if (this.radius != 0) {
+            painter.drawRoundRect(
+                this.leftTopX,
+                this.leftTopY,
+                this.width,
+                this.height,
+                this.radius
+            );
+        } else {
+            painter.drawRect(
+                this.leftTopX,
+                this.leftTopY,
+                this.width,
+                this.height
+            );
+        }
+    } // Function onDraw()
+} // Class SGraphRectItem

+ 8 - 3
persagy-web-graph/src/items/SGraphShape.ts

@@ -34,9 +34,14 @@ import {
     SRadialGradient
 } from "@persagy-web/draw/lib";
 
+/**
+ * 图形item基类
+ *
+ * @author  郝建龙
+ */
 export class SGraphShape extends SGraphItem {
     /** 当前item的风格 */
-    style: Style | null = null;
+    style: Style | undefined;
 
     /**
      * 构造函数
@@ -44,9 +49,9 @@ export class SGraphShape extends SGraphItem {
      * @param   parent  父类
      * @param   style   item各种状态的样式
      * */
-    constructor(parent: SGraphItem, style?: Style) {
+    constructor(parent: SGraphItem | null, style?: Style) {
         super(parent);
-        this.style = style || null;
+        this.style = style;
     } // Constructor
 
     /**

+ 38 - 0
persagy-web-graph/src/types/AreaGroup.ts

@@ -0,0 +1,38 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+import { Point } from "./Point";
+import { Style } from "./Style";
+
+/**
+ * 多边形组数据类型
+ *
+ * */
+export interface AreaGroup {
+    /** 轮廓线集合 */
+    OutLine: Point[][][];
+    /** Item 风格 */
+    Style?: Style;
+} // Interface AreaGroup

+ 35 - 0
persagy-web-graph/src/types/Point.ts

@@ -0,0 +1,35 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+/**
+ * 轮廓坐标接口
+ *
+ * @author  郝建龙
+ */
+export interface Point {
+    X: number;
+    Y: number;
+    Z?: number;
+} // Interface Point

+ 38 - 0
persagy-web-graph/src/types/PolyGroup.ts

@@ -0,0 +1,38 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+import { Point } from "./Point";
+import { Style } from "./Style";
+
+/**
+ * 多边形组数据类型
+ *
+ * */
+export interface PolyGroup {
+    /** 轮廓线集合 */
+    Outline: Point[][];
+    /** Item 风格 */
+    Style?: Style;
+} // Interface PolyGroup

+ 46 - 0
persagy-web-graph/src/types/SGraphRect.ts

@@ -0,0 +1,46 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+import { Style } from "./Style";
+
+/**
+ * 矩形(包含圆角矩形)数据类型
+ *
+ * @author 郝建龙
+ * */
+export interface SGraphRect {
+    /** item风格 */
+    Style?: Style;
+    /** 矩形左上角X坐标 */
+    X: number;
+    /** 矩形左上角Y坐标 */
+    Y: number;
+    /** 矩形宽 */
+    Width: number;
+    /** 矩形左上角X坐标 */
+    Height: number;
+    /** 当为圆角时的圆角半径 */
+    Radius?: number;
+} // Interface SGraphRect