|
@@ -17,8 +17,7 @@
|
|
*
|
|
*
|
|
* ********************************************************************************************************************
|
|
* ********************************************************************************************************************
|
|
*/
|
|
*/
|
|
-
|
|
|
|
-import { SGraphItem, SGraphCommand } from "@saga-web/graph/";
|
|
|
|
|
|
+import { SGraphItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate } from "@saga-web/graph/lib";
|
|
import { SMouseEvent, SUndoStack } from "@saga-web/base/";;
|
|
import { SMouseEvent, SUndoStack } from "@saga-web/base/";;
|
|
import {
|
|
import {
|
|
SColor,
|
|
SColor,
|
|
@@ -32,8 +31,6 @@ import { PolygonData } from "./type/PolygonData";
|
|
import { SRelationState } from "@saga-web/big/lib/enums/SRelationState"
|
|
import { SRelationState } from "@saga-web/big/lib/enums/SRelationState"
|
|
import { SMathUtil } from "@saga-web/big/lib/utils/SMathUtil";
|
|
import { SMathUtil } from "@saga-web/big/lib/utils/SMathUtil";
|
|
|
|
|
|
-import { SPointListInsert, SPointListInDelete, SPointListUpdate } from "./command/index"
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 编辑多边形
|
|
* 编辑多边形
|
|
*
|
|
*
|
|
@@ -311,7 +308,7 @@ export class SPolygonItem extends SGraphItem {
|
|
const delePoint = new SPoint(this.pointList[lenIndex].x, this.pointList[lenIndex].y)
|
|
const delePoint = new SPoint(this.pointList[lenIndex].x, this.pointList[lenIndex].y)
|
|
this.deletePoint(lenIndex);
|
|
this.deletePoint(lenIndex);
|
|
// 记录顶点操作记录压入堆栈
|
|
// 记录顶点操作记录压入堆栈
|
|
- this.recordAction(SPointListInDelete, [this.pointList, delePoint,lenIndex]);
|
|
|
|
|
|
+ this.recordAction(SGraphPointListDelete, [this.pointList, delePoint,lenIndex]);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// 1 判断是否点击在多边形顶点
|
|
// 1 判断是否点击在多边形顶点
|
|
@@ -362,7 +359,7 @@ export class SPolygonItem extends SGraphItem {
|
|
if (len.MinDis <= this.scenceLen) {
|
|
if (len.MinDis <= this.scenceLen) {
|
|
this.pointList.splice(index + 1, 0, len.Point);
|
|
this.pointList.splice(index + 1, 0, len.Point);
|
|
// 记录新增顶点操作记录压入堆栈
|
|
// 记录新增顶点操作记录压入堆栈
|
|
- this.recordAction(SPointListInsert, [this.pointList, len.Point, index + 1])
|
|
|
|
|
|
+ this.recordAction(SGraphPointListInsert, [this.pointList, len.Point, index + 1])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -498,7 +495,7 @@ export class SPolygonItem extends SGraphItem {
|
|
this.insertPoint(event.x, event.y);
|
|
this.insertPoint(event.x, event.y);
|
|
// 记录新增顶点操作记录压入堆栈
|
|
// 记录新增顶点操作记录压入堆栈
|
|
let pos = new SPoint(event.x, event.y);
|
|
let pos = new SPoint(event.x, event.y);
|
|
- this.recordAction(SPointListInsert, [this.pointList, pos])
|
|
|
|
|
|
+ this.recordAction(SGraphPointListInsert, [this.pointList, pos])
|
|
} else if (this._status == SRelationState.Edit) {
|
|
} else if (this._status == SRelationState.Edit) {
|
|
// 对多边形数组做编辑操作
|
|
// 对多边形数组做编辑操作
|
|
this.editPolygonPoint(event);
|
|
this.editPolygonPoint(event);
|
|
@@ -564,7 +561,7 @@ export class SPolygonItem extends SGraphItem {
|
|
if (this._status == SRelationState.Edit) {
|
|
if (this._status == SRelationState.Edit) {
|
|
if (-1 != this.curIndex) {
|
|
if (-1 != this.curIndex) {
|
|
const pos = new SPoint(this.pointList[this.curIndex].x, this.pointList[this.curIndex].y)
|
|
const pos = new SPoint(this.pointList[this.curIndex].x, this.pointList[this.curIndex].y)
|
|
- this.recordAction(SPointListUpdate, [this.pointList, this.curPoint, pos, this.curIndex])
|
|
|
|
|
|
+ this.recordAction(SGraphPointListUpdate, [this.pointList, this.curPoint, pos, this.curIndex])
|
|
}
|
|
}
|
|
this.curIndex = -1;
|
|
this.curIndex = -1;
|
|
this.curPoint = null;
|
|
this.curPoint = null;
|