Browse Source

格式整理;

haojianlong 4 years ago
parent
commit
31fe5ef8a4

+ 12 - 21
persagy-web-big/src/items/SPolygonItem.ts

@@ -147,7 +147,7 @@ export class SPolygonItem extends SGraphItem {
      */
     constructor(parent: SGraphItem | null) {
         super(parent);
-    }
+    } // Constructor
 
     //////////////////
     //  以下为对pointList 数组的操作方法
@@ -169,7 +169,7 @@ export class SPolygonItem extends SGraphItem {
         }
         this.update();
         return point;
-    }
+    } // Function insertPoint()
 
     /**
      * 删除点位
@@ -198,7 +198,7 @@ export class SPolygonItem extends SGraphItem {
         this.curPoint = null;
         this.update();
         return point;
-    }
+    } // Function deletePoint()
 
     /**
      * 多边形顶点的移动位置
@@ -219,16 +219,7 @@ export class SPolygonItem extends SGraphItem {
         }
         point = this.pointList[i];
         return point;
-    }
-
-    /**
-     * 打印出多边形数组
-     *
-     * @return  顶点数组
-     */
-    PrintPointList(): SPoint[] {
-        return this.pointList;
-    }
+    } // Function movePoint()
 
     ////////////
     //  以下为三种状态下的绘制多边形方法
@@ -266,7 +257,7 @@ export class SPolygonItem extends SGraphItem {
         }
         painter.drawPolygon([...pointList]);
         painter.restore();
-    }
+    } // Function drawShowPolygon()
 
     /**
      * 创建状态 --绘制多边形数组
@@ -322,7 +313,7 @@ export class SPolygonItem extends SGraphItem {
         } else {
             painter.drawPolygon(pointList);
         }
-    }
+    } // Function drawCreatePolygon()
 
     /**
      *
@@ -348,7 +339,7 @@ export class SPolygonItem extends SGraphItem {
             }
             painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
         });
-    }
+    } // Function drawCreatePolygon()
 
     /**
      * 编辑状态操作多边形数组
@@ -462,7 +453,7 @@ export class SPolygonItem extends SGraphItem {
             // 刷新视图
             this.update();
         }
-    }
+    } // Function editPolygonPoint()
 
     /////////////////////
     // undo、redo相关操作
@@ -476,7 +467,7 @@ export class SPolygonItem extends SGraphItem {
         // 记录相关命令并推入堆栈中
         const sgraphcommand = new SGraphCommand(this.scene, this, ...any);
         this.undoStack.push(sgraphcommand);
-    }
+    } // Function recordAction()
 
     /**
      * 执行取消操作执行
@@ -486,7 +477,7 @@ export class SPolygonItem extends SGraphItem {
             return;
         }
         this.undoStack.undo();
-    }
+    } // Function undo()
 
     /**
      * 执行重做操作执行
@@ -496,7 +487,7 @@ export class SPolygonItem extends SGraphItem {
             return;
         }
         this.undoStack.redo();
-    }
+    } // Function redo()
 
     ///////////////////////////////
     // 以下为鼠标事件
@@ -829,4 +820,4 @@ export class SPolygonItem extends SGraphItem {
             this.drawEditPolygon(painter, this.pointList);
         }
     } // Function onDraw()
-}
+} // Class SPolygonItem

+ 27 - 23
persagy-web-big/src/items/SPolylineItem.ts

@@ -37,76 +37,77 @@ import {
 } from "@persagy-web/graph";
 
 /**
- * 线item
+ * 线item
  *
+ * @author  郝建龙
  * */
 
 export class SPolylineItem extends SGraphItem {
-    /** X坐标最小值  */
+    /** X坐标最小值 */
     private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
+    /** X坐标最大值 */
     private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
+    /** Y坐标最小值 */
     private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
+    /** Y坐标最大值 */
     private maxY = Number.MIN_SAFE_INTEGER;
-    /** 折点信息    */
+    /** 折点信息 */
     pointList: SPoint[] = [];
-    /** 是否绘制完成  */
+    /** 是否绘制完成 */
     _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
-    }
+    } // Get status
     set status(v: SItemStatus) {
         this._status = v;
         this.undoStack.clear();
         this.update();
-    }
+    } // Set status
     /** 鼠标移动时的点 */
     private lastPoint: SPoint | null = null;
-    /** 线条颜色    */
+    /** 线条颜色 */
     _strokeColor: SColor = SColor.Black;
     get strokeColor(): SColor {
         return this._strokeColor;
-    }
+    } // Get strokeColor
     set strokeColor(v: SColor) {
         this._strokeColor = v;
         this.update();
-    }
+    } // Set strokeColor
     /** 填充色 */
     _fillColor: SColor = new SColor("#2196f3");
     get fillColor(): SColor {
         return this._fillColor;
-    }
+    } // Get fillColor
     set fillColor(v: SColor) {
         this._fillColor = v;
         this.update();
-    }
-    /** 线条宽度    */
+    } // Set fillColor
+    /** 线条宽度 */
     _lineWidth: number = 1;
     get lineWidth(): number {
         return this._lineWidth;
-    }
+    } // Get lineWidth
     set lineWidth(v: number) {
         this._lineWidth = v;
         this.update();
-    }
+    } // Set lineWidth
     /** 边框样式 */
     _lineStyle: SLineStyle = SLineStyle.Solid;
     get lineStyle(): SLineStyle {
         return this._lineStyle;
-    }
+    } // Get lineStyle
     set lineStyle(v: SLineStyle) {
         this._lineStyle = v;
         this.update();
-    }
-    /** 全局灵敏度   */
+    } // Set lineStyle
+    /** 全局灵敏度 */
     dis: number = 10;
-    /** 灵敏度转换为场景长度  */
+    /** 灵敏度转换为场景长度 */
     private sceneDis: number = 10;
-    /** 当前点索引   */
+    /** 当前点索引 */
     private curIndex: number = -1;
-    /** 当前点索引   */
+    /** 当前点 */
     private curPoint: SPoint | null = null;
     /** undo/redo堆栈 */
     private undoStack: SUndoStack = new SUndoStack();
@@ -416,6 +417,7 @@ export class SPolylineItem extends SGraphItem {
      * shift垂直水平创建或编辑
      *
      * @param   event   事件
+     * @return  事件对象
      * */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.pointList.length) {
@@ -548,6 +550,8 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 绘制基本图形
+     *
+     * @param   painter painter对象
      * */
     drawBaseLine(painter: SPainter): void {
         // 绘制基本图形

+ 2 - 2
persagy-web-big/src/items/SRectSelectItem.ts

@@ -35,9 +35,9 @@ import { ItemColor, ItemOrder } from "..";
  * @author  郝建龙
  */
 export class SRectSelectItem extends SGraphItem {
-    /** 起点  */
+    /** 起点 */
     startPoint: SPoint = new SPoint();
-    /** 终点  */
+    /** 终点 */
     endPoint: SPoint = new SPoint();
 
     /**

+ 6 - 6
persagy-web-big/src/parser/SFloorParser.ts

@@ -44,17 +44,17 @@ import { SSpaceItem } from "../items/floor/SSpaceItem";
  *
  */
 export class SFloorParser extends SParser {
-    /** 墙list   */
+    /** 墙list */
     wallList: SWallItem[] = [];
-    /** 柱子list   */
+    /** 柱子list */
     columnList: SColumnItem[] = [];
-    /** 门list   */
+    /** 门list */
     doorList: SDoorItem[] = [];
-    /** 窗list   */
+    /** 窗list */
     casementList: SWindowItem[] = [];
-    /** 虚拟墙list   */
+    /** 虚拟墙list */
     virtualWallList: SVirtualWallItem[] = [];
-    /** 空间list   */
+    /** 空间list */
     spaceList: SSpaceItem[] = [];
 
     /**

+ 1 - 1
persagy-web-big/src/parser/SParser.ts

@@ -31,7 +31,7 @@ import { SItemFactory } from "..";
  *
  */
 export abstract class SParser {
-    /** 解析器工厂   */
+    /** 解析器工厂 */
     protected factory: SItemFactory = new SItemFactory();
 
     /**

+ 1 - 1
persagy-web-big/src/parser/SZoneParser.ts

@@ -33,7 +33,7 @@ import { Zone } from "../types/floor/Zone";
  *
  */
 export class SZoneParser extends SParser {
-    /** 业务空间list   */
+    /** 业务空间list */
     zoneList: SZoneItem[] = [];
 
     /**

+ 5 - 5
persagy-web-big/src/types/ImageData.ts

@@ -30,18 +30,18 @@
  * @author  郝建龙
  */
 export interface ImageData {
-    /** 图片的id   */
+    /** 图片的id */
     Id?: string;
-    /** 图片的名称   */
+    /** 图片的名称 */
     Name?: string;
     /** X坐标 */
     X: number;
     /** Y坐标 */
     Y: number;
-    /** 图片url   */
+    /** 图片url */
     Url: string;
-    /** 绘制图片的宽  */
+    /** 绘制图片的宽 */
     Width: number;
-    /** 绘制图片的高  */
+    /** 绘制图片的高 */
     Height: number;
 } // Interface ImageData

+ 2 - 2
persagy-web-big/src/types/Marker.ts

@@ -30,9 +30,9 @@
  * @author  郝建龙
  */
 export interface Marker {
-    /** 标记的id  */
+    /** 标记的id */
     Id?: string;
-    /** 标记的名称  */
+    /** 标记的名称 */
     Name?: string;
     /** X坐标 */
     X: number;

+ 2 - 2
persagy-web-big/src/types/MinDis.ts

@@ -32,8 +32,8 @@ import { Point } from "./Point";
  * @author  郝建龙
  */
 export interface MinDis {
-    /** 最短距离      */
+    /** 最短距离 */
     MinDis: number;
-    /** 最短距离的点  */
+    /** 最短距离的点 */
     Point: Point | undefined;
 } // Interface Space

+ 2 - 2
persagy-web-big/src/types/Size.ts

@@ -30,6 +30,6 @@
  * @author  张宇
  */
 export interface Size {
-  Width: number;
-  Height: number;
+    Width: number;
+    Height: number;
 } // Interface Size

+ 7 - 7
persagy-web-big/src/types/TextData.ts

@@ -32,22 +32,22 @@ import { STextAlign, STextBaseLine, STextDirection } from "@persagy-web/draw";
  * @author  郝建龙
  */
 export interface TextData {
-    /** 文本的id   */
+    /** 文本的id */
     Id?: string;
-    /** 文本内容   */
+    /** 文本内容 */
     Text: string;
     /** X坐标 */
     X: number;
     /** Y坐标 */
     Y: number;
-    /** 文本最大宽  */
+    /** 文本最大宽 */
     Width?: number;
-    /** 文本对齐方向  */
+    /** 文本对齐方向 */
     TextAlign?: STextAlign;
-    /** 文本基线对齐  */
+    /** 文本基线对齐 */
     BaseLine?: STextBaseLine;
-    /** 文本方向    */
+    /** 文本方向 */
     TextDirection?: STextDirection;
-    /** 文本大小    */
+    /** 文本大小 */
     Size?: number;
 } // Interface TextData

+ 0 - 51
persagy-web-big/src/types/TopologyData.ts

@@ -1,51 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { ElementData } from "./ElementData";
-
-/**
- * 系统图json数据接口
- *
- * @author  张宇
- */
-export interface TopologyData {
-    /** ID */
-    ID: string;
-    /** 系统图展示所需数据 */
-    Elements: ElementData;
-    /** 名称  */
-    Name?: string;
-    /** 图分类ID  */
-    CategoryID?: string;
-    /** 项目ID  */
-    ProjectID?: string;
-    /** 建筑ID  */
-    BuildingID?: string;
-    /** 楼层ID  */
-    FloorID?: string;
-    /** 图说明  */
-    Note?: string;
-} // Interface TopologyData

+ 5 - 5
persagy-web-big/src/types/floor/Column.ts

@@ -33,15 +33,15 @@ import { Place } from "../Place";
  * @author  郝建龙
  */
 export interface Column {
-    /** 名称  */
+    /** 名称 */
     Name?: string;
-    /** 轮廓线  */
+    /** 轮廓线 */
     OutLine: Point[][];
-    /** 房间边界  */
+    /** 房间边界 */
     RoomBoundary?: boolean;
-    /** 位置  */
+    /** 位置 */
     Location?: Place;
-    /** 模型id(外键)    */
+    /** 模型id(外键) */
     ModelId?: string;
     /** 对应Revit模型id */
     SourceId?: string;

+ 8 - 8
persagy-web-big/src/types/floor/Door.ts

@@ -33,26 +33,26 @@ import { Place } from "../Place";
  * @author  郝建龙
  */
 export interface Door {
-    /** 面朝方向  */
+    /** 面朝方向 */
     FaceDirection: Point;
-    /** 把手方向  */
+    /** 把手方向 */
     HandDirection: Point;
-    /** 位置  */
+    /** 位置 */
     Location: Place;
-    /** 模型id(外键)    */
+    /** 模型id(外键) */
     ModelId: string;
-    /** 名称  */
+    /** 名称 */
     Name: string;
-    /** 轮廓线  */
+    /** 轮廓线 */
     OutLine: Point[][];
     /** 拥有者的RevitId */
     Owner: string;
     /** 对应Revit模型id */
     SourceId: string;
-    /** 厚度  */
+    /** 厚度 */
     Thick: number;
     /** 所属墙 */
     WallId: string;
-    /** 宽度  */
+    /** 宽度 */
     Width: string;
 } // Interface Door

+ 8 - 8
persagy-web-big/src/types/floor/Space.ts

@@ -33,22 +33,22 @@ import { Place } from "../Place";
  * @author  郝建龙
  */
 export interface Space {
-    /** 轮廓线段    */
+    /** 轮廓线段 */
     BoundarySegments?: string[];
-    /** 位置  */
+    /** 位置 */
     Location: Place;
-    /** 高度  */
+    /** 高度 */
     Height?: number;
-    /** 模型id(外键)    */
+    /** 模型id(外键) */
     ModelId?: string;
-    /** 名称  */
+    /** 名称 */
     Name?: string;
-    /** 轮廓线  */
+    /** 轮廓线 */
     OutLine: Point[][];
     /** 对应Revit模型id */
     SourceId?: string;
-    /** 补充信息    */
+    /** 补充信息 */
     Tag?: string;
-    /** 类型  */
+    /** 类型 */
     TypeId?: string;
 } // Interface Space

+ 4 - 4
persagy-web-big/src/types/floor/VirtualWall.ts

@@ -33,13 +33,13 @@ import { Place } from "../Place";
  * @author  郝建龙
  */
 export interface VirtualWall {
-    /** 位置  */
+    /** 位置 */
     Location?: Place;
-    /** 模型id(外键)    */
+    /** 模型id(外键) */
     ModelId?: string;
-    /** 名称  */
+    /** 名称 */
     Name?: string;
-    /** 轮廓线  */
+    /** 轮廓线 */
     OutLine: Point[][];
     /** 对应Revit模型id */
     SourceId?: string;

+ 6 - 6
persagy-web-big/src/types/floor/Wall.ts

@@ -35,18 +35,18 @@ import { Place } from "../Place";
 export interface Wall {
     /** 层id */
     LevelId?: string;
-    /** 位置  */
+    /** 位置 */
     Location?: Place;
-    /** 模型id(外键)    */
+    /** 模型id(外键) */
     ModelId?: string;
-    /** 名称  */
+    /** 名称 */
     Name?: string;
-    /** 轮廓线  */
+    /** 轮廓线 */
     OutLine: Point[][];
-    /** 轮廓线  */
+    /** 轮廓线 */
     Holes?: Point[][];
     /** 对应Revit模型id */
     SourceId?: string;
-    /** 厚度  */
+    /** 厚度 */
     Width?: number;
 } // Interface Wall

+ 8 - 8
persagy-web-big/src/types/floor/Zone.ts

@@ -32,20 +32,20 @@ import { Point } from "../Point";
  * @author  郝建龙
  */
 export interface Zone {
-    /** 名称  */
+    /** 名称 */
     RoomLocalName: string;
-    /** 轮廓线  */
+    /** 轮廓线 */
     OutLine: Point[][][];
-    /** 业务空间id  */
+    /** 业务空间id */
     RoomID: string;
-    /** 颜色  */
+    /** 颜色 */
     Color: string;
-    /** 高度  */
+    /** 高度 */
     Height?: number;
-    /** 是否高亮  */
+    /** 是否高亮 */
     HighLightFlag?: boolean;
-    /** 透明度  */
+    /** 透明度 */
     Transparency?: number;
-    /** 是否受影响   */
+    /** 是否受影响 */
     Infected?: boolean;
 } // Interface Zone

+ 1 - 1
persagy-web-big/src/utils/SMathUtil.ts

@@ -319,5 +319,5 @@ export class SMathUtil {
             sum += arr[i].x * arr[i - 1].y - arr[i - 1].x * arr[i].y;
         }
         return sum / 2;
-    }
+    } // Function calculateArea()
 } // Class SMathUtil