|
@@ -12,20 +12,19 @@ import { SWindowItem } from "../items/floor/SWindowItem";
|
|
|
import { Casement } from "../types/floor/Casement";
|
|
|
import { SZoneItem } from "../items/floor/ZoneItem";
|
|
|
import { Zone } from "../types/floor/Zone";
|
|
|
-import { ImageData } from "../types/ImageData";
|
|
|
import { Legend } from "../types/topology/Legend";
|
|
|
import { Marker } from "../types/topology/Marker";
|
|
|
import { Relation } from "../types/topology/Relation";
|
|
|
-import { Anchor } from "../types/topology/Anchor";
|
|
|
-import { SLineType } from "../enums/SLineType";
|
|
|
-import { SAnchorItem, SEntityItem, SImageItem, SMarkerItem } from "..";
|
|
|
import {
|
|
|
- SRelation,
|
|
|
- SLineRelation,
|
|
|
SVerticalRelation,
|
|
|
- SCurveRelation
|
|
|
+ SNoneLegendItem,
|
|
|
+ SLineLegendItem,
|
|
|
+ SZoneLegendItem,
|
|
|
+ SImageLegendItem,
|
|
|
+ SImageMarkerItem,
|
|
|
+ SLineMarkerItem,
|
|
|
+ STextMarkerItem
|
|
|
} from "..";
|
|
|
-import {SGraphElementType} from "../enums/SGraphElementType";
|
|
|
|
|
|
/**
|
|
|
* 拓扑图信息解析器
|
|
@@ -110,46 +109,67 @@ export class SItemFactory {
|
|
|
} // Function createZone()
|
|
|
|
|
|
/**
|
|
|
- * 创建图片item
|
|
|
+ * 创建图例节点item(非图例类型)
|
|
|
*
|
|
|
- * @param data 图片数据
|
|
|
+ * @param data 图例节点数据
|
|
|
+ * */
|
|
|
+ createNoneLegend(data: Legend): SNoneLegendItem {
|
|
|
+ return new SNoneLegendItem(null, data);
|
|
|
+ } // Function createNoneLegend()
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建图例节点item(线类型)
|
|
|
+ *
|
|
|
+ * @param data 图例节点数据
|
|
|
* */
|
|
|
- createImage(data: ImageData): SImageItem {
|
|
|
- return new SImageItem(null);
|
|
|
- } // Function createImage()
|
|
|
+ createLineLegend(data: Legend): SLineLegendItem {
|
|
|
+ return new SLineLegendItem(null, data);
|
|
|
+ } // Function createLineLegend()
|
|
|
|
|
|
/**
|
|
|
- * 创建文本item
|
|
|
+ * 创建图例节点item(区域类型)
|
|
|
*
|
|
|
- * @param data 文本数据
|
|
|
+ * @param data 图例节点数据
|
|
|
* */
|
|
|
- // createText(data: TextData): STextItem {
|
|
|
- // return new STextItem(null);
|
|
|
- // } // Function createImage()
|
|
|
+ createZoneLegend(data: Legend): SZoneLegendItem {
|
|
|
+ return new SZoneLegendItem(null, data);
|
|
|
+ } // Function createZoneLegend()
|
|
|
|
|
|
/**
|
|
|
- * 创建图例节点item
|
|
|
+ * 创建图例节点item(图标类型)
|
|
|
*
|
|
|
* @param data 图例节点数据
|
|
|
* */
|
|
|
- createNode(data: Legend): SEntityItem {
|
|
|
- if (data.GraphElementType == SGraphElementType.None) {
|
|
|
- return new SEntityItem(null, data);
|
|
|
- }
|
|
|
- if (data.GraphElementType == SGraphElementType.Line) {
|
|
|
+ createImageLegend(data: Legend): SImageLegendItem {
|
|
|
+ return new SImageLegendItem(null, data);
|
|
|
+ } // Function createImageLegend()
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建标识item(图类型)
|
|
|
+ *
|
|
|
+ * @param data 标识对象数据
|
|
|
+ * */
|
|
|
+ createImageMarker(data: Marker): SImageMarkerItem {
|
|
|
+ return new SImageMarkerItem(null, data);
|
|
|
+ } // Function createImageMarker()
|
|
|
|
|
|
- }
|
|
|
- return new SEntityItem(null, data);
|
|
|
- } // Function createNode()
|
|
|
+ /**
|
|
|
+ * 创建标识item(线类型)
|
|
|
+ *
|
|
|
+ * @param data 标识对象数据
|
|
|
+ * */
|
|
|
+ createLineMarker(data: Marker): SLineMarkerItem {
|
|
|
+ return new SLineMarkerItem(null, data);
|
|
|
+ } // Function createLineMarker()
|
|
|
|
|
|
/**
|
|
|
- * 创建标识item
|
|
|
+ * 创建标识item(文本类型)
|
|
|
*
|
|
|
* @param data 标识对象数据
|
|
|
* */
|
|
|
- createMarker(data: Marker): SMarkerItem {
|
|
|
- return new SMarkerItem(null, data);
|
|
|
- } // Function createMarker()
|
|
|
+ createTextMarker(data: Marker): STextMarkerItem {
|
|
|
+ return new STextMarkerItem(null, data);
|
|
|
+ } // Function createTextMarker()
|
|
|
|
|
|
/**
|
|
|
* 创建管线关系item
|
|
@@ -159,13 +179,4 @@ export class SItemFactory {
|
|
|
createRelation(data: Relation): SVerticalRelation {
|
|
|
return new SVerticalRelation(null, data);
|
|
|
} // Function createRelation()
|
|
|
-
|
|
|
- /**
|
|
|
- * 创建锚点item
|
|
|
- *
|
|
|
- * @param data 锚点数据
|
|
|
- * */
|
|
|
- createAnchor(data: Anchor): SAnchorItem {
|
|
|
- return new SAnchorItem(null);
|
|
|
- } // Function createAnchor()
|
|
|
} // class SItemFactory
|