deeptwins-engine-3d 0.1.63 → 0.1.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Build/DeepTwins/Workers/MvtVector.worker.js +1 -0
- package/dist/esm/{plot/utils/Algorithm.js → drawer/algorithm.js} +1 -3
- package/dist/esm/drawer/common.d.ts +61 -0
- package/dist/esm/{plot/utils/PlotCommon.js → drawer/common.js} +104 -551
- package/dist/esm/{plot/utils/Coordinate.d.ts → drawer/coordinate.d.ts} +1 -1
- package/dist/esm/drawer/index.d.ts +11 -18
- package/dist/esm/drawer/index.js +329 -80
- package/dist/esm/{plot/utils → drawer}/plotUtil.js +1 -3
- package/dist/esm/drawer/shape/Assemble.d.ts +34 -0
- package/dist/esm/drawer/shape/Assemble.js +415 -0
- package/dist/esm/drawer/shape/AttackArrow.d.ts +32 -0
- package/dist/esm/drawer/shape/AttackArrow.js +442 -0
- package/dist/esm/drawer/shape/BaseShape.d.ts +14 -4
- package/dist/esm/drawer/shape/BaseShape.js +175 -20
- package/dist/esm/drawer/shape/Bow.d.ts +31 -0
- package/dist/esm/drawer/shape/Bow.js +375 -0
- package/dist/esm/drawer/shape/Circle.d.ts +37 -0
- package/dist/esm/drawer/shape/Circle.js +461 -0
- package/dist/esm/drawer/shape/Curve.d.ts +29 -0
- package/dist/esm/drawer/shape/Curve.js +386 -0
- package/dist/esm/drawer/shape/DragPoint.d.ts +32 -0
- package/dist/esm/drawer/shape/DragPoint.js +211 -0
- package/dist/esm/drawer/shape/Elliptic.d.ts +38 -0
- package/dist/esm/drawer/shape/Elliptic.js +491 -0
- package/dist/esm/drawer/shape/Formation.d.ts +33 -0
- package/dist/esm/drawer/shape/Formation.js +395 -0
- package/dist/esm/drawer/shape/PincerArrow.d.ts +32 -0
- package/dist/esm/drawer/shape/PincerArrow.js +445 -0
- package/dist/esm/drawer/shape/Point.d.ts +2 -31
- package/dist/esm/drawer/shape/Point.js +7 -201
- package/dist/esm/drawer/shape/Polygon.d.ts +1 -1
- package/dist/esm/drawer/shape/Polygon.js +10 -81
- package/dist/esm/drawer/shape/Polyline.d.ts +1 -1
- package/dist/esm/drawer/shape/Polyline.js +10 -81
- package/dist/esm/drawer/shape/RegularPolygon.d.ts +37 -0
- package/dist/esm/drawer/shape/RegularPolygon.js +468 -0
- package/dist/esm/drawer/shape/RightAngleArrow.d.ts +34 -0
- package/dist/esm/drawer/shape/RightAngleArrow.js +423 -0
- package/dist/esm/drawer/shape/Sector.d.ts +37 -0
- package/dist/esm/drawer/shape/Sector.js +568 -0
- package/dist/esm/drawer/shape/StraightArrow.d.ts +34 -0
- package/dist/esm/drawer/shape/StraightArrow.js +422 -0
- package/dist/esm/drawer/shape/SwallowtailArrow.d.ts +36 -0
- package/dist/esm/drawer/shape/SwallowtailArrow.js +438 -0
- package/dist/esm/drawer/types.d.ts +23 -0
- package/dist/esm/drawer/types.js +11 -0
- package/dist/esm/drawer/utils.d.ts +14 -0
- package/dist/esm/drawer/utils.js +320 -2
- package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +5 -3
- package/dist/esm/measure/Area.d.ts +17 -17
- package/dist/esm/measure/Area.js +95 -63
- package/dist/esm/measure/BaseDraw.d.ts +9 -4
- package/dist/esm/measure/BaseDraw.js +37 -2
- package/dist/esm/measure/Distance.d.ts +9 -9
- package/dist/esm/measure/Distance.js +52 -68
- package/dist/esm/measure/index.d.ts +16 -26
- package/dist/esm/measure/index.js +72 -84
- package/dist/esm/measure/types.d.ts +94 -0
- package/dist/esm/measure/types.js +17 -0
- package/dist/esm/measure/utils.d.ts +7 -7
- package/dist/esm/measure/utils.js +43 -24
- package/dist/esm/tileLayer/MvtVectorLoad.d.ts +241 -0
- package/dist/esm/tileLayer/MvtVectorLoad.js +1353 -0
- package/dist/esm/tileLayer/MvtVectorWorkerClient.d.ts +25 -0
- package/dist/esm/tileLayer/MvtVectorWorkerClient.js +126 -0
- package/dist/esm/tool/utils.js +1 -1
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +2 -1
- package/dist/assets/Build/DeepTwins/Image/compass/pointer-white.png +0 -0
- package/dist/esm/plot/create/CreateAssemble.d.ts +0 -2
- package/dist/esm/plot/create/CreateAssemble.js +0 -63
- package/dist/esm/plot/create/CreateAttackArrow.d.ts +0 -5
- package/dist/esm/plot/create/CreateAttackArrow.js +0 -75
- package/dist/esm/plot/create/CreateBillboard.d.ts +0 -2
- package/dist/esm/plot/create/CreateBillboard.js +0 -47
- package/dist/esm/plot/create/CreateBow.d.ts +0 -2
- package/dist/esm/plot/create/CreateBow.js +0 -63
- package/dist/esm/plot/create/CreateCircle.d.ts +0 -2
- package/dist/esm/plot/create/CreateCircle.js +0 -68
- package/dist/esm/plot/create/CreateCurve.d.ts +0 -2
- package/dist/esm/plot/create/CreateCurve.js +0 -76
- package/dist/esm/plot/create/CreateElliptic.d.ts +0 -2
- package/dist/esm/plot/create/CreateElliptic.js +0 -69
- package/dist/esm/plot/create/CreateFlag.d.ts +0 -2
- package/dist/esm/plot/create/CreateFlag.js +0 -80
- package/dist/esm/plot/create/CreateFormation.d.ts +0 -2
- package/dist/esm/plot/create/CreateFormation.js +0 -65
- package/dist/esm/plot/create/CreateFreeLine.d.ts +0 -2
- package/dist/esm/plot/create/CreateFreeLine.js +0 -69
- package/dist/esm/plot/create/CreateFreePolygon.d.ts +0 -2
- package/dist/esm/plot/create/CreateFreePolygon.js +0 -65
- package/dist/esm/plot/create/CreateLabel.d.ts +0 -2
- package/dist/esm/plot/create/CreateLabel.js +0 -55
- package/dist/esm/plot/create/CreateLineArrow.d.ts +0 -2
- package/dist/esm/plot/create/CreateLineArrow.js +0 -79
- package/dist/esm/plot/create/CreatePincerArrow.d.ts +0 -5
- package/dist/esm/plot/create/CreatePincerArrow.js +0 -73
- package/dist/esm/plot/create/CreatePoint.d.ts +0 -2
- package/dist/esm/plot/create/CreatePoint.js +0 -47
- package/dist/esm/plot/create/CreatePolygon.d.ts +0 -2
- package/dist/esm/plot/create/CreatePolygon.js +0 -80
- package/dist/esm/plot/create/CreatePolyline.d.ts +0 -2
- package/dist/esm/plot/create/CreatePolyline.js +0 -70
- package/dist/esm/plot/create/CreateRectangle.d.ts +0 -2
- package/dist/esm/plot/create/CreateRectangle.js +0 -60
- package/dist/esm/plot/create/CreateRegularPolygon.d.ts +0 -2
- package/dist/esm/plot/create/CreateRegularPolygon.js +0 -75
- package/dist/esm/plot/create/CreateRightAngleArrow.d.ts +0 -5
- package/dist/esm/plot/create/CreateRightAngleArrow.js +0 -73
- package/dist/esm/plot/create/CreateRoundRectangle.d.ts +0 -2
- package/dist/esm/plot/create/CreateRoundRectangle.js +0 -63
- package/dist/esm/plot/create/CreateSector.d.ts +0 -2
- package/dist/esm/plot/create/CreateSector.js +0 -65
- package/dist/esm/plot/create/CreateStraightArrow.d.ts +0 -5
- package/dist/esm/plot/create/CreateStraightArrow.js +0 -65
- package/dist/esm/plot/create/CreateSwallowtailArrow.d.ts +0 -5
- package/dist/esm/plot/create/CreateSwallowtailArrow.js +0 -67
- package/dist/esm/plot/create/index.d.ts +0 -25
- package/dist/esm/plot/create/index.js +0 -25
- package/dist/esm/plot/edit/EditAssemble.d.ts +0 -8
- package/dist/esm/plot/edit/EditAssemble.js +0 -120
- package/dist/esm/plot/edit/EditAttackArrow.d.ts +0 -8
- package/dist/esm/plot/edit/EditAttackArrow.js +0 -182
- package/dist/esm/plot/edit/EditBillboard.d.ts +0 -7
- package/dist/esm/plot/edit/EditBillboard.js +0 -70
- package/dist/esm/plot/edit/EditBow.d.ts +0 -8
- package/dist/esm/plot/edit/EditBow.js +0 -119
- package/dist/esm/plot/edit/EditCircle.d.ts +0 -8
- package/dist/esm/plot/edit/EditCircle.js +0 -133
- package/dist/esm/plot/edit/EditCurve.d.ts +0 -8
- package/dist/esm/plot/edit/EditCurve.js +0 -180
- package/dist/esm/plot/edit/EditElliptic.d.ts +0 -8
- package/dist/esm/plot/edit/EditElliptic.js +0 -144
- package/dist/esm/plot/edit/EditFlag.d.ts +0 -8
- package/dist/esm/plot/edit/EditFlag.js +0 -121
- package/dist/esm/plot/edit/EditFormation.d.ts +0 -8
- package/dist/esm/plot/edit/EditFormation.js +0 -120
- package/dist/esm/plot/edit/EditLabel.d.ts +0 -7
- package/dist/esm/plot/edit/EditLabel.js +0 -100
- package/dist/esm/plot/edit/EditLineArrow.d.ts +0 -8
- package/dist/esm/plot/edit/EditLineArrow.js +0 -180
- package/dist/esm/plot/edit/EditPincerArrow.d.ts +0 -8
- package/dist/esm/plot/edit/EditPincerArrow.js +0 -121
- package/dist/esm/plot/edit/EditPoint.d.ts +0 -7
- package/dist/esm/plot/edit/EditPoint.js +0 -70
- package/dist/esm/plot/edit/EditPolygon.d.ts +0 -8
- package/dist/esm/plot/edit/EditPolygon.js +0 -181
- package/dist/esm/plot/edit/EditPolyline.d.ts +0 -8
- package/dist/esm/plot/edit/EditPolyline.js +0 -179
- package/dist/esm/plot/edit/EditRectangle.d.ts +0 -8
- package/dist/esm/plot/edit/EditRectangle.js +0 -119
- package/dist/esm/plot/edit/EditRegularPolygon.d.ts +0 -8
- package/dist/esm/plot/edit/EditRegularPolygon.js +0 -170
- package/dist/esm/plot/edit/EditRightAngleArrow.d.ts +0 -8
- package/dist/esm/plot/edit/EditRightAngleArrow.js +0 -143
- package/dist/esm/plot/edit/EditRoundRectangle.d.ts +0 -8
- package/dist/esm/plot/edit/EditRoundRectangle.js +0 -119
- package/dist/esm/plot/edit/EditSector.d.ts +0 -8
- package/dist/esm/plot/edit/EditSector.js +0 -120
- package/dist/esm/plot/edit/EditStraightArrow.d.ts +0 -8
- package/dist/esm/plot/edit/EditStraightArrow.js +0 -120
- package/dist/esm/plot/edit/EditSwallowtailArrow.d.ts +0 -8
- package/dist/esm/plot/edit/EditSwallowtailArrow.js +0 -121
- package/dist/esm/plot/edit/index.d.ts +0 -23
- package/dist/esm/plot/edit/index.js +0 -23
- package/dist/esm/plot/utils/DomUtil.d.ts +0 -34
- package/dist/esm/plot/utils/DomUtil.js +0 -100
- package/dist/esm/plot/utils/PlotCommon.d.ts +0 -101
- package/dist/esm/plot/utils/ReminderTip.d.ts +0 -10
- package/dist/esm/plot/utils/ReminderTip.js +0 -67
- package/dist/esm/plot/utils/Tooltip.d.ts +0 -3
- package/dist/esm/plot/utils/Tooltip.js +0 -97
- /package/dist/esm/{plot/utils/Algorithm.d.ts → drawer/algorithm.d.ts} +0 -0
- /package/dist/esm/{plot/utils/Coordinate.js → drawer/coordinate.js} +0 -0
- /package/dist/esm/{plot/utils → drawer}/plotUtil.d.ts +0 -0
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 编辑圆角矩形方法
|
|
3
|
-
*/
|
|
4
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
5
|
-
import { getCatesian3FromPX } from "../utils/Coordinate";
|
|
6
|
-
import { computeRoundedRectanglePoints, lockingMap, newSessionid } from "../utils/PlotCommon";
|
|
7
|
-
var EditRoundRectangle = function EditRoundRectangle(viewer, entity, handler, collection) {
|
|
8
|
-
var editItem = collection.find(function (ele) {
|
|
9
|
-
return ele.id === entity.id;
|
|
10
|
-
});
|
|
11
|
-
var editEntity;
|
|
12
|
-
var sourcePos = entity.EditingPoint;
|
|
13
|
-
var updatePos = Cesium.clone(sourcePos, true);
|
|
14
|
-
entity.show = false;
|
|
15
|
-
var dynamicPositions = new Cesium.CallbackProperty(function () {
|
|
16
|
-
return new Cesium.PolygonHierarchy(computeRoundedRectanglePoints(updatePos));
|
|
17
|
-
}, false);
|
|
18
|
-
if (editItem) {
|
|
19
|
-
editEntity = editItem.target;
|
|
20
|
-
editEntity.show = true;
|
|
21
|
-
editEntity.polygon.hierarchy = dynamicPositions;
|
|
22
|
-
editItem.processEntities = initVertexEntities();
|
|
23
|
-
} else {
|
|
24
|
-
var newRoundRectangle = Cesium.clone(entity.polygon);
|
|
25
|
-
newRoundRectangle.material = Cesium.Color.RED.withAlpha(0.4);
|
|
26
|
-
newRoundRectangle.hierarchy = dynamicPositions;
|
|
27
|
-
editEntity = viewer.entities.add({
|
|
28
|
-
GeoType: 'EditRoundRectangle',
|
|
29
|
-
Editable: true,
|
|
30
|
-
id: 'edit_' + entity.id,
|
|
31
|
-
polygon: newRoundRectangle
|
|
32
|
-
});
|
|
33
|
-
var vertexs = initVertexEntities();
|
|
34
|
-
collection.push({
|
|
35
|
-
id: entity.id,
|
|
36
|
-
source: entity,
|
|
37
|
-
target: editEntity,
|
|
38
|
-
geoType: 'remix_roundrectangle',
|
|
39
|
-
processEntities: vertexs
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
var boolDown = false; //鼠标左键是否处于摁下状态
|
|
43
|
-
var currentPickVertex = undefined; //当前选择的要编辑的节点
|
|
44
|
-
var currentPickPolygon = undefined; //当前选择的要移动的圆角矩形
|
|
45
|
-
// 左键摁下事件
|
|
46
|
-
handler.setInputAction(function (event) {
|
|
47
|
-
boolDown = true;
|
|
48
|
-
var pick = viewer.scene.pick(event.position);
|
|
49
|
-
if (Cesium.defined(pick) && pick.id) {
|
|
50
|
-
var pickEntity = pick.id;
|
|
51
|
-
if (!pickEntity.GeoType || !pickEntity.Editable) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (pickEntity.GeoType === 'RoundRectangleEditPoint') {
|
|
55
|
-
lockingMap(viewer, false);
|
|
56
|
-
currentPickVertex = pickEntity;
|
|
57
|
-
} else if (pickEntity.GeoType === 'EditRoundRectangle') {
|
|
58
|
-
lockingMap(viewer, false);
|
|
59
|
-
currentPickPolygon = pickEntity;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
|
|
63
|
-
// 鼠标移动事件
|
|
64
|
-
handler.setInputAction(function (event) {
|
|
65
|
-
//console.log('鼠标移动事件监测:------圆角矩形编辑中------');
|
|
66
|
-
if (boolDown && currentPickVertex) {
|
|
67
|
-
var pos = getCatesian3FromPX(viewer, event.endPosition);
|
|
68
|
-
if (pos) {
|
|
69
|
-
updatePos[currentPickVertex.description] = pos;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (boolDown && currentPickPolygon) {
|
|
73
|
-
var startPosition = viewer.scene.pickPosition(event.startPosition);
|
|
74
|
-
var endPosition = viewer.scene.pickPosition(event.endPosition);
|
|
75
|
-
var changed_x = endPosition.x - startPosition.x;
|
|
76
|
-
var changed_y = endPosition.y - startPosition.y;
|
|
77
|
-
var changed_z = endPosition.z - startPosition.z;
|
|
78
|
-
updatePos[0] = new Cesium.Cartesian3(updatePos[0].x + changed_x, updatePos[0].y + changed_y, updatePos[0].z + changed_z);
|
|
79
|
-
updatePos[1] = new Cesium.Cartesian3(updatePos[1].x + changed_x, updatePos[1].y + changed_y, updatePos[1].z + changed_z);
|
|
80
|
-
}
|
|
81
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
82
|
-
// 左键抬起事件
|
|
83
|
-
handler.setInputAction(function () {
|
|
84
|
-
entity.polygon.hierarchy = editEntity.polygon.hierarchy;
|
|
85
|
-
boolDown = false;
|
|
86
|
-
currentPickVertex = undefined;
|
|
87
|
-
currentPickPolygon = undefined;
|
|
88
|
-
lockingMap(viewer, true);
|
|
89
|
-
entity.EditingPoint = updatePos;
|
|
90
|
-
}, Cesium.ScreenSpaceEventType.LEFT_UP);
|
|
91
|
-
function initVertexEntities() {
|
|
92
|
-
var processEntities = [];
|
|
93
|
-
var _loop = function _loop(index) {
|
|
94
|
-
var verEntity = viewer.entities.add({
|
|
95
|
-
id: 'edit_' + newSessionid(),
|
|
96
|
-
position: new Cesium.CallbackProperty(function () {
|
|
97
|
-
return updatePos[index];
|
|
98
|
-
}, false),
|
|
99
|
-
point: {
|
|
100
|
-
pixelSize: 20,
|
|
101
|
-
color: Cesium.Color.YELLOW.withAlpha(0.6),
|
|
102
|
-
outlineWidth: 2,
|
|
103
|
-
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
104
|
-
outlineColor: Cesium.Color.DARKRED.withAlpha(1)
|
|
105
|
-
},
|
|
106
|
-
show: true,
|
|
107
|
-
description: index //记录节点索引
|
|
108
|
-
});
|
|
109
|
-
verEntity.GeoType = 'RoundRectangleEditPoint';
|
|
110
|
-
verEntity.Editable = true;
|
|
111
|
-
processEntities.push(verEntity);
|
|
112
|
-
};
|
|
113
|
-
for (var index = 0; index < updatePos.length; index++) {
|
|
114
|
-
_loop(index);
|
|
115
|
-
}
|
|
116
|
-
return processEntities;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
export default EditRoundRectangle;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 编辑扇形方法
|
|
3
|
-
*/
|
|
4
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
5
|
-
import { getCatesian3FromPX } from "../utils/Coordinate";
|
|
6
|
-
import { calculateSectorPoints, lockingMap, newSessionid } from "../utils/PlotCommon";
|
|
7
|
-
var EditSector = function EditSector(viewer, entity, handler, collection) {
|
|
8
|
-
var editItem = collection.find(function (ele) {
|
|
9
|
-
return ele.id === entity.id;
|
|
10
|
-
});
|
|
11
|
-
var editEntity;
|
|
12
|
-
var sourcePos = entity.EditingPoint;
|
|
13
|
-
var updatePos = Cesium.clone(sourcePos, true);
|
|
14
|
-
entity.show = false;
|
|
15
|
-
var dynamicPositions = new Cesium.CallbackProperty(function () {
|
|
16
|
-
return new Cesium.PolygonHierarchy(calculateSectorPoints(updatePos));
|
|
17
|
-
}, false);
|
|
18
|
-
if (editItem) {
|
|
19
|
-
editEntity = editItem.target;
|
|
20
|
-
editEntity.show = true;
|
|
21
|
-
editEntity.polygon.hierarchy = dynamicPositions;
|
|
22
|
-
editItem.processEntities = initVertexEntities();
|
|
23
|
-
} else {
|
|
24
|
-
var newSector = Cesium.clone(entity.polygon);
|
|
25
|
-
newSector.material = Cesium.Color.RED.withAlpha(0.4);
|
|
26
|
-
newSector.hierarchy = dynamicPositions;
|
|
27
|
-
editEntity = viewer.entities.add({
|
|
28
|
-
GeoType: 'EditSector',
|
|
29
|
-
Editable: true,
|
|
30
|
-
id: 'edit_' + entity.id,
|
|
31
|
-
polygon: newSector
|
|
32
|
-
});
|
|
33
|
-
var vertexs = initVertexEntities();
|
|
34
|
-
collection.push({
|
|
35
|
-
id: entity.id,
|
|
36
|
-
source: entity,
|
|
37
|
-
target: editEntity,
|
|
38
|
-
geoType: 'remix_sector',
|
|
39
|
-
processEntities: vertexs
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
var boolDown = false; //鼠标左键是否处于摁下状态
|
|
43
|
-
var currentPickVertex = undefined; //当前选择的要编辑的节点
|
|
44
|
-
var currentPickPolygon = undefined; //当前选择的要移动的扇形
|
|
45
|
-
// 左键摁下事件
|
|
46
|
-
handler.setInputAction(function (event) {
|
|
47
|
-
boolDown = true;
|
|
48
|
-
var pick = viewer.scene.pick(event.position);
|
|
49
|
-
if (Cesium.defined(pick) && pick.id) {
|
|
50
|
-
var pickEntity = pick.id;
|
|
51
|
-
if (!pickEntity.GeoType || !pickEntity.Editable) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (pickEntity.GeoType === 'SectorEditPoint') {
|
|
55
|
-
lockingMap(viewer, false);
|
|
56
|
-
currentPickVertex = pickEntity;
|
|
57
|
-
} else if (pickEntity.GeoType === 'EditSector') {
|
|
58
|
-
lockingMap(viewer, false);
|
|
59
|
-
currentPickPolygon = pickEntity;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
|
|
63
|
-
// 鼠标移动事件
|
|
64
|
-
handler.setInputAction(function (event) {
|
|
65
|
-
//console.log('鼠标移动事件监测:------扇形编辑中------');
|
|
66
|
-
if (boolDown && currentPickVertex) {
|
|
67
|
-
var pos = getCatesian3FromPX(viewer, event.endPosition);
|
|
68
|
-
if (pos) {
|
|
69
|
-
updatePos[currentPickVertex.description] = pos;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (boolDown && currentPickPolygon) {
|
|
73
|
-
var startPosition = viewer.scene.pickPosition(event.startPosition);
|
|
74
|
-
var endPosition = viewer.scene.pickPosition(event.endPosition);
|
|
75
|
-
var changed_x = endPosition.x - startPosition.x;
|
|
76
|
-
var changed_y = endPosition.y - startPosition.y;
|
|
77
|
-
var changed_z = endPosition.z - startPosition.z;
|
|
78
|
-
for (var index = 0; index < updatePos.length; index++) {
|
|
79
|
-
updatePos[index] = new Cesium.Cartesian3(updatePos[index].x + changed_x, updatePos[index].y + changed_y, updatePos[index].z + changed_z);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
83
|
-
// 左键抬起事件
|
|
84
|
-
handler.setInputAction(function () {
|
|
85
|
-
entity.polygon.hierarchy = editEntity.polygon.hierarchy;
|
|
86
|
-
boolDown = false;
|
|
87
|
-
currentPickVertex = undefined;
|
|
88
|
-
currentPickPolygon = undefined;
|
|
89
|
-
lockingMap(viewer, true);
|
|
90
|
-
entity.EditingPoint = updatePos;
|
|
91
|
-
}, Cesium.ScreenSpaceEventType.LEFT_UP);
|
|
92
|
-
function initVertexEntities() {
|
|
93
|
-
var processEntities = [];
|
|
94
|
-
var _loop = function _loop(index) {
|
|
95
|
-
var verEntity = viewer.entities.add({
|
|
96
|
-
id: 'edit_' + newSessionid(),
|
|
97
|
-
position: new Cesium.CallbackProperty(function () {
|
|
98
|
-
return updatePos[index];
|
|
99
|
-
}, false),
|
|
100
|
-
point: {
|
|
101
|
-
pixelSize: 20,
|
|
102
|
-
color: Cesium.Color.YELLOW.withAlpha(0.6),
|
|
103
|
-
outlineWidth: 2,
|
|
104
|
-
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
105
|
-
outlineColor: Cesium.Color.DARKRED.withAlpha(1)
|
|
106
|
-
},
|
|
107
|
-
show: true,
|
|
108
|
-
description: index //记录节点索引
|
|
109
|
-
});
|
|
110
|
-
verEntity.GeoType = 'SectorEditPoint';
|
|
111
|
-
verEntity.Editable = true;
|
|
112
|
-
processEntities.push(verEntity);
|
|
113
|
-
};
|
|
114
|
-
for (var index = 0; index < updatePos.length; index++) {
|
|
115
|
-
_loop(index);
|
|
116
|
-
}
|
|
117
|
-
return processEntities;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
export default EditSector;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 编辑直线箭头方法
|
|
3
|
-
*/
|
|
4
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
5
|
-
import { getCatesian3FromPX } from "../utils/Coordinate";
|
|
6
|
-
import { calculateSwallowPoints, lockingMap, newSessionid } from "../utils/PlotCommon";
|
|
7
|
-
var EditStraightArrow = function EditStraightArrow(viewer, entity, handler, collection) {
|
|
8
|
-
var editItem = collection.find(function (ele) {
|
|
9
|
-
return ele.id === entity.id;
|
|
10
|
-
});
|
|
11
|
-
var editEntity;
|
|
12
|
-
var sourcePos = entity.EditingPoint;
|
|
13
|
-
var updatePos = Cesium.clone(sourcePos, true);
|
|
14
|
-
entity.show = false;
|
|
15
|
-
var dynamicPositions = new Cesium.CallbackProperty(function () {
|
|
16
|
-
var points = calculateSwallowPoints(updatePos, 3);
|
|
17
|
-
return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(points));
|
|
18
|
-
}, false);
|
|
19
|
-
if (editItem) {
|
|
20
|
-
editEntity = editItem.target;
|
|
21
|
-
editEntity.show = true;
|
|
22
|
-
editEntity.polygon.hierarchy = dynamicPositions;
|
|
23
|
-
editItem.processEntities = initVertexEntities();
|
|
24
|
-
} else {
|
|
25
|
-
var newSwallowtail = Cesium.clone(entity.polygon);
|
|
26
|
-
newSwallowtail.material = Cesium.Color.RED.withAlpha(0.4);
|
|
27
|
-
newSwallowtail.hierarchy = dynamicPositions;
|
|
28
|
-
editEntity = viewer.entities.add({
|
|
29
|
-
GeoType: 'EditStraightArrow',
|
|
30
|
-
Editable: true,
|
|
31
|
-
id: 'edit_' + entity.id,
|
|
32
|
-
polygon: newSwallowtail
|
|
33
|
-
});
|
|
34
|
-
var vertexs = initVertexEntities();
|
|
35
|
-
collection.push({
|
|
36
|
-
id: entity.id,
|
|
37
|
-
source: entity,
|
|
38
|
-
target: editEntity,
|
|
39
|
-
geoType: 'remix_straightarrow',
|
|
40
|
-
processEntities: vertexs
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
var boolDown = false; //鼠标左键是否处于摁下状态
|
|
44
|
-
var currentPickVertex = undefined; //当前选择的要编辑的节点
|
|
45
|
-
var currentPickPolygon = undefined; //当前选择的要移动的直线箭头
|
|
46
|
-
// 左键摁下事件
|
|
47
|
-
handler.setInputAction(function (event) {
|
|
48
|
-
boolDown = true;
|
|
49
|
-
var pick = viewer.scene.pick(event.position);
|
|
50
|
-
if (Cesium.defined(pick) && pick.id) {
|
|
51
|
-
var pickEntity = pick.id;
|
|
52
|
-
if (!pickEntity.GeoType || !pickEntity.Editable) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (pickEntity.GeoType === 'StraightArrowEditPoint') {
|
|
56
|
-
lockingMap(viewer, false);
|
|
57
|
-
currentPickVertex = pickEntity;
|
|
58
|
-
} else if (pickEntity.GeoType === 'EditStraightArrow') {
|
|
59
|
-
lockingMap(viewer, false);
|
|
60
|
-
currentPickPolygon = pickEntity;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
|
|
64
|
-
// 鼠标移动事件
|
|
65
|
-
handler.setInputAction(function (event) {
|
|
66
|
-
//console.log('鼠标移动事件监测:------直线箭头编辑中------');
|
|
67
|
-
if (boolDown && currentPickVertex) {
|
|
68
|
-
var pos = getCatesian3FromPX(viewer, event.endPosition);
|
|
69
|
-
if (pos) {
|
|
70
|
-
updatePos[currentPickVertex.description] = pos;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
if (boolDown && currentPickPolygon) {
|
|
74
|
-
var startPosition = viewer.scene.pickPosition(event.startPosition);
|
|
75
|
-
var endPosition = viewer.scene.pickPosition(event.endPosition);
|
|
76
|
-
var changed_x = endPosition.x - startPosition.x;
|
|
77
|
-
var changed_y = endPosition.y - startPosition.y;
|
|
78
|
-
var changed_z = endPosition.z - startPosition.z;
|
|
79
|
-
updatePos[0] = new Cesium.Cartesian3(updatePos[0].x + changed_x, updatePos[0].y + changed_y, updatePos[0].z + changed_z);
|
|
80
|
-
updatePos[1] = new Cesium.Cartesian3(updatePos[1].x + changed_x, updatePos[1].y + changed_y, updatePos[1].z + changed_z);
|
|
81
|
-
}
|
|
82
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
83
|
-
// 左键抬起事件
|
|
84
|
-
handler.setInputAction(function () {
|
|
85
|
-
entity.polygon.hierarchy = editEntity.polygon.hierarchy;
|
|
86
|
-
boolDown = false;
|
|
87
|
-
currentPickVertex = undefined;
|
|
88
|
-
currentPickPolygon = undefined;
|
|
89
|
-
lockingMap(viewer, true);
|
|
90
|
-
entity.EditingPoint = updatePos;
|
|
91
|
-
}, Cesium.ScreenSpaceEventType.LEFT_UP);
|
|
92
|
-
function initVertexEntities() {
|
|
93
|
-
var processEntities = [];
|
|
94
|
-
var _loop = function _loop(index) {
|
|
95
|
-
var verEntity = viewer.entities.add({
|
|
96
|
-
id: 'edit_' + newSessionid(),
|
|
97
|
-
position: new Cesium.CallbackProperty(function () {
|
|
98
|
-
return updatePos[index];
|
|
99
|
-
}, false),
|
|
100
|
-
point: {
|
|
101
|
-
pixelSize: 20,
|
|
102
|
-
color: Cesium.Color.YELLOW.withAlpha(0.6),
|
|
103
|
-
outlineWidth: 2,
|
|
104
|
-
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
105
|
-
outlineColor: Cesium.Color.DARKRED.withAlpha(1)
|
|
106
|
-
},
|
|
107
|
-
show: true,
|
|
108
|
-
description: index //记录节点索引
|
|
109
|
-
});
|
|
110
|
-
verEntity.GeoType = 'StraightArrowEditPoint';
|
|
111
|
-
verEntity.Editable = true;
|
|
112
|
-
processEntities.push(verEntity);
|
|
113
|
-
};
|
|
114
|
-
for (var index = 0; index < updatePos.length; index++) {
|
|
115
|
-
_loop(index);
|
|
116
|
-
}
|
|
117
|
-
return processEntities;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
export default EditStraightArrow;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 编辑燕尾箭头方法
|
|
3
|
-
*/
|
|
4
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
5
|
-
import { getCatesian3FromPX } from "../utils/Coordinate";
|
|
6
|
-
import { calculateSwallowPoints, lockingMap, newSessionid } from "../utils/PlotCommon";
|
|
7
|
-
var EditSwallowtailArrow = function EditSwallowtailArrow(viewer, entity, handler, collection) {
|
|
8
|
-
var editItem = collection.find(function (ele) {
|
|
9
|
-
return ele.id === entity.id;
|
|
10
|
-
});
|
|
11
|
-
var editEntity;
|
|
12
|
-
var sourcePos = entity.EditingPoint;
|
|
13
|
-
var type = entity.GeoNum;
|
|
14
|
-
var updatePos = Cesium.clone(sourcePos, true);
|
|
15
|
-
entity.show = false;
|
|
16
|
-
var dynamicPositions = new Cesium.CallbackProperty(function () {
|
|
17
|
-
var points = calculateSwallowPoints(updatePos, type);
|
|
18
|
-
return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(points));
|
|
19
|
-
}, false);
|
|
20
|
-
if (editItem) {
|
|
21
|
-
editEntity = editItem.target;
|
|
22
|
-
editEntity.show = true;
|
|
23
|
-
editEntity.polygon.hierarchy = dynamicPositions;
|
|
24
|
-
editItem.processEntities = initVertexEntities();
|
|
25
|
-
} else {
|
|
26
|
-
var newSwallowtail = Cesium.clone(entity.polygon);
|
|
27
|
-
newSwallowtail.material = Cesium.Color.RED.withAlpha(0.4);
|
|
28
|
-
newSwallowtail.hierarchy = dynamicPositions;
|
|
29
|
-
editEntity = viewer.entities.add({
|
|
30
|
-
GeoType: 'EditSwallowtailArrow',
|
|
31
|
-
Editable: true,
|
|
32
|
-
id: 'edit_' + entity.id,
|
|
33
|
-
polygon: newSwallowtail
|
|
34
|
-
});
|
|
35
|
-
var vertexs = initVertexEntities();
|
|
36
|
-
collection.push({
|
|
37
|
-
id: entity.id,
|
|
38
|
-
source: entity,
|
|
39
|
-
target: editEntity,
|
|
40
|
-
geoType: 'remix_swallowtailarrow',
|
|
41
|
-
processEntities: vertexs
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
var boolDown = false; //鼠标左键是否处于摁下状态
|
|
45
|
-
var currentPickVertex = undefined; //当前选择的要编辑的节点
|
|
46
|
-
var currentPickPolygon = undefined; //当前选择的要移动的燕尾箭头
|
|
47
|
-
// 左键摁下事件
|
|
48
|
-
handler.setInputAction(function (event) {
|
|
49
|
-
boolDown = true;
|
|
50
|
-
var pick = viewer.scene.pick(event.position);
|
|
51
|
-
if (Cesium.defined(pick) && pick.id) {
|
|
52
|
-
var pickEntity = pick.id;
|
|
53
|
-
if (!pickEntity.GeoType || !pickEntity.Editable) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (pickEntity.GeoType === 'SwallowtailArrowEditPoint') {
|
|
57
|
-
lockingMap(viewer, false);
|
|
58
|
-
currentPickVertex = pickEntity;
|
|
59
|
-
} else if (pickEntity.GeoType === 'EditSwallowtailArrow') {
|
|
60
|
-
lockingMap(viewer, false);
|
|
61
|
-
currentPickPolygon = pickEntity;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
|
|
65
|
-
// 鼠标移动事件
|
|
66
|
-
handler.setInputAction(function (event) {
|
|
67
|
-
//console.log('鼠标移动事件监测:------燕尾箭头编辑中------');
|
|
68
|
-
if (boolDown && currentPickVertex) {
|
|
69
|
-
var pos = getCatesian3FromPX(viewer, event.endPosition);
|
|
70
|
-
if (pos) {
|
|
71
|
-
updatePos[currentPickVertex.description] = pos;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (boolDown && currentPickPolygon) {
|
|
75
|
-
var startPosition = viewer.scene.pickPosition(event.startPosition);
|
|
76
|
-
var endPosition = viewer.scene.pickPosition(event.endPosition);
|
|
77
|
-
var changed_x = endPosition.x - startPosition.x;
|
|
78
|
-
var changed_y = endPosition.y - startPosition.y;
|
|
79
|
-
var changed_z = endPosition.z - startPosition.z;
|
|
80
|
-
updatePos[0] = new Cesium.Cartesian3(updatePos[0].x + changed_x, updatePos[0].y + changed_y, updatePos[0].z + changed_z);
|
|
81
|
-
updatePos[1] = new Cesium.Cartesian3(updatePos[1].x + changed_x, updatePos[1].y + changed_y, updatePos[1].z + changed_z);
|
|
82
|
-
}
|
|
83
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
84
|
-
// 左键抬起事件
|
|
85
|
-
handler.setInputAction(function () {
|
|
86
|
-
entity.polygon.hierarchy = editEntity.polygon.hierarchy;
|
|
87
|
-
boolDown = false;
|
|
88
|
-
currentPickVertex = undefined;
|
|
89
|
-
currentPickPolygon = undefined;
|
|
90
|
-
lockingMap(viewer, true);
|
|
91
|
-
entity.EditingPoint = updatePos;
|
|
92
|
-
}, Cesium.ScreenSpaceEventType.LEFT_UP);
|
|
93
|
-
function initVertexEntities() {
|
|
94
|
-
var processEntities = [];
|
|
95
|
-
var _loop = function _loop(index) {
|
|
96
|
-
var verEntity = viewer.entities.add({
|
|
97
|
-
id: 'edit_' + newSessionid(),
|
|
98
|
-
position: new Cesium.CallbackProperty(function () {
|
|
99
|
-
return updatePos[index];
|
|
100
|
-
}, false),
|
|
101
|
-
point: {
|
|
102
|
-
pixelSize: 20,
|
|
103
|
-
color: Cesium.Color.YELLOW.withAlpha(0.6),
|
|
104
|
-
outlineWidth: 2,
|
|
105
|
-
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
106
|
-
outlineColor: Cesium.Color.DARKRED.withAlpha(1)
|
|
107
|
-
},
|
|
108
|
-
show: true,
|
|
109
|
-
description: index //记录节点索引
|
|
110
|
-
});
|
|
111
|
-
verEntity.GeoType = 'SwallowtailArrowEditPoint';
|
|
112
|
-
verEntity.Editable = true;
|
|
113
|
-
processEntities.push(verEntity);
|
|
114
|
-
};
|
|
115
|
-
for (var index = 0; index < updatePos.length; index++) {
|
|
116
|
-
_loop(index);
|
|
117
|
-
}
|
|
118
|
-
return processEntities;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
export default EditSwallowtailArrow;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import EditAssemble from './EditAssemble';
|
|
2
|
-
import EditAttackArrow from './EditAttackArrow';
|
|
3
|
-
import EditBillboard from './EditBillboard';
|
|
4
|
-
import EditBow from './EditBow';
|
|
5
|
-
import EditCircle from './EditCircle';
|
|
6
|
-
import EditCurve from './EditCurve';
|
|
7
|
-
import EditElliptic from './EditElliptic';
|
|
8
|
-
import EditFlag from './EditFlag';
|
|
9
|
-
import EditFormation from './EditFormation';
|
|
10
|
-
import EditLabel from './EditLabel';
|
|
11
|
-
import EditLineArrow from './EditLineArrow';
|
|
12
|
-
import EditPincerArrow from './EditPincerArrow';
|
|
13
|
-
import EditPoint from './EditPoint';
|
|
14
|
-
import EditPolygon from './EditPolygon';
|
|
15
|
-
import EditPolyline from './EditPolyline';
|
|
16
|
-
import EditRectangle from './EditRectangle';
|
|
17
|
-
import EditRegularPolygon from './EditRegularPolygon';
|
|
18
|
-
import EditRightAngleArrow from './EditRightAngleArrow';
|
|
19
|
-
import EditRoundRectangle from './EditRoundRectangle';
|
|
20
|
-
import EditSector from './EditSector';
|
|
21
|
-
import EditStraightArrow from './EditStraightArrow';
|
|
22
|
-
import EditSwallowtailArrow from './EditSwallowtailArrow';
|
|
23
|
-
export { EditAssemble, EditAttackArrow, EditBillboard, EditBow, EditCircle, EditCurve, EditElliptic, EditFlag, EditFormation, EditLabel, EditLineArrow, EditPincerArrow, EditPoint, EditPolygon, EditPolyline, EditRectangle, EditRegularPolygon, EditRightAngleArrow, EditRoundRectangle, EditSector, EditStraightArrow, EditSwallowtailArrow, };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import EditAssemble from "./EditAssemble";
|
|
2
|
-
import EditAttackArrow from "./EditAttackArrow";
|
|
3
|
-
import EditBillboard from "./EditBillboard";
|
|
4
|
-
import EditBow from "./EditBow";
|
|
5
|
-
import EditCircle from "./EditCircle";
|
|
6
|
-
import EditCurve from "./EditCurve";
|
|
7
|
-
import EditElliptic from "./EditElliptic";
|
|
8
|
-
import EditFlag from "./EditFlag";
|
|
9
|
-
import EditFormation from "./EditFormation";
|
|
10
|
-
import EditLabel from "./EditLabel";
|
|
11
|
-
import EditLineArrow from "./EditLineArrow";
|
|
12
|
-
import EditPincerArrow from "./EditPincerArrow";
|
|
13
|
-
import EditPoint from "./EditPoint";
|
|
14
|
-
import EditPolygon from "./EditPolygon";
|
|
15
|
-
import EditPolyline from "./EditPolyline";
|
|
16
|
-
import EditRectangle from "./EditRectangle";
|
|
17
|
-
import EditRegularPolygon from "./EditRegularPolygon";
|
|
18
|
-
import EditRightAngleArrow from "./EditRightAngleArrow";
|
|
19
|
-
import EditRoundRectangle from "./EditRoundRectangle";
|
|
20
|
-
import EditSector from "./EditSector";
|
|
21
|
-
import EditStraightArrow from "./EditStraightArrow";
|
|
22
|
-
import EditSwallowtailArrow from "./EditSwallowtailArrow";
|
|
23
|
-
export { EditAssemble, EditAttackArrow, EditBillboard, EditBow, EditCircle, EditCurve, EditElliptic, EditFlag, EditFormation, EditLabel, EditLineArrow, EditPincerArrow, EditPoint, EditPolygon, EditPolyline, EditRectangle, EditRegularPolygon, EditRightAngleArrow, EditRoundRectangle, EditSector, EditStraightArrow, EditSwallowtailArrow };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import '../index.css';
|
|
2
|
-
interface WindowPos {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
}
|
|
6
|
-
interface AttributeOption {
|
|
7
|
-
id: string;
|
|
8
|
-
coord: {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
z: number;
|
|
12
|
-
};
|
|
13
|
-
size: string;
|
|
14
|
-
text: string;
|
|
15
|
-
}
|
|
16
|
-
export declare class LabelAttributeForm {
|
|
17
|
-
_viewer: any;
|
|
18
|
-
_winPos: WindowPos;
|
|
19
|
-
_id: string;
|
|
20
|
-
_coord: {
|
|
21
|
-
x: number;
|
|
22
|
-
y: number;
|
|
23
|
-
z: number;
|
|
24
|
-
};
|
|
25
|
-
_size: string;
|
|
26
|
-
_text: string;
|
|
27
|
-
_customDiv: HTMLElement | null;
|
|
28
|
-
constructor(viewer: any, winPos: WindowPos, options: AttributeOption);
|
|
29
|
-
initDom(): void;
|
|
30
|
-
initEvent(): void;
|
|
31
|
-
confirm(bool: boolean): void;
|
|
32
|
-
destroy(): void;
|
|
33
|
-
}
|
|
34
|
-
export {};
|