haojianlong před 4 roky
rodič
revize
671ac7840f

+ 25 - 7
package-lock.json

@@ -1064,11 +1064,11 @@
       "integrity": "sha512-gnItoKBjjv+kbcDfnY8f9EMMVPRJgXXgebdSEj2NTsNmygpdsjQBaqQ6AfDUYzRaWwP53sdmFHeidOCYcqg0RA=="
     },
     "@saga-web/big": {
-      "version": "1.0.35",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/big/-/big-1.0.35.tgz",
-      "integrity": "sha512-0VMastxCUglX2mOgIfwJT2uPT9SaMiOwtYlk+J5HQJf1ANwhWkgtYmQ0FPLL0v8l+QhX601iKCQsrZ8UsLagFg==",
+      "version": "1.0.36",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/big/-/big-1.0.36.tgz",
+      "integrity": "sha512-8rbW+NtK0p74P938LBdXG4yr5JR4EJd0tI98bwk/No1xYFT1EoAAMXCTcpCRpifU76GH5fnunIr8adns+F7dAQ==",
       "requires": {
-        "@saga-web/graph": "2.1.78"
+        "@saga-web/graph": "2.1.79"
       }
     },
     "@saga-web/draw": {
@@ -1085,12 +1085,30 @@
       "integrity": "sha512-t43r0jYpaUu1Pa1g1Vbbzkqhw6kGX++VuDvEjduCjepNHNJXZFSlFjSwsTy5Zun1dtqMvXzKqThpWcIpEgtZjA==",
       "requires": {
         "@saga-web/big": "1.0.35"
+      },
+      "dependencies": {
+        "@saga-web/big": {
+          "version": "1.0.35",
+          "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/big/-/big-1.0.35.tgz",
+          "integrity": "sha512-0VMastxCUglX2mOgIfwJT2uPT9SaMiOwtYlk+J5HQJf1ANwhWkgtYmQ0FPLL0v8l+QhX601iKCQsrZ8UsLagFg==",
+          "requires": {
+            "@saga-web/graph": "2.1.78"
+          }
+        },
+        "@saga-web/graph": {
+          "version": "2.1.78",
+          "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.78.tgz",
+          "integrity": "sha512-pnNMSY+zy2QuHsMaSTdJs0qVcyuq6yToCGYhpKrLQF4tCcjuaLnAnhvbUHm9Tv8XlWAGGtO8BlXDwOoHK0vxYA==",
+          "requires": {
+            "@saga-web/draw": "2.1.90"
+          }
+        }
       }
     },
     "@saga-web/graph": {
-      "version": "2.1.78",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.78.tgz",
-      "integrity": "sha512-pnNMSY+zy2QuHsMaSTdJs0qVcyuq6yToCGYhpKrLQF4tCcjuaLnAnhvbUHm9Tv8XlWAGGtO8BlXDwOoHK0vxYA==",
+      "version": "2.1.79",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.79.tgz",
+      "integrity": "sha512-rrMrpg/jrohxvOlQZb8dHchBx329h0f6gWVWctWFEpurZ/aerJ2Ey/EkTXupmUkBIaf+jcpyAGTmnj7os2SmKg==",
       "requires": {
         "@saga-web/draw": "2.1.90"
       }

+ 2 - 2
package.json

@@ -9,10 +9,10 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.16",
-    "@saga-web/big": "1.0.35",
+    "@saga-web/big": "1.0.36",
     "@saga-web/draw": "2.1.90",
     "@saga-web/feng-map": "1.0.8",
-    "@saga-web/graph": "2.1.78",
+    "@saga-web/graph": "2.1.79",
     "@saga-web/topology": "1.0.84",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",

+ 15 - 0
src/lib/enums/SGraphElementType.ts

@@ -0,0 +1,15 @@
+/**
+ * 图标,区域类型
+ *
+ * @author  张宇
+ */
+export enum SGraphElementType {
+    /** 非图例    */
+    None,
+    /** 线类型    */
+    Line,
+    /** 区域类型    */
+    Zone,
+    /** 图类型    */
+    Image
+} // Enum SGraphElementType

+ 13 - 0
src/lib/enums/SMarkerType.ts

@@ -0,0 +1,13 @@
+/**
+ * 标识对象类型
+ *
+ * @author  张宇
+ */
+export enum SMarkerType {
+    /** 图标    */
+    Image,
+    /** 线类型    */
+    Line,
+    /** 文本类型    */
+    Text
+} // Enum SMarkerType

+ 25 - 0
src/lib/items/SImageLegendItem.ts

@@ -0,0 +1,25 @@
+
+import { SGraphItem } from "@saga-web/graph/lib";
+import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
+import { Legend } from '../types/Legend';
+
+/**
+ * 图例节点Item(图标类型)
+ *
+ * * @author  张宇(taohuzy@163.com)
+ */
+export class SImageLegendItem extends SIconTextItem {
+    /** 图例节点对象数据 */
+    data: Legend;
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      图例节点对象数据
+     */
+    constructor(parent: SGraphItem | null, data: Legend) {
+        super(parent);
+        this.data = data;
+    }
+} // Class SImageLegendItem

+ 156 - 0
src/lib/items/SImageMarkerItem.ts

@@ -0,0 +1,156 @@
+
+import { SGraphItem, SImageItem, SImageShowType } from "@saga-web/graph/lib";
+import { SPainter } from "@saga-web/draw";
+import { Marker } from '../types/Marker';
+
+/**
+ * 标识对象Item(图标类型)
+ *
+ * * @author  张宇(taohuzy@163.com)
+ */
+export class SImageMarkerItem extends SImageItem {
+    /** 标识对象数据 */
+    data: Marker;
+
+    /** x轴缩放属性 */
+    _scaleX: number = 1;
+    get scaleX(): number {
+        return this._scaleX;
+    }
+    set scaleX(v: number) {
+        this._scaleX = v;
+        if (this.data.Scale) {
+            this.data.Scale.X = v;
+        }
+        this.update();
+    }
+
+    /** y轴缩放属性 */
+    _scaleY: number = 1;
+    get scaleY(): number {
+        return this._scaleY;
+    }
+    set scaleY(v: number) {
+        this._scaleY = v;
+        if (this.data.Scale) {
+            this.data.Scale.Y = v;
+        }
+        this.update();
+    }
+
+    /** y轴旋转属性 */
+    _rolate: number = 0;
+    get rolate(): number {
+        return this._rolate;
+    }
+    set rolate(v: number) {
+        this._rolate = v;
+        if (this.data.Rolate) {
+            this.data.Rolate.Z = v;
+        }
+        this.update();
+    }
+
+    set name(v: string) {
+        this.data.Name = v;
+    }
+
+    set url(v: string) {
+        if (this.data.Properties) {
+            this.data.Properties.Url = v;
+        }
+    }
+
+    set x(v: number) {
+        this.data.Pos.X = v;
+    }
+
+    set y(v: number) {
+        this.data.Pos.Y = v;
+    }
+
+    set width(v: number) {
+        if (this.data.Size) {
+            this.data.Size.Width = v;
+        }
+    }
+
+    set height(v: number) {
+        if (this.data.Size) {
+            this.data.Size.Height = v;
+        }
+    }
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      标识对象数据
+     */
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent);
+        this.data = data;
+        this.moveTo(data.Pos.X, data.Pos.Y);
+        if (this.data.Scale) {
+            this.scaleX = this.data.Scale.X;
+            this.scaleY = this.data.Scale.Y;
+        }
+        if (this.data.Rolate && this.data.Rolate.Z) {
+            this.rolate = this.data.Rolate.Z;
+        }
+        if (this.data.Size) {
+            this.width = this.data.Size.Width;
+            this.height = this.data.Size.Height;
+        }
+        if (this.data.Properties && this.data.Properties.Url) {
+            if (this.data.Properties.Url instanceof String) {
+                this.url = this.data.Properties.Url;
+            }
+        }
+    } // Constructor
+
+    /**
+     * Item绘制操作
+     *
+     * @param   painter      绘画类
+     */
+    onDraw(painter: SPainter): void {
+        if (this.img) {
+            // 要绘制图片的宽度
+            let width = 0;
+            // 要绘制图片的宽度
+            let height = 0;
+            // 图片item的宽高比
+            let itemAspectRatio: number = this.width / this.height;
+            // 原始图片的宽高比
+            let imgAspectRatio: number =
+                (this.img.width as number) / (this.img.height as number);
+            // 原始图片的高宽比
+            let imgHwRatio: number =
+                (this.img.height as number) / (this.img.width as number);
+            if (this.showType == SImageShowType.Full) {
+                width = this.width;
+                height = this.height;
+            } else if (this.showType == SImageShowType.Equivalency) {
+                if (itemAspectRatio > imgAspectRatio) {
+                    height = this.height;
+                    width = imgAspectRatio * height;
+                } else if (itemAspectRatio < imgAspectRatio) {
+                    width = this.width;
+                    height = width * imgHwRatio;
+                } else {
+                    width = this.width;
+                    height = this.height;
+                }
+            } else if (this.showType == SImageShowType.AutoFit) {
+                this.width = this.img.width as number;
+                this.height = this.img.height as number;
+                width = this.width;
+                height = this.height;
+            }
+            painter.scale(this.scaleX, this.scaleY);
+            painter.rotate(this.rolate);
+            painter.drawImage(this.img, -width / 2, -height / 2, width, height);
+        }
+    } // Function onDraw()
+} // Class SImageMarkerItem

+ 110 - 0
src/lib/items/SLineLegendItem.ts

@@ -0,0 +1,110 @@
+
+import { SGraphItem } from "@saga-web/graph/lib";
+import { SPoint } from "@saga-web/draw/lib";
+import { SPolylineItem } from '@saga-web/big/lib';
+import { Legend } from '../types/Legend';
+
+/**
+ * 图例节点Item(线类型)
+ *
+ * * @author  张宇(taohuzy@163.com)
+ */
+export class SLineLegendItem extends SPolylineItem {
+    /** 图例节点对象数据 */
+    data: Legend;
+
+    /** x轴缩放属性 */
+    _scaleX: number = 1;
+    get scaleX(): number {
+        return this._scaleX;
+    }
+    set scaleX(v: number) {
+        this._scaleX = v;
+        if (this.data.Scale) {
+            this.data.Scale.X = v;
+        }
+        this.update();
+    }
+
+    /** y轴缩放属性 */
+    _scaleY: number = 1;
+    get scaleY(): number {
+        return this._scaleY;
+    }
+    set scaleY(v: number) {
+        this._scaleY = v;
+        if (this.data.Scale) {
+            this.data.Scale.Y = v;
+        }
+        this.update();
+    }
+
+    /** y轴旋转属性 */
+    _rolate: number = 0;
+    get rolate(): number {
+        return this._rolate;
+    }
+    set rolate(v: number) {
+        this._rolate = v;
+        if (this.data.Rolate) {
+            this.data.Rolate.Z = v;
+        }
+        this.update();
+    }
+
+    set name(v: string) {
+        this.data.Name = v;
+    }
+
+    set line(arr: SPoint[]) {
+        if (this.data.Properties) {
+            this.data.Properties.Line = arr;
+        }
+    }
+
+    set x(v: number) {
+        this.data.Pos.X = v;
+    }
+
+    set y(v: number) {
+        this.data.Pos.Y = v;
+    }
+
+    set width(v: number) {
+        if (this.data.Size) {
+            this.data.Size.Width = v;
+        }
+    }
+
+    set height(v: number) {
+        if (this.data.Size) {
+            this.data.Size.Height = v;
+        }
+    }
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      图例节点对象数据
+     */
+    constructor(parent: SGraphItem | null, data: Legend) {
+        super(parent,[]);
+        this.data = data;
+        this.moveTo(data.Pos.X, data.Pos.Y);
+        if (this.data.Scale) {
+            this.scaleX = this.data.Scale.X;
+            this.scaleY = this.data.Scale.Y;
+        }
+        if (this.data.Rolate && this.data.Rolate.Z) {
+            this.rolate = this.data.Rolate.Z;
+        }
+        if (this.data.Size) {
+            this.width = this.data.Size.Width;
+            this.height = this.data.Size.Height;
+        }
+        if (this.data.Properties && this.data.Properties.Line) {
+            this.line = this.data.Properties.Line;
+        }
+    }
+} // Class SLineLegendItem

+ 110 - 0
src/lib/items/SLineMarkerItem.ts

@@ -0,0 +1,110 @@
+
+import { SGraphItem } from "@saga-web/graph/lib";
+import { SPoint } from "@saga-web/draw/lib";
+import { SPolylineItem } from '@saga-web/big/lib';
+import { Marker } from '../types/Marker';
+
+/**
+ * 标识对象Item(线类型)
+ *
+ * * @author  张宇(taohuzy@163.com)
+ */
+export class SLineMarkerItem extends SPolylineItem {
+    /** 标识对象数据 */
+    data: Marker;
+
+    /** x轴缩放属性 */
+    _scaleX: number = 1;
+    get scaleX(): number {
+        return this._scaleX;
+    }
+    set scaleX(v: number) {
+        this._scaleX = v;
+        if (this.data.Scale) {
+            this.data.Scale.X = v;
+        }
+        this.update();
+    }
+
+    /** y轴缩放属性 */
+    _scaleY: number = 1;
+    get scaleY(): number {
+        return this._scaleY;
+    }
+    set scaleY(v: number) {
+        this._scaleY = v;
+        if (this.data.Scale) {
+            this.data.Scale.Y = v;
+        }
+        this.update();
+    }
+
+    /** y轴旋转属性 */
+    _rolate: number = 0;
+    get rolate(): number {
+        return this._rolate;
+    }
+    set rolate(v: number) {
+        this._rolate = v;
+        if (this.data.Rolate) {
+            this.data.Rolate.Z = v;
+        }
+        this.update();
+    }
+
+    set name(v: string) {
+        this.data.Name = v;
+    }
+
+    set line(arr: SPoint[]) {
+        if (this.data.Properties) {
+            this.data.Properties.Line = arr;
+        }
+    }
+
+    set x(v: number) {
+        this.data.Pos.X = v;
+    }
+
+    set y(v: number) {
+        this.data.Pos.Y = v;
+    }
+
+    set width(v: number) {
+        if (this.data.Size) {
+            this.data.Size.Width = v;
+        }
+    }
+
+    set height(v: number) {
+        if (this.data.Size) {
+            this.data.Size.Height = v;
+        }
+    }
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      标识对象数据
+     */
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent,[]);
+        this.data = data;
+        this.moveTo(data.Pos.X, data.Pos.Y);
+        if (this.data.Scale) {
+            this.scaleX = this.data.Scale.X;
+            this.scaleY = this.data.Scale.Y;
+        }
+        if (this.data.Rolate && this.data.Rolate.Z) {
+            this.rolate = this.data.Rolate.Z;
+        }
+        if (this.data.Size) {
+            this.width = this.data.Size.Width;
+            this.height = this.data.Size.Height;
+        }
+        if (this.data.Properties && this.data.Properties.Line) {
+            this.line = this.data.Properties.Line;
+        }
+    } // Constructor
+} // Class SLineMarkerItem

+ 23 - 0
src/lib/items/SNoneLegendItem.ts

@@ -0,0 +1,23 @@
+import { SGraphItem } from "@saga-web/graph/lib";
+import { Legend } from '../types/Legend';
+
+/**
+ * 图例节点Item(非图例类型)
+ *
+ * * @author  张宇(taohuzy@163.com)
+ */
+export class SNoneLegendItem extends SGraphItem {
+    /** 图例节点对象数据 */
+    data: Legend;
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      图例节点对象数据
+     */
+    constructor(parent: SGraphItem | null, data: Legend) {
+        super(parent);
+        this.data = data;
+    }
+} // Class SNoneLegendItem

+ 124 - 0
src/lib/items/STextMarkerItem.ts

@@ -0,0 +1,124 @@
+import { SGraphItem, STextItem } from "@saga-web/graph/lib";
+import { SPainter, SColor } from "@saga-web/draw";
+import { Marker } from '../types/Marker';
+
+/**
+ * 标识对象Item(文本类型)
+ *
+ * * @author  张宇(taohuzy@163.com)
+ */
+export class STextMarkerItem extends STextItem {
+    /** 标识对象数据 */
+    data: Marker;
+
+    /** x轴缩放属性 */
+    _scaleX: number = 1;
+    get scaleX(): number {
+        return this._scaleX;
+    }
+    set scaleX(v: number) {
+        this._scaleX = v;
+        if (this.data.Scale) {
+            this.data.Scale.X = v;
+        }
+        this.update();
+    }
+
+    /** y轴缩放属性 */
+    _scaleY: number = 1;
+    get scaleY(): number {
+        return this._scaleY;
+    }
+    set scaleY(v: number) {
+        this._scaleY = v;
+        if (this.data.Scale) {
+            this.data.Scale.Y = v;
+        }
+        this.update();
+    }
+
+    /** y轴旋转属性 */
+    _rolate: number = 0;
+    get rolate(): number {
+        return this._rolate;
+    }
+    set rolate(v: number) {
+        this._rolate = v;
+        if (this.data.Rolate) {
+            this.data.Rolate.Z = v;
+        }
+        this.update();
+    }
+
+    set name(v: string) {
+        this.data.Name = v;
+    }
+
+    set text(v: string) {
+        if (this.data.Properties) {
+            this.data.Properties.Text = v;
+        }
+    }
+
+    set x(v: number) {
+        this.data.Pos.X = v;
+    }
+
+    set y(v: number) {
+        this.data.Pos.Y = v;
+    }
+
+    set width(v: number) {
+        if (this.data.Size) {
+            this.data.Size.Width = v;
+        }
+    }
+
+    set height(v: number) {
+        if (this.data.Size) {
+            this.data.Size.Height = v;
+        }
+    }
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      标识对象数据
+     */
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent);
+        this.data = data;
+        this.moveTo(data.Pos.X, data.Pos.Y);
+        if (this.data.Scale) {
+            this.scaleX = this.data.Scale.X;
+            this.scaleY = this.data.Scale.Y;
+        }
+        if (this.data.Rolate && this.data.Rolate.Z) {
+            this.rolate = this.data.Rolate.Z;
+        }
+        if (this.data.Size) {
+            this.width = this.data.Size.Width;
+            this.height = this.data.Size.Height;
+        }
+        if (this.data.Properties && this.data.Properties.Text) {
+            if (this.data.Properties.Text instanceof String) {
+                this.text = this.data.Properties.Text;
+            }
+        }
+    } // Constructor
+
+    /**
+     * Item绘制操作
+     *
+     * @param   painter      绘画类
+     */
+    onDraw(painter: SPainter): void {
+        // 绘制文本
+        painter.brush.color = new SColor(this.color);
+        painter.font = this.font;
+        painter.scale(this.scaleX, this.scaleY);
+        painter.rotate(this.rolate);
+        this.drawFormatText(painter);
+    } // Function onDraw()
+} // Class STextMarkerItem

+ 25 - 0
src/lib/items/SZoneLegendItem.ts

@@ -0,0 +1,25 @@
+
+import { SGraphItem } from "@saga-web/graph/lib";
+import { SPolygonItem } from "@saga-web/big/lib";
+import { Legend } from '../types/Legend';
+
+/**
+ * 图例节点Item(区域类型)
+ *
+ * * @author  张宇(taohuzy@163.com)
+ */
+export class SZoneLegendItem extends SPolygonItem {
+    /** 图例节点对象数据 */
+    data: Legend;
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      图例节点对象数据
+     */
+    constructor(parent: SGraphItem | null, data: Legend) {
+        super(parent);
+        this.data = data;
+    }
+} // Class SZoneLegendItem

+ 111 - 0
src/lib/parsers/STopologyParser.ts

@@ -0,0 +1,111 @@
+import { ElementData } from "../types/ElementData";
+import { Legend } from "../types/Legend";
+import { Marker } from "../types/Marker";
+import { Relation } from "../types/Relation";
+import { SGraphElementType } from "../enums/SGraphElementType";
+import { SMarkerType } from "../enums/SMarkerType";
+import { SParser, SRelation } from '@saga-web/big/lib';
+import { SNoneLegendItem } from '../items/SNoneLegendItem';
+import { SLineLegendItem } from '../items/SLineLegendItem';
+import { SZoneLegendItem } from '../items/SZoneLegendItem';
+import { SImageLegendItem } from '../items/SImageLegendItem';
+import { SImageMarkerItem } from '../items/SImageMarkerItem';
+import { SLineMarkerItem } from '../items/SLineMarkerItem';
+import { STextMarkerItem } from '../items/STextMarkerItem';
+
+/**
+ * 拓扑图信息解析器
+ *
+ */
+export class STopologyParser extends SParser {
+    /** 图例list(非图例类型)   */
+    noneLegendList: SNoneLegendItem[] = [];
+    /** 图例list(线类型)   */
+    lineLegendList: SLineLegendItem[] = [];
+    /** 图例list(区域类型)   */
+    zoneLegendList: SZoneLegendItem[] = [];
+    /** 图例list(图标类型)   */
+    imageLegendList: SImageLegendItem[] = [];
+
+    /** 标识list(图类型)   */
+    imageMarkerList: SImageMarkerItem[] = [];
+    /** 标识list(线类型)   */
+    lineMarkerList: SLineMarkerItem[] = [];
+    /** 标识list(文本类型)   */
+    textMarkerList: STextMarkerItem[] = [];
+
+    /** 管线关系对象关系list   */
+    relationList: SRelation[] = [];
+
+    /**
+     * 解析数据
+     *
+     * @param   data    系统图数据
+     * */
+    parseData(data: ElementData): void {
+        if (data.Nodes) {
+            data.Nodes.forEach((t: Legend): void => {
+                this.addLegend(t);
+            });
+        }
+        if (data.Markers) {
+            data.Markers.forEach((t: Marker): void => {
+                this.addMarker(t);
+            });
+        }
+        if (data.Relations) {
+            data.Relations.forEach((t: Relation): void => {
+                this.addRelation(t);
+            });
+        }
+    } // Function parseData()
+
+    /**
+     * 添加图例节点至场景中
+     *
+     * @param   t       图例节点数据
+     * */
+    private addLegend(t: Legend): void {
+        if (t.GraphElementType == SGraphElementType.None) {
+            let item = this.factory.createNoneLegend(t);
+            this.noneLegendList.push(item);
+        } else if (t.GraphElementType == SGraphElementType.Line) {
+            let item = this.factory.createLineLegend(t);
+            this.lineLegendList.push(item);
+        } else if (t.GraphElementType == SGraphElementType.Zone) {
+            let item = this.factory.createZoneLegend(t);
+            this.zoneLegendList.push(item);
+        } else if (t.GraphElementType == SGraphElementType.Image) {
+            let item = this.factory.createImageLegend(t);
+            this.imageLegendList.push(item);
+        }
+    } // Function addNode()
+
+    /**
+     * 添加标识对象至场景中
+     *
+     * @param   t       标识对象数据
+     * */
+    private addMarker(t: Marker): void {
+        if (t.Type == SMarkerType.Image) {
+            let item = this.factory.createImageMarker(t);
+            this.imageMarkerList.push(item);
+        } else if (t.Type == SMarkerType.Line) {
+            let item = this.factory.createLineMarker(t);
+            this.lineMarkerList.push(item);
+        } else if (t.Type == SMarkerType.Text) {
+            let item = this.factory.createTextMarker(t);
+            this.textMarkerList.push(item);
+        }
+    } // Function addMarker()
+
+    /**
+     * 添加管线关系至场景中
+     *
+     * @param   t       管线关系对象数据
+     * */
+    private addRelation(t: Relation): void {
+        let item = this.factory.createRelation(t);
+        this.relationList.push(item);
+    } // Function addRelation()
+} // class STopologyParser

+ 33 - 0
src/lib/types/Anchor.ts

@@ -0,0 +1,33 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "../Point";
+
+/**
+ * 锚点item接口
+ *
+ * @author  张宇
+ */
+export interface Anchor {
+    /** 锚点ID */
+    ID: string;
+    /** 锚点的坐标  */
+    Pos: Point;
+} // Interface Anchor

+ 34 - 0
src/lib/types/ElementData.ts

@@ -0,0 +1,34 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Legend } from "./topology/Legend";
+import { Marker } from "./topology/Marker";
+import { Relation } from "./topology/Relation";
+
+/**
+ * 系统图数据接口
+ *
+ * @author  张宇
+ */
+export interface ElementData {
+    Nodes: Legend[];
+    Markers: Marker[];
+    Relations: Relation[];
+} // Interface ElementData

+ 56 - 0
src/lib/types/Legend.ts

@@ -0,0 +1,56 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "../Point";
+import { Size } from "../Size";
+import { Anchor } from "./Anchor";
+import { SGraphElementType } from "../../enums/SGraphElementType";
+
+/**
+ * 图例节点接口
+ *
+ * @author  张宇
+ */
+export interface Legend {
+    /** ID */
+    ID: string;
+    /** 名称  */
+    Name: string;
+    /** 返回工程信息化对象 ID 列表 */
+    AttachObjectIds?: string[];
+    /** 图标,区域类型  */
+    GraphElementType: SGraphElementType;
+    /** 对应的图例ID  */
+    GraphElementId: string;
+    /** 位置  */
+    Pos: Point;
+    /** 缩放  */
+    Scale?: Point;
+    /** 旋转  */
+    Rolate?: Point;
+    /** 大小  */
+    Size?: Size;
+    /** 锚点List  */
+    AnchorList?: Anchor[];
+    /** 轮廓线  */
+    OutLine?: Point[][];
+    /** 由应用自己定义  */
+    Properties?: any;
+} // Interface Legend

+ 47 - 0
src/lib/types/Marker.ts

@@ -0,0 +1,47 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "../Point";
+import { Size } from "../Size";
+import { SMarkerType } from "../../enums/SMarkerType";
+
+/**
+ * 标识对象接口
+ *
+ * @author  张宇
+ */
+export interface Marker {
+    /** ID */
+    ID: string;
+    /** 名称  */
+    Name: string;
+    /** 图标(Image),线类型(Line) */
+    Type: SMarkerType;
+    /** 位置  */
+    Pos: Point;
+    /** 缩放  */
+    Scale?: Point;
+    /** 旋转  */
+    Rolate?: Point;
+    /** 大小  */
+    Size?: Size;
+    /** 由应用自己定义  */
+    Properties?: any;
+} // Interface Marker

+ 53 - 0
src/lib/types/Relation.ts

@@ -0,0 +1,53 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { Point } from "../Point";
+import { SRelationDir } from "../../enums/SRelationDir";
+import { SLineType } from "../../enums/SLineType";
+
+/**
+ * 管线对象关系接口
+ *
+ * @author  张宇
+ */
+export interface Relation {
+    /** ID */
+    ID: string;
+    /** 名称 */
+    Name: string;
+    /** 对应的图例ID */
+    GraphElementId: string;
+    /** 关联节点1_id */
+    Node1ID?: string;
+    /** 关联节点2_id */
+    Node2ID?: string;
+    /** 关联锚点1_id  */
+    Anchor1ID?: string;
+    /** 关联锚点2_id */
+    Anchor2ID?: string;
+    /** 方向(0:无向,1:节点1到节点2,2:节点2到节点1) */
+    Dir?: SRelationDir;
+    /** 线类型(0:直线,1:水平/垂直线,2:曲线) */
+    LineType: SLineType;
+    /** 线的顶点坐标 */
+    PointList: Point[];
+    /** 线的绘图样式 */
+    Style?: string;
+} // Interface Relation