Browse Source

蜂鸟顶楼多张图片配置文件添加;rect新增包含某个矩阵算法;

haojianlong 4 years ago
parent
commit
ef1673b61c

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

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/big",
-    "version": "1.0.104",
+    "version": "1.0.106",
     "description": "上格云建筑信息化库",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -42,6 +42,6 @@
         "typescript": "^3.9.3"
     },
     "dependencies": {
-        "@saga-web/graph": "2.1.121"
+        "@saga-web/graph": "2.1.122"
     }
 }

+ 3 - 1
saga-web-big/src/index.ts

@@ -22,6 +22,7 @@ import { SLineItem } from "./items/SLineItem";
 import { SRelationState } from "./enums/SRelationState";
 import { SItemStatus } from "./enums/SItemStatus";
 import { SPolygonItem } from "./items/SPolygonItem";
+import { SRectSelectItem } from "./items/SRectSelectItem";
 
 export {
     SCompassItem,
@@ -47,5 +48,6 @@ export {
     SIconTextItem,
     SRelationState,
     SItemStatus,
-    SPolygonItem
+    SPolygonItem,
+    SRectSelectItem
 };

+ 55 - 0
saga-web-big/src/items/SRectSelectItem.ts

@@ -0,0 +1,55 @@
+import { SGraphItem } from "@saga-web/graph/lib";
+import { SPainter, SPoint } from "@saga-web/draw/lib";
+import { SMouseEvent } from "@saga-web/base/lib";
+import { ItemColor, ItemOrder } from "..";
+
+/**
+ * 矩形选择item
+ *
+ * @author  郝建龙
+ */
+export class SRectSelectItem extends SGraphItem {
+    /** 起点  */
+    startPoint: SPoint = new SPoint();
+    /** 终点  */
+    endPoint: SPoint = new SPoint();
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param point     起点数据
+     */
+    constructor(parent: SGraphItem | null, point: SPoint) {
+        super(parent);
+        this.startPoint = point;
+        this.endPoint = new SPoint(point.x, point.y);
+        this.update();
+        this.zOrder = ItemOrder.rectSelectOrder;
+    } // Constructor
+
+    /**
+     * 鼠标移动事件
+     *
+     * @param	event         事件参数
+     * @return	boolean
+     */
+    onMouseMove(event: SMouseEvent): boolean {
+        this.endPoint.x = event.x;
+        this.endPoint.y = event.y;
+        this.update();
+        return true;
+    } // Function onMouseMove()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   painter       painter对象
+     */
+    onDraw(painter: SPainter): void {
+        painter.pen.lineWidth = painter.toPx(2);
+        painter.pen.color = ItemColor.rectSelectOutColor;
+        painter.brush.color = ItemColor.rectSelectInColor;
+        painter.drawRect(this.startPoint, this.endPoint);
+    } // Function onDraw()
+} // SRectSelectItem

+ 14 - 0
saga-web-draw/src/types/SRect.ts

@@ -177,6 +177,20 @@ export class SRect {
     } // Function isValid()
 
     /**
+     * 是否包含另一个矩阵
+     *
+     * @return  true    包含
+     */
+    isIn(rect: SRect): boolean {
+        return (
+            this.left <= rect.left &&
+            this.right >= rect.right &&
+            this.bottom >= rect.bottom &&
+            this.top <= rect.top
+        );
+    } // Function isIn()
+
+    /**
      * 判断矩形空间是否包含点x,y
      *
      * @param   x       X坐标

+ 2 - 2
saga-web-fengmap/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/feng-map",
-    "version": "1.0.35",
+    "version": "1.0.36",
     "description": "上格云Web平面图。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -33,7 +33,7 @@
         "typescript": "^3.9.3"
     },
     "dependencies": {
-        "@saga-web/big": "1.0.101",
+        "@saga-web/big": "1.0.106",
         "axios": "^0.18.0"
     }
 }

+ 24 - 0
saga-web-fengmap/src/config/ProjectRf.ts

@@ -0,0 +1,24 @@
+/**
+ * 项目特殊顶层处理
+ *
+ * */
+export const ProjectRf = {
+    1002006: [
+        {
+            id: "28",
+            name: "rf237032b.png",
+            width: 1714,
+            height: 1687,
+            x: 4450,
+            y: 2063
+        },
+        {
+            id: "27",
+            name: "rf237032a.png",
+            width: 8192,
+            height: 8192,
+            x: 0,
+            y: 0
+        }
+    ]
+};

+ 2 - 1
saga-web-fengmap/src/index.ts

@@ -1,3 +1,4 @@
 import { SFengParser } from "./parser/SFengParser";
+import { ProjectRf } from "./config/ProjectRf";
 
-export { SFengParser };
+export { SFengParser, ProjectRf };

+ 4 - 1
saga-web-fengmap/src/parser/SFengParser.ts

@@ -294,8 +294,11 @@ export class SFengParser extends SParser {
                             // @ts-ignore
                             columns.push({ OutLine: [outline] });
                         } else if (this.wallType.indexOf(type) > -1) {
+                            const hasHole =
+                                t.target._data.holes &&
+                                t.target._data.holes.length;
                             // @ts-ignore
-                            walls.push({ OutLine: [outline] });
+                            walls.push({ OutLine: [outline], HasHole: hasHole });
                         } else if (this.virtualWallType.indexOf(type) > -1) {
                             // @ts-ignore
                             virtualWall.push({ OutLine: [outline] });

+ 1 - 1
saga-web-graph/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/graph",
-    "version": "2.1.121",
+    "version": "2.1.122",
     "description": "上格云二维图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",