浏览代码

渐变类调整;系统图引擎新增

haojianlong 5 年之前
父节点
当前提交
ed20db7cfd

+ 8 - 0
saga-web-big/src/SAnchorItem.ts

@@ -0,0 +1,8 @@
+import { SGraphyItem } from "@saga-web/graphy/lib";
+
+/**
+ * 锚点item
+ *
+ * @author  郝建龙(1061851420@qq.com)
+ */
+export class SAnchorItem extends SGraphyItem {} // Class SAnchorItem

+ 8 - 0
saga-web-big/src/SCompassItem.ts

@@ -0,0 +1,8 @@
+import { SGraphyItem } from "@saga-web/graphy/lib";
+
+/**
+ * 指南针item
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export class SCompassItem extends SGraphyItem {} // Class SCompassItem

+ 27 - 0
saga-web-big/src/SCurveRelation.ts

@@ -0,0 +1,27 @@
+import { SRelation } from "./SRelation";
+
+/**
+ * 曲线关系item
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export class SCurveRelation extends SRelation {
+
+    /**
+     * 曲线转直线
+     *
+     * */
+    curve2Line(): void {} // Function curve2Line()
+
+    /**
+     * 曲线转折线
+     *
+     * */
+    curve2Polyline(): void {} // Function curve2Polyline()
+
+    /**
+     * 曲线转垂直线
+     *
+     * */
+    curve2Vertical(): void {} // Function curve2Vertical()
+} // Class SCurveRelation

+ 17 - 0
saga-web-big/src/SEntityItem.ts

@@ -0,0 +1,17 @@
+import { SObjectItem } from "./SObjectItem";
+
+/**
+ * 实例item,与物理世界对应
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export class SEntityItem extends SObjectItem {
+    /** 与物理世界对应的实例的所有数据 */
+    data: {} = {};
+    /** 实例id    */
+    id: string = "";
+    /** 本地编码    */
+    localId: string = "";
+    /** 本地名称    */
+    localName: string = "";
+} // Class SEntityItem

+ 8 - 0
saga-web-big/src/SFloorItem.ts

@@ -0,0 +1,8 @@
+import { SGraphyItem } from "@saga-web/graphy/lib";
+
+/**
+ * 一个场景中显示多个楼层
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export class SFloorItem extends SGraphyItem {} // Class SFloorItem

+ 32 - 0
saga-web-big/src/SImageItem.ts

@@ -0,0 +1,32 @@
+import { SObjectItem } from "./SObjectItem";
+import { SGraphyItem } from "@saga-web/graphy/lib";
+import { ImageData } from "./types/ImageData";
+
+/**
+ *  图片绘制
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export class SImageItem extends SObjectItem {
+    /** 标志宽度 */
+    private width: number = 28;
+    /** 标志高度 */
+    private height: number = 37;
+    /** 图片地址    */
+    url: string = "";
+    /** 图片dom */
+    Img: CanvasImageSource;
+
+    /**
+     * 构造函数
+     *
+     *  @param parent    指向父对象
+     *  @param data      空间数据
+     * */
+    constructor(parent: SGraphyItem | null, data: ImageData) {
+        super(parent);
+        this.url = data.Url;
+    }
+
+    /****/
+} // Class SImageItem

+ 8 - 0
saga-web-big/src/SLayerItem.ts

@@ -0,0 +1,8 @@
+import { SFloorItem } from "./SFloorItem";
+
+/**
+ *  编辑器图层-图层锁定,业务层组合使用
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export class SLayerItem extends SFloorItem {} // Class SLayerItem

+ 29 - 0
saga-web-big/src/SLineRelation.ts

@@ -0,0 +1,29 @@
+import { SRelation } from "./SRelation";
+
+/**
+ * 直连关系线item
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export class SLineRelation extends SRelation {
+    /** 是否可以添加点 */
+    canAddPoint: boolean = true;
+
+    /**
+     * 折线转曲线
+     *
+     * */
+    polyline2Curve(): void {} // Function polyline2Curve()
+
+    /**
+     * 折线转直线
+     *
+     * */
+    polyline2Line(): void {} // Function polyline2Line()
+
+    /**
+     * 折线转垂直线
+     *
+     * */
+    polyline2Vertical(): void {} // Function polyline2Vertical()
+} // Class SLineRelation

+ 12 - 0
saga-web-big/src/SObjectItem.ts

@@ -0,0 +1,12 @@
+import { SGraphyItem } from "@saga-web/graphy/lib";
+import { SAnchorItem } from "./SAnchorItem";
+
+/**
+ * 对象item
+ *
+ * @author  郝建龙(1061851420@qq.com)
+ */
+export abstract class SObjectItem extends SGraphyItem {
+    /** 锚点list  */
+    anchorList: SAnchorItem[] = [];
+} // Class SObjectItem

+ 40 - 0
saga-web-big/src/SRelation.ts

@@ -0,0 +1,40 @@
+import { SGraphyItem } from "@saga-web/graphy/lib";
+import { SColor, SPoint, SArrowStyleType } from "@saga-web/draw/lib";
+import { SRelationState } from "./enums/SRelationState";
+import { SAnchorItem } from "./SAnchorItem";
+
+/**
+ * 关系item
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export abstract class SRelation extends SGraphyItem {
+    /** 起始端点线帽样式(枚举)    */
+    beginCap: SRelationState = SArrowStyleType.None;
+    /** 终止端点线帽样式(枚举)    */
+    endCap: SRelationState = SArrowStyleType.None;
+    /** 线帽填充色   */
+    capColor: SColor;
+    /** 外线颜色    */
+    color: SColor;
+    /** 起始锚点对象  */
+    startAnchor: SAnchorItem | null = null;
+    /** 终止锚点对象  */
+    endAnchor: SAnchorItem | null = null;
+    /** 内线颜色    */
+    innerLineColor: SColor;
+    /** 内线宽度    */
+    innerLineWidth: number = -1;
+    /** 虚线样式    */
+    lineDash: number[] = [];
+    /** 虚线偏移量   */
+    lineDashOffset: number = 0;
+    /** 动画速度    */
+    speed: number = 0;
+    /** 线宽  */
+    lineWidth: number;
+    /** 线状态 */
+    state: SRelationState = SRelationState.Normal;
+    /** 折点list  */
+    pointList: SPoint[] = [];
+} // Class SRelation

+ 8 - 0
saga-web-big/src/STextItem.ts

@@ -0,0 +1,8 @@
+import { SObjectItem } from "./SObjectItem";
+
+/**
+ * 文本item
+ *
+ * @author  郝建龙(1061851420@qq.com)
+ */
+export class STextItem extends SObjectItem {} // Class STextItem

+ 8 - 0
saga-web-big/src/STooltipItem.ts

@@ -0,0 +1,8 @@
+import { STextItem } from "./STextItem";
+
+/**
+ * 提示框item
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export class STooltipItem extends STextItem {} // Class STooltipItem

+ 27 - 0
saga-web-big/src/SVerticalRelation.ts

@@ -0,0 +1,27 @@
+import { SRelation } from "./SRelation";
+
+/**
+ * 垂直线关系线item
+ *
+ * * @author  郝建龙(1061851420@qq.com)
+ */
+export class SVerticalRelation extends SRelation {
+
+    /**
+     * 垂直线转曲线
+     *
+     * */
+    vertical2Curve(): void {} // Function vertical2Curve()
+
+    /**
+     * 垂直线转直线
+     *
+     * */
+    vertical2Line(): void {} // Function vertical2Line()
+
+    /**
+     * 垂直线转折线
+     *
+     * */
+    vertical2Polyline(): void {} // Function vertical2Polyline()
+} // Class SVerticalRelation

+ 13 - 0
saga-web-big/src/enums/SRelationState.ts

@@ -0,0 +1,13 @@
+/**
+ * 关系状态
+ *
+ * @author
+ */
+export enum SRelationState {
+    /** 标准状态    */
+    Normal,
+    /** 动画撞他    */
+    Animation,
+    /** 编辑状态    */
+    Edit
+} // Enum SRelationState

+ 7 - 0
saga-web-big/src/parser/SBigParser.ts

@@ -0,0 +1,7 @@
+import { SGraphyScene } from "@saga-web/graphy/lib";
+
+/**
+ *  混合解析器
+ *
+ */
+export class SBigParser extends SGraphyScene {} // class SBigParser

+ 7 - 0
saga-web-big/src/parser/SEquipParser.ts

@@ -0,0 +1,7 @@
+import { SGraphyScene } from "@saga-web/graphy/lib";
+
+/**
+ * 设备信息解析器
+ *
+ */
+export class SEquipParser extends SGraphyScene {} // class SEquipParser

+ 7 - 0
saga-web-big/src/parser/SFloorParser.ts

@@ -0,0 +1,7 @@
+import { SGraphyScene } from "@saga-web/graphy/lib";
+
+/**
+ *  楼层信息解析器
+ *
+ */
+export class SFloorParser extends SGraphyScene {} // class SFloorParser

+ 7 - 0
saga-web-big/src/parser/STopologyParser.ts

@@ -0,0 +1,7 @@
+import { SGraphyScene } from "@saga-web/graphy/lib";
+
+/**
+ * 拓扑图信息解析器
+ *
+ */
+export class STopologyParser extends SGraphyScene {} // class STopologyParser

+ 7 - 0
saga-web-big/src/parser/SZoneParser.ts

@@ -0,0 +1,7 @@
+import { SGraphyScene } from "@saga-web/graphy/lib";
+
+/**
+ * 业务空间信息解析器
+ *
+ */
+export class STopologyParser extends SGraphyScene {} // class STopologyParser

+ 17 - 0
saga-web-big/src/types/ImageData.ts

@@ -0,0 +1,17 @@
+/**
+ * 图片item数据接口
+ *
+ * @author  郝建龙
+ */
+export interface ImageData {
+    /** 图片的id   */
+    Id?: string;
+    /** 图片的名称   */
+    Name?: string;
+    /** X坐标 */
+    X: number;
+    /** Y坐标 */
+    Y: number;
+    /** 图片url   */
+    Url: string;
+} // Interface ImageData

+ 9 - 0
saga-web-big/src/utils/SImageUtil.ts

@@ -0,0 +1,9 @@
+/**
+ *
+ * 图片工具类
+ *
+ * */
+
+export class SImageUtil {
+    static urlToBase64(url: string) {}
+} // Class SImageUtil

+ 1 - 1
saga-web-draw/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/draw",
-    "version": "2.1.78",
+    "version": "2.1.80",
     "description": "上格云绘制引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",

+ 63 - 1
saga-web-draw/src/SGradient.ts

@@ -1,4 +1,4 @@
-import { SColor, SGradientStop } from "./";
+import { SColor, SGradientStop, SPoint } from "./";
 
 /**
  * 渐变颜色节点
@@ -6,6 +6,46 @@ import { SColor, SGradientStop } from "./";
  * @author  庞利祥(sybotan@126.com)
  */
 export abstract class SGradient {
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // 属性定义
+    /** 起点 */
+    start = new SPoint();
+
+    /** 结束点 */
+    end = new SPoint();
+
+    /** 起点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[] = [];
 
@@ -18,4 +58,26 @@ export abstract class SGradient {
     addColorStop(pos: number, color: SColor): void {
         this.stopList.push(new SGradientStop(pos, color));
     } // Function addColorStop()
+
+    /**
+     * 设置起点坐标
+     *
+     * @param   x       X坐标
+     * @param   y       Y坐标
+     */
+    setStart(x: number, y: number): void {
+        this.start.x = x;
+        this.start.y = y;
+    } // Function setStart()
+
+    /**
+     * 设置终点坐标
+     *
+     * @param   x       X坐标
+     * @param   y       Y坐标
+     */
+    setEnd(x: number, y: number): void {
+        this.end.x = x;
+        this.end.y = y;
+    } // Function setEnd()
 } // Class SGradientStop

+ 0 - 64
saga-web-draw/src/SLinearGradient.ts

@@ -6,48 +6,6 @@ import { SGradient, SPoint } from "./";
  * @author  庞利祥(sybotan@126.com)
  */
 export class SLinearGradient extends SGradient {
-    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // 属性定义
-    /** 起点 */
-    start = new SPoint();
-
-    /** 结束点 */
-    end = new SPoint();
-
-    /** 起点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
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // 构造函数
     /**
      * 构造函数
      *
@@ -89,26 +47,4 @@ export class SLinearGradient extends SGradient {
             this.end = new SPoint(x2 as number, y2 as number);
         }
     } // Constructor()
-
-    /**
-     * 设置起点坐标
-     *
-     * @param   x       X坐标
-     * @param   y       Y坐标
-     */
-    setStart(x: number, y: number): void {
-        this.start.x = x;
-        this.start.y = y;
-    } // Function setStart()
-
-    /**
-     * 设置终点坐标
-     *
-     * @param   x       X坐标
-     * @param   y       Y坐标
-     */
-    setEnd(x: number, y: number): void {
-        this.end.x = x;
-        this.end.y = y;
-    } // Function setEnd()
 } // Class SGradientBrush

+ 0 - 62
saga-web-draw/src/SRadialGradient.ts

@@ -6,51 +6,11 @@ import { SGradient, SPoint } from "./";
  * @author  庞利祥(sybotan@126.com)
  */
 export class SRadialGradient extends SGradient {
-    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // 属性定义
-    /** 开始圆形坐标 */
-    start = new SPoint();
     /** 开始圆形半径 */
     r1: number;
-    /** 结束圆形坐标 */
-    end = new SPoint();
     /** 结束圆形半径 */
     r2: number;
 
-    /** 开始圆形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
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // 构造函数
     /**
      * 构造函数
      *
@@ -111,26 +71,4 @@ export class SRadialGradient extends SGradient {
             this.r2 = r2 as number;
         }
     } // Constructor()
-
-    /**
-     * 设置开始圆形坐标
-     *
-     * @param   x       X坐标
-     * @param   y       Y坐标
-     */
-    setStart(x: number, y: number): void {
-        this.start.x = x;
-        this.start.y = y;
-    } // Function setStart()
-
-    /**
-     * 设置结束圆形坐标
-     *
-     * @param   x       X坐标
-     * @param   y       Y坐标
-     */
-    setEnd(x: number, y: number): void {
-        this.end.x = x;
-        this.end.y = y;
-    } // Function setEnd()
 } // Class SRadialGradient

+ 3 - 1
saga-web-draw/src/index.ts

@@ -43,6 +43,7 @@ import { SPainter } from "./SPainter";
 import { SPath2D } from "./SPath2D";
 import { SPen } from "./SPen";
 import { SRadialGradient } from "./SRadialGradient";
+import { SArrowStyleType } from "./enums/SArrowStyleType";
 export {
     SBrush,
     SCanvasView,
@@ -54,5 +55,6 @@ export {
     SPainter,
     SPath2D,
     SPen,
-    SRadialGradient
+    SRadialGradient,
+    SArrowStyleType
 };

+ 2 - 2
saga-web-graphy/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/graphy",
-    "version": "2.1.50",
+    "version": "2.1.52",
     "description": "上格云二维图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -31,6 +31,6 @@
         "typescript": "^3.5.3"
     },
     "dependencies": {
-        "@saga-web/draw": "^2.1.78"
+        "@saga-web/draw": "2.1.80"
     }
 }