Jelajahi Sumber

添加item接口定义,修改场景类

haojianlong 5 tahun lalu
induk
melakukan
b860b5e62e

+ 17 - 3
package-lock.json

@@ -25,9 +25,9 @@
             }
         },
         "@sybotan-web/base": {
-            "version": "2.0.53",
-            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/base/-/base-2.0.53.tgz",
-            "integrity": "sha512-lRVvNIB6yv6cXONLDL2hR5TrephKQRylgXKH0SM1fokCPZiaLvsppY3V+8fkD9TGIJaP0Vg/U6ejBWa7wnDe5g=="
+            "version": "2.0.54",
+            "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/base/-/base-2.0.54.tgz",
+            "integrity": "sha512-cYHF8tm/uIwMHRKGp+whO6/juVCyarNqrUq4nsHL22iV8pFOe5lDI8duc4Glg9Ar5dLdzNOdTIoYilmctJOOhQ=="
         },
         "@sybotan-web/draw": {
             "version": "2.0.109",
@@ -35,6 +35,13 @@
             "integrity": "sha512-h7y81yrt4ZcOYqNED9wqvAdSD92SqwQDhA2vEsZ308A9W0y7gTCbrx5ZQp3SaHlwr0wP+LfHJebx4HY3bHvKuA==",
             "requires": {
                 "@sybotan-web/base": "^2.0.53"
+            },
+            "dependencies": {
+                "@sybotan-web/base": {
+                    "version": "2.0.54",
+                    "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/base/-/base-2.0.54.tgz",
+                    "integrity": "sha512-cYHF8tm/uIwMHRKGp+whO6/juVCyarNqrUq4nsHL22iV8pFOe5lDI8duc4Glg9Ar5dLdzNOdTIoYilmctJOOhQ=="
+                }
             }
         },
         "@sybotan-web/graphy": {
@@ -44,6 +51,13 @@
             "requires": {
                 "@sybotan-web/base": "^2.0.53",
                 "@sybotan-web/draw": "^2.0.109"
+            },
+            "dependencies": {
+                "@sybotan-web/base": {
+                    "version": "2.0.54",
+                    "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/@sybotan-web/base/-/base-2.0.54.tgz",
+                    "integrity": "sha512-cYHF8tm/uIwMHRKGp+whO6/juVCyarNqrUq4nsHL22iV8pFOe5lDI8duc4Glg9Ar5dLdzNOdTIoYilmctJOOhQ=="
+                }
             }
         },
         "@types/eslint-visitor-keys": {

+ 3 - 2
package.json

@@ -1,11 +1,12 @@
 {
     "name": "cad-engine",
-    "version": "2.0.1",
+    "version": "2.0.5",
     "description": "上格云 CAD图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
     "scripts": {
         "build": "tsc",
+        "publish": "npm publish",
         "lint": "eslint src/**/*.{js,ts,tsx}",
         "test": "echo \"Error: no test specified\" && exit 1",
         "typedoc": "typedoc --hideGenerator src ../sybotan-web-base/src ../sybotan-web-draw/src ../sybotan-web-graphy/src ../sybotan-web-graphy-item/src"
@@ -32,7 +33,7 @@
         "pako": "^1.0.10"
     },
     "dependencies": {
-        "@sybotan-web/base": "2.0.53",
+        "@sybotan-web/base": "2.0.54",
         "@sybotan-web/draw": "2.0.109",
         "@sybotan-web/graphy": "2.0.86"
     }

+ 31 - 39
src/FloorScene.ts

@@ -18,13 +18,17 @@
  * ********************************************************************************************************************
  */
 
-import { SGraphyScene } from "@sybotan-web/graphy/lib";
+import { SGraphyClockItem, SGraphyScene } from "@sybotan-web/graphy/lib";
 import Axios from "axios";
 // @ts-ignore
 import pako from "pako";
-
-// eslint-disable-next-line @typescript-eslint/class-name-casing
-class dataInterface {}
+import { JsonData } from "./types/JsonData";
+import { Space } from "./types/Space";
+import { Column } from "./types/Column";
+import { Wall } from "./types/Wall";
+import { VirtualWall } from "./types/VirtualWall";
+import { Door } from "./types/Door";
+import { Casement } from "./types/Casement";
 
 /**
  * 楼层场景
@@ -33,7 +37,7 @@ class dataInterface {}
  */
 export class FloorScene extends SGraphyScene {
     /** item数据  */
-    data: dataInterface | null = null;
+    data: JsonData | null = null;
     /** 是否显示空间  */
     isShowSpace = true;
     /** 是否展示墙体  */
@@ -46,13 +50,11 @@ export class FloorScene extends SGraphyScene {
     /**
      *  @param  data    绘制空间地图得所有参数
      */
-    constructor(data: dataInterface | null) {
+    constructor() {
         super();
-        this.data = data;
-        if (this.data != null) {
-            this.addAllItemList(this.data);
-        }
-    }
+        let click = new SGraphyClockItem(null, 300, 300);
+        this.addItem(click);
+    } // Constructor()
 
     /**
      *  获取底图文件
@@ -67,13 +69,12 @@ export class FloorScene extends SGraphyScene {
                 url: url,
                 data: {},
                 responseType: "blob"
-                // contentType: "charset=utf-8"
             })
                 .then((res: any) => {
                     let blob = res.data;
                     this.zipToJson(blob)
                         .then((jsonData: any) => {
-                            that.addAllItemList(jsonData);
+                            that.addAllItems(jsonData);
                             relove();
                         })
                         .catch((error: any) => {
@@ -93,33 +94,17 @@ export class FloorScene extends SGraphyScene {
      *  @param  blob     文件
      */
     zipToJson(blob: any): any {
-        let data = null;
         let reader = new FileReader();
         reader.readAsBinaryString(blob);
-        let _this = this;
+        let that = this;
         return new Promise(resolve => {
             reader.onload = (readerEvt: any) => {
                 let binaryString = readerEvt.target.result;
                 //解压数据
                 let base64Data = btoa(binaryString);
                 let unGzipData = pako.unzip(base64Data);
-                data = unGzipData;
-                if (data.WallList && data.WallList.length) {
-                    this.changeMap(data.WallList, -1, "PointList");
-                }
-                if (data.SpaceList && data.SpaceList.length) {
-                    this.changeMap(data.SpaceList, -1, "Paths");
-                }
-                if (data.ColumnList && data.ColumnList.length) {
-                    this.changeMap(data.ColumnList, -1, "Path");
-                }
-                if (data.VirtualWallList && data.VirtualWallList.length) {
-                    this.changeMap(data.VirtualWallList, -1, "PointList");
-                }
-                if (data.EquipmentList && data.EquipmentList.length) {
-                    this.changeMap(data.EquipmentList, -1, "PointList");
-                }
-                resolve(data);
+                that.data = unGzipData.EntityList.Elements;
+                resolve(unGzipData);
             };
         });
     } // Function zipToJson
@@ -129,49 +114,56 @@ export class FloorScene extends SGraphyScene {
      *
      *  @param  data    itemList对象
      */
-    addAllItemList(data: dataInterface) {} // Function addAllItemList
+    addAllItems(data: JsonData) {
+        this.addCasementItems(data.Casement);
+        this.addSpaceItems(data.Spaces);
+        this.addColumnItems(data.Columns);
+        this.addWallItems(data.Walls);
+        this.addVirtualWallItems(data.VirtualWalls);
+        this.addDoorItems(data.Doors);
+    } // Function addAllItemList
 
     /**
      *  添加所有空间到scene 中
      *
      *  @param  space   空间list
      */
-    addSpaceList(): void {} // Function addSpaceList
+    addSpaceItems(space: Space): void {} // Function addSpaceList
 
     /**
      *  添加所有设备到scene 中
      *
      *  @param  column   柱子list
      */
-    addColumnListList(): void {} // Function addColumnListList
+    addColumnItems(column: Column): void {} // Function addColumnListList
 
     /**
      *  添加所有设备到scene 中
      *
      *  @param  wall   墙list
      */
-    addWallList(): void {} // Function addWallList
+    addWallItems(wall: Wall): void {} // Function addWallList
 
     /**
      *  添加所有虚拟墙到scene 中
      *
      *  @param  virtualWall   虚拟墙list
      */
-    addVirtualWallList(): void {} // Function addVirtualWallList
+    addVirtualWallItems(virtualWall: VirtualWall): void {} // Function addVirtualWallList
 
     /**
      *  添加所有位置标签到scene 中
      *
      *  @param  doors   门list
      */
-    addDoorList(): void {} // Function addDoorList
+    addDoorItems(door: Door): void {} // Function addDoorList
 
     /**
      *  添加所有位置标签到scene 中
      *
      *  @param  windows   窗户list
      */
-    addWindowList(): void {} // Function addWindowList
+    addCasementItems(casement: Casement): void {} // Function addWindowList
     /**
      *  扩大数组中相应字段一定倍数
      *

+ 3 - 0
src/index.ts

@@ -0,0 +1,3 @@
+import { FloorScene } from "./FloorScene";
+
+export { FloorScene };

+ 148 - 169
src/items/ColumnItem.ts

@@ -20,6 +20,7 @@
 
 import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
 import { SColor, SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
+import {Column} from "../types/Column";
 
 /**
  * 柱子item
@@ -27,173 +28,151 @@ import { SColor, SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
  * @author  郝建龙
  */
 export class ColumnItem extends SGraphyItem {
-    /** 点坐标list */
-    pointArr: SPoint[];
-    /** 填充色 */
-    fillColor: SColor = new SColor("#F2F6FC");
-    /** 边框色 */
-    color: SColor = SColor.Black;
-    /** 边框宽度    */
-    width: number = 200;
-    /** 空间id  */
-    id: string;
-    /** 中心坐标    */
-    centerOfGravityPoint: { x: number; y: number };
-    /** 空间名称    */
-    initName: null | string | undefined;
-    /** 绘制文案    */
-    viewText: string = "";
-    /** 需要缓存的边框颜色   */
-    cacheColor: SColor = SColor.Black;
-    /** 需要缓存的填充色   */
-    cacheFillColor: SColor = new SColor("#F2F6FC");
-    /** 需要缓存的边框宽度   */
-    cacheWidth: number = 100;
-    /** 是否激活    */
-    actived: boolean = false;
-
-    /**
-     * 构造函数
-     *
-     * @param PolygonItemData
-     */
-    constructor(PolygonItemData: ColumnItemInterface) {
-        super(PolygonItemData.parent);
-        // 修改绘制路径格式
-        let newSpacePaths: SPoint[] = PolygonItemData.space.Paths[0].map(
-            (item: SPoint) => {
-                return new SPoint(item.x, item.y);
-            }
-        );
-        this.pointArr = newSpacePaths;
-        // 填充色
-        this.fillColor = PolygonItemData.space.fillColor
-            ? PolygonItemData.space.fillColor
-            : new SColor("#F2F6FC");
-        // 边框色
-        this.color = PolygonItemData.space.color
-            ? PolygonItemData.space.color
-            : SColor.Black;
-        //边框宽度
-        this.width = PolygonItemData.space.width
-            ? PolygonItemData.space.width
-            : 100;
-        //中心点
-        this.centerOfGravityPoint = {
-            x: PolygonItemData.space.LocationPoint.X,
-            y: -PolygonItemData.space.LocationPoint.Y
-        };
-        this.initName = PolygonItemData.space.Name;
-        this.id = PolygonItemData.space.id;
-        this.viewText = PolygonItemData.space.Name;
-    }
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        let minX = this.pointArr[0].x;
-        let maxX = minX;
-        let minY = this.pointArr[0].y;
-        let maxY = minY;
-        for (let i = 1; i < this.pointArr.length; i++) {
-            if (this.pointArr[i].x < minX) {
-                minX = this.pointArr[i].x;
-            }
-            if (this.pointArr[i].y < minY) {
-                minY = this.pointArr[i].y;
-            }
-            if (this.pointArr[i].x > maxX) {
-                maxX = this.pointArr[i].x;
-            }
-            if (this.pointArr[i].y > maxY) {
-                maxY = this.pointArr[i].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.pointArr,
-            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;
-    }
-
-    /**
-     *
-     * @param text 修改的文字
-     * @param centerOfGravityPoint 文字的坐标
-     */
-    addText(text: string, centerOfGravityPoint?: { x: number; y: number }) {
-        this.viewText = text;
-        if (centerOfGravityPoint) {
-            this.centerOfGravityPoint = centerOfGravityPoint;
-        }
-    }
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    onDraw(painter: SPainter, rect?: SRect): void {
-        if (this.pointArr.length) {
-            painter.pen.color = this.color;
-            painter.brush.color = this.fillColor;
-            painter.pen.lineWidth = this.width;
-            painter.drawPolygon(this.pointArr);
-            // let text = ''
-            // if (this.businessName || this.businessId) {
-            // 	text = '👇   ' + this.businessName
-            // } else {
-            // 	text = '⬇️   ' + this.initName
-            // }
-            painter.font.size = this.scale * 200;
-            painter.brush.color = SColor.Black;
-            // painter.drawText(text,this.centerOfGravityPoint.x,this.centerOfGravityPoint.y)
-            painter.drawText(
-                this.viewText,
-                this.centerOfGravityPoint.x,
-                this.centerOfGravityPoint.y
-            );
-        }
-    }
+    // data
+    //
+    // /**
+    //  * 构造函数
+    //  *
+    //  * @param PolygonItemData
+    //  */
+    // constructor(PolygonItemData: Column) {
+    //     super(null);
+    //     // super(PolygonItemData.parent);
+    //     // // 修改绘制路径格式
+    //     // let newSpacePaths: SPoint[] = PolygonItemData.space.Paths[0].map(
+    //     //     (item: SPoint) => {
+    //     //         return new SPoint(item.x, item.y);
+    //     //     }
+    //     // );
+    //     // this.pointArr = newSpacePaths;
+    //     // // 填充色
+    //     // this.fillColor = PolygonItemData.space.fillColor
+    //     //     ? PolygonItemData.space.fillColor
+    //     //     : new SColor("#F2F6FC");
+    //     // // 边框色
+    //     // this.color = PolygonItemData.space.color
+    //     //     ? PolygonItemData.space.color
+    //     //     : SColor.Black;
+    //     // //边框宽度
+    //     // this.width = PolygonItemData.space.width
+    //     //     ? PolygonItemData.space.width
+    //     //     : 100;
+    //     // //中心点
+    //     // this.centerOfGravityPoint = {
+    //     //     x: PolygonItemData.space.LocationPoint.X,
+    //     //     y: -PolygonItemData.space.LocationPoint.Y
+    //     // };
+    //     // this.initName = PolygonItemData.space.Name;
+    //     // this.id = PolygonItemData.space.id;
+    //     // this.viewText = PolygonItemData.space.Name;
+    // }
+    //
+    // /**
+    //  * Item对象边界区域
+    //  *
+    //  * @return SRect
+    //  */
+    // boundingRect(): SRect {
+    //     let minX = this.pointArr[0].x;
+    //     let maxX = minX;
+    //     let minY = this.pointArr[0].y;
+    //     let maxY = minY;
+    //     for (let i = 1; i < this.pointArr.length; i++) {
+    //         if (this.pointArr[i].x < minX) {
+    //             minX = this.pointArr[i].x;
+    //         }
+    //         if (this.pointArr[i].y < minY) {
+    //             minY = this.pointArr[i].y;
+    //         }
+    //         if (this.pointArr[i].x > maxX) {
+    //             maxX = this.pointArr[i].x;
+    //         }
+    //         if (this.pointArr[i].y > maxY) {
+    //             maxY = this.pointArr[i].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.pointArr,
+    //         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;
+    // }
+    //
+    // /**
+    //  *
+    //  * @param text 修改的文字
+    //  * @param centerOfGravityPoint 文字的坐标
+    //  */
+    // addText(text: string, centerOfGravityPoint?: { x: number; y: number }) {
+    //     this.viewText = text;
+    //     if (centerOfGravityPoint) {
+    //         this.centerOfGravityPoint = centerOfGravityPoint;
+    //     }
+    // }
+    //
+    // /**
+    //  * Item绘制操作
+    //  *
+    //  * @param   painter       painter对象
+    //  * @param   rect          绘制区域
+    //  */
+    // onDraw(painter: SPainter, rect?: SRect): void {
+    //     if (this.pointArr.length) {
+    //         painter.pen.color = this.color;
+    //         painter.brush.color = this.fillColor;
+    //         painter.pen.lineWidth = this.width;
+    //         painter.drawPolygon(this.pointArr);
+    //         // let text = ''
+    //         // if (this.businessName || this.businessId) {
+    //         // 	text = '👇   ' + this.businessName
+    //         // } else {
+    //         // 	text = '⬇️   ' + this.initName
+    //         // }
+    //         painter.font.size = this.scale * 200;
+    //         painter.brush.color = SColor.Black;
+    //         // painter.drawText(text,this.centerOfGravityPoint.x,this.centerOfGravityPoint.y)
+    //         painter.drawText(
+    //             this.viewText,
+    //             this.centerOfGravityPoint.x,
+    //             this.centerOfGravityPoint.y
+    //         );
+    //     }
+    // }
 } // Class ColumnItem

+ 48 - 0
src/types/Casement.ts

@@ -0,0 +1,48 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "./Point";
+import { Place } from "./Place";
+
+/**
+ * 窗户item接口
+ *
+ * @author  郝建龙
+ */
+export interface Casement {
+    /** 位置  */
+    Location: Place;
+    /** 模型id(外键)    */
+    ModelId: string;
+    /** 名称  */
+    Name: string;
+    /** 轮廓线  */
+    OutLine: Point[][];
+    /** 拥有者的RevitId */
+    Owner: string;
+    /** 对应Revit模型id */
+    SourceId: string;
+    /** 厚度  */
+    Thick: number;
+    /** 所属墙 */
+    WallId: string;
+    /** 宽度  */
+    Width: string;
+} // interface Casement

+ 42 - 0
src/types/Column.ts

@@ -0,0 +1,42 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "./Point";
+import { Place } from "./Place";
+
+/**
+ * 柱子item接口
+ *
+ * @author  郝建龙
+ */
+export interface Column {
+    /** 名称  */
+    Name: string;
+    /** 轮廓线  */
+    OutLine: Point[][];
+    /** 房间边界  */
+    RoomBoundary: boolean;
+    /** 位置  */
+    Location: Place;
+    /** 模型id(外键)    */
+    ModelId: string;
+    /** 对应Revit模型id */
+    SourceId: string;
+} // Interface Column

+ 52 - 0
src/types/Door.ts

@@ -0,0 +1,52 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "./Point";
+import { Place } from "./Place";
+
+/**
+ * 门item接口
+ *
+ * @author  郝建龙
+ */
+export interface Door {
+    /** 面朝方向  */
+    FaceDirection: Point;
+    /** 把手方向  */
+    HandDirection: Point;
+    /** 位置  */
+    Location: Place;
+    /** 模型id(外键)    */
+    ModelId: string;
+    /** 名称  */
+    Name: string;
+    /** 轮廓线  */
+    OutLine: Point[][];
+    /** 拥有者的RevitId */
+    Owner: string;
+    /** 对应Revit模型id */
+    SourceId: string;
+    /** 厚度  */
+    Thick: number;
+    /** 所属墙 */
+    WallId: string;
+    /** 宽度  */
+    Width: string;
+} // Interface Door

+ 40 - 0
src/types/JsonData.ts

@@ -0,0 +1,40 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Door } from "./Door";
+import { Column } from "./Column";
+import { Space } from "./Space";
+import { VirtualWall } from "./VirtualWall";
+import { Wall } from "./Wall";
+import { Casement } from "./Casement";
+
+/**
+ * json数据接口
+ *
+ * @author  郝建龙
+ */
+export interface JsonData {
+    Columns: Column;
+    Doors: Door;
+    Spaces: Space;
+    VirtualWalls: VirtualWall;
+    Walls: Wall;
+    Casement: Casement;
+} // Interface JsonData

+ 0 - 0
src/types/Opt.ts


+ 31 - 0
src/types/Place.ts

@@ -0,0 +1,31 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "./Point";
+
+/**
+ * 位置接口
+ *
+ * @author  郝建龙
+ */
+export interface Place {
+    Points: Point[];
+    Type: string;
+} // Interface Place

+ 6 - 4
src/items/ColumnItemInterface.ts

@@ -19,10 +19,12 @@
  */
 
 /**
- * 柱子item接口
+ * 轮廓坐标接口
  *
  * @author  郝建龙
  */
-export class ColumnItemInterface{
-
-} // Class ColumnItemInterface
+export interface Point {
+    X: number;
+    Y: number;
+    Z: number;
+} // Interface Point

+ 44 - 0
src/types/Space.ts

@@ -0,0 +1,44 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "./Point";
+import { Place } from "./Place";
+
+/**
+ * 空间item接口
+ *
+ * @author  郝建龙
+ */
+export interface Space {
+    /** 轮廓线段    */
+    BoundarySegments: string[];
+    /** 位置  */
+    Location: Place;
+    /** 模型id(外键)    */
+    ModelId: string;
+    /** 名称  */
+    Name: string;
+    /** 轮廓线  */
+    OutLine: Point[][];
+    /** 对应Revit模型id */
+    SourceId: string;
+    /** 补充信息    */
+    Tag: string;
+} // Interface Space

+ 40 - 0
src/types/VirtualWall.ts

@@ -0,0 +1,40 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "./Point";
+import { Place } from "./Place";
+
+/**
+ * 虚拟墙item接口
+ *
+ * @author  郝建龙
+ */
+export interface VirtualWall {
+    /** 位置  */
+    Location: Place;
+    /** 模型id(外键)    */
+    ModelId: string;
+    /** 名称  */
+    Name: string;
+    /** 轮廓线  */
+    OutLine: Point[][];
+    /** 对应Revit模型id */
+    SourceId: string;
+} // interface VirtualWall

+ 44 - 0
src/types/Wall.ts

@@ -0,0 +1,44 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "./Point";
+import { Place } from "./Place";
+
+/**
+ * 墙item接口
+ *
+ * @author  郝建龙
+ */
+export interface Wall {
+    /** 层id */
+    LevelId: string;
+    /** 位置  */
+    Location: Place;
+    /** 模型id(外键)    */
+    ModelId: string;
+    /** 名称  */
+    Name: string;
+    /** 轮廓线  */
+    OutLine: Point[][];
+    /** 对应Revit模型id */
+    SourceId: string;
+    /** 厚度  */
+    Width: number;
+} // Interface Wall