Sfoglia il codice sorgente

门注释画弧线;业务空间引入透明度传参及高亮传参;场景类增加框选业务空间;新版本2.0.426

haojianlong 5 anni fa
parent
commit
6613eb6f79
6 ha cambiato i file con 153 aggiunte e 13 eliminazioni
  1. 1 1
      package.json
  2. 3 2
      src/DivideFloorScene.ts
  3. 9 9
      src/items/DoorItem.ts
  4. 8 1
      src/items/ZoneItem.ts
  5. 128 0
      src/types/Transparency.ts
  6. 4 0
      src/types/Zone.ts

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/cad-engine",
-    "version": "2.0.420",
+    "version": "2.0.426",
     "description": "上格云 CAD图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",

+ 3 - 2
src/DivideFloorScene.ts

@@ -53,7 +53,6 @@ export class DivideFloorScene extends FloorScene {
         }
         this._isMarking = v;
     } // Set isMarking
-
     /** 蒙版item  */
     sceneMark: SceneMarkItem | null = null;
     /** 业务空间list   */
@@ -887,7 +886,9 @@ export class DivideFloorScene extends FloorScene {
         return Obj;
     } // Function getIntersectInSpace()
 
-    /** 框选区域,选中与之相交的业务空间    */
+    /**
+     * 框选区域,选中与之相交的业务空间
+     */
     private groupSelectZone(): void {
         if (this.rectSelectItem) {
             let item = this.rectSelectItem;

+ 9 - 9
src/items/DoorItem.ts

@@ -100,14 +100,14 @@ export class DoorItem extends SGraphyItem {
         painter.pen.lineWidth = 100;
         painter.pen.color = Opt.doorColor;
         painter.drawLine(0, 0, this.r, 0);
-        painter.pen.lineDash = [50, 100];
-        painter.drawArc(
-            -this.r,
-            -this.r,
-            this.r * 2,
-            this.r * 2,
-            this.startAng,
-            this.startAng + Math.PI / 2
-        );
+        // painter.pen.lineDash = [50, 100];
+        // painter.drawArc(
+        //     -this.r,
+        //     -this.r,
+        //     this.r * 2,
+        //     this.r * 2,
+        //     this.startAng,
+        //     this.startAng + Math.PI / 2
+        // );
     } // Function onDraw()
 } // Class DoorItem

+ 8 - 1
src/items/ZoneItem.ts

@@ -31,6 +31,7 @@ import { Zone } from "../types/Zone";
 import { SMouseEvent } from "@saga-web/base/lib";
 import { ItemOrder } from "../types/ItemOrder";
 import { Opt } from "../types/Opt";
+import { Transparency } from "../types/Transparency";
 
 /**
  * 业务空间item
@@ -66,6 +67,8 @@ export class ZoneItem extends SGraphyItem {
     set highLightFlag(value: boolean) {
         this._highLightFlag = value;
     } // Set highLightFlag
+    /** 透明度 */
+    transparency: number = 20;
 
     /**
      * 构造函数
@@ -77,6 +80,8 @@ export class ZoneItem extends SGraphyItem {
         super(parent);
         this.data = data;
         this.zOrder = ItemOrder.zoneOrder;
+        this.highLightFlag = data.HighLightFlag || false;
+        this.transparency = data.Transparency || 20;
         if (
             this.data.OutLine.length &&
             this.data.OutLine[0] &&
@@ -193,7 +198,9 @@ export class ZoneItem extends SGraphyItem {
             } else if (this.highLightFlag) {
                 painter.brush.color = new SColor(this.data.Color);
             } else {
-                painter.brush.color = new SColor(`${this.data.Color}33`);
+                painter.brush.color = new SColor(
+                    `${this.data.Color}${Transparency[this.transparency]}`
+                );
             }
         }
         painter.pen.lineWidth = 200;

+ 128 - 0
src/types/Transparency.ts

@@ -0,0 +1,128 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+/**
+ * 透明度接口
+ *
+ * @author  郝建龙
+ */
+export const Transparency = [
+    "00",
+    "03",
+    "05",
+    "08",
+    "0A",
+    "0D",
+    "0F",
+    "12",
+    "14",
+    "17",
+    "1A",
+    "1C",
+    "1F",
+    "21",
+    "24",
+    "26",
+    "29",
+    "2B",
+    "2E",
+    "30",
+    "33",
+    "36",
+    "38",
+    "3B",
+    "3D",
+    "40",
+    "42",
+    "45",
+    "47",
+    "4A",
+    "4D",
+    "4F",
+    "52",
+    "54",
+    "57",
+    "59",
+    "5C",
+    "5E",
+    "61",
+    "63",
+    "66",
+    "69",
+    "6B",
+    "6E",
+    "70",
+    "73",
+    "75",
+    "78",
+    "7A",
+    "7D",
+    "80",
+    "82",
+    "85",
+    "87",
+    "8A",
+    "8C",
+    "8F",
+    "91",
+    "94",
+    "96",
+    "99",
+    "9C",
+    "9E",
+    "A1",
+    "A3",
+    "A6",
+    "A8",
+    "AB",
+    "AD",
+    "B0",
+    "B3",
+    "B5",
+    "B8",
+    "BA",
+    "BD",
+    "BF",
+    "C2",
+    "C4",
+    "C7",
+    "C9",
+    "CC",
+    "CF",
+    "D1",
+    "D4",
+    "D6",
+    "D9",
+    "DB",
+    "DE",
+    "E0",
+    "E3",
+    "E6",
+    "E8",
+    "EB",
+    "ED",
+    "F0",
+    "F2",
+    "F5",
+    "F7",
+    "FA",
+    "FC",
+    "FF"
+]; // Interface Transparency

+ 4 - 0
src/types/Zone.ts

@@ -36,4 +36,8 @@ export interface Zone {
     Color: string;
     /** 高度  */
     Height: number;
+    /** 是否高亮  */
+    HighLightFlag?: boolean;
+    /** 透明度  */
+    Transparency?: number;
 } // Interface Space