Pārlūkot izejas kodu

楼层平面图文档添加

haojianlong 4 gadi atpakaļ
vecāks
revīzija
7eb9ad8f34

+ 0 - 213
docs/dev/saga-graphy/floor-map/README.md

@@ -1,214 +1 @@
 # 楼层平面图
-
-## 1.json数据格式
-
-### 整体数据格式
-
-```
-    export interface FloorData {
-        Columns: Column[]; //所有柱子数据
-        Doors: Door[]; //所有门数据
-        Spaces: Space[]; //所有空间数据
-        VirtualWalls: VirtualWall[]; //所有虚拟墙数据
-        Walls: Wall[]; //所有墙数据
-        Windows: Casement[]; //所有窗户数据
-    } // Interface FloorData
-```
-
-### 柱子具体数据内容
-
-```
-export interface Column {
-    /** 名称  */
-    Name: string;
-    /** 轮廓线  */
-    OutLine: Point[][];
-    /** 房间边界  */
-    RoomBoundary: boolean;
-    /** 位置  */
-    Location: Place;
-    /** 模型id(外键)    */
-    ModelId: string;
-    /** 对应Revit模型id */
-    SourceId: string;
-} // Interface Column
-```
-
-### 门具体数据
-
-```
-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
-```
-
-### 空间具体数据
-
-```
-export interface Space {
-    /** 轮廓线段    */
-    BoundarySegments: string[];
-    /** 位置  */
-    Location: Place;
-    /** 高度  */
-    Height: number;
-    /** 模型id(外键)    */
-    ModelId: string;
-    /** 名称  */
-    Name: string;
-    /** 轮廓线  */
-    OutLine: Point[][];
-    /** 对应Revit模型id */
-    SourceId: string;
-    /** 补充信息    */
-    Tag: string;
-} // Interface Space
-```
-
-### 虚拟墙具体数据
-
-```
-export interface VirtualWall {
-    /** 位置  */
-    Location: Place;
-    /** 模型id(外键)    */
-    ModelId: string;
-    /** 名称  */
-    Name: string;
-    /** 轮廓线  */
-    OutLine: Point[][];
-    /** 对应Revit模型id */
-    SourceId: string;
-} // interface VirtualWall
-```
-
-### 墙具体数据
-
-```
-export interface Wall {
-    /** 层id */
-    LevelId: string;
-    /** 位置  */
-    Location: Place;
-    /** 模型id(外键)    */
-    ModelId: string;
-    /** 名称  */
-    Name: string;
-    /** 轮廓线  */
-    OutLine: Point[][];
-    /** 对应Revit模型id */
-    SourceId: string;
-    /** 厚度  */
-    Width: number;
-} // Interface Wall
-```
-
-### 窗户具体数据
-
-```
-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
-```
-
----
-
-## 2.下载-解析-生成 过程
-
-### 下载
-
-#### 方式1 通过楼层对象floormap信息点,直接从文件服务器获取压缩数据
-引擎中已封装好函数loadUrl,直接传入文件服务器路径即可;并且会将压缩数据自动解压
-```
-loadUrl(url: string): Promise<void> {}
-```
-
-#### 方式2 通过模型后台接口 /base-graph/query 传入模型id 直接获取未压缩数据
-引擎中已封装好函数getFloorData,直接传入模型id,url为接口地址
-
-```
-getFloorData(url: string, data: { ModelId: string }) {}
-```
-
-### 解析
-引擎中会读取下载好的数据,按数据将不同的对象分发到引擎中各个添加对象的方法中
-
-```
-private addBaseMapItem(data: FloorData): void {
-        if (data.Walls) {
-            data.Walls.forEach((t: Wall): void => {
-                this.addWall(t);
-            });
-        }
-        if (data.Columns) {
-            data.Columns.forEach((t: Column): void => {
-                this.addColumn(t);
-            });
-        }
-        if (data.Windows) {
-            data.Windows.forEach((t: Casement): void => {
-                this.addCasement(t);
-            });
-        }
-        if (data.VirtualWalls) {
-            data.VirtualWalls.forEach((t: VirtualWall): void => {
-                this.addVirtualWall(t);
-            });
-        }
-        if (data.Doors) {
-            data.Doors.forEach((t: Door): void => {
-                this.addDoor(t);
-            });
-        }
-        if (data.Spaces) {
-            data.Spaces.forEach((t: Space): void => {
-                this.addSpace(t);
-            });
-        }
-    } // Function addBaseMapItem()
-```
-
-### 生成
-当视图监听到需要刷新时,就会触发update()方法,刷新视图,用户就可以在页面中看到相应的楼层平面图了
-
----
-
-## 3.划分

+ 0 - 0
docs/dev/saga-graphy/floor-map/divide.md


+ 6 - 0
docs/dev/saga-graphy/floor-map/downloadFile.md

@@ -0,0 +1,6 @@
+
+## 手工下载楼层底图文件
+
+手工下载地址例:[http://adm.sagacloud.cn/image-service/common/file_get?systemId=revit&key=Fl11010500011b85b9eeff8211e8b8b087ac5144d0ef20191108102222bim.jsonz](http://adm.sagacloud.cn/image-service/common/file_get?systemId=revit&key=Fl11010500011b85b9eeff8211e8b8b087ac5144d0ef20191108102222bim.jsonz)
+
+下载后为无后缀压缩文件,直接打开是乱码,需手工添加zip后缀并解压方可得到json文件

BIN
docs/dev/saga-graphy/floor-map/img/equipLocation.png


BIN
docs/dev/saga-graphy/floor-map/img/liucheng.png


BIN
docs/dev/saga-graphy/floor-map/img/space.png


+ 147 - 0
docs/dev/saga-graphy/floor-map/jsonFile.md

@@ -0,0 +1,147 @@
+
+## json数据格式
+
+### 整体数据格式
+
+```
+    {
+        EntityList:[
+            Elements:{                          // 底图展示所需数据
+                Columns:[],                     // 所有柱子数据
+                Doors:[],                       // 所有门数据
+                Spaces:[],                      // 所有空间数据
+                VirtualWalls:[],                // 所有虚拟墙数据
+                Walls:[],                       // 所有墙数据
+                Windows:[],                     // 所有窗户数据
+            },
+            MBIName:'',
+            ModelId:'',
+            PlanName:''
+        ]
+    }
+```
+
+### 柱子具体数据内容
+
+```
+    Columns:[
+        {
+            Name: '',                           // 名称
+            OutLine: [
+                [{X:0,Y:0,Z:0},...],            // 外轮廓 
+                ...                             // 内轮廓
+            ],                                  // 轮廓线
+            RoomBoundary: '',                   // 房间边界
+            Location: {X:0,Y:0,Z:0},            // 位置
+            ModelId: '',                        // 模型id
+            SourceId: '',                       // 对应Revit模型id
+        },
+        ...
+    ]
+```
+
+### 门具体数据
+
+```
+    Doors:[
+        {
+            FaceDirection: {X:0,Y:0,Z:0},       // 面朝方向
+            HandDirection: {X:0,Y:0,Z:0},       // 把手方向
+            Location: {X:0,Y:0,Z:0},            // 位置
+            ModelId: '',                        // 模型id
+            Name: '',                           // 名称
+            OutLine: [
+                [{X:0,Y:0,Z:0},...],            // 外轮廓 
+                ...                             // 内轮廓
+            ],                                  // 轮廓线
+            Owner: '',                          // 拥有者的RevitId
+            SourceId: '',                       // 对应Revit模型id
+            Thick: 200,                         // 厚度
+            WallId: '',                         // 所属墙
+            Width: 200,                         // 宽度
+        },
+        ...
+    ]
+```
+
+### 空间具体数据
+
+```
+    Spaces:[
+        {
+            BoundarySegments: [[''],...],       // 轮廓线段
+            Location: {X:0,Y:0,Z:0},            // 位置
+            ModelId: '',                        // 模型id
+            Name: '',                           // 名称
+            OutLine: [
+                [{X:0,Y:0,Z:0},...],            // 外轮廓 
+                ...                             // 内轮廓
+            ],                                  // 轮廓线
+            SourceId: '',                       // 对应Revit模型id
+            Tag: '',                            // 补充信息
+            Height: 200,                        // 高度
+        },
+        ...
+    ]
+```
+
+### 虚拟墙具体数据
+
+```
+    VirtualWalls:[
+        {
+            Location: {X:0,Y:0,Z:0},            // 位置
+            ModelId: '',                        // 模型id
+            Name: '',                           // 名称
+            OutLine: [
+                [{X:0,Y:0,Z:0},...],            // 外轮廓 
+                ...                             // 内轮廓
+            ],                                  // 轮廓线
+            SourceId: '',                       // 对应Revit模型id
+        },
+        ...
+    ]
+```
+
+### 墙具体数据
+
+```
+    Walls:[
+        {
+            LevelId: '',                        // 层id
+            Location: {X:0,Y:0,Z:0},            // 位置
+            ModelId: '',                        // 模型id
+            Name: '',                           // 名称
+            OutLine: [
+                [{X:0,Y:0,Z:0},...],            // 外轮廓 
+                ...                             // 内轮廓
+            ],                                  // 轮廓线
+            SourceId: '',                       // 对应Revit模型id
+            Tag: '',                            // 补充信息
+            Width: 200,                         // 厚度
+        },
+        ...
+    ]
+```
+
+### 窗户具体数据
+
+```
+    Windows:[
+        {
+            Location: {X:0,Y:0,Z:0},            // 位置
+            ModelId: '',                        // 模型id
+            Name: '',                           // 名称
+            OutLine: [
+                [{X:0,Y:0,Z:0},...],            // 外轮廓 
+                ...                             // 内轮廓
+            ],                                  // 轮廓线
+            Owner: '',                          // 拥有者的RevitId
+            SourceId: '',                       // 对应Revit模型id
+            WallId: '',                         // 所属墙
+            Width: 200,                         // 宽度
+            Thick: 200,                         // 厚度
+        },
+        ...
+    ]
+```

+ 98 - 0
docs/dev/saga-graphy/floor-map/workLine.md

@@ -0,0 +1,98 @@
+## 下载-解析-生成 过程
+
+### 工作流程图
+
+![工作流程图](./img/liucheng.png)
+
+### 下载底图数据
+
+#### 方式1 通过楼层对象floormap信息点,直接从文件服务器获取压缩数据
+
+引擎中已封装好函数loadUrl,直接传入文件服务器路径即可;并且会将压缩数据自动解压
+
+```
+loadUrl(url: string): Promise<void> {}
+```
+
+#### 方式2 通过模型后台接口 /base-graph/query 传入模型id 直接获取未压缩数据
+引擎中已封装好函数getFloorData,直接传入模型id,url为接口地址
+
+```
+getFloorData(url: string, data: { ModelId: string }) {}
+```
+
+
+### 下载设备,业务空间数据
+
+下载设备,业务空间等的数据均需要另走查询对象接口
+
+如设备数据
+
+```
+    Equip:{
+        ...
+        BIMLocation:'0,0,0',                    // 如果设备有位置,则会在设备对象中存在此数据
+    }
+```    
+
+根据此坐标生成设备位置
+
+![工作流程图](./img/equipLocation.png)
+
+业务空间数据
+```
+    Space:{
+        ...
+        OutLine: [                              
+            [
+                [{X:0,Y:0,Z:0},...],            // 外轮廓 
+                ...                             // 内轮廓
+            ]
+        ],                                      // 轮廓线
+    }
+```
+
+根据轮廓线生成业务空间
+
+![工作流程图](./img/space.png) 
+
+### 解析
+引擎中会读取下载好的数据,按数据将不同的对象分发到引擎中各个添加对象的方法中
+
+```
+private addBaseMapItem(data: FloorData): void {
+        if (data.Walls) {
+            data.Walls.forEach((t: Wall): void => {
+                this.addWall(t);
+            });
+        }
+        if (data.Columns) {
+            data.Columns.forEach((t: Column): void => {
+                this.addColumn(t);
+            });
+        }
+        if (data.Windows) {
+            data.Windows.forEach((t: Casement): void => {
+                this.addCasement(t);
+            });
+        }
+        if (data.VirtualWalls) {
+            data.VirtualWalls.forEach((t: VirtualWall): void => {
+                this.addVirtualWall(t);
+            });
+        }
+        if (data.Doors) {
+            data.Doors.forEach((t: Door): void => {
+                this.addDoor(t);
+            });
+        }
+        if (data.Spaces) {
+            data.Spaces.forEach((t: Space): void => {
+                this.addSpace(t);
+            });
+        }
+    } // Function addBaseMapItem()
+```
+
+### 生成
+当视图监听到需要刷新时,就会触发update()方法,刷新视图,用户就可以在页面中看到相应的楼层平面图了

+ 4 - 1
docs/dev/saga-graphy/index.js

@@ -17,7 +17,10 @@ const content = [
         title: "楼层平面图",
         path: "/dev/saga-graphy/floor-map/",
         children: [
-
+            ["/dev/saga-graphy/floor-map/workLine", "工作流程"],
+            ["/dev/saga-graphy/floor-map/downloadFile", "手工下载楼层底图文件"],
+            ["/dev/saga-graphy/floor-map/jsonFile", "json数据格式"],
+            ["/dev/saga-graphy/floor-map/divide", "划分"],
         ]
     },
     {