deeptwins-engine-3d 0.1.64 → 0.1.66
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/esm/constant.d.ts +1 -0
- package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.d.ts +1 -0
- package/dist/esm/drawCommand/viewShed/ViewShedAnalyserLayer.d.ts +1 -0
- package/dist/esm/{plot/utils/Algorithm.js → drawer/algorithm.js} +1 -3
- package/dist/esm/drawer/common.d.ts +62 -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 -0
- 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 +15 -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 +2 -0
- package/dist/esm/index.js +6 -2
- package/dist/esm/map/Map.d.ts +9 -0
- package/dist/esm/map/Map.js +115 -2
- package/dist/esm/material/AtmosphericDispersion.d.ts +71 -0
- package/dist/esm/material/AtmosphericDispersion.js +485 -33
- package/dist/esm/material/GlobalVolumetricCloud.d.ts +117 -0
- package/dist/esm/material/GlobalVolumetricCloud.js +219 -223
- package/dist/esm/material/entity/ImageMaterialProperty.d.ts +1 -0
- package/dist/esm/material/shader/AtmosphericShader.glsl +244 -0
- package/dist/esm/measure/Area.d.ts +17 -17
- package/dist/esm/measure/Area.js +95 -63
- package/dist/esm/measure/BaseDraw.d.ts +10 -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 +95 -0
- package/dist/esm/measure/types.js +17 -0
- package/dist/esm/measure/utils.d.ts +8 -7
- package/dist/esm/measure/utils.js +43 -24
- package/dist/esm/sceneFusion/Airway.d.ts +0 -0
- package/dist/esm/sceneFusion/Airway.js +692 -0
- package/dist/esm/tileLayer/ArcGisLayer.d.ts +1 -0
- package/dist/esm/tileLayer/ImageryLayer.d.ts +1 -0
- package/dist/esm/tileLayer/MvtVectorLoad.d.ts +1 -0
- package/dist/esm/tool/common.d.ts +1 -0
- package/dist/esm/tool/utils.d.ts +1 -0
- package/dist/esm/tool/utils.js +1 -1
- package/dist/esm/typings.d.ts +8 -0
- package/dist/esm/visualization/BaseHeatmap.d.ts +5 -0
- package/dist/esm/visualization/BaseHeatmap.js +54 -12
- package/dist/esm/visualization/Heatmap2d.d.ts +1 -0
- package/dist/esm/visualization/Heatmap2d.js +17 -26
- package/dist/esm/visualization/Heatmap3d.d.ts +8 -2
- package/dist/esm/visualization/Heatmap3d.js +195 -59
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +1 -1
- 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,180 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 编辑曲线方法
|
|
3
|
-
*/
|
|
4
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
5
|
-
import { createBezierPoints, lockingMap, newSessionid } from "../utils/PlotCommon";
|
|
6
|
-
var EditCurve = function EditCurve(viewer, entity, handler, collection) {
|
|
7
|
-
var editItem = collection.find(function (ele) {
|
|
8
|
-
return ele.id === entity.id;
|
|
9
|
-
});
|
|
10
|
-
var editEntity;
|
|
11
|
-
var sourcePos = entity.EditingPoint;
|
|
12
|
-
var updatePos = Cesium.clone(sourcePos, true);
|
|
13
|
-
var linePoints = createBezierPoints(updatePos);
|
|
14
|
-
entity.polyline.positions = linePoints;
|
|
15
|
-
entity.show = false;
|
|
16
|
-
var dynamicPos = new Cesium.CallbackProperty(function () {
|
|
17
|
-
return createBezierPoints(updatePos);
|
|
18
|
-
}, false);
|
|
19
|
-
if (editItem) {
|
|
20
|
-
editEntity = editItem.target;
|
|
21
|
-
editEntity.show = true;
|
|
22
|
-
editEntity.polyline.position = dynamicPos;
|
|
23
|
-
editItem.processEntities = initVertexEntities();
|
|
24
|
-
} else {
|
|
25
|
-
var newPolyline = Cesium.clone(entity.polyline);
|
|
26
|
-
newPolyline.material = Cesium.Color.RED.withAlpha(0.4);
|
|
27
|
-
newPolyline.width = 10;
|
|
28
|
-
newPolyline.positions = dynamicPos;
|
|
29
|
-
editEntity = viewer.entities.add({
|
|
30
|
-
GeoType: 'EditCurve',
|
|
31
|
-
Editable: true,
|
|
32
|
-
id: 'edit_' + entity.id,
|
|
33
|
-
polyline: newPolyline
|
|
34
|
-
});
|
|
35
|
-
var vertexs = initVertexEntities();
|
|
36
|
-
collection.push({
|
|
37
|
-
id: entity.id,
|
|
38
|
-
source: entity,
|
|
39
|
-
target: editEntity,
|
|
40
|
-
geoType: 'remix_curve',
|
|
41
|
-
processEntities: vertexs
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
var boolDown = false; //鼠标左键是否处于摁下状态
|
|
45
|
-
var currentPickVertex = undefined; //当前选择的要编辑的节点
|
|
46
|
-
var currentPickPolyline = undefined; //当前选择的要移动的折线
|
|
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 === 'CurveEditPoints') {
|
|
56
|
-
lockingMap(viewer, false);
|
|
57
|
-
currentPickVertex = pickEntity;
|
|
58
|
-
} else if (pickEntity.GeoType === 'EditCurve') {
|
|
59
|
-
lockingMap(viewer, false);
|
|
60
|
-
currentPickPolyline = pickEntity;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
|
|
64
|
-
// 鼠标移动事件
|
|
65
|
-
handler.setInputAction(function (event) {
|
|
66
|
-
//console.log("鼠标移动事件监测:------曲线编辑中------");
|
|
67
|
-
if (boolDown && currentPickVertex) {
|
|
68
|
-
var pos = viewer.scene.pickPosition(event.endPosition);
|
|
69
|
-
updatePos[currentPickVertex.description.getValue()] = pos;
|
|
70
|
-
}
|
|
71
|
-
if (boolDown && currentPickPolyline) {
|
|
72
|
-
var startPosition = viewer.scene.pickPosition(event.startPosition);
|
|
73
|
-
var endPosition = viewer.scene.pickPosition(event.endPosition);
|
|
74
|
-
var changed_x = endPosition.x - startPosition.x;
|
|
75
|
-
var changed_y = endPosition.y - startPosition.y;
|
|
76
|
-
var changed_z = endPosition.z - startPosition.z;
|
|
77
|
-
updatePos.forEach(function (element) {
|
|
78
|
-
element.x = element.x + changed_x;
|
|
79
|
-
element.y = element.y + changed_y;
|
|
80
|
-
element.z = element.z + changed_z;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
84
|
-
// 左键抬起事件
|
|
85
|
-
handler.setInputAction(function () {
|
|
86
|
-
entity.polyline.positions = editEntity.polyline.positions.getValue();
|
|
87
|
-
boolDown = false;
|
|
88
|
-
currentPickVertex = undefined;
|
|
89
|
-
currentPickPolyline = undefined;
|
|
90
|
-
lockingMap(viewer, true);
|
|
91
|
-
entity.EditingPoint = Cesium.clone(updatePos, true);
|
|
92
|
-
}, Cesium.ScreenSpaceEventType.LEFT_UP);
|
|
93
|
-
// 左键点击事件
|
|
94
|
-
handler.setInputAction(function (event) {
|
|
95
|
-
var pick = viewer.scene.pick(event.position);
|
|
96
|
-
if (Cesium.defined(pick) && pick.id) {
|
|
97
|
-
if (pick.id.GeoType === 'CurveEditCenterPoints') {
|
|
98
|
-
var index = pick.id.description.getValue() + 1;
|
|
99
|
-
var pos = pick.id.position.getValue();
|
|
100
|
-
updateProcessObj(true, index, pos);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
104
|
-
//右键点击事件
|
|
105
|
-
handler.setInputAction(function (event) {
|
|
106
|
-
var pick = viewer.scene.pick(event.position);
|
|
107
|
-
if (Cesium.defined(pick) && pick.id) {
|
|
108
|
-
if (pick.id.GeoType === 'CurveEditPoints') {
|
|
109
|
-
if (updatePos.length < 3) {
|
|
110
|
-
alert('折线节点数不能少于2个');
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
var index = pick.id.description.getValue();
|
|
114
|
-
updateProcessObj(false, index);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
|
|
118
|
-
function updateProcessObj(add, index, pos) {
|
|
119
|
-
var item = collection.find(function (ele) {
|
|
120
|
-
return ele.id === entity.id;
|
|
121
|
-
});
|
|
122
|
-
if (item && item.processEntities) {
|
|
123
|
-
item.processEntities.forEach(function (entity) {
|
|
124
|
-
viewer.entities.remove(entity);
|
|
125
|
-
});
|
|
126
|
-
add ? updatePos.splice(index, 0, pos) : updatePos.splice(index, 1);
|
|
127
|
-
item.processEntities = initVertexEntities();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
function initVertexEntities() {
|
|
131
|
-
var vertexPointsEntity = []; //中途创建的Point对象
|
|
132
|
-
var centerPointsEntity = []; //中途创建的虚拟Point对象
|
|
133
|
-
var _loop = function _loop(index) {
|
|
134
|
-
var point = viewer.entities.add({
|
|
135
|
-
id: 'edit_' + newSessionid(),
|
|
136
|
-
position: new Cesium.CallbackProperty(function () {
|
|
137
|
-
return updatePos[index];
|
|
138
|
-
}, false),
|
|
139
|
-
point: {
|
|
140
|
-
pixelSize: 20,
|
|
141
|
-
color: Cesium.Color.YELLOW.withAlpha(0.6),
|
|
142
|
-
outlineWidth: 2,
|
|
143
|
-
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
144
|
-
outlineColor: Cesium.Color.DARKRED.withAlpha(1)
|
|
145
|
-
},
|
|
146
|
-
show: true,
|
|
147
|
-
description: index //记录节点索引
|
|
148
|
-
});
|
|
149
|
-
point.GeoType = 'CurveEditPoints';
|
|
150
|
-
point.Editable = true;
|
|
151
|
-
vertexPointsEntity.push(point);
|
|
152
|
-
if (updatePos[index + 1]) {
|
|
153
|
-
var centerPoint = viewer.entities.add({
|
|
154
|
-
id: 'edit_' + newSessionid(),
|
|
155
|
-
position: new Cesium.CallbackProperty(function () {
|
|
156
|
-
return Cesium.Cartesian3.midpoint(updatePos[index], updatePos[index + 1], new Cesium.Cartesian3());
|
|
157
|
-
}, false),
|
|
158
|
-
point: {
|
|
159
|
-
pixelSize: 15,
|
|
160
|
-
color: Cesium.Color.GREEN.withAlpha(1),
|
|
161
|
-
outlineWidth: 2,
|
|
162
|
-
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
163
|
-
outlineColor: Cesium.Color.YELLOW.withAlpha(0.6)
|
|
164
|
-
},
|
|
165
|
-
show: true,
|
|
166
|
-
description: index //记录节点索引
|
|
167
|
-
});
|
|
168
|
-
centerPoint.GeoType = 'CurveEditCenterPoints';
|
|
169
|
-
centerPoint.Editable = true;
|
|
170
|
-
centerPointsEntity.push(centerPoint);
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
for (var index = 0; index < updatePos.length; index++) {
|
|
174
|
-
_loop(index);
|
|
175
|
-
}
|
|
176
|
-
var processEntities = vertexPointsEntity.concat(centerPointsEntity);
|
|
177
|
-
return processEntities;
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
export default EditCurve;
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 编辑椭圆方法
|
|
3
|
-
*/
|
|
4
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
5
|
-
import { getCatesian3FromPX } from "../utils/Coordinate";
|
|
6
|
-
import { getEllipticAngle, getSemiAxis, lockingMap, newSessionid } from "../utils/PlotCommon";
|
|
7
|
-
var EditElliptic = function EditElliptic(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 dynamicPos = new Cesium.CallbackProperty(function () {
|
|
16
|
-
return updatePos[0];
|
|
17
|
-
}, false);
|
|
18
|
-
var semiMinorAxis = new Cesium.CallbackProperty(function () {
|
|
19
|
-
return getSemiAxis(updatePos) / 2;
|
|
20
|
-
}, false);
|
|
21
|
-
var semiMajorAxis = new Cesium.CallbackProperty(function () {
|
|
22
|
-
return getSemiAxis(updatePos);
|
|
23
|
-
}, false);
|
|
24
|
-
var rotation = new Cesium.CallbackProperty(function () {
|
|
25
|
-
return getEllipticAngle(updatePos);
|
|
26
|
-
}, false);
|
|
27
|
-
if (editItem) {
|
|
28
|
-
editEntity = editItem.target;
|
|
29
|
-
editEntity.show = true;
|
|
30
|
-
editEntity.position = dynamicPos;
|
|
31
|
-
editEntity.ellipse.semiMinorAxis = semiMinorAxis;
|
|
32
|
-
editEntity.ellipse.semiMajorAxis = semiMajorAxis;
|
|
33
|
-
editEntity.ellipse.rotation = rotation;
|
|
34
|
-
editItem.processEntities = initVertexEntities();
|
|
35
|
-
} else {
|
|
36
|
-
var newElliptic = Cesium.clone(entity.ellipse);
|
|
37
|
-
newElliptic.material = Cesium.Color.RED.withAlpha(0.4);
|
|
38
|
-
newElliptic.semiMinorAxis = semiMinorAxis;
|
|
39
|
-
newElliptic.semiMajorAxis = semiMajorAxis;
|
|
40
|
-
newElliptic.rotation = rotation;
|
|
41
|
-
editEntity = viewer.entities.add({
|
|
42
|
-
position: dynamicPos,
|
|
43
|
-
GeoType: 'EditElliptic',
|
|
44
|
-
Editable: true,
|
|
45
|
-
id: 'edit_' + entity.id,
|
|
46
|
-
ellipse: newElliptic
|
|
47
|
-
});
|
|
48
|
-
var vertexs = initVertexEntities();
|
|
49
|
-
collection.push({
|
|
50
|
-
id: entity.id,
|
|
51
|
-
source: entity,
|
|
52
|
-
target: editEntity,
|
|
53
|
-
geoType: 'remix_elliptic',
|
|
54
|
-
processEntities: vertexs
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
var boolDown = false; //鼠标左键是否处于摁下状态
|
|
58
|
-
var currentPickVertex = undefined; //当前选择的要编辑的节点
|
|
59
|
-
var currentPickPolygon = undefined; //当前选择的要移动的椭圆
|
|
60
|
-
// 左键摁下事件
|
|
61
|
-
handler.setInputAction(function (event) {
|
|
62
|
-
boolDown = true;
|
|
63
|
-
var pick = viewer.scene.pick(event.position);
|
|
64
|
-
if (Cesium.defined(pick) && pick.id) {
|
|
65
|
-
var pickEntity = pick.id;
|
|
66
|
-
if (!pickEntity.GeoType || !pickEntity.Editable) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (pickEntity.GeoType === 'EllipticEditEnd') {
|
|
70
|
-
lockingMap(viewer, false);
|
|
71
|
-
currentPickVertex = pickEntity;
|
|
72
|
-
} else if (pickEntity.GeoType === 'EditElliptic' || pickEntity.GeoType === 'EllipticEditCenter') {
|
|
73
|
-
lockingMap(viewer, false);
|
|
74
|
-
currentPickPolygon = pickEntity;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
|
|
78
|
-
// 鼠标移动事件
|
|
79
|
-
handler.setInputAction(function (event) {
|
|
80
|
-
//console.log('鼠标移动事件监测:------正多边形编辑中------');
|
|
81
|
-
if (boolDown && currentPickVertex) {
|
|
82
|
-
var pos = getCatesian3FromPX(viewer, event.endPosition);
|
|
83
|
-
updatePos[1] = pos;
|
|
84
|
-
}
|
|
85
|
-
if (boolDown && currentPickPolygon) {
|
|
86
|
-
var startPosition = viewer.scene.pickPosition(event.startPosition);
|
|
87
|
-
var endPosition = viewer.scene.pickPosition(event.endPosition);
|
|
88
|
-
var changed_x = endPosition.x - startPosition.x;
|
|
89
|
-
var changed_y = endPosition.y - startPosition.y;
|
|
90
|
-
var changed_z = endPosition.z - startPosition.z;
|
|
91
|
-
updatePos[0] = new Cesium.Cartesian3(updatePos[0].x + changed_x, updatePos[0].y + changed_y, updatePos[0].z + changed_z);
|
|
92
|
-
updatePos[1] = new Cesium.Cartesian3(updatePos[1].x + changed_x, updatePos[1].y + changed_y, updatePos[1].z + changed_z);
|
|
93
|
-
}
|
|
94
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
95
|
-
// 左键抬起事件
|
|
96
|
-
handler.setInputAction(function () {
|
|
97
|
-
entity.position = editEntity.position;
|
|
98
|
-
entity.ellipse.semiMinorAxis = editEntity.ellipse.semiMinorAxis;
|
|
99
|
-
entity.ellipse.semiMajorAxis = editEntity.ellipse.semiMajorAxis;
|
|
100
|
-
entity.ellipse.rotation = editEntity.ellipse.rotation;
|
|
101
|
-
boolDown = false;
|
|
102
|
-
currentPickVertex = undefined;
|
|
103
|
-
currentPickPolygon = undefined;
|
|
104
|
-
lockingMap(viewer, true);
|
|
105
|
-
entity.EditingPoint = updatePos;
|
|
106
|
-
}, Cesium.ScreenSpaceEventType.LEFT_UP);
|
|
107
|
-
function initVertexEntities() {
|
|
108
|
-
var centerEntity = viewer.entities.add({
|
|
109
|
-
id: 'edit_' + newSessionid(),
|
|
110
|
-
position: new Cesium.CallbackProperty(function () {
|
|
111
|
-
return updatePos[0];
|
|
112
|
-
}, false),
|
|
113
|
-
point: {
|
|
114
|
-
pixelSize: 20,
|
|
115
|
-
color: Cesium.Color.YELLOW.withAlpha(0.6),
|
|
116
|
-
outlineWidth: 2,
|
|
117
|
-
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
118
|
-
outlineColor: Cesium.Color.DARKRED.withAlpha(1)
|
|
119
|
-
},
|
|
120
|
-
show: true
|
|
121
|
-
});
|
|
122
|
-
centerEntity.GeoType = 'EllipticEditCenter';
|
|
123
|
-
centerEntity.Editable = true;
|
|
124
|
-
var endEntity = viewer.entities.add({
|
|
125
|
-
id: 'edit_' + newSessionid(),
|
|
126
|
-
position: new Cesium.CallbackProperty(function () {
|
|
127
|
-
return updatePos[1];
|
|
128
|
-
}, false),
|
|
129
|
-
point: {
|
|
130
|
-
pixelSize: 20,
|
|
131
|
-
color: Cesium.Color.GREEN.withAlpha(1),
|
|
132
|
-
outlineWidth: 2,
|
|
133
|
-
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
134
|
-
outlineColor: Cesium.Color.YELLOW.withAlpha(0.6)
|
|
135
|
-
},
|
|
136
|
-
show: true
|
|
137
|
-
});
|
|
138
|
-
endEntity.GeoType = 'EllipticEditEnd';
|
|
139
|
-
endEntity.Editable = true;
|
|
140
|
-
var processEntities = [centerEntity, endEntity];
|
|
141
|
-
return processEntities;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
export default EditElliptic;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 编辑旗标方法
|
|
3
|
-
*/
|
|
4
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
5
|
-
import { getCatesian3FromPX } from "../utils/Coordinate";
|
|
6
|
-
import { calculateFlagPoints, lockingMap, newSessionid } from "../utils/PlotCommon";
|
|
7
|
-
var EditFlag = function EditFlag(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
|
-
var type = entity.GeoNum;
|
|
15
|
-
entity.show = false;
|
|
16
|
-
var dynamicPositions = new Cesium.CallbackProperty(function () {
|
|
17
|
-
var points = calculateFlagPoints(updatePos, type);
|
|
18
|
-
return new Cesium.PolygonHierarchy(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 newFlag = Cesium.clone(entity.polygon);
|
|
27
|
-
newFlag.material = Cesium.Color.RED.withAlpha(0.4);
|
|
28
|
-
newFlag.hierarchy = dynamicPositions;
|
|
29
|
-
editEntity = viewer.entities.add({
|
|
30
|
-
GeoType: 'EditFlag',
|
|
31
|
-
Editable: true,
|
|
32
|
-
id: 'edit_' + entity.id,
|
|
33
|
-
polygon: newFlag
|
|
34
|
-
});
|
|
35
|
-
var vertexs = initVertexEntities();
|
|
36
|
-
collection.push({
|
|
37
|
-
id: entity.id,
|
|
38
|
-
source: entity,
|
|
39
|
-
target: editEntity,
|
|
40
|
-
geoType: 'remix_flag',
|
|
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 === 'FlagEditPoint') {
|
|
57
|
-
lockingMap(viewer, false);
|
|
58
|
-
currentPickVertex = pickEntity;
|
|
59
|
-
} else if (pickEntity.GeoType === 'EditFlag') {
|
|
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 = 'FlagEditPoint';
|
|
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 EditFlag;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 编辑防御、进攻阵型方法
|
|
3
|
-
*/
|
|
4
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
5
|
-
import { getCatesian3FromPX } from "../utils/Coordinate";
|
|
6
|
-
import { calculateFormationPoints, lockingMap, newSessionid } from "../utils/PlotCommon";
|
|
7
|
-
var EditFormation = function EditFormation(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
|
-
var type = entity.GeoNum;
|
|
15
|
-
entity.show = false;
|
|
16
|
-
var dynamicPositions = new Cesium.CallbackProperty(function () {
|
|
17
|
-
return calculateFormationPoints(updatePos, type);
|
|
18
|
-
}, false);
|
|
19
|
-
if (editItem) {
|
|
20
|
-
editEntity = editItem.target;
|
|
21
|
-
editEntity.show = true;
|
|
22
|
-
editEntity.polyline.positions = dynamicPositions;
|
|
23
|
-
editItem.processEntities = initVertexEntities();
|
|
24
|
-
} else {
|
|
25
|
-
var newFormation = Cesium.clone(entity.polyline);
|
|
26
|
-
newFormation.material = Cesium.Color.RED.withAlpha(0.4);
|
|
27
|
-
newFormation.positions = dynamicPositions;
|
|
28
|
-
editEntity = viewer.entities.add({
|
|
29
|
-
GeoType: 'EditFormation',
|
|
30
|
-
Editable: true,
|
|
31
|
-
id: 'edit_' + entity.id,
|
|
32
|
-
polyline: newFormation
|
|
33
|
-
});
|
|
34
|
-
var vertexs = initVertexEntities();
|
|
35
|
-
collection.push({
|
|
36
|
-
id: entity.id,
|
|
37
|
-
source: entity,
|
|
38
|
-
target: editEntity,
|
|
39
|
-
geoType: 'remix_formation',
|
|
40
|
-
processEntities: vertexs
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
var boolDown = false; //鼠标左键是否处于摁下状态
|
|
44
|
-
var currentPickVertex = undefined; //当前选择的要编辑的节点
|
|
45
|
-
var currentPickFormation = 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 === 'FormationEditPoint') {
|
|
56
|
-
lockingMap(viewer, false);
|
|
57
|
-
currentPickVertex = pickEntity;
|
|
58
|
-
} else if (pickEntity.GeoType === 'EditFormation') {
|
|
59
|
-
lockingMap(viewer, false);
|
|
60
|
-
currentPickFormation = 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 && currentPickFormation) {
|
|
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.polyline.positions = editEntity.polyline.positions;
|
|
86
|
-
boolDown = false;
|
|
87
|
-
currentPickVertex = undefined;
|
|
88
|
-
currentPickFormation = 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 = 'FormationEditPoint';
|
|
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 EditFormation;
|