Browse Source

目录修正

haojianlong 4 years ago
parent
commit
10497180c9

+ 0 - 1
docs/.vuepress/config.js

@@ -58,7 +58,6 @@ module.exports = {
                     {
                         text: "引擎",
                         items: [
-                            {text: "安装", link: "/guides/base/"},
                             {text: "图形引擎", link: "/guides/engine/"},
                             {text: "场景管理", link: "/guides/scene/"},
                             {text: "楼层平面图", link: "/guides/big/"},

+ 17 - 0
docs/guides/big/factory/itemFactory.md

@@ -0,0 +1,17 @@
+# item 创建工厂
+::: details 目录
+[[toc]]
+:::
+
+## 源代码
+
+::: details 查看代码
+
+<<< @/docs/guides/big/factory/src/SItemFactory.ts
+
+:::
+
+::: tip 工厂主要职责
+    根据传入的item风格,创建相应样式的 item, 并返回
+:::
+

+ 123 - 0
docs/guides/big/factory/src/SItemFactory.ts

@@ -0,0 +1,123 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import {Column} from "@persagy-web/big/lib/types/floor/Column";
+import {SColumnItem} from "@persagy-web/big/lib/items/floor/SColumnItem";
+import {Wall} from "@persagy-web/big/lib/types/floor/Wall";
+import {SWallItem} from "@persagy-web/big/lib/items/floor/SWallItem";
+import {VirtualWall} from "@persagy-web/big/lib/types/floor/VirtualWall";
+import {SVirtualWallItem} from "@persagy-web/big/lib/items/floor/SVirtualWallItem";
+import {Space} from "@persagy-web/big/lib/types/floor/Space";
+import {SSpaceItem} from "@persagy-web/big/lib/items/floor/SSpaceItem";
+import {Door} from "@persagy-web/big/lib/types/floor/Door";
+import {SDoorItem} from "@persagy-web/big/lib/items/floor/SDoorItem";
+import {Casement} from "@persagy-web/big/lib/types/floor/Casement";
+import {SWindowItem} from "@persagy-web/big/lib/items/floor/SWindowItem";
+import {SZoneItem} from "@persagy-web/big/lib/items/floor/ZoneItem";
+import {Zone} from "@persagy-web/big/lib/types/floor/Zone";
+
+/**
+ * item创建工厂
+ *
+ */
+
+export class SItemFactory {
+    /**
+     * 构造函数
+     *
+     * */
+    constructor() {} // Constructor
+
+    /**
+     * 创建柱子item
+     *
+     * @param   data    柱子数据
+     * @return  柱子item
+     * */
+    createColumn(data: Column): SColumnItem {
+        return new SColumnItem(null, data);
+    } // Function createColumn()
+
+    /**
+     * 创建墙item
+     *
+     * @param   data    墙数据
+     * @return  墙item
+     * */
+    createWall(data: Wall): SWallItem {
+        return new SWallItem(null, data);
+    } // Function createWall()
+
+    /**
+     * 创建虚拟墙item
+     *
+     * @param   data    虚拟墙数据
+     * @return  虚拟墙item
+     * */
+    createVirtualWall(data: VirtualWall): SVirtualWallItem {
+        return new SVirtualWallItem(null, data);
+    } // Function createVirtualWall()
+
+    /**
+     * 创建空间item
+     *
+     * @param   data    空间数据
+     * @return  空间item
+     * */
+    createSpace(data: Space): SSpaceItem {
+        return new SSpaceItem(null, data);
+    } // Function createSpace()
+
+    /**
+     * 创建门item
+     *
+     * @param   data    门数据
+     * @return  门item
+     * */
+    createDoor(data: Door): SDoorItem {
+        return new SDoorItem(null, data);
+    } // Function createDoor()
+
+    /**
+     * 创建窗item
+     *
+     * @param   data    窗户数据
+     * @return  窗户item
+     * */
+    createWindow(data: Casement): SWindowItem {
+        return new SWindowItem(null, data);
+    } // Function createWindow()
+
+    /**
+     * 创建业务空间item
+     *
+     * @param   data    业务空间数据
+     * @return  业务空间item
+     * */
+    createZone(data: Zone): SZoneItem {
+        return new SZoneItem(null, data);
+    } // Function createZone()
+} // Class SItemFactory

+ 2 - 2
docs/guides/big/items/column.md

@@ -30,8 +30,8 @@
         ...
     ]
 ```
-::: tip
-1、柱子可能有多个块组成<br/>
+::: tip
+1、柱子可能有多个块组成 <br/>
 2、柱子不会挖洞,是累加 <br/>
 3、内外轮廓数据无排序要求 <br/>
 4、轮廓数据单位均为毫米

+ 7 - 1
docs/guides/big/items/door.md

@@ -35,7 +35,7 @@
         ...
     ]
 ```
-::: tip
+::: tip
 1、根据把手方向确定门的转轴 <br/>
 2、根据面朝方向确定门朝哪边开 <br/>
 3、outline 仅有一项,且只有2个点 <br/>
@@ -46,6 +46,12 @@
 不能在绘制的时候计算,因为绘制是高频调用方法,尽量不要在绘制方法中做大量计算工作;<br/>
 计算方法一般在数据变化的时候做,如果只是展示的话,则只需要在构造函数中计算一次;
 
+### 计算门开的方向及旋转方向
+使用向量点乘 => x1 * x2 + y1 * y2,计算得到,大于0同向,则旋转点使用第二个点;否则使用第一个 <br />
+计算两点间距离,从而得到门的长度 <br />
+利用arctan计算得到,门展开方向与水平方向夹角<br />
+使用向量叉乘 => x1 * y2 - x2 * y1, 计算得到, 小于0代表门顺时针展开,同时确定了展开的弧线绘制起始和结束角度 <br /> 
+
 ### Y轴取反
 revit 坐标使用的是数学坐标系, Y 轴方向是向上的, canvas 坐标使用的绘图坐标系, Y 轴方向是向下的;<br/>
 数据是通过 revit 模型导出

+ 6 - 0
docs/guides/big/layerOrder.md

@@ -0,0 +1,6 @@
+# 图层
+
+::: tip
+1.创建的 item 要添加到对应的层 <br />
+2.保存图数据将其对应的层级一块保存 <br />
+:::

+ 18 - 0
docs/guides/big/style.md

@@ -0,0 +1,18 @@
+# 底图风格
+::: details 目录
+[[toc]]
+:::
+
+## style类
+
+主要包含线条颜色(strokeColor:值为SColor类型),填充颜色,线条宽度,被选中时颜色,高亮时颜色,渐变属性
+```json
+{
+    "strokeColor": "SColor",
+    "fillColor": "SColor",            
+    "lineWidth": "number",
+    "selectColor": "SColor",
+    "highlightColor": "SColor",
+    "backgroundImage": "Gradient"
+}
+```

+ 11 - 5
docs/guides/index.js

@@ -1,10 +1,7 @@
 const content = [
     {
-        title: "安装",
-        path: "/guides/base/"
-    },
-    {
         title: "绘图引擎",
+        path: "/guides/engine/",
         children: [
             ["/guides/engine/draw", "绘制形状"],
             ["/guides/engine/style", "颜色与样式"],
@@ -19,6 +16,7 @@ const content = [
     },
     {
         title: "场景管理",
+        path: "/guides/scene/",
         children: [
             {
                 title: "图元素实例",
@@ -53,7 +51,15 @@ const content = [
             },
             ["/guides/big/workLine", "工作流程"],
             ["/guides/big/downloadFile", "手工下载楼层底图文件"],
-            ["/guides/big/jsonFile", "json数据格式"],
+            {
+                title: "数据格式",
+                children: [
+                    ["/guides/big/jsonFile", "jsonz 数据格式"],
+                ]
+            },
+            ["/guides/big/style", "底图风格"],
+            ["/guides/big/layerOrder", "图层"],
+            ["/guides/big/factory/itemFactory", "item 创建工厂"],
             ["/guides/big/divide", "划分"],
             ["/guides/big/mapDemo", "楼层平面图范例"],
         ]

+ 15 - 1
docs/setup/ide/nodejs.md

@@ -120,10 +120,24 @@ npm install -g element-ui 2.12.0
 做组件包时用
 npm insall -g babel-plugin-component
 
+### 设置数据源为公司私服
+```
+npm config set registry http://dev.dp.sagacloud.cn:8082/repository/npm-saga/
+```
+#### @persagy-web/base
+```
+npm i @persagy-web/base
+```
+::: tip 如果改完源以后,npm i的时候没有成功
+    1.需要先把node_modules删除,package-lock.json删除 
+    2.将源改到淘宝源或者官网源,把package.json中的公司服的npm包先删掉,执行npm i安装 
+    3.安装成功后,再把@persagy-web/graph等几个包添加到package.json中,并把源切换至公司服,在安装 
+:::
+
 ## 常见错误
 ### npm install出现Unexpected end of JSON input while parsing near
 
 执行如下命令解决:
 ```
 npm cache clean --force
-```
+```