Browse Source

base,big,big-edit,draw,edit,fengmap,graph:fix>统一代码注释

shaun-sheep 4 years ago
parent
commit
f17c26a116
100 changed files with 585 additions and 569 deletions
  1. 107 95
      persagy-web-base/src/SMatrix.ts
  2. 2 2
      persagy-web-base/src/SMouseEvent.ts
  3. 4 4
      persagy-web-base/src/SObject.ts
  4. 4 4
      persagy-web-base/src/SObjectObserver.ts
  5. 1 1
      persagy-web-base/src/enums/SKeyCode.ts
  6. 1 1
      persagy-web-base/src/enums/SMouseButton.ts
  7. 1 1
      persagy-web-base/src/enums/STouchState.ts
  8. 1 1
      persagy-web-base/src/undo/SCommandLog.ts
  9. 5 5
      persagy-web-base/src/undo/SUndoCommand.ts
  10. 12 12
      persagy-web-base/src/undo/SUndoStack.ts
  11. 2 2
      persagy-web-base/src/utils/SNetUtil.ts
  12. 4 4
      persagy-web-base/src/utils/SStringBuilder.ts
  13. 2 2
      persagy-web-base/src/utils/SStringUtil.ts
  14. 2 2
      persagy-web-base/src/utils/SUuid.ts
  15. 10 10
      persagy-web-big-edit/src/BigEditFactory.ts
  16. 17 17
      persagy-web-big-edit/src/SBaseEditScene.ts
  17. 9 9
      persagy-web-big-edit/src/items/SBaseArrow.ts
  18. 3 3
      persagy-web-big-edit/src/items/SBaseEquipment.ts
  19. 4 4
      persagy-web-big-edit/src/items/SBaseExpainEdit.ts
  20. 4 4
      persagy-web-big-edit/src/items/SBasePipe.ts
  21. 4 4
      persagy-web-big-edit/src/items/SBasePipeUninTool.ts
  22. 1 1
      persagy-web-big-edit/src/types/Anchor.ts
  23. 1 1
      persagy-web-big-edit/src/types/ElementData.ts
  24. 1 1
      persagy-web-big-edit/src/types/Legend.ts
  25. 1 1
      persagy-web-big-edit/src/types/Marker.ts
  26. 1 1
      persagy-web-big-edit/src/types/Relation.ts
  27. 1 1
      persagy-web-big/src/config/ItemColor.ts
  28. 1 1
      persagy-web-big/src/config/ItemOrder.ts
  29. 1 1
      persagy-web-big/src/config/Transparency.ts
  30. 1 1
      persagy-web-big/src/enums/SGraphElementType.ts
  31. 1 1
      persagy-web-big/src/enums/SItemStatus.ts
  32. 1 1
      persagy-web-big/src/enums/SLineType.ts
  33. 1 1
      persagy-web-big/src/enums/SMarkerType.ts
  34. 1 1
      persagy-web-big/src/enums/SRelationDir.ts
  35. 1 1
      persagy-web-big/src/enums/SRelationState.ts
  36. 9 9
      persagy-web-big/src/factories/SItemFactory.ts
  37. 1 1
      persagy-web-big/src/factories/STopoItemFactory.ts
  38. 1 1
      persagy-web-big/src/items/SLayerItem.ts
  39. 45 42
      persagy-web-big/src/items/SPolylineItem.ts
  40. 5 5
      persagy-web-big/src/items/SRectSelectItem.ts
  41. 1 1
      persagy-web-big/src/items/STooltipItem.ts
  42. 2 2
      persagy-web-big/src/items/floor/SColumnItem.ts
  43. 4 4
      persagy-web-big/src/items/floor/SDoorItem.ts
  44. 9 8
      persagy-web-big/src/parser/SFloorParser.ts
  45. 2 2
      persagy-web-big/src/parser/SParser.ts
  46. 5 5
      persagy-web-big/src/parser/STopologyParser.ts
  47. 3 3
      persagy-web-big/src/parser/SZoneParser.ts
  48. 1 1
      persagy-web-big/src/types/BigPoint.ts
  49. 1 1
      persagy-web-big/src/types/FloorData.ts
  50. 1 1
      persagy-web-big/src/types/ImageData.ts
  51. 1 1
      persagy-web-big/src/types/Marker.ts
  52. 1 1
      persagy-web-big/src/types/MinDis.ts
  53. 1 1
      persagy-web-big/src/types/Outline.ts
  54. 1 1
      persagy-web-big/src/types/Place.ts
  55. 1 1
      persagy-web-big/src/types/PointToLine.ts
  56. 1 1
      persagy-web-big/src/types/Size.ts
  57. 1 1
      persagy-web-big/src/types/TextData.ts
  58. 1 1
      persagy-web-big/src/types/TopologyData.ts
  59. 1 1
      persagy-web-big/src/types/floor/Casement.ts
  60. 1 1
      persagy-web-big/src/types/floor/Column.ts
  61. 1 1
      persagy-web-big/src/types/floor/Door.ts
  62. 1 1
      persagy-web-big/src/types/floor/Space.ts
  63. 1 1
      persagy-web-big/src/types/floor/VirtualWall.ts
  64. 1 1
      persagy-web-big/src/types/floor/Wall.ts
  65. 1 1
      persagy-web-big/src/types/floor/Zone.ts
  66. 1 1
      persagy-web-big/src/types/topology/Anchor.ts
  67. 1 1
      persagy-web-big/src/types/topology/MarkerTopo.ts
  68. 1 1
      persagy-web-big/src/types/topology/Node.ts
  69. 1 1
      persagy-web-big/src/types/topology/Relation.ts
  70. 11 11
      persagy-web-big/src/utils/SMathUtil.ts
  71. 6 6
      persagy-web-draw/src/SBrush.ts
  72. 37 37
      persagy-web-draw/src/SCanvasView.ts
  73. 18 18
      persagy-web-draw/src/SColor.ts
  74. 2 2
      persagy-web-draw/src/SFont.ts
  75. 12 12
      persagy-web-draw/src/SGradient.ts
  76. 4 4
      persagy-web-draw/src/SGradientStop.ts
  77. 3 3
      persagy-web-draw/src/SLinearGradient.ts
  78. 41 41
      persagy-web-draw/src/SPainter.ts
  79. 13 13
      persagy-web-draw/src/SPath.ts
  80. 2 2
      persagy-web-draw/src/SPen.ts
  81. 3 3
      persagy-web-draw/src/SRadialGradient.ts
  82. 2 2
      persagy-web-draw/src/SShadow.ts
  83. 32 32
      persagy-web-draw/src/engines/SCanvasPaintEngine.ts
  84. 11 11
      persagy-web-draw/src/engines/SPaintEngine.ts
  85. 12 12
      persagy-web-draw/src/engines/SPaintState.ts
  86. 22 22
      persagy-web-draw/src/engines/SSvgPaintEngine.ts
  87. 1 1
      persagy-web-draw/src/enums/SArrowStyleType.ts
  88. 1 1
      persagy-web-draw/src/enums/SAspectRatioMode.ts
  89. 1 1
      persagy-web-draw/src/enums/SBrushType.ts
  90. 1 1
      persagy-web-draw/src/enums/SCompositeType.ts
  91. 1 1
      persagy-web-draw/src/enums/SLineCapStyle.ts
  92. 1 1
      persagy-web-draw/src/enums/SLineJoinStyle.ts
  93. 1 1
      persagy-web-draw/src/enums/SPaintEngineType.ts
  94. 1 1
      persagy-web-draw/src/enums/STextAlign.ts
  95. 1 1
      persagy-web-draw/src/enums/STextBaseLine.ts
  96. 1 1
      persagy-web-draw/src/enums/STextDirection.ts
  97. 1 1
      persagy-web-draw/src/types/SArrow.ts
  98. 15 15
      persagy-web-draw/src/types/SLine.ts
  99. 6 6
      persagy-web-draw/src/types/SPoint.ts
  100. 0 0
      persagy-web-draw/src/types/SRect.ts

+ 107 - 95
persagy-web-base/src/SMatrix.ts

@@ -50,57 +50,69 @@ export class SMatrix {
     m24 = 0;
     m34 = 0;
     m44 = 1;
+
     // 结束:矩阵元素定义
 
     /** x 轴方向的缩放比例 */
     get a(): number {
         return this.m11;
-    } // Get a
+    }
+
     set a(v: number) {
         this.m11 = v;
-    } // Set a
+    }
+
     /** x 轴方向斜切 */
     get b(): number {
         return this.m12;
-    } // Get b
+    }
+
     set b(v: number) {
         this.m12 = v;
-    } // Set b
+    }
+
     /** y轴方向斜切 */
     get c(): number {
         return this.m21;
-    } // Get c
+    }
+
     set c(v: number) {
         this.m21 = v;
-    } // Set c
+    }
+
     /** y轴方向缩放比例   */
     get d(): number {
         return this.m22;
-    } // Get d
+    }
+
     set d(v: number) {
         this.m22 = v;
-    } // Set d
+    }
+
     /** x轴方向平移 */
     get e(): number {
         return this.m41;
-    } // Get e
+    }
+
     set e(v: number) {
         this.m41 = v;
-    } // Set e
+    }
+
     /** y轴方向平移 */
     get f(): number {
         return this.m42;
-    } // Get f
+    }
+
     set f(v: number) {
         this.m42 = v;
-    } // Set f
+    }
 
     /**
      * 是否为 2D 矩阵
      */
     get is2D(): boolean {
         return true;
-    } // Get is2D
+    }
 
     /**
      * 是否为单位矩阵
@@ -124,7 +136,7 @@ export class SMatrix {
             this.m34 == 0 &&
             this.m44 == 1
         );
-    } // Get isIdentity
+    }
 
     /**
      * 重置变换矩阵
@@ -152,7 +164,7 @@ export class SMatrix {
         this.m34 = 0;
         this.m44 = 1;
         return this;
-    } // Function reset()
+    }
 
     /**
      * 原始矩阵乘以给定的变换矩阵
@@ -183,75 +195,75 @@ export class SMatrix {
             this.m44
         ] = [
             this.m11 * mat.m11 +
-                this.m21 * mat.m12 +
-                this.m31 * mat.m13 +
-                this.m41 * mat.m14,
+            this.m21 * mat.m12 +
+            this.m31 * mat.m13 +
+            this.m41 * mat.m14,
             this.m11 * mat.m21 +
-                this.m21 * mat.m22 +
-                this.m31 * mat.m23 +
-                this.m41 * mat.m24,
+            this.m21 * mat.m22 +
+            this.m31 * mat.m23 +
+            this.m41 * mat.m24,
             this.m11 * mat.m31 +
-                this.m21 * mat.m32 +
-                this.m31 * mat.m33 +
-                this.m41 * mat.m34,
+            this.m21 * mat.m32 +
+            this.m31 * mat.m33 +
+            this.m41 * mat.m34,
             this.m11 * mat.m41 +
-                this.m21 * mat.m42 +
-                this.m31 * mat.m43 +
-                this.m41 * mat.m44,
+            this.m21 * mat.m42 +
+            this.m31 * mat.m43 +
+            this.m41 * mat.m44,
 
             this.m12 * mat.m11 +
-                this.m22 * mat.m12 +
-                this.m32 * mat.m13 +
-                this.m42 * mat.m14,
+            this.m22 * mat.m12 +
+            this.m32 * mat.m13 +
+            this.m42 * mat.m14,
             this.m12 * mat.m21 +
-                this.m22 * mat.m22 +
-                this.m32 * mat.m23 +
-                this.m42 * mat.m24,
+            this.m22 * mat.m22 +
+            this.m32 * mat.m23 +
+            this.m42 * mat.m24,
             this.m12 * mat.m31 +
-                this.m22 * mat.m32 +
-                this.m32 * mat.m33 +
-                this.m42 * mat.m34,
+            this.m22 * mat.m32 +
+            this.m32 * mat.m33 +
+            this.m42 * mat.m34,
             this.m12 * mat.m41 +
-                this.m22 * mat.m42 +
-                this.m32 * mat.m43 +
-                this.m42 * mat.m44,
+            this.m22 * mat.m42 +
+            this.m32 * mat.m43 +
+            this.m42 * mat.m44,
 
             this.m13 * mat.m11 +
-                this.m23 * mat.m12 +
-                this.m33 * mat.m13 +
-                this.m43 * mat.m14,
+            this.m23 * mat.m12 +
+            this.m33 * mat.m13 +
+            this.m43 * mat.m14,
             this.m13 * mat.m21 +
-                this.m23 * mat.m22 +
-                this.m33 * mat.m23 +
-                this.m43 * mat.m24,
+            this.m23 * mat.m22 +
+            this.m33 * mat.m23 +
+            this.m43 * mat.m24,
             this.m13 * mat.m31 +
-                this.m23 * mat.m32 +
-                this.m33 * mat.m33 +
-                this.m43 * mat.m34,
+            this.m23 * mat.m32 +
+            this.m33 * mat.m33 +
+            this.m43 * mat.m34,
             this.m13 * mat.m41 +
-                this.m23 * mat.m42 +
-                this.m33 * mat.m43 +
-                this.m43 * mat.m44,
+            this.m23 * mat.m42 +
+            this.m33 * mat.m43 +
+            this.m43 * mat.m44,
 
             this.m14 * mat.m11 +
-                this.m24 * mat.m12 +
-                this.m34 * mat.m13 +
-                this.m44 * mat.m14,
+            this.m24 * mat.m12 +
+            this.m34 * mat.m13 +
+            this.m44 * mat.m14,
             this.m14 * mat.m21 +
-                this.m24 * mat.m22 +
-                this.m34 * mat.m23 +
-                this.m44 * mat.m24,
+            this.m24 * mat.m22 +
+            this.m34 * mat.m23 +
+            this.m44 * mat.m24,
             this.m14 * mat.m31 +
-                this.m24 * mat.m32 +
-                this.m34 * mat.m33 +
-                this.m44 * mat.m34,
+            this.m24 * mat.m32 +
+            this.m34 * mat.m33 +
+            this.m44 * mat.m34,
             this.m14 * mat.m41 +
-                this.m24 * mat.m42 +
-                this.m34 * mat.m43 +
-                this.m44 * mat.m44
+            this.m24 * mat.m42 +
+            this.m34 * mat.m43 +
+            this.m44 * mat.m44
         ];
         return this;
-    } // Function multiply()
+    }
 
     /**
      * 位移变换
@@ -268,7 +280,7 @@ export class SMatrix {
         mat.m43 = dz;
         this.multiply(mat);
         return this;
-    } // Function translate()
+    }
 
     /**
      * 缩放变换
@@ -283,7 +295,7 @@ export class SMatrix {
         mat.m22 = sy;
         this.multiply(mat);
         return this;
-    } // Function scale
+    }
 
     /**
      * 旋转变形
@@ -342,7 +354,7 @@ export class SMatrix {
             this.multiply(matZ);
             return this;
         }
-    } // Function rotate()
+    }
 
     /**
      * 转置当前矩阵
@@ -359,7 +371,7 @@ export class SMatrix {
 
         [this.m34, this.m43] = [this.m43, this.m34];
         return this;
-    } // Function transpose()
+    }
 
     /**
      * 返回当前矩阵的逆矩阵
@@ -390,7 +402,7 @@ export class SMatrix {
         ret.m34 = detMat.m34 / d;
         ret.m44 = detMat.m44 / d;
         return ret;
-    } // Function inversed()
+    }
 
     /**
      * 返回当前矩阵的伴随矩阵
@@ -523,7 +535,7 @@ export class SMatrix {
             this.m21 * this.m12 * this.m33 -
             this.m11 * this.m32 * this.m23;
         return m;
-    } // Function det()
+    }
 
     /**
      * 返回当前矩阵的值
@@ -533,33 +545,33 @@ export class SMatrix {
     value(): number {
         return (
             this.m11 *
-                (this.m22 * this.m33 * this.m44 +
-                    this.m32 * this.m43 * this.m24 +
-                    this.m42 * this.m23 * this.m34 -
-                    this.m42 * this.m33 * this.m24 -
-                    this.m32 * this.m23 * this.m44 -
-                    this.m22 * this.m43 * this.m34) -
+            (this.m22 * this.m33 * this.m44 +
+                this.m32 * this.m43 * this.m24 +
+                this.m42 * this.m23 * this.m34 -
+                this.m42 * this.m33 * this.m24 -
+                this.m32 * this.m23 * this.m44 -
+                this.m22 * this.m43 * this.m34) -
             this.m21 *
-                (this.m12 * this.m33 * this.m44 +
-                    this.m32 * this.m43 * this.m14 +
-                    this.m42 * this.m13 * this.m34 -
-                    this.m42 * this.m33 * this.m14 -
-                    this.m32 * this.m13 * this.m44 -
-                    this.m12 * this.m43 * this.m34) +
+            (this.m12 * this.m33 * this.m44 +
+                this.m32 * this.m43 * this.m14 +
+                this.m42 * this.m13 * this.m34 -
+                this.m42 * this.m33 * this.m14 -
+                this.m32 * this.m13 * this.m44 -
+                this.m12 * this.m43 * this.m34) +
             this.m31 *
-                (this.m12 * this.m23 * this.m44 +
-                    this.m22 * this.m43 * this.m14 +
-                    this.m42 * this.m13 * this.m24 -
-                    this.m42 * this.m23 * this.m14 -
-                    this.m22 * this.m13 * this.m44 -
-                    this.m12 * this.m43 * this.m24) -
+            (this.m12 * this.m23 * this.m44 +
+                this.m22 * this.m43 * this.m14 +
+                this.m42 * this.m13 * this.m24 -
+                this.m42 * this.m23 * this.m14 -
+                this.m22 * this.m13 * this.m44 -
+                this.m12 * this.m43 * this.m24) -
             this.m41 *
-                (this.m12 * this.m23 * this.m34 +
-                    this.m22 * this.m33 * this.m14 +
-                    this.m32 * this.m13 * this.m24 -
-                    this.m32 * this.m23 * this.m14 -
-                    this.m22 * this.m13 * this.m34 -
-                    this.m12 * this.m33 * this.m24)
+            (this.m12 * this.m23 * this.m34 +
+                this.m22 * this.m33 * this.m14 +
+                this.m32 * this.m13 * this.m24 -
+                this.m32 * this.m23 * this.m14 -
+                this.m22 * this.m13 * this.m34 -
+                this.m12 * this.m33 * this.m24)
         );
-    } // Function value()
+    }
 }

+ 2 - 2
persagy-web-base/src/SMouseEvent.ts

@@ -102,5 +102,5 @@ export class SMouseEvent {
             this.x = event.offsetX;
             this.y = event.offsetY;
         }
-    } // Constructor()
-} // Class SMouseEvent
+    }
+}

+ 4 - 4
persagy-web-base/src/SObject.ts

@@ -63,7 +63,7 @@ export class SObject {
 
         // @ts-ignore
         this.listeners[name].push(new SObjectObserver(receiver, callback));
-    } // Function
+    }
 
     /**
      * 断开连接的信号
@@ -91,7 +91,7 @@ export class SObject {
             // @ts-ignore
             delete this.listeners[name];
         }
-    } // Function disconnect()
+    }
 
     /**
      * 发出事件
@@ -110,5 +110,5 @@ export class SObject {
         for (let observer of observerList) {
             observer.notify(this, args);
         }
-    } // Function $emit()
-} // Class SObject
+    }
+}

+ 4 - 4
persagy-web-base/src/SObjectObserver.ts

@@ -46,7 +46,7 @@ export class SObjectObserver {
     constructor(receiver: any, callback: Function) {
         this.receiver = receiver;
         this.callback = callback;
-    } // Constructor
+    }
 
     /**
      * 发送通知
@@ -56,7 +56,7 @@ export class SObjectObserver {
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     notify(...args: any): void {
         this.callback.call(this.receiver, ...args);
-    } // Function notify()
+    }
 
     /**
      * 上一个信号接收者比较
@@ -67,5 +67,5 @@ export class SObjectObserver {
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     compar(receiver: any): boolean {
         return receiver == this.receiver;
-    } // Function compar()
-} // Class EventObserver
+    }
+}

+ 1 - 1
persagy-web-base/src/enums/SKeyCode.ts

@@ -90,4 +90,4 @@ export enum SKeyCode {
     x = 120,
     y = 121,
     z = 122
-} // Enum SKeyCode
+}

+ 1 - 1
persagy-web-base/src/enums/SMouseButton.ts

@@ -36,4 +36,4 @@ export enum SMouseButton {
     RightButton = 0x2,
     /** 鼠标中键 */
     MidButton = 0x4
-} // Enum SMouseButton
+}

+ 1 - 1
persagy-web-base/src/enums/STouchState.ts

@@ -36,4 +36,4 @@ export enum STouchState {
     Move,
     /** 缩放状态 */
     Zoom
-} // Enum STouchState
+}

+ 1 - 1
persagy-web-base/src/undo/SCommandLog.ts

@@ -36,4 +36,4 @@ export interface SCommandLog {
     desc: string;
     /** 命令细节 */
     detail: string;
-} // interface SCommandLog
+}

+ 5 - 5
persagy-web-base/src/undo/SUndoCommand.ts

@@ -40,7 +40,7 @@ export abstract class SUndoCommand {
      *
      * @param  parent   指向父命令
      */
-    protected constructor(parent: SUndoCommand | null = null) {} // Constructor
+    protected constructor(parent: SUndoCommand | null = null) {}
 
     /**
      * undo回调
@@ -60,19 +60,19 @@ export abstract class SUndoCommand {
      */
     mergeWith(command: SUndoCommand): boolean {
         return false;
-    } // Function mergeWith()
+    }
 
     /**
      * 命令 ID 。如果命令不能合并,则返回 -1 。如果支持合并则返回一个正整数。
      */
     id(): number {
         return -1;
-    } // Function id()
+    }
 
     /**
      * 命令转为描述谢姐
      */
     toString(): string {
         return "";
-    } // toString()
-} // Class SUndoCommand
+    }
+}

+ 12 - 12
persagy-web-base/src/undo/SUndoStack.ts

@@ -41,12 +41,12 @@ export class SUndoStack extends SObject {
     private _index = -1;
     get index(): number {
         return this._index;
-    } // Get index
+    }
 
     /** 命令栈是否为空 */
     get isEmpty(): boolean {
         return this.cmdStack.length <= 0;
-    } // Get isEmpty
+    }
 
     /** 是否更改 */
     isChange: boolean = false;
@@ -63,7 +63,7 @@ export class SUndoStack extends SObject {
         this._index++;
         this.cmdStack[this._index].redo();
         this.isChange = true;
-    } // Function redo()
+    }
 
     /**
      * 执行 undo 操作
@@ -77,7 +77,7 @@ export class SUndoStack extends SObject {
         this.cmdStack[this._index].undo();
         this._index--;
         this.isChange = true;
-    } // Function undo()
+    }
 
     /**
      * 是否可以执行 Redo 操作
@@ -86,7 +86,7 @@ export class SUndoStack extends SObject {
      */
     canRedo(): boolean {
         return this.index + 1 < this.cmdStack.length;
-    } // Function canRedo()
+    }
 
     /**
      * 是否可以执行 Undo 操作
@@ -95,7 +95,7 @@ export class SUndoStack extends SObject {
      */
     canUndo(): boolean {
         return this.index >= 0;
-    } // Function canUndo()
+    }
 
     /**
      * 清空堆栈
@@ -104,7 +104,7 @@ export class SUndoStack extends SObject {
         this.cmdStack.length = 0;
         this._index = -1;
         this.isChange = true;
-    } // Function clear()
+    }
 
     /**
      * 返回指定索引的命令
@@ -119,14 +119,14 @@ export class SUndoStack extends SObject {
         }
 
         return this.cmdStack[index];
-    } // Function command()
+    }
 
     /**
      * 统计命令栈中命令的数量
      */
     count(): number {
         return this.cmdStack.length;
-    } // Function count()
+    }
 
     /**
      * 将命令添加到命令栈
@@ -142,7 +142,7 @@ export class SUndoStack extends SObject {
         this.cmdStack.push(cmd);
         this._index = this.cmdStack.length - 1;
         this.isChange = true;
-    } // Function push()
+    }
 
     /**
      * 将命令堆栈转为日志(命令数组)
@@ -157,5 +157,5 @@ export class SUndoStack extends SObject {
             });
         }
         return stackList;
-    } // Function toLog()
-} // Class SUndoStack
+    }
+}

+ 2 - 2
persagy-web-base/src/utils/SNetUtil.ts

@@ -43,5 +43,5 @@ export class SNetUtil {
         oA.click();
         // 下载之后把创建的元素删除
         oA.remove();
-    } // Function downLoad()
-} // Class SNetUtil
+    }
+}

+ 4 - 4
persagy-web-base/src/utils/SStringBuilder.ts

@@ -42,7 +42,7 @@ export class SStringBuilder {
         if (msg != undefined) {
             this.append(msg);
         }
-    } // Constructor()
+    }
 
     /**
      * 追加字符串
@@ -53,7 +53,7 @@ export class SStringBuilder {
     append(msg: string): SStringBuilder {
         this._strArray.push(msg);
         return this;
-    } // Function append()
+    }
 
     /**
      * 转换为字符串
@@ -63,5 +63,5 @@ export class SStringBuilder {
      */
     toString(gap: string = "\n"): string {
         return this._strArray.join(gap);
-    } // Function toString()
-} // Class SStringBuilder
+    }
+}

+ 2 - 2
persagy-web-base/src/utils/SStringUtil.ts

@@ -62,5 +62,5 @@ export class SStringUtil {
             len--;
         }
         return hex;
-    } // Function num2Hex()
-} // Class SStringUtil
+    }
+}

+ 2 - 2
persagy-web-base/src/utils/SUuid.ts

@@ -57,5 +57,5 @@ export class SUuid {
             }
         }
         return uuid.join("");
-    } // Function uuid()
-} // Class SUuid()
+    }
+}

+ 10 - 10
persagy-web-big-edit/src/BigEditFactory.ts

@@ -46,7 +46,7 @@ export class BigEditFactory extends SItemFactory {
      */
     constructor() {
         super()
-    } // Constructor
+    }
 
     /**
      * 创建基础直线
@@ -56,7 +56,7 @@ export class BigEditFactory extends SItemFactory {
      */
     createBaseLineEdit(data: Marker): SBaseLineEdit {
         return new SBaseLineEdit(null, data);
-    } // Function createBaseLineEdit()
+    }
 
     /**
      * 创建基础文本
@@ -66,7 +66,7 @@ export class BigEditFactory extends SItemFactory {
      */
     createBaseTextEdit(data: Marker): SBaseTextEdit {
         return new SBaseTextEdit(null, data);
-    } // Function createBaseTextEdit()
+    }
 
     /**
      * 创建基础图片
@@ -76,7 +76,7 @@ export class BigEditFactory extends SItemFactory {
      */
     createBaseImageEdit(data: Marker): SBaseImageEdit {
         return new SBaseImageEdit(null, data);
-    } // Function createBaseImageEdit()
+    }
 
     /**
      * 创建基础矩形
@@ -86,7 +86,7 @@ export class BigEditFactory extends SItemFactory {
      */
     createBaseRectEdit(data: Marker): SBaseRectEdit {
         return new SBaseRectEdit(null, data);
-    } // Function createBaseRectEdit()
+    }
 
     /**
      * 创建基础圆
@@ -96,7 +96,7 @@ export class BigEditFactory extends SItemFactory {
      */
     createBaseCircleEdit(data: Marker): SBaseCircleEdit {
         return new SBaseCircleEdit(null, data);
-    } // Function createBaseRectEdit()
+    }
 
     /**
      * 创建基础注释
@@ -106,7 +106,7 @@ export class BigEditFactory extends SItemFactory {
      */
     createBaseExpainEdit(data: Marker): SBaseExpainEdit {
         return new SBaseExpainEdit(null, data);
-    } // Function createBaseExpainEdit()
+    }
 
     /**
      * 创建基础多边形
@@ -116,7 +116,7 @@ export class BigEditFactory extends SItemFactory {
      */
     createBasePolygonEdit(data: Marker): SBasePolygonEdit {
         return new SBasePolygonEdit(null, data);
-    } // Function createBasePolygonEdit()
+    }
 
     /**
      * 创建基础基础箭头(折线)
@@ -126,6 +126,6 @@ export class BigEditFactory extends SItemFactory {
      */
     createBaseArrow(data: Marker): SBaseArrow {
         return new SBaseArrow(null, data);
-    } // Function createBasePolygonEdit()
+    }
 
-} // Class BigEditFactory
+}

+ 17 - 17
persagy-web-big-edit/src/SBaseEditScene.ts

@@ -55,7 +55,7 @@ export class SBaseEditScene extends SGraphEditScene {
      */
     constructor() {
         super()
-    } // Constructor
+    }
 
     /**
      * 新增基础类注释
@@ -91,7 +91,7 @@ export class SBaseEditScene extends SGraphEditScene {
         this.undoStack.push(new SGraphAddCommand(this, item));
         this.grabItem = null;
         this.finishCreated(item);
-    } // Function addExplainItem()
+    }
 
     /**
      * 新增基础箭头(折线)
@@ -125,7 +125,7 @@ export class SBaseEditScene extends SGraphEditScene {
         if (this.view) {
             this.view.update();
         }
-    } // Function addPolyLineArrow()
+    }
 
     /**
      * 添加基本设备 item
@@ -166,7 +166,7 @@ export class SBaseEditScene extends SGraphEditScene {
         if (this.view) {
             this.view.update();
         }
-    } // Function addEuqipment()
+    }
 
     /**
      * 新增管道
@@ -198,7 +198,7 @@ export class SBaseEditScene extends SGraphEditScene {
         if (this.view) {
             this.view.update();
         }
-    } // Function addBasePipe()
+    }
 
     /**
      * 添加基本管道联通器
@@ -242,7 +242,7 @@ export class SBaseEditScene extends SGraphEditScene {
         if (this.view) {
             this.view.update();
         }
-    } // Function addPipeUninTool()
+    }
 
     /**
      * 重做
@@ -253,7 +253,7 @@ export class SBaseEditScene extends SGraphEditScene {
         } else {
             this.undoStack.redo();
         }
-    } // Function redo()
+    }
 
     /**
      * 撤销
@@ -264,7 +264,7 @@ export class SBaseEditScene extends SGraphEditScene {
         } else {
             this.undoStack.undo();
         }
-    } // Function undo()
+    }
 
     /**
      * 删除
@@ -283,7 +283,7 @@ export class SBaseEditScene extends SGraphEditScene {
             this.view.update()
         }
         return itemList
-    } // Function deleteItem()
+    }
 
     /**
      * 框选
@@ -293,7 +293,7 @@ export class SBaseEditScene extends SGraphEditScene {
         let rect = new SRectSelectItem(null, point);
         this.addItem(rect);
         this.grabItem = rect;
-    } // Function addRectSelect()
+    }
 
     /**
      * 计算框选交集
@@ -308,7 +308,7 @@ export class SBaseEditScene extends SGraphEditScene {
             const rect = this.grabItem.boundingRect();
             this.arrToSelect(this.root.children, rect)
         }
-    } // Function groupSelect()
+    }
 
     /**
      * 选中item:框选
@@ -330,7 +330,7 @@ export class SBaseEditScene extends SGraphEditScene {
                 }
             })
         }
-    } // Function arrToSelect()
+    }
 
     /////////////////////////////////////////////////////////////////////
     // 鼠标事件
@@ -344,7 +344,7 @@ export class SBaseEditScene extends SGraphEditScene {
         if (!super.onMouseDown(event) && 1 == event.buttons) {
             this.addRectSelect(event);
         }
-    } // Function onMouseDown()
+    }
 
     /**
      * 鼠标抬起
@@ -367,7 +367,7 @@ export class SBaseEditScene extends SGraphEditScene {
             return this.grabItem.onMouseUp(event);
         }
         return super.onMouseUp(event)
-    } // Function onMouseUp()
+    }
 
     /**
      * 复制
@@ -395,7 +395,7 @@ export class SBaseEditScene extends SGraphEditScene {
             console.log(input.value, Date.now());
             document.body.removeChild(input)
         }
-    } // Function copy()
+    }
 
     /**
      * 粘贴
@@ -414,5 +414,5 @@ export class SBaseEditScene extends SGraphEditScene {
         });
         this.view ? this.view.update() : ''
         console.log(this.view)
-    } // Function paste()
-} // Class SBaseEditScene
+    }
+} 

+ 9 - 9
persagy-web-big-edit/src/items/SBaseArrow.ts

@@ -43,21 +43,21 @@ export class SBaseArrow extends SBasePolylineEdit {
     _begin = SArrowStyleType.None;
     get begin(): SArrowStyleType {
         return this._begin;
-    } // Get begin
+    }
     set begin(v: SArrowStyleType) {
         this._begin = v;
         this.update();
-    } // Set begin
+    }
 
     /** 结束点样式 */
     _end = SArrowStyleType.None;
     get end(): SArrowStyleType {
         return this._end;
-    } // Get end
+    }
     set end(v: SArrowStyleType) {
         this._end = v;
         this.update();
-    } // Set end
+    }
 
     /**
      * 构造函数
@@ -73,7 +73,7 @@ export class SBaseArrow extends SBasePolylineEdit {
             this.begin = data.style.begin ? data.style.begin : SArrowStyleType.None;
             this.end = data.style.end ? data.style.end : SArrowStyleType.None
         }
-    } // Constructor
+    }
 
     /**
      * 鼠标按下事件
@@ -84,7 +84,7 @@ export class SBaseArrow extends SBasePolylineEdit {
     onMouseDown(event: SMouseEvent): boolean {
         super.onMouseDown(event)
         return true;
-    } // Function onMouseDown()
+    }
 
     /**
      * 绘制基本图形
@@ -119,7 +119,7 @@ export class SBaseArrow extends SBasePolylineEdit {
             }
         );
         painter.drawPolyline(this.pointList);
-    } // Function drawBaseLine()
+    }
 
     /**
      * 返回对象储存的相关数据
@@ -130,5 +130,5 @@ export class SBaseArrow extends SBasePolylineEdit {
         this.data.style.begin = this.begin;
         this.data.style.end = this.end;
         return super.toData();
-    } // Function toData()
-} // Class SBaseArrow
+    }
+}

+ 3 - 3
persagy-web-big-edit/src/items/SBaseEquipment.ts

@@ -43,7 +43,7 @@ export class SBaseEquipment extends SBaseImageEdit {
      */
     constructor(parent: SGraphItem | null, data: Marker) {
         super(parent, data);
-    } // Constructor
+    }
 
     /**
      * 返回对象储存的相关数据
@@ -52,5 +52,5 @@ export class SBaseEquipment extends SBaseImageEdit {
      */
     toData(): any {
         return super.toData()
-    } // Function toData
-} // Class SBaseEquipment
+    }
+}

+ 4 - 4
persagy-web-big-edit/src/items/SBaseExpainEdit.ts

@@ -45,7 +45,7 @@ import {SMouseEvent} from "@persagy-web/base/lib";
       */
      constructor(parent: SGraphItem | null, data: Marker) {
          super(parent, data);
-     } // Constructor
+     }
 
      /**
       * 鼠标按下事件
@@ -56,7 +56,7 @@ import {SMouseEvent} from "@persagy-web/base/lib";
      onMouseDown(event: SMouseEvent): boolean {
          super.onMouseDown(event);
          return true;
-     } // Function onMouseDown()
+     }
 
      /**
       * 返回对象储存的相关数据
@@ -65,5 +65,5 @@ import {SMouseEvent} from "@persagy-web/base/lib";
       */
      toData(): any {
          return super.toData()
-     } // Function toData()
- } // Class SBaseExpainEdit
+     }
+ }

+ 4 - 4
persagy-web-big-edit/src/items/SBasePipe.ts

@@ -45,7 +45,7 @@ export class SBasePipe extends SBasePolylineEdit {
      */
     constructor(parent: SGraphItem | null, data: Marker) {
         super(parent, data);
-    } // Constructor
+    }
 
     /**
      * 鼠标按下事件
@@ -56,7 +56,7 @@ export class SBasePipe extends SBasePolylineEdit {
     onMouseDown(event: SMouseEvent): boolean {
         super.onMouseDown(event);
         return true;
-    } // Function onMouseDown()
+    }
 
     /**
      * 返回对象储存的相关数据
@@ -65,5 +65,5 @@ export class SBasePipe extends SBasePolylineEdit {
      */
     toData(): any {
         return super.toData()
-    } // Function toData()
-} // Class SBasePipe
+    }
+}

+ 4 - 4
persagy-web-big-edit/src/items/SBasePipeUninTool.ts

@@ -61,7 +61,7 @@ export class SBasePipeUninTool extends SBaseImageEdit {
                 //     break;
             }
         }
-    } // Constructor
+    }
 
     /**
      * 鼠标按下事件
@@ -72,7 +72,7 @@ export class SBasePipeUninTool extends SBaseImageEdit {
     onMouseDown(event: SMouseEvent): boolean {
         super.onMouseDown(event);
         return true;
-    } // Function onMouseDown()
+    }
 
     /**
      * 返回对象储存的相关数据
@@ -81,5 +81,5 @@ export class SBasePipeUninTool extends SBaseImageEdit {
      */
     toData(): any {
         return super.toData()
-    } // Function toData()
-} // Class SBasePipeUninTool
+    }
+}

+ 1 - 1
persagy-web-big-edit/src/types/Anchor.ts

@@ -36,4 +36,4 @@ export interface Anchor {
     ID: string;
     /** 锚点的坐标 */
     Pos: Point;
-} // Interface Anchor
+}

+ 1 - 1
persagy-web-big-edit/src/types/ElementData.ts

@@ -40,4 +40,4 @@ export interface ElementData {
 s: Marker[];
     /** 关系类节点 */
     Relations: Relation[];
-} // Interface ElementData
+}

+ 1 - 1
persagy-web-big-edit/src/types/Legend.ts

@@ -65,4 +65,4 @@ export interface Legend {
     Properties?: any;
      /** zone 区分防火分区和石材铺装 */
     SubType?:string
-} // Interface Legend
+}

+ 1 - 1
persagy-web-big-edit/src/types/Marker.ts

@@ -51,4 +51,4 @@ export interface Marker {
     style: any;
     /** 由应用自己定义 */
     properties?: any;
-} // Interface Marker
+}

+ 1 - 1
persagy-web-big-edit/src/types/Relation.ts

@@ -55,4 +55,4 @@ export interface Relation {
     PointList: Point[];
     /** 线的绘图样式 */
     Properties?: any;
-} // Interface Relation
+}

+ 1 - 1
persagy-web-big/src/config/ItemColor.ts

@@ -69,4 +69,4 @@ export class ItemColor {
     static zoneInfectedColor = new SColor("#ff0000");
     /** 受影响的业务空间边框颜色 */
     static zoneInfectedBorder = new SColor("#e2675c");
-} // Class ItemColor
+}

+ 1 - 1
persagy-web-big/src/config/ItemOrder.ts

@@ -69,4 +69,4 @@ export class ItemOrder {
     static RelationOrder = 999900;
     /** 蒙版层级 */
     static sceneMarkOrder = 9999900;
-} // Class ItemOrder
+}

+ 1 - 1
persagy-web-big/src/config/Transparency.ts

@@ -132,4 +132,4 @@ export const Transparency = [
     "FA",
     "FC",
     "FF"
-]; // Interface Transparency
+];

+ 1 - 1
persagy-web-big/src/enums/SGraphElementType.ts

@@ -39,4 +39,4 @@ export enum SGraphElementType {
     Zone,
     /** 图类型 */
     Image
-} // Enum SGraphElementType
+}

+ 1 - 1
persagy-web-big/src/enums/SItemStatus.ts

@@ -37,4 +37,4 @@ export enum SItemStatus {
     Edit,
     /** 创建态 */
     Create
-} // Enum SItemStatus
+}

+ 1 - 1
persagy-web-big/src/enums/SLineType.ts

@@ -33,4 +33,4 @@
 export enum SLineType {
     /** 直线 */
     Line
-} // Enum SLineType
+}

+ 1 - 1
persagy-web-big/src/enums/SMarkerType.ts

@@ -37,4 +37,4 @@ export enum SMarkerType {
     Line,
     /** 文本类型 */
     Text
-} // Enum SMarkerType
+}

+ 1 - 1
persagy-web-big/src/enums/SRelationDir.ts

@@ -37,4 +37,4 @@ export enum SRelationDir {
     Forward,
     /** 逆向(节点2到节点1) */
     Reverse
-} // Enum SRelationDir
+}

+ 1 - 1
persagy-web-big/src/enums/SRelationState.ts

@@ -39,4 +39,4 @@ export enum SRelationState {
     Edit,
     /** 创建态 */
     Create
-} // Enum SRelationState
+}

+ 9 - 9
persagy-web-big/src/factories/SItemFactory.ts

@@ -48,7 +48,7 @@ export class SItemFactory {
     /**
      * 构造函数
      */
-    constructor() {} // Constructor
+    constructor() {}
 
     /**
      * 创建柱子 item
@@ -58,7 +58,7 @@ export class SItemFactory {
      */
     createColumn(data: Column): SColumnItem {
         return new SColumnItem(null, data);
-    } // Function createColumn()
+    }
 
     /**
      * 创建墙 item
@@ -68,7 +68,7 @@ export class SItemFactory {
      */
     createWall(data: Wall): SWallItem {
         return new SWallItem(null, data);
-    } // Function createWall()
+    }
 
     /**
      * 创建虚拟墙 item
@@ -78,7 +78,7 @@ export class SItemFactory {
      */
     createVirtualWall(data: VirtualWall): SVirtualWallItem {
         return new SVirtualWallItem(null, data);
-    } // Function createVirtualWall()
+    }
 
     /**
      * 创建空间 item
@@ -88,7 +88,7 @@ export class SItemFactory {
      */
     createSpace(data: Space): SSpaceItem {
         return new SSpaceItem(null, data);
-    } // Function createSpace()
+    }
 
     /**
      * 创建门 item
@@ -98,7 +98,7 @@ export class SItemFactory {
      */
     createDoor(data: Door): SDoorItem {
         return new SDoorItem(null, data);
-    } // Function createDoor()
+    }
 
     /**
      * 创建窗 item
@@ -108,7 +108,7 @@ export class SItemFactory {
      */
     createWindow(data: Casement): SWindowItem {
         return new SWindowItem(null, data);
-    } // Function createWindow()
+    }
 
     /**
      * 创建业务空间 item
@@ -118,5 +118,5 @@ export class SItemFactory {
      */
     createZone(data: Zone): SZoneItem {
         return new SZoneItem(null, data);
-    } // Function createZone()
-} // Class SItemFactory
+    }
+}

+ 1 - 1
persagy-web-big/src/factories/STopoItemFactory.ts

@@ -29,4 +29,4 @@
  *
  * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
-export class STopoItemFactory {} // Class STopoItemFactory
+export class STopoItemFactory {}

+ 1 - 1
persagy-web-big/src/items/SLayerItem.ts

@@ -31,4 +31,4 @@ import { SGraphItem } from "@persagy-web/graph";
  *
  * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
-export class SLayerItem extends SGraphItem {} // Class SLayerItem
+export class SLayerItem extends SGraphItem {}

+ 45 - 42
persagy-web-big/src/items/SPolylineItem.ts

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SKeyCode, SMouseEvent, SUndoStack } from "@persagy-web/base";
-import { SItemStatus } from "..";
-import { SMathUtil } from "../utils/SMathUtil";
+import {SColor, SLine, SPainter, SPoint, SRect} from "@persagy-web/draw";
+import {SKeyCode, SMouseEvent, SUndoStack} from "@persagy-web/base";
+import {SItemStatus} from "..";
+import {SMathUtil} from "../utils/SMathUtil";
 import {
     SGraphItem,
     SGraphPointListDelete,
@@ -56,12 +56,12 @@ export class SPolylineItem extends SGraphItem {
     _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
+    }
 
     /** 鼠标移动时的点 */
     protected lastPoint: SPoint | null = null;
@@ -69,41 +69,41 @@ export class SPolylineItem extends SGraphItem {
     _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;
@@ -145,7 +145,7 @@ export class SPolylineItem extends SGraphItem {
         } else {
             this.pointList = list;
         }
-    } // Constructor
+    }
 
     /**
      * 添加点至数组中
@@ -167,7 +167,7 @@ export class SPolylineItem extends SGraphItem {
         }
 
         this.update();
-    } // Function addPoint()
+    }
 
     /**
      * 是否可以添加点到数组中
@@ -177,7 +177,7 @@ export class SPolylineItem extends SGraphItem {
      */
     private canHandle(index: number): boolean {
         return index >= 0 && index <= this.pointList.length;
-    } // Function canHandle()
+    }
 
     /**
      * 根据索引删除点
@@ -200,7 +200,7 @@ export class SPolylineItem extends SGraphItem {
             this.curPoint = null;
             this.update();
         }
-    } // Function deletePoint
+    }
 
     /**
      * 鼠标按下事件
@@ -222,6 +222,7 @@ export class SPolylineItem extends SGraphItem {
             } else if (this.status == SItemStatus.Edit) {
                 // 查询鼠标最近的索引
                 this.findNearestPoint(new SPoint(event.x, event.y));
+
                 // 增加点
                 if (this.curIndex < 0) {
                     this.findAddPos(new SPoint(event.x, event.y));
@@ -240,7 +241,7 @@ export class SPolylineItem extends SGraphItem {
         }
 
         return super.onMouseDown(event);
-    } // Function onMouseDown()
+    }
 
     /**
      * 鼠标移动事件
@@ -276,7 +277,7 @@ export class SPolylineItem extends SGraphItem {
         } else {
             return super.onMouseMove(event);
         }
-    } // Function onMouseMove()
+    }
 
     /**
      * 鼠标移动事件
@@ -304,7 +305,7 @@ export class SPolylineItem extends SGraphItem {
         }
 
         return true;
-    } // Function onMouseUp()
+    }
 
     /**
      * 鼠标双击事件
@@ -332,7 +333,7 @@ export class SPolylineItem extends SGraphItem {
 
         this.$emit("onDoubleClick", event);
         return true;
-    } // Function onDoubleClick()
+    }
 
     /***
      * 键盘按键弹起事件
@@ -352,13 +353,10 @@ export class SPolylineItem extends SGraphItem {
         }
 
         // delete删除点
-        if (
-            event.keyCode == SKeyCode.Delete &&
-            this.status == SItemStatus.Edit
-        ) {
+        if (event.keyCode == SKeyCode.Delete && this.status == SItemStatus.Edit) {
             this.deletePoint(this.curIndex);
         }
-    } // Function onKeyUp()
+    }
 
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
@@ -377,7 +375,7 @@ export class SPolylineItem extends SGraphItem {
         );
         this.x = 0;
         this.y = 0;
-    } // Function moveToOrigin()
+    }
 
     /**
      * 获取点击点与点集中距离最近点
@@ -402,7 +400,7 @@ export class SPolylineItem extends SGraphItem {
                 );
             }
         }
-    } // Function findNearestPoint()
+    }
 
     /**
      * 计算增加点的位置
@@ -411,8 +409,8 @@ export class SPolylineItem extends SGraphItem {
      */
     findAddPos(p: SPoint): void {
         let len = SMathUtil.pointToLine(
-                p,
-                new SLine(this.pointList[0], this.pointList[1])
+            p,
+            new SLine(this.pointList[0], this.pointList[1])
             ),
             index = 0;
         if (this.pointList.length > 2) {
@@ -431,7 +429,7 @@ export class SPolylineItem extends SGraphItem {
         if (len.MinDis < this.sceneDis && len.Point) {
             this.addPoint(len.Point, index + 1);
         }
-    } // Function findAddPos()
+    }
 
     /**
      * shift 垂直水平创建或编辑
@@ -460,7 +458,7 @@ export class SPolylineItem extends SGraphItem {
         }
 
         return event;
-    } // Function compare()
+    }
 
     /**
      * 记录相关动作并推入栈中
@@ -472,7 +470,7 @@ export class SPolylineItem extends SGraphItem {
         // 记录相关命令并推入堆栈中
         const command = new SGraphCommand(this.scene, this, ...any);
         this.undoStack.push(command);
-    } // Function recordAction()
+    }
 
     /**
      * Item 对象边界区域
@@ -488,18 +486,23 @@ export class SPolylineItem extends SGraphItem {
             this.pointList.forEach((it): void => {
                 let x = it.x,
                     y = it.y;
+
+                // 如果数据 x 坐标小于 x 坐标最小值
                 if (x < this.minX) {
                     this.minX = x;
                 }
 
+                // 如果数据 y 坐标小于 y 坐标最小值
                 if (y < this.minY) {
                     this.minY = y;
                 }
 
+                // 如果数据 x 坐标大于 x 坐标最小值
                 if (x > this.maxX) {
                     this.maxX = x;
                 }
 
+                // 如果数据 y 坐标大于 y 坐标最小值
                 if (y > this.maxY) {
                     this.maxY = y;
                 }
@@ -512,7 +515,7 @@ export class SPolylineItem extends SGraphItem {
             this.maxX - this.minX,
             this.maxY - this.minY
         );
-    } // Function boundingRect()
+    }
 
     /**
      * 判断点是否在区域内
@@ -538,7 +541,7 @@ export class SPolylineItem extends SGraphItem {
             }
         }
         return false;
-    } // Function contains()
+    }
 
     /**
      * 撤销操作
@@ -547,7 +550,7 @@ export class SPolylineItem extends SGraphItem {
         if (this._status != SItemStatus.Normal) {
             this.undoStack.undo();
         }
-    } // Function undo()
+    }
 
     /**
      * 重做操作
@@ -556,7 +559,7 @@ export class SPolylineItem extends SGraphItem {
         if (this._status != SItemStatus.Normal) {
             this.undoStack.redo();
         }
-    } // Function redo()
+    }
 
     /**
      * 取消操作执行
@@ -569,7 +572,7 @@ export class SPolylineItem extends SGraphItem {
             this.status = SItemStatus.Normal;
             this.releaseItem();
         }
-    } // Function cancelOperate()
+    }
 
     /**
      * 绘制基本图形
@@ -592,7 +595,7 @@ export class SPolylineItem extends SGraphItem {
 
         painter.pen.color = this.strokeColor;
         painter.drawPolyline(this.pointList);
-    } // Function drawBaseLine()
+    }
 
     /**
      * Item 绘制操作
@@ -644,5 +647,5 @@ export class SPolylineItem extends SGraphItem {
             // 绘制基本图形
             this.drawBaseLine(painter);
         }
-    } // Function onDraw()
-} // Class SPolylineItem
+    }
+}

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

@@ -52,7 +52,7 @@ export class SRectSelectItem extends SGraphItem {
         this.endPoint = new SPoint(point.x, point.y);
         this.update();
         this.zOrder = ItemOrder.rectSelectOrder;
-    } // Constructor
+    }
 
     /**
      * Item 对象边界区域
@@ -61,7 +61,7 @@ export class SRectSelectItem extends SGraphItem {
      */
     boundingRect(): SRect {
         return new SRect(this.startPoint, this.endPoint);
-    } // Function boundingRect()
+    }
 
     /**
      * 鼠标移动事件
@@ -74,7 +74,7 @@ export class SRectSelectItem extends SGraphItem {
         this.endPoint.y = event.y;
         this.update();
         return true;
-    } // Function onMouseMove()
+    }
 
     /**
      * Item 绘制操作
@@ -86,5 +86,5 @@ export class SRectSelectItem extends SGraphItem {
         painter.pen.color = ItemColor.rectSelectOutColor;
         painter.brush.color = ItemColor.rectSelectInColor;
         painter.drawRect(this.startPoint, this.endPoint);
-    } // Function onDraw()
-} // SRectSelectItem
+    }
+}

+ 1 - 1
persagy-web-big/src/items/STooltipItem.ts

@@ -31,4 +31,4 @@ import { STextItem } from "@persagy-web/graph";
  *
  * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
-export class STooltipItem extends STextItem {} // Class STooltipItem
+export class STooltipItem extends STextItem {}

+ 2 - 2
persagy-web-big/src/items/floor/SColumnItem.ts

@@ -63,5 +63,5 @@ export class SColumnItem extends SGraphPolyGroupItem {
         super(parent, { outline: outline, style: style });
         this.data = data;
         this.zOrder = ItemOrder.columnOrder;
-    } // Constructor
-} // Class SColumnItem
+    }
+}

+ 4 - 4
persagy-web-big/src/items/floor/SDoorItem.ts

@@ -133,7 +133,7 @@ export class SDoorItem extends SGraphItem {
                 this.startAng = 0;
             }
         }
-    } // Constructor
+    }
 
     /**
      * Item 对象边界区域
@@ -142,7 +142,7 @@ export class SDoorItem extends SGraphItem {
      */
     boundingRect(): SRect {
         return new SRect(0, 0, this.r, this.r);
-    } // Function boundingRect()
+    }
 
     /**
      * Item 绘制操作
@@ -165,5 +165,5 @@ export class SDoorItem extends SGraphItem {
         //     this.startAng,
         //     this.startAng + Math.PI / 2
         // );
-    } // Function onDraw()
-} // Class SDoorItem
+    }
+}

+ 9 - 8
persagy-web-big/src/parser/SFloorParser.ts

@@ -64,6 +64,7 @@ export class SFloorParser extends SParser {
      * @param data  楼层数据
      */
     parseData(data: FloorData): void {
+        // 墙数据
         if (data.Walls) {
             data.Walls.forEach((t: Wall): void => {
                 this.addWall(t);
@@ -99,7 +100,7 @@ export class SFloorParser extends SParser {
                 this.addSpace(t);
             });
         }
-    } // Function parseData()
+    }
 
     /**
      * 添加墙至场景中
@@ -109,7 +110,7 @@ export class SFloorParser extends SParser {
     private addWall(t: Wall): void {
         let item = this.factory.createWall(t);
         this.wallList.push(item);
-    } // Function addWall()
+    }
 
     /**
      * 添加柱子至场景中
@@ -119,7 +120,7 @@ export class SFloorParser extends SParser {
     private addColumn(t: Column): void {
         let item = this.factory.createColumn(t);
         this.columnList.push(item);
-    } // Function addColumn()
+    }
 
     /**
      * 添加窗户至场景中
@@ -129,7 +130,7 @@ export class SFloorParser extends SParser {
     private addCasement(t: Casement): void {
         let item = this.factory.createWindow(t);
         this.casementList.push(item);
-    } // Function addCasement()
+    }
 
     /**
      * 添加虚拟墙至场景中
@@ -139,7 +140,7 @@ export class SFloorParser extends SParser {
     private addVirtualWall(t: VirtualWall): void {
         let item = this.factory.createVirtualWall(t);
         this.virtualWallList.push(item);
-    } // Function addVirtualWall()
+    }
 
     /**
      * 添加门至场景中
@@ -149,7 +150,7 @@ export class SFloorParser extends SParser {
     private addDoor(t: Door): void {
         let item = this.factory.createDoor(t);
         this.doorList.push(item);
-    } // Function addDoor()
+    }
 
     /**
      * 添加空间至场景中
@@ -159,5 +160,5 @@ export class SFloorParser extends SParser {
     private addSpace(t: Space): void {
         let item = this.factory.createSpace(t);
         this.spaceList.push(item);
-    } // Function addSpace()
-} // class SFloorParser
+    }
+}

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

@@ -44,5 +44,5 @@ export abstract class SParser {
         if (factory) {
             this.factory = factory;
         }
-    } // Constructor
-} // class SParser
+    }
+}

+ 5 - 5
persagy-web-big/src/parser/STopologyParser.ts

@@ -66,20 +66,20 @@ export class STopologyParser extends SParser {
                 this.addRelations(t);
             });
         }
-    } // Function parseData
+    }
 
     /**
      * 添加标识对象
      */
-    private addMarks(t: MarkerTopo): void {} // Function addMarks
+    private addMarks(t: MarkerTopo): void {}
 
     /**
      * 添加关系对象
      */
-    private addRelations(t: Relation): void {} // Function addRelations
+    private addRelations(t: Relation): void {}
 
     /**
      * 添加节点对象
      */
-    private addNodes(t: Node): void {} // Function addNodes
-} // class STopologyParser
+    private addNodes(t: Node): void {}
+}

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

@@ -46,7 +46,7 @@ export class SZoneParser extends SParser {
         if (data && data.length) {
             data.forEach((z): void => this.addZone(z));
         }
-    } // Function parseData()
+    }
 
     /**
      * 添加业务空间至场景中
@@ -56,5 +56,5 @@ export class SZoneParser extends SParser {
     private addZone(z: Zone): void {
         let item = this.factory.createZone(z);
         this.zoneList.push(item);
-    } // Function addZone()
-} // class SZoneParser
+    }
+}

+ 1 - 1
persagy-web-big/src/types/BigPoint.ts

@@ -35,4 +35,4 @@ export interface BigPoint {
     Y: number;
     /** z 坐标 */
     Z?: number;
-} // Interface BigPoint
+}

+ 1 - 1
persagy-web-big/src/types/FloorData.ts

@@ -49,4 +49,4 @@ export interface FloorData {
     Walls: Wall[];
     /** 窗户 */
     Windows: Casement[];
-} // Interface FloorData
+}

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

@@ -44,4 +44,4 @@ export interface ImageData {
     width: number;
     /** 绘制图片的高 */
     height: number;
-} // Interface ImageData
+}

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

@@ -38,4 +38,4 @@ export interface Marker {
     x: number;
     /** Y 坐标 */
     y: number;
-} // Interface Marker
+}

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

@@ -36,4 +36,4 @@ export interface MinDis {
     MinDis: number;
     /** 最短距离的点 */
     Point: Point | undefined;
-} // Interface Space
+}

+ 1 - 1
persagy-web-big/src/types/Outline.ts

@@ -36,4 +36,4 @@ export interface Outline {
     Outer: SPoint[];
     /** 内轮廓 */
     Inner: SPoint[][];
-} // Interface Outline
+}

+ 1 - 1
persagy-web-big/src/types/Place.ts

@@ -36,4 +36,4 @@ export interface Place {
     Points: BigPoint[];
     /** 类型 */
     Type: string;
-} // Interface Place
+}

+ 1 - 1
persagy-web-big/src/types/PointToLine.ts

@@ -38,4 +38,4 @@ export interface PointToLine {
     Line: SLine | undefined;
     /** 最短距离的点 */
     Point: SPoint | undefined;
-} // Interface Space
+}

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

@@ -34,4 +34,4 @@ export interface Size {
     width: number;
     /** 高 */
     height: number;
-} // Interface Size
+}

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

@@ -50,4 +50,4 @@ export interface TextData {
     textDirection?: STextDirection;
     /** 文本大小 */
     size?: number;
-} // Interface TextData
+}

+ 1 - 1
persagy-web-big/src/types/TopologyData.ts

@@ -40,4 +40,4 @@ export interface TopologyData {
     Marks: MarkerTopo[];
     /** 对象关系 */
     Relations: Relation[];
-} // interface TopologyData
+}

+ 1 - 1
persagy-web-big/src/types/floor/Casement.ts

@@ -52,4 +52,4 @@ export interface Casement {
     WallId: string;
     /** 宽度 */
     Width: string;
-} // interface Casement
+}

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

@@ -46,4 +46,4 @@ export interface Column {
     ModelId?: string;
     /** 对应 Revit 模型 id */
     SourceId?: string;
-} // Interface Column
+}

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

@@ -56,4 +56,4 @@ export interface Door {
     WallId: string;
     /** 宽度 */
     Width: string;
-} // Interface Door
+}

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

@@ -52,4 +52,4 @@ export interface Space {
     Tag?: string;
     /** 类型 */
     TypeId?: string;
-} // Interface Space
+}

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

@@ -43,4 +43,4 @@ export interface VirtualWall {
     OutLine: BigPoint[][];
     /** 对应 Revit 模型 id */
     SourceId?: string;
-} // interface VirtualWall
+}

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

@@ -49,4 +49,4 @@ export interface Wall {
     SourceId?: string;
     /** 厚度 */
     Width?: number;
-} // Interface Wall
+}

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

@@ -48,4 +48,4 @@ export interface Zone {
     Transparency?: number;
     /** 是否受影响 */
     Infected?: boolean;
-} // Interface Zone
+}

+ 1 - 1
persagy-web-big/src/types/topology/Anchor.ts

@@ -36,4 +36,4 @@ export interface Anchor {
     id: string;
     /** 位置 */
     pos: Point;
-} // interface Anchor
+}

+ 1 - 1
persagy-web-big/src/types/topology/MarkerTopo.ts

@@ -49,4 +49,4 @@ export interface MarkerTopo {
     size: Size;
     /** 由应用自己定义 */
     properties: any;
-} // interface MarkerTo
+}

+ 1 - 1
persagy-web-big/src/types/topology/Node.ts

@@ -60,4 +60,4 @@ export interface Node {
     outLine: Point[][];
     /** 由应用自己定义 */
     properties: any;
-} // interface Node
+}

+ 1 - 1
persagy-web-big/src/types/topology/Relation.ts

@@ -55,4 +55,4 @@ export interface Relation {
     pointList: Point[];
     /** 线的绘图样式 */
     style: any;
-} // interface Relation
+}

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

@@ -54,7 +54,7 @@ export class SMathUtil {
         y2: number
     ): number {
         return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
-    } // Function pointDistance()
+    }
 
     /**
      * 计算点到点集中点最小距离,返回该点和该距离
@@ -95,7 +95,7 @@ export class SMathUtil {
             }
         }
         return minDis;
-    } // Function getMinDisPoint()
+    }
 
     /**
      * 计算点到线段垂线与线段的交点
@@ -146,7 +146,7 @@ export class SMathUtil {
         }
 
         return d;
-    } // Function pointDistance()
+    }
 
     /**
      * 计算点到点集中线段最小距离,返回该点和该距离
@@ -192,7 +192,7 @@ export class SMathUtil {
             }
         }
         return PTL;
-    } // Function getMinDisPoint()
+    }
 
     /**
      * 计算矩形是否有交集(外包矩形算法)
@@ -210,7 +210,7 @@ export class SMathUtil {
             rect1.width + rect2.width > maxX - minX &&
             rect1.height + rect2.height > maxY - minY
         );
-    } // Function rectIntersection()
+    }
 
     /**
      * 计算线段交点
@@ -244,7 +244,7 @@ export class SMathUtil {
         }
 
         return null;
-    } // Function lineIntersection()
+    }
 
     /**
      * 转化数据格式为[][]
@@ -254,7 +254,7 @@ export class SMathUtil {
      */
     static transferToArray(SP: SPoint[]): number[][] {
         return SP.map((t): number[] => [t.x, t.y]);
-    } // Function transferToArray()
+    }
 
     /**
      * 转化数据格式为 SPoint[]
@@ -264,7 +264,7 @@ export class SMathUtil {
      */
     static transferToSPoint(arr: number[][]): SPoint[] {
         return arr.map((t): SPoint => new SPoint(t[0], t[1]));
-    } // Function transferToSPoint()
+    }
 
     /**
      * 计算数组中每一项的交集,并返回外轮廓与内轮廓
@@ -332,7 +332,7 @@ export class SMathUtil {
             }
         }
         return outlineList;
-    } // Function getIntersectInArray()
+    }
 
     /**
      * 计算轮廓线面积
@@ -349,5 +349,5 @@ export class SMathUtil {
         }
 
         return sum / 2;
-    } // Function calculateArea()
-} // Class SMathUtil
+    }
+}

+ 6 - 6
persagy-web-draw/src/SBrush.ts

@@ -40,21 +40,21 @@ export class SBrush {
     private _color = SColor.Black;
     get color(): SColor {
         return this._color;
-    } // Get color
+    }
     set color(value: SColor) {
         this.type = SBrushType.Color;
         this._color = value;
-    } // Set color
+    }
 
     /** 画刷渐变 */
     private _gradient: SGradient | null = null;
     get gradient(): SGradient | null {
         return this._gradient;
-    } // Get gradient
+    }
     set gradient(value: SGradient | null) {
         this._gradient = value;
         this.type = SBrushType.Gradient;
-    } // Set gradient
+    }
 
     /**
      * 构造函数
@@ -101,5 +101,5 @@ export class SBrush {
         } else {
             this.color = new SColor(brush);
         }
-    } // Constructor()
-} // Class SBrush
+    }
+}

+ 37 - 37
persagy-web-draw/src/SCanvasView.ts

@@ -47,23 +47,23 @@ export class SCanvasView extends SObject {
     protected readonly canvasView: HTMLCanvasElement;
     get canvas(): CanvasRenderingContext2D | null {
         return this.canvasView.getContext("2d") as CanvasRenderingContext2D;
-    } // Get canvas
+    }
 
     /** 宽度 */
     get width(): number {
         return this.canvasView.width;
-    } // Get width()
+    }
 
     /** 高度 */
     get height(): number {
         return this.canvasView.height;
-    } // Get height()
+    }
 
     /** 原点坐标 */
     private _origin = new SPoint();
     get origin(): SPoint {
         return this._origin;
-    } // Get origin
+    }
     set origin(v: SPoint) {
         if (!this.moveable) {
             return;
@@ -71,7 +71,7 @@ export class SCanvasView extends SObject {
         this._origin.x = v.x;
         this._origin.y = v.y;
         this._needDraw = true;
-    } // Set origin
+    }
 
     /** 可否进行平移操作 */
     moveable = true;
@@ -79,14 +79,14 @@ export class SCanvasView extends SObject {
     private _scale: number = 1;
     get scale(): number {
         return this._scale;
-    } // Get scale
+    }
     set scale(v: number) {
         if (!this.scalable) {
             return;
         }
         this._scale = v;
         this._needDraw = true;
-    } // Set scale
+    }
 
     /** 可否执行绽放操作 */
     scalable = true;
@@ -114,7 +114,7 @@ export class SCanvasView extends SObject {
     /** 鼠标样式 */
     set cursor(v: string) {
         this.canvasView.style.cursor = v;
-    } // Set cursor
+    }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //
@@ -129,14 +129,14 @@ export class SCanvasView extends SObject {
         this.bindEvent(this.canvasView);
 
         this.requestAnimationFrame(this.loop.bind(this));
-    } // Constructor
+    }
 
     /**
      * 更新视图
      */
     update(): void {
         this._needDraw = true;
-    } // Function update()
+    }
 
     /**
      * 保存图像
@@ -147,7 +147,7 @@ export class SCanvasView extends SObject {
     saveImage(name: string, type: string): void {
         let url = this.canvasView.toDataURL(`image/${type}`);
         SNetUtil.downLoad(name, url);
-    } // Function saveImage()
+    }
 
     /**
      * 图像的 URL
@@ -157,7 +157,7 @@ export class SCanvasView extends SObject {
      */
     imageUrl(type: string): string {
         return this.canvasView.toDataURL(`image/${type}`);
-    } // Function imageUrl()
+    }
 
     /**
      * 视图内容保存为 SVG 文件
@@ -169,7 +169,7 @@ export class SCanvasView extends SObject {
             new Blob([this.svgData()], { type: "text/xml,charset=UTF-8" })
         );
         SNetUtil.downLoad(name, url);
-    } // Function saveSvg()
+    }
 
     /**
      * 视图 SVG 图形的数据
@@ -181,7 +181,7 @@ export class SCanvasView extends SObject {
         let painter = new SPainter(engine);
         this.onDraw(painter);
         return engine.toSvg();
-    } // Function saveSvg()
+    }
 
     /**
      * 缩放视图时计算视图的位置与缩放比例
@@ -211,7 +211,7 @@ export class SCanvasView extends SObject {
 
         this.origin.x = x0 - (x0 - this.origin.x) * z;
         this.origin.y = y0 - (y0 - this.origin.y) * z;
-    } // Function scaleByPoint()
+    }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //
@@ -227,28 +227,28 @@ export class SCanvasView extends SObject {
             this.onDraw(painter);
         }
         this.requestAnimationFrame(this.loop.bind(this));
-    } // Function loop()
+    }
 
     /**
      * 绘制视图
      *
      * @param painter     painter 对象
      */
-    protected onDraw(painter: SPainter): void {} // Function onDraw()
+    protected onDraw(painter: SPainter): void {}
 
     /**
      * 鼠标单击事件
      *
      * @param event       事件参数
      */
-    protected onClick(event: MouseEvent): void {} // Function onClick()
+    protected onClick(event: MouseEvent): void {}
 
     /**
      * 鼠标双击事件
      *
      * @param event       事件参数
      */
-    protected onDoubleClick(event: MouseEvent): void {} // Function onDoubleClick()
+    protected onDoubleClick(event: MouseEvent): void {}
 
     /**
      * 鼠标按下事件
@@ -261,7 +261,7 @@ export class SCanvasView extends SObject {
             this._midKeyPos.x = se.x;
             this._midKeyPos.y = se.y;
         }
-    } // Function onMouseDown()
+    }
 
     /**
      * 鼠标移动事件
@@ -282,21 +282,21 @@ export class SCanvasView extends SObject {
                 return;
             }
         }
-    } // Function onMouseMove()
+    }
 
     /**
      * 鼠标松开事件
      *
      * @param event       事件参数
      */
-    protected onMouseUp(event: MouseEvent): void {} // Function onMouseUp()
+    protected onMouseUp(event: MouseEvent): void {}
 
     /**
      * 上下文菜单事件
      *
      * @param event       事件参数
      */
-    protected onContextMenu(event: MouseEvent): void {} // Function onContextMenu()
+    protected onContextMenu(event: MouseEvent): void {}
 
     /**
      * 鼠标滚轮事件
@@ -309,28 +309,28 @@ export class SCanvasView extends SObject {
         } else {
             this.scaleByPoint(1 / this.wheelZoom, event.offsetX, event.offsetY);
         }
-    } // Function onMouseWheel()
+    }
 
     /**
      * 按键按下事件
      *
      * @param event       事件参数
      */
-    protected onKeyDown(event: KeyboardEvent): void {} // Function onKeydown()
+    protected onKeyDown(event: KeyboardEvent): void {}
 
     /**
      * 按键press事件
      *
      * @param event       事件参数
      */
-    protected onKeyPress(event: KeyboardEvent): void {} // Function onKeypress()
+    protected onKeyPress(event: KeyboardEvent): void {}
 
     /**
      * 按键松开事件
      *
      * @param event       事件参数
      */
-    protected onKeyUp(event: KeyboardEvent): void {} // Function onKeyup()
+    protected onKeyUp(event: KeyboardEvent): void {}
 
     /**
      * 开始触摸事件
@@ -347,7 +347,7 @@ export class SCanvasView extends SObject {
             this._touchState = STouchState.Zoom;
             this._beforeLength = this.getDistance(event);
         }
-    } // Function onTouchStart()
+    }
 
     /**
      * 触摸移动事件
@@ -365,7 +365,7 @@ export class SCanvasView extends SObject {
         if (touches.length == 2) {
             this.viewZoom(event);
         }
-    } // Function onTouchMove()
+    }
 
     /**
      * 结束触摸事件
@@ -374,14 +374,14 @@ export class SCanvasView extends SObject {
      */
     protected onTouchEnd(event: TouchEvent): void {
         this._touchState = STouchState.None;
-    } // Function onTouchEnd()
+    }
 
     /**
      * View大小变更事件
      *
      * @param event       事件参数
      */
-    protected onResize(event: UIEvent): void {} // Function onClick()
+    protected onResize(event: UIEvent): void {}
 
     /**
      * 绑定事件
@@ -410,7 +410,7 @@ export class SCanvasView extends SObject {
 
         // 绑定窗口事件
         element.onresize = this.onResize.bind(this);
-    } // Function bindEvent()
+    }
 
     /**
      * 启动动画帧(即指定时间执行回调函数)
@@ -425,7 +425,7 @@ export class SCanvasView extends SObject {
         }, timeToCall);
         this._lastFrameTime = currTime + timeToCall;
         return id;
-    } // Function requestAnimationFrame()
+    }
 
     /**
      * 缩放视图
@@ -448,7 +448,7 @@ export class SCanvasView extends SObject {
             }
         }
         return true;
-    } // Function onTouchMove()
+    }
 
     /**
      * 获取两手指之间的距离
@@ -464,7 +464,7 @@ export class SCanvasView extends SObject {
         let dx = event.touches[0].clientX - event.touches[1].clientX;
         let dy = event.touches[0].clientY - event.touches[1].clientY;
         return Math.sqrt(dx * dx + dy * dy);
-    } // Function getDistance()
+    }
 
     /**
      * 获得两个手指触摸点的中点坐标
@@ -477,5 +477,5 @@ export class SCanvasView extends SObject {
             (event.touches[0].clientX + event.touches[1].clientX) / 2,
             (event.touches[0].clientY + event.touches[1].clientY) / 2
         );
-    } // Function getMiddlePoint()
-} // Class SCanvasView
+    }
+}

+ 18 - 18
persagy-web-draw/src/SColor.ts

@@ -92,51 +92,51 @@ export class SColor {
      */
     static rgba(r: number, g: number, b: number, a: number): SColor {
         return new SColor(r, g, b, a);
-    } // Function rgb()
+    }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 属性定义
     /** 红色分量 */
     get red(): number {
         return (this._value >> 24) & 0xff;
-    } // Get red
+    }
     set red(v: number) {
         const r = (Math.floor(v) & 0xff) << 24;
         this._value = (this._value & 0x00ffffff) | r;
-    } // Set red
+    }
 
     /** 绿色分量 */
     get green(): number {
         return (this._value >> 16) & 0xff;
-    } // Get green
+    }
     set green(v: number) {
         const r = (Math.floor(v) & 0xff) << 16;
         this._value = (this._value & 0xff00ffff) | r;
-    } //Set green
+    }
 
     /** 蓝色分量 */
     get blue(): number {
         return (this._value >> 8) & 0xff;
-    } // Get blue
+    }
     set blue(v: number) {
         const r = (Math.floor(v) & 0xff) << 8;
         this._value = (this._value & 0xffff00ff) | r;
-    } // Set blue
+    }
 
     /** 透明度 */
     get alpha(): number {
         return this._value & 0xff;
-    } // Get alpha
+    }
     set alpha(v: number) {
         const r = Math.floor(v) & 0xff;
         this._value = (this._value & 0xffffff00) | r;
-    } // Set alpha
+    }
 
     /** 颜色 */
     private _value = 0xff;
     get value(): string {
         return "#" + SStringUtil.num2Hex(this._value, 8);
-    } // Get value
+    }
     set value(v: string) {
         if (v.substr(0, 1) != "#") {
             return;
@@ -148,7 +148,7 @@ export class SColor {
         if (v.length == 7) {
             this._value = (this._value << 8) + 0xff;
         }
-    } // Set value
+    }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 构造函数
@@ -215,7 +215,7 @@ export class SColor {
         } else {
             this.setRgba(r as number, g as number, b as number, a as number);
         }
-    } // Constructor
+    }
 
     /**
      * 设置颜色
@@ -230,7 +230,7 @@ export class SColor {
             ((g as number) << 16) +
             ((b as number) << 8) +
             0xff;
-    } // Function setRgb()
+    }
 
     /**
      * 设置颜色
@@ -246,7 +246,7 @@ export class SColor {
             ((g as number) << 16) +
             ((b as number) << 8) +
             (a as number);
-    } // Function setRgba()
+    }
 
     /**
      * 颜色转 rgb
@@ -255,7 +255,7 @@ export class SColor {
      */
     toRgb(): string {
         return `rgb(${this.red}, ${this.green}, ${this.blue})`;
-    } // Function toRgb()
+    }
 
     /**
      * 颜色转 rgba
@@ -265,7 +265,7 @@ export class SColor {
     toRgba(): string {
         return `rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha /
             255.0})`;
-    } // Function toRgb()
+    }
 
     /**
      * 颜色转 616 进制
@@ -274,5 +274,5 @@ export class SColor {
      */
     toVal(): string {
         return "#" + SStringUtil.num2Hex(this._value, 6);
-    } // Function toRgb()
-} // Class SColor
+    }
+}

+ 2 - 2
persagy-web-draw/src/SFont.ts

@@ -91,5 +91,5 @@ export class SFont {
             this.name = name;
             this.size = size != undefined ? size : 16;
         }
-    } // Constructor
-} // Class SFont
+    }
+}

+ 12 - 12
persagy-web-draw/src/SGradient.ts

@@ -43,34 +43,34 @@ export abstract class SGradient {
     /** 起点 X 坐标 */
     get x1(): number {
         return this.start.x;
-    } // Get x1
+    }
     set x1(value: number) {
         this.start.x = value;
-    } // Set x1
+    }
 
     /** 起点 Y 坐标 */
     get y1(): number {
         return this.start.y;
-    } // Get y1
+    }
     set y1(value: number) {
         this.start.y = value;
-    } // Set y1
+    }
 
     /** 终点 X 坐标 */
     get x2(): number {
         return this.end.x;
-    } // Get x2
+    }
     set x2(value: number) {
         this.end.x = value;
-    } // Set x2
+    }
 
     /** 终点 Y 坐标 */
     get y2(): number {
         return this.end.y;
-    } // Get y2
+    }
     set y2(value: number) {
         this.end.y = value;
-    } // Set y2
+    }
 
     /** 渐变颜色节点列表 */
     stopList: SGradientStop[] = [];
@@ -83,7 +83,7 @@ export abstract class SGradient {
      */
     addColorStop(pos: number, color: SColor): void {
         this.stopList.push(new SGradientStop(pos, color));
-    } // Function addColorStop()
+    }
 
     /**
      * 设置起点坐标
@@ -94,7 +94,7 @@ export abstract class SGradient {
     setStart(x: number, y: number): void {
         this.start.x = x;
         this.start.y = y;
-    } // Function setStart()
+    }
 
     /**
      * 设置终点坐标
@@ -105,7 +105,7 @@ export abstract class SGradient {
     setEnd(x: number, y: number): void {
         this.end.x = x;
         this.end.y = y;
-    } // Function setEnd()
+    }
 
     /**
      * 转为字符串保存
@@ -113,4 +113,4 @@ export abstract class SGradient {
      * @return 转为字符串保存
      */
     abstract value(): string;
-} // Class SGradientStop
+}

+ 4 - 4
persagy-web-draw/src/SGradientStop.ts

@@ -36,7 +36,7 @@ export class SGradientStop {
     private _pos: number = 0;
     get pos(): number {
         return this._pos;
-    } // Get pos
+    }
     set pos(value: number) {
         if (value < 0) {
             value = 0;
@@ -45,7 +45,7 @@ export class SGradientStop {
             value = 1;
         }
         this._pos = value;
-    } // Set pos
+    }
     /** 颜色 */
     color: SColor;
 
@@ -58,5 +58,5 @@ export class SGradientStop {
     constructor(pos: number, color: SColor) {
         this.pos = pos;
         this.color = color;
-    } // Constructor()
-} // Class SGradientStop
+    }
+}

+ 3 - 3
persagy-web-draw/src/SLinearGradient.ts

@@ -72,7 +72,7 @@ export class SLinearGradient extends SGradient {
             this.start = new SPoint(x1 as number, y1 as number);
             this.end = new SPoint(x2 as number, y2 as number);
         }
-    } // Constructor()
+    }
 
     /**
      * 转为字符串保存
@@ -87,5 +87,5 @@ export class SLinearGradient extends SGradient {
             str += `${t.pos},${t.color.value};`;
         });
         return `${str}}`;
-    } // Function value()
-} // Class SGradientBrush
+    }
+}

+ 41 - 41
persagy-web-draw/src/SPainter.ts

@@ -57,56 +57,56 @@ export class SPainter extends SObject {
     /** 画笔 */
     get pen(): SPen {
         return this.engine.state.pen;
-    } // Get pen
+    }
     set pen(value: SPen) {
         this.engine.state.pen = value;
-    } // Set pen
+    }
 
     /** 画刷 */
     get brush(): SBrush {
         return this.engine.state.brush;
-    } // Get brush
+    }
     set brush(value: SBrush) {
         this.engine.state.brush = value;
-    } // Set brush
+    }
 
     /** 字体属性 */
     get font(): SFont {
         return this.engine.state.font;
-    } // Get font
+    }
     set font(value: SFont) {
         this.engine.state.font = value;
         this.engine.changeFont(value);
-    } // Set font
+    }
 
     /** 融合属性 */
     get composite(): number {
         return this.engine.state._composite;
-    } // Get composite
+    }
     set composite(value: number) {
         this.engine.state._composite = value;
-    } // Set composite
+    }
 
     /** 阴影设置 */
     get shadow(): SShadow {
         return this.engine.state.shadow;
-    } // Get shadow
+    }
     set shadow(value: SShadow) {
         this.engine.state.shadow = value;
-    } // Set shadow
+    }
 
     /** 裁剪设置 */
     get clip(): SPath | undefined {
         return this.engine.state.clip;
-    } // Get clip
+    }
     set clip(value: SPath | undefined) {
         this.engine.state.clip = value;
-    } // Set clip
+    }
 
     /** 变换矩阵 */
     get worldTransform(): SMatrix {
         return this.engine.state.matrix;
-    } // Get worldTransform
+    }
 
     /**
      * 构造函数
@@ -127,21 +127,21 @@ export class SPainter extends SObject {
         this.font = new SFont();
         this.composite = SCompositeType.SourceOver;
         this.shadow = new SShadow();
-    } // Constructor()
+    }
 
     /**
      * 保存 painter 状态
      */
     save(): void {
         this.engine.save();
-    } // Function save()
+    }
 
     /**
      * 恢复 painter 状态
      */
     restore(): void {
         this.engine.restore();
-    } // Function restore()
+    }
 
     // =================================================================================================================
     // 变换相关
@@ -153,7 +153,7 @@ export class SPainter extends SObject {
      */
     translate(x: number, y: number): void {
         this.engine.translate(x, y);
-    } // Function translate()
+    }
 
     /**
      * 缩放
@@ -163,7 +163,7 @@ export class SPainter extends SObject {
      */
     scale(x: number, y: number): void {
         this.engine.scale(x, y);
-    } // Function scale()
+    }
 
     /**
      * 旋转
@@ -172,7 +172,7 @@ export class SPainter extends SObject {
      */
     rotate(angle: number): void {
         this.engine.rotate(angle);
-    } // Function rotate()
+    }
 
     /**
      * 将当前的变形矩阵乘上一个基于自身参数的矩阵
@@ -193,7 +193,7 @@ export class SPainter extends SObject {
         dy: number
     ): void {
         this.engine.transform(m11, m12, m21, m22, dx, dy);
-    } // Function transform()
+    }
 
     /**
      * 将当前的变形矩阵重置为单位矩阵,再将当前的变形矩阵乘上一个基于自身参数的矩阵
@@ -214,14 +214,14 @@ export class SPainter extends SObject {
         dy: number
     ): void {
         this.engine.setTransform(m11, m12, m21, m22, dx, dy);
-    } // Function transform()
+    }
 
     /**
      * 重置当前变形为单位矩阵。等价于调用 setTransform(1, 0, 0, 1, 0, 0)
      */
     resetTransform(): void {
         this.engine.resetTransform();
-    } // Function resetTransform()
+    }
 
     // =================================================================================================================
     // 绘制相关
@@ -284,7 +284,7 @@ export class SPainter extends SObject {
                 new SRect(x as number, y as number, w as number, h as number)
             );
         }
-    } // Function clearRect()
+    }
 
     /**
      * 绘制矩形
@@ -350,7 +350,7 @@ export class SPainter extends SObject {
                 new SRect(x as number, y as number, w as number, h as number)
             );
         }
-    } // Function drawRect()
+    }
 
     /**
      * 绘制带导角矩形
@@ -430,7 +430,7 @@ export class SPainter extends SObject {
         if (rect != null && r != null) {
             this.engine.drawRoundRect(rect, r);
         }
-    } // Function drawRoundRect()
+    }
 
     /**
      * 绘制圆形
@@ -441,7 +441,7 @@ export class SPainter extends SObject {
      */
     drawCircle(cx: number, cy: number, r: number): void {
         this.engine.drawCircle(cx, cy, r);
-    } // Function drawCircle()
+    }
 
     /**
      * 绘制椭圆
@@ -453,7 +453,7 @@ export class SPainter extends SObject {
      */
     drawEllipse(cx: number, cy: number, rx: number, ry: number): void {
         this.engine.drawEllipse(cx, cy, rx, ry);
-    } // Function drawEllipse()
+    }
 
     /**
      * 绘制一条线段
@@ -508,7 +508,7 @@ export class SPainter extends SObject {
                 )
             );
         }
-    } // Function drawLine()
+    }
 
     /**
      * 绘制折线
@@ -517,7 +517,7 @@ export class SPainter extends SObject {
      */
     drawPolyline(points: SPoint[]): void {
         this.engine.drawPolyline(points);
-    } // Function drawPolyline()
+    }
 
     /**
      * 绘制多边形
@@ -526,7 +526,7 @@ export class SPainter extends SObject {
      */
     drawPolygon(points: SPoint[]): void {
         this.engine.drawPolygon(points);
-    } // Function drawPolygon()
+    }
 
     /**
      * 绘制路径
@@ -535,7 +535,7 @@ export class SPainter extends SObject {
      */
     drawPath(path: SPath): void {
         this.engine.drawPath(path);
-    } // Function drawPath()
+    }
 
     /**
      * 绘制文本
@@ -547,7 +547,7 @@ export class SPainter extends SObject {
      */
     drawText(text: string, x: number, y: number, maxWidth?: number): void {
         this.engine.drawText(text, x, y, maxWidth);
-    } // Function drawText()
+    }
 
     /**
      * 绘制图片
@@ -566,7 +566,7 @@ export class SPainter extends SObject {
         height?: number
     ): void {
         this.engine.drawImage(img, x, y, width, height);
-    } // Function drawImage()
+    }
 
     /**
      * painter 转实现 view 象素
@@ -575,7 +575,7 @@ export class SPainter extends SObject {
      */
     toPx(p: number): number {
         return p / this.engine.state.matrix.a;
-    } // Function painterToView()
+    }
 
     /**
      * 预测量文本宽度
@@ -682,7 +682,7 @@ export class SPainter extends SObject {
                 }
             }
         }
-    } // Function drawArrowLine()
+    }
 
     /**
      * 私有计算方法-绘制线段末端标准箭头
@@ -721,7 +721,7 @@ export class SPainter extends SObject {
             ]);
         }
         this.restore();
-    } // Function drawArrow()
+    }
 
     /**
      * 私有计算方法-绘制线段末端三角形箭头
@@ -760,7 +760,7 @@ export class SPainter extends SObject {
             ]);
         }
         this.restore();
-    } // Function drawTriangleArrow()
+    }
 
     /**
      * 私有计算方法-绘制线段末端菱形箭头
@@ -801,7 +801,7 @@ export class SPainter extends SObject {
             ]);
         }
         this.restore();
-    } // Function drawDiamondArrow()
+    }
 
     /**
      * 私有计算方法-绘制线段末端方形箭头
@@ -839,7 +839,7 @@ export class SPainter extends SObject {
             ]);
         }
         this.restore();
-    } // Function drawSquareArrow()
+    }
 
     /**
      * 私有计算方法-绘制线段末端圆形箭头
@@ -867,5 +867,5 @@ export class SPainter extends SObject {
             this.engine.drawCircle(d / 2, 0, d / 2);
         }
         this.restore();
-    } // Function drawCircleArrow()
-} // Class SPainter
+    }
+}

+ 13 - 13
persagy-web-draw/src/SPath.ts

@@ -44,7 +44,7 @@ export class SPath {
      */
     private addCommand(cmd: string, ...args: number[]): void {
         this.cmdList.push({ command: cmd, args: args });
-    } // Function addCommand()
+    }
 
     /**
      * 添加一条新路径到对当前路径。
@@ -53,14 +53,14 @@ export class SPath {
      */
     addPath(path: SPath): void {
         this.cmdList = this.cmdList.concat(path.cmdList);
-    } // Function addPath()
+    }
 
     /**
      * 使笔点返回到当前子路径的起始点。它尝试从当前点到起始点绘制一条直线。 如果图形已经是封闭的或者只有一个点,那么此函数不会做任何操作。
      */
     closePath(): void {
         this.addCommand("Z");
-    } // Function closePath()
+    }
 
     /**
      * 移动当前点到指定位置
@@ -70,7 +70,7 @@ export class SPath {
      */
     moveTo(x: number, y: number): void {
         this.addCommand("M", x, y);
-    } // Function moveTo()
+    }
 
     /**
      * 从当前点向指定点画线
@@ -80,7 +80,7 @@ export class SPath {
      */
     lineTo(x: number, y: number): void {
         this.addCommand("L", x, y);
-    } // Function lineTo()
+    }
 
     /**
      * 添加一条圆弧路径。
@@ -109,7 +109,7 @@ export class SPath {
             endAngle,
             anticlockwise
         );
-    } // Function arc()
+    }
 
     /**
      * 根据控制点和半径添加一条圆弧路径,使用直线连接前一个点。
@@ -128,7 +128,7 @@ export class SPath {
         radius: number
     ): void {
         this.addCommand("ArcTo", x1, y1, x2, y2, radius);
-    } // Function arcTo()
+    }
 
     /**
      * 添加二次贝塞尔曲线
@@ -140,7 +140,7 @@ export class SPath {
      */
     quadraticCurveTo(cp1x: number, cp1y: number, x: number, y: number): void {
         this.addCommand("Q", cp1x, cp1y, x, y);
-    } // Function quadraticCurveTo()
+    }
 
     /**
      * 添加三次贝塞尔曲线
@@ -161,7 +161,7 @@ export class SPath {
         y: number
     ): void {
         this.addCommand("C", cp1x, cp1y, cp2x, cp2y, x, y);
-    } // Function bezierCurveTo()
+    }
 
     /**
      * 添加椭圆
@@ -173,7 +173,7 @@ export class SPath {
      */
     ellipse(cx: number, cy: number, rx: number, ry: number): void {
         this.addCommand("Ellipse", cx, cy, rx, ry);
-    } // Function ellipse()
+    }
 
     /**
      * 添加矩形
@@ -189,7 +189,7 @@ export class SPath {
         this.addCommand("L", x + w, y + h);
         this.addCommand("L", x, y + h);
         this.addCommand("Z");
-    } // Function rect()
+    }
 
     /**
      * 添加多边形
@@ -204,5 +204,5 @@ export class SPath {
             }
             this.addCommand("Z");
         }
-    } // Function polygon()
-} // Class SPath
+    }
+}

+ 2 - 2
persagy-web-draw/src/SPen.ts

@@ -100,5 +100,5 @@ export class SPen {
             this.color = new SColor(color);
             this.lineWidth = lineWidth != undefined ? lineWidth : 1;
         }
-    } // Constructor()
-} // Class SPen
+    }
+}

+ 3 - 3
persagy-web-draw/src/SRadialGradient.ts

@@ -96,7 +96,7 @@ export class SRadialGradient extends SGradient {
             this.r1 = r1 as number;
             this.r2 = r2 as number;
         }
-    } // Constructor()
+    }
 
     /**
      * 转为字符串保存
@@ -110,5 +110,5 @@ export class SRadialGradient extends SGradient {
             str += `${t.pos},${t.color.value};`;
         });
         return `${str}}`;
-    } // Function value()
-} // Class SRadialGradient
+    }
+}

+ 2 - 2
persagy-web-draw/src/SShadow.ts

@@ -80,5 +80,5 @@ export class SShadow {
             this.shadowBlur = blur;
             this.shadowColor = color || SColor.Black;
         }
-    } // Constructor
-} // Class SShadow
+    }
+}

+ 32 - 32
persagy-web-draw/src/engines/SCanvasPaintEngine.ts

@@ -73,7 +73,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      */
     get type(): SPaintEngineType {
         return SPaintEngineType.Canvas;
-    } // Get type
+    }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 构造函数
@@ -86,8 +86,8 @@ export class SCanvasPaintEngine extends SPaintEngine {
         super();
         this._canvas = canvas;
         this._canvas.imageSmoothingEnabled = true;
-        // this._canvas.imageSmoothingQuality;
-    } // Constructor()
+
+    }
 
     // =================================================================================================================
     // 绘制图形
@@ -100,7 +100,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
     clearRect(rect: SRect): void {
         this.setMatrix();
         this._canvas.clearRect(rect.x, rect.y, rect.width, rect.height);
-    } // Function clearRect()
+    }
 
     /**
      * 绘制矩形
@@ -114,7 +114,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             this._canvas.stroke();
             this._canvas.fill();
         });
-    } // Function drawRect()
+    }
 
     /**
      * 绘制圆形
@@ -130,7 +130,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             this._canvas.fill();
             this._canvas.stroke();
         });
-    } // Function drawCircle()
+    }
 
     /**
      * 绘制椭圆
@@ -147,7 +147,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             this._canvas.fill();
             this._canvas.stroke();
         });
-    } // Function drawEllipse()
+    }
 
     /**
      * 绘制线段
@@ -161,7 +161,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             this._canvas.lineTo(line.x2, line.y2);
             this._canvas.stroke();
         });
-    } // Function drawLine()
+    }
 
     /**
      * 绘制折线
@@ -182,7 +182,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             }
             this._canvas.stroke();
         });
-    } // Function drawPolyline()
+    }
 
     /**
      * 绘制多边形
@@ -206,7 +206,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             this._canvas.fill();
             this._canvas.stroke();
         });
-    } // Function drawPolygon()
+    }
 
     /**
      * 绘制路径
@@ -217,7 +217,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         this.init((): void => {
             this.drawWay(path);
         });
-    } // Function drawPath()
+    }
 
     /**
      * 绘制文本
@@ -236,7 +236,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
                 this._canvas.fillText(text, x, y, maxWidth);
             }
         });
-    } // Function drawText()
+    }
 
     /**
      * 绘制图片
@@ -265,7 +265,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
                 console.log(e);
             }
         });
-    } // Function drawImage()
+    }
 
     /**
      * 预测量文本宽度
@@ -275,7 +275,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      */
     textWidth(text: string): number {
         return this._canvas.measureText(text).width;
-    } // Function textWidth()
+    }
 
     /**
      * 绘制二次贝塞尔曲线
@@ -287,7 +287,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      */
     quadraticCurveTo(cp1x: number, cp1y: number, x: number, y: number): void {
         this._canvas.quadraticCurveTo(cp1x, cp1y, x, y);
-    } // Function quadraticCurveTo()
+    }
 
     /**
      * 绘制三次贝塞尔曲线
@@ -308,7 +308,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         y: number
     ): void {
         this._canvas.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
-    } // Function bezierCurveTo()
+    }
 
     /**
      * 绘制带导角空心矩形
@@ -346,7 +346,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             this._canvas.fill();
             this._canvas.stroke();
         });
-    } // Function drawRoundRect()
+    }
 
     /**
      * 设置字体
@@ -358,7 +358,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         this.setTextAlign(font.textAlign);
         this.setBaseLine(font.textBaseLine);
         this.setTextDirection(font.textDirection);
-    } // Function changeFont()
+    }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 私有函数
@@ -376,7 +376,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         this.setShadow();
         this.setClip();
         fn();
-    } // Function init()
+    }
 
     /**
      * 设置画笔
@@ -400,7 +400,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         }
 
         this.setLineCapStyle(this.state.pen.lineCapStyle);
-    } // Function setPen()
+    }
 
     /**
      * 线段端点风格
@@ -416,7 +416,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         } else {
             this._canvas.lineCap = "butt";
         }
-    } // Set lineCapStyle
+    }
 
     /**
      * 设置画刷
@@ -461,7 +461,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
                 this._canvas.fillStyle = drawGradient;
             }
         }
-    } // Function setBrush()
+    }
 
     /**
      * 设置融合
@@ -469,7 +469,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
     private setComposite(): void {
         this._canvas.globalCompositeOperation =
             SCanvasPaintEngine.gcoList[this.state._composite];
-    } // Function setComposite()
+    }
 
     /**
      * 设置阴影
@@ -490,7 +490,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             this._canvas.shadowOffsetX = 0;
             this._canvas.shadowOffsetY = 0;
         }
-    } // Function setShadow()
+    }
 
     /**
      * 设置字体
@@ -500,7 +500,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         this.setTextAlign(this.state.font.textAlign);
         this.setBaseLine(this.state.font.textBaseLine);
         this.setTextDirection(this.state.font.textDirection);
-    } // Function setFont()
+    }
 
     /**
      * 文本对齐选项
@@ -522,7 +522,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         } else {
             this._canvas.textAlign = "right";
         }
-    } // Function setTextAlign()
+    }
 
     /**
      * 设置文本基线对齐选项
@@ -546,7 +546,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         } else {
             this._canvas.textBaseline = "bottom";
         }
-    } // Set textBaseLine()
+    }
 
     /**
      * 设置文本方向选项
@@ -564,7 +564,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
         } else {
             this._canvas.direction = "rtl";
         }
-    } // Set textDirection
+    }
 
     /**
      * 设置变型矩阵
@@ -578,7 +578,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             this.state.matrix.e,
             this.state.matrix.f
         );
-    } // Function setMatrix()
+    }
 
     /**
      * 设置裁剪路径
@@ -589,7 +589,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
             this.drawWay(this.state.clip);
             this._canvas.clip();
         }
-    } // Function setClip()
+    }
 
     /**
      * 绘制路径
@@ -651,5 +651,5 @@ export class SCanvasPaintEngine extends SPaintEngine {
         });
         this._canvas.fill();
         this._canvas.stroke();
-    } // Function drawWay()
-} // class SPaintEngine
+    }
+}

+ 11 - 11
persagy-web-draw/src/engines/SPaintEngine.ts

@@ -38,10 +38,10 @@ export abstract class SPaintEngine {
     private _state = new SPaintState();
     get state(): SPaintState {
         return this._state;
-    } // Get state
+    }
     set state(value: SPaintState) {
         this._state = value;
-    } // Set state
+    }
 
     /** 状态栈 */
     private stateStack = new Array<SPaintState>();
@@ -55,7 +55,7 @@ export abstract class SPaintEngine {
     save(): void {
         let state = new SPaintState(this.state);
         this.stateStack.push(state);
-    } // Function save()
+    }
 
     /**
      * 恢复 painter 状态
@@ -64,7 +64,7 @@ export abstract class SPaintEngine {
         if (this.stateStack.length > 0) {
             this.state = this.stateStack.pop() as SPaintState;
         }
-    } // Function restore()
+    }
 
     // =================================================================================================================
     // 变换相关
@@ -76,7 +76,7 @@ export abstract class SPaintEngine {
      */
     translate(x: number, y: number): void {
         this.state.matrix.translate(x, y);
-    } // Function translate()
+    }
 
     /**
      * 缩放
@@ -86,7 +86,7 @@ export abstract class SPaintEngine {
      */
     scale(x: number, y: number): void {
         this.state.matrix.scale(x, y);
-    } // Function scale()
+    }
 
     /**
      * 旋转
@@ -95,7 +95,7 @@ export abstract class SPaintEngine {
      */
     rotate(angle: number): void {
         this.state.matrix.rotate(0, 0, angle);
-    } // Function rotate()
+    }
 
     /**
      * 将当前的变形矩阵乘上一个基于自身参数的矩阵
@@ -114,7 +114,7 @@ export abstract class SPaintEngine {
         m22: number,
         dx: number,
         dy: number
-    ): void {} // Function transform()
+    ): void {}
 
     /**
      * 将当前的变形矩阵重置为单位矩阵,再将当前的变形矩阵乘上一个基于自身参数的矩阵
@@ -133,14 +133,14 @@ export abstract class SPaintEngine {
         m22: number,
         dx: number,
         dy: number
-    ): void {} // Function transform()
+    ): void {}
 
     /**
      * 重置当前变形为单位矩阵。等价于调用 setTransform(1, 0, 0, 1, 0, 0)
      */
     resetTransform(): void {
         this.state.matrix = new SMatrix();
-    } // Function resetTransform()
+    }
 
     // =================================================================================================================
     // 绘制图形
@@ -259,4 +259,4 @@ export abstract class SPaintEngine {
      * @param r       导角半径
      */
     abstract drawRoundRect(rect: SRect, r: number): void;
-} // class SPaintEngine
+}

+ 12 - 12
persagy-web-draw/src/engines/SPaintState.ts

@@ -42,28 +42,28 @@ export class SPaintState {
     private _pen = new SPen();
     get pen(): SPen {
         return this._pen;
-    } // Get pen
+    }
     set pen(value: SPen) {
         this._pen = value;
-    } // Set pen
+    }
 
     /** 画刷 */
     private _brush = new SBrush();
     get brush(): SBrush {
         return this._brush;
-    } // Get brush
+    }
     set brush(value: SBrush) {
         this._brush = value;
-    } // Set brush
+    }
 
     /** 字体 */
     private _font = new SFont();
     get font(): SFont {
         return this._font;
-    } // Get font
+    }
     set font(value: SFont) {
         this._font = value;
-    } // Set font
+    }
 
     /** 融合 */
     _composite = SCompositeType.SourceOver;
@@ -72,16 +72,16 @@ export class SPaintState {
     private _shadow: SShadow = new SShadow();
     get shadow(): SShadow {
         return this._shadow;
-    } // Set shadow
+    }
     set shadow(v: SShadow) {
         this._shadow = v;
-    } // Set shadow
+    }
 
     /** 裁剪 */
     private _clip: SPath | undefined;
     get clip(): SPath | undefined {
         return this._clip;
-    } // Set clip
+    }
     set clip(v: SPath | undefined) {
         if (v) {
             this._clip = new SPath();
@@ -89,7 +89,7 @@ export class SPaintState {
         } else {
             this._clip = v;
         }
-    } // Set clip
+    }
 
     /**
      * 构造函数
@@ -123,5 +123,5 @@ export class SPaintState {
             m.m44 = state.matrix.m44;
             this.matrix = m;
         }
-    } // Constructor
-} // class SPaintState
+    }
+}

+ 22 - 22
persagy-web-draw/src/engines/SSvgPaintEngine.ts

@@ -60,7 +60,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      */
     get type(): SPaintEngineType {
         return SPaintEngineType.SVG;
-    } // Get type
+    }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 构造函数
@@ -86,7 +86,7 @@ export class SSvgPaintEngine extends SPaintEngine {
         this._builder.append(
             `version="${this.version}" width="${w}" height="${h}">`
         );
-    } // Constructor
+    }
 
     /**
      * 转 svg 图像
@@ -95,7 +95,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      */
     toSvg(): string {
         return this._builder.toString("\n") + "</svg>\n";
-    } // Function toSvg()
+    }
 
     // =================================================================================================================
     // 绘制图形
@@ -105,7 +105,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      *
      * @param rect  矩形
      */
-    clearRect(rect: SRect): void {} // Function clearRect()
+    clearRect(rect: SRect): void {}
 
     /**
      * 绘制空心矩形
@@ -114,12 +114,12 @@ export class SSvgPaintEngine extends SPaintEngine {
      */
     drawRect(rect: SRect): void {
         this._builder.append(
-            // eslint-disable-next-line max-len
+
             `<rect x="${rect.x}" y="${rect.y}" width="${rect.width}" height="${
                 rect.height
             }" ${this.getStyle(true, true, false)} ${this.getSvgMatrix()}/>`
         );
-    } // Function drawRects()
+    }
 
     /**
      * 绘制圆形
@@ -136,7 +136,7 @@ export class SSvgPaintEngine extends SPaintEngine {
                 false
             )} ${this.getSvgMatrix()}/>`
         );
-    } // Function drawCircle()
+    }
 
     /**
      * 绘制椭圆
@@ -154,7 +154,7 @@ export class SSvgPaintEngine extends SPaintEngine {
                 false
             )} ${this.getSvgMatrix()}/>`
         );
-    } // Function drawEllipse()
+    }
 
     /**
      * 绘制线段
@@ -167,7 +167,7 @@ export class SSvgPaintEngine extends SPaintEngine {
                 line.y2
             }" ${this.getStyle(false, true, false)} ${this.getSvgMatrix()}/>`
         );
-    } // Function drawLine()
+    }
 
     /**
      * 绘制折线
@@ -180,7 +180,7 @@ export class SSvgPaintEngine extends SPaintEngine {
                 points
             )}" ${this.getStyle(false, true, false)} ${this.getSvgMatrix()}/>`
         );
-    } // Function drawPolyline()
+    }
 
     /**
      * 绘制多边形
@@ -193,7 +193,7 @@ export class SSvgPaintEngine extends SPaintEngine {
                 points
             )}" ${this.getStyle(true, true, false)} ${this.getSvgMatrix()}/>`
         );
-    } // Function drawPolyline()
+    }
 
     /**
      * 绘制路径
@@ -201,14 +201,14 @@ export class SSvgPaintEngine extends SPaintEngine {
      * @param path  路径
      */
     drawPath(path: SPath): void {
-        // this._builder.append(
+
         //     `<path d="${path.svgPath()}" ${this.getStyle(
         //         true,
         //         true,
         //         false
         //     )} ${this.getSvgMatrix()}/>`
         // );
-    } // Function drawPath()
+    }
 
     /**
      * 绘制文本
@@ -226,7 +226,7 @@ export class SSvgPaintEngine extends SPaintEngine {
                 true
             )} ${this.getSvgMatrix()}>${text}</text>>`
         );
-    } // Function drawText()
+    }
 
     /**
      * 绘制图片
@@ -245,7 +245,7 @@ export class SSvgPaintEngine extends SPaintEngine {
         height?: number
     ): void {
         // TODO: 未完成
-    } // Function drawImage()
+    }
 
     /**
      * 预测量文本宽度
@@ -255,14 +255,14 @@ export class SSvgPaintEngine extends SPaintEngine {
      */
     textWidth(text: string): number {
         return 0;
-    } // Function textWidth()
+    }
 
     /**
      * 设置字体
      *
      * @param font  字体
      */
-    changeFont(font: SFont): void {} // Function changeFont()
+    changeFont(font: SFont): void {}
 
     /**
      * 获得svg需要的变形信息
@@ -272,7 +272,7 @@ export class SSvgPaintEngine extends SPaintEngine {
     private getSvgMatrix(): string {
         // eslint-disable-next-line max-len
         return `transform="matrix(${this.state.matrix.a}, ${this.state.matrix.b}, ${this.state.matrix.c}, ${this.state.matrix.d}, ${this.state.matrix.e}, ${this.state.matrix.f})"`;
-    } // Function getMatrix()
+    }
 
     /**
      * 将点列表转换为字符串表达形式
@@ -286,7 +286,7 @@ export class SSvgPaintEngine extends SPaintEngine {
             strBuilder.append(`${p.x},${p.y}`);
         }
         return strBuilder.toString(" ");
-    } // Function pointsToStr()
+    }
 
     /** 获得风格 */
     private getStyle(
@@ -330,10 +330,10 @@ export class SSvgPaintEngine extends SPaintEngine {
         }
         builder.append('"');
         return builder.toString("");
-    } // Get penStyle
+    }
 
     /**
      * 绘制圆角矩形
      */
-    drawRoundRect(): void {} // Function drawRoundRect()
-} // Class SSvgPaintEngine
+    drawRoundRect(): void {}
+}

+ 1 - 1
persagy-web-draw/src/enums/SArrowStyleType.ts

@@ -42,4 +42,4 @@ export enum SArrowStyleType {
     Square,
     /** 圆形类型 */
     Circle
-} // Enum SArrowStyleType
+}

+ 1 - 1
persagy-web-draw/src/enums/SAspectRatioMode.ts

@@ -36,4 +36,4 @@ export enum SAspectRatioMode {
     KeepAspectRatio,
     /** 自由缩放,保存纵横比 */
     KeepAspectRatioByExpanding
-} // Enum SAspectRatioMode
+}

+ 1 - 1
persagy-web-draw/src/enums/SBrushType.ts

@@ -34,4 +34,4 @@ export enum SBrushType {
     Color,
     /** 渐变 */
     Gradient
-} // Enum SBrushType
+}

+ 1 - 1
persagy-web-draw/src/enums/SCompositeType.ts

@@ -52,4 +52,4 @@ export enum SCompositeType {
     SourceOver,
     /** 使用异或操作对源图像与目标图像进行组合。 */
     Xor
-} // Enum SCompositeType
+}

+ 1 - 1
persagy-web-draw/src/enums/SLineCapStyle.ts

@@ -36,4 +36,4 @@ export enum SLineCapStyle {
     Round,
     /** 线段末端以方形结束,但是增加了一个宽度和线段相同,高度是线段厚度一半的矩形区域。 */
     Square
-} // Enum SLineCapStyle
+}

+ 1 - 1
persagy-web-draw/src/enums/SLineJoinStyle.ts

@@ -36,4 +36,4 @@ export enum SLineJoinStyle {
     Round,
     /** 在相连部分的末端填充一个额外的以三角形为底的区域, 每个部分都有各自独立的矩形拐角。 */
     Bevel
-} // Enum SLineJoinStyle
+}

+ 1 - 1
persagy-web-draw/src/enums/SPaintEngineType.ts

@@ -38,4 +38,4 @@ export enum SPaintEngineType {
     OpenGL,
     /** 图片绘制引擎 */
     Image
-} // Enum SPaintEngineType
+}

+ 1 - 1
persagy-web-draw/src/enums/STextAlign.ts

@@ -40,4 +40,4 @@ export enum STextAlign {
     Left,
     /** 文本的中心被放置在指定的位置 */
     Center
-} // Enum STextAlign
+}

+ 1 - 1
persagy-web-draw/src/enums/STextBaseLine.ts

@@ -42,4 +42,4 @@ export enum STextBaseLine {
     Ideographic,
     /** 文本基线是 em 方框的底端 */
     Bottom
-} // Enum STextBaseLine
+}

+ 1 - 1
persagy-web-draw/src/enums/STextDirection.ts

@@ -36,4 +36,4 @@ export enum STextDirection {
     LTR,
     /** 文本方向从右向左 */
     RTL
-} // Enum STextDirection
+}

+ 1 - 1
persagy-web-draw/src/types/SArrow.ts

@@ -36,4 +36,4 @@ export interface SArrow {
     begin: SArrowStyleType;
     /** 箭头终点样式 */
     end: SArrowStyleType;
-} // Class SArrow
+}

+ 15 - 15
persagy-web-draw/src/types/SLine.ts

@@ -45,40 +45,40 @@ export class SLine {
     } // Get x1
     set x1(value: number) {
         this.p1.x = value;
-    } // Set x1
+    }
 
     /** 属性 Y1 */
     get y1(): number {
         return this.p1.y;
-    } // Get y1
+    }
     set y1(value: number) {
         this.p1.y = value;
-    } // Set y1
+    }
 
     /** 属性 X2 */
     get x2(): number {
         return this.p2.x;
-    } // Get x2
+    }
     set x2(v: number) {
         this.p2.x = v;
-    } // Set x2
+    }
 
     /** 属性 Y2 */
     get y2(): number {
         return this.p2.y;
-    } // Get y2
+    }
     set y2(value: number) {
         this.p2.y = value;
-    } // Set y2
+    }
 
     /** 属性 dx */
     get dx(): number {
         return this.p2.x - this.p1.x;
-    } // Get dx
+    }
     /** 属性 dy */
     get dy(): number {
         return this.p2.y - this.p1.y;
-    } // Get dy()
+    }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 构造函数
@@ -139,7 +139,7 @@ export class SLine {
             this.p1 = new SPoint(x1 as number, y1 as number);
             this.p2 = new SPoint(x2 as number, y2 as number);
         }
-    } // constructor
+    }
 
     /**
      * 判断线段是否为空
@@ -151,7 +151,7 @@ export class SLine {
             Math.abs(this.p1.x - this.p2.x) + Math.abs(this.p1.y - this.p2.y) <
             0.000001
         );
-    } // Function isNull()
+    }
 
     /**
      * 返回线段的中点
@@ -163,7 +163,7 @@ export class SLine {
             (this.p1.x + this.p2.x) / 2,
             (this.p1.y + this.p2.y) / 2
         );
-    } // Function center()
+    }
 
     /**
      * 平移线段
@@ -176,7 +176,7 @@ export class SLine {
         this.p2.x += dx;
         this.p1.y += dy;
         this.p2.y += dy;
-    } // Function translate()
+    }
 
     /**
      * 生成平移线段
@@ -192,5 +192,5 @@ export class SLine {
             this.p2.x + dx,
             this.p2.y + dy
         );
-    } // Function translate()
-} // Class SLine
+    }
+}

+ 6 - 6
persagy-web-draw/src/types/SPoint.ts

@@ -78,7 +78,7 @@ export class SPoint {
             this.x = x as number;
             this.y = y as number;
         }
-    } // Constructor()
+    }
 
     /**
      * 设置点
@@ -109,7 +109,7 @@ export class SPoint {
             this.x = x as number;
             this.y = y as number;
         }
-    } // Function setPoint()
+    }
 
     /**
      * 布线长度
@@ -119,7 +119,7 @@ export class SPoint {
     manhattanLength(): number {
         // noinspection JSSuspiciousNameCombination
         return Math.abs(this.x) + Math.abs(this.y);
-    } // Function manhattanLength()
+    }
 
     /**
      * 返回点矩阵变换后的值
@@ -131,7 +131,7 @@ export class SPoint {
         p.x = this.x * mat.a + this.y * mat.b + mat.e;
         p.y = this.x * mat.c + this.y * mat.d + mat.f;
         return p;
-    } // Function matrixTransform()
+    }
 
     /**
      * 平移点
@@ -142,5 +142,5 @@ export class SPoint {
     translate(dx: number, dy: number): void {
         this.x += dx;
         this.y += dy;
-    } // Function translate()
-} // Class SPoint
+    }
+}

+ 0 - 0
persagy-web-draw/src/types/SRect.ts


Some files were not shown because too many files changed in this diff