@kq_npm/client3d_webgl_vue 4.5.55 → 4.5.57
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/adddata/index.js +189 -21
- package/airspacegridoccupancyquery/index.js +1977 -0
- package/airspacegridoccupancyquery/style/airspacegridoccupancyquery.css +1 -0
- package/airspacegridoccupancyquery/style/index.js +3 -0
- package/airspaceprofileanalysis/index.js +1870 -0
- package/airspaceprofileanalysis/style/airspaceprofileanalysis.css +1 -0
- package/airspaceprofileanalysis/style/index.js +3 -0
- package/aspectanalysis/index.js +25 -7
- package/baseterraingallery/index.js +16 -4
- package/boxclip/index.js +58 -16
- package/buildpointmodel/index.js +3207 -230
- package/buildpointmodel/style/buildpointmodel.css +1 -1
- package/buildpolygonmodel/index.js +205 -81
- package/buildpolylinemodel/index.js +346 -70
- package/clientPrint/index.js +32440 -2337
- package/comparemap/index.js +132 -60
- package/compass/index.js +16 -6
- package/excavatefillanalysis/index.js +51 -7
- package/fixedzoomin/index.js +24 -7
- package/fixedzoomout/index.js +25 -7
- package/flight/index.js +113 -26
- package/floodanalysis/index.js +79 -14
- package/geologicalbodyanalysis/index.js +41 -5
- package/gpuspatialquery/index.js +127 -19
- package/gridoccupancyquery/index.js +627 -0
- package/gridoccupancyquery/style/gridoccupancyquery.css +1 -0
- package/gridoccupancyquery/style/index.js +3 -0
- package/hawkeye/index.js +20 -2
- package/headertemp/index.js +7 -2
- package/heatmap3d/index.js +282 -158
- package/index.js +32440 -2337
- package/isolineanalysis/index.js +113 -38
- package/light/index.js +80 -22
- package/limitheightanalysis/index.js +30 -10
- package/lowaltitudefeature/index.js +5027 -0
- package/lowaltitudefeature/style/index.js +3 -0
- package/lowaltitudefeature/style/lowaltitudefeature.css +1 -0
- package/measure/index.js +60 -19
- package/modelFlat/index.js +48 -8
- package/modeledit/index.js +38 -4
- package/modelexcavate/index.js +48 -7
- package/modelfilter/index.js +51 -8
- package/modelmaterialedit/index.js +127 -25
- package/modelprofileanalysis/index.js +51 -14
- package/modelselect/index.js +34 -3
- package/modelstyleedit/index.js +39 -3
- package/modeltransform/index.js +79 -14
- package/package.json +1 -1
- package/particleeffect/index.js +83 -17
- package/planeclip/index.js +66 -17
- package/pointcloudrender/index.js +134 -15
- package/radarscananalysis/index.js +35 -3
- package/resetview/index.js +14 -6
- package/roller/index.js +55 -18
- package/scaneffect/index.js +98 -29
- package/sceneadvancedtoimage/index.js +32 -6
- package/sceneapp/index.js +32440 -2337
- package/sceneset/index.js +141 -71
- package/scenetohdimage/index.js +23 -3
- package/sceneview/index.js +32440 -2337
- package/sceneview/style/sceneview.css +1 -1
- package/screenshot/index.js +44 -11
- package/shadowanalysis/index.js +79 -19
- package/sightlineanalysis/index.js +66 -15
- package/skylineanalysis/index.js +20 -4
- package/slopeanalysis/index.js +75 -16
- package/slopeaspectanalysis/index.js +128 -26
- package/statusbar/index.js +80 -67
- package/style.css +1 -1
- package/terrainoperation/index.js +39 -7
- package/terrainprofileanalysis/index.js +43 -5
- package/toolbarapp/index.js +32440 -2337
- package/toolboxapp/index.js +32440 -2337
- package/typhoontrac/index.js +134 -16
- package/underground/index.js +8 -2
- package/videofusion/index.js +164 -79
- package/videoproject/index.js +77 -23
- package/viewshedanalysis/index.js +61 -14
- package/weathereffect/index.js +73 -18
- package/webgl.es.js +866 -16
- package/windyslicing/index.js +258 -54
- package/wireframesketch/index.js +25 -8
|
@@ -127,6 +127,8 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
127
127
|
lang,
|
|
128
128
|
locale
|
|
129
129
|
} = (0, _useGlobalConfig.useLocale)();
|
|
130
|
+
|
|
131
|
+
// 地质体对象列表
|
|
130
132
|
let geologys = (0, _vue.ref)([]);
|
|
131
133
|
|
|
132
134
|
// 获取组件传参
|
|
@@ -137,6 +139,8 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
137
139
|
drillingRadius: props?.settingParams?.drillingRadius ?? 10,
|
|
138
140
|
drillingDepth: props?.settingParams?.drillingDepth ?? 50
|
|
139
141
|
});
|
|
142
|
+
|
|
143
|
+
// 地质体分析视图模型实例
|
|
140
144
|
let viewModel = null;
|
|
141
145
|
|
|
142
146
|
// 组件容器Ref
|
|
@@ -144,6 +148,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
144
148
|
|
|
145
149
|
// 生成组件默认header
|
|
146
150
|
let headerTemp = (0, _vue.ref)();
|
|
151
|
+
// header组件引用Ref
|
|
147
152
|
let headerTempRef = (0, _vue.ref)();
|
|
148
153
|
(0, _vue.onMounted)(() => {
|
|
149
154
|
(0, _util.updatePosition)(boxRef.value, props);
|
|
@@ -173,6 +178,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
173
178
|
}
|
|
174
179
|
}, 1000);
|
|
175
180
|
});
|
|
181
|
+
/** @description 视图模型回调,地质体加载完成后刷新地质体列表
|
|
182
|
+
* @param {string} key 回调参数键
|
|
183
|
+
* @param {*} val 回调参数值
|
|
184
|
+
*/
|
|
176
185
|
function callbackParams(key, val) {
|
|
177
186
|
if (viewModel) {
|
|
178
187
|
tiles.value = viewModel.findLayers(); // 获取所有tileset对象
|
|
@@ -190,9 +199,12 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
190
199
|
}
|
|
191
200
|
};
|
|
192
201
|
|
|
193
|
-
|
|
202
|
+
/** @description 参数改变处理,根据参数类型更新地质体分析状态
|
|
203
|
+
* @param {string} key 变化的参数类型(geology/drillingRadius/drillingDepth)
|
|
204
|
+
*/
|
|
194
205
|
function paramsChanged(key) {
|
|
195
206
|
switch (key) {
|
|
207
|
+
// 地质体对象变化
|
|
196
208
|
case "geology":
|
|
197
209
|
viewModel.setLayer(formItem.geology);
|
|
198
210
|
break;
|
|
@@ -547,6 +559,12 @@ var _useGlobalConfig = __webpack_require__(22686);
|
|
|
547
559
|
//地质体分析逻辑类
|
|
548
560
|
|
|
549
561
|
class GeologicalBodyAnalysisViewModel {
|
|
562
|
+
//外部回调函数
|
|
563
|
+
/** @description 构造函数,初始化地质体分析视图模型并绑定测量事件
|
|
564
|
+
* @param {Object} scenceView 三维场景视图对象
|
|
565
|
+
* @param {Object} options 地质体分析配置参数
|
|
566
|
+
* @param {Function} callbackParams 外部回调函数
|
|
567
|
+
*/
|
|
550
568
|
constructor(scenceView, options, callbackParams) {
|
|
551
569
|
this._viewer = null;
|
|
552
570
|
//三维viewer对象
|
|
@@ -555,7 +573,9 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
555
573
|
this._geologyBody = null;
|
|
556
574
|
//地质体分析三维对象
|
|
557
575
|
this._measureHandler = null;
|
|
576
|
+
//测量三维对象
|
|
558
577
|
this._language = {};
|
|
578
|
+
//多语言资源对象
|
|
559
579
|
this.callbackParams = null;
|
|
560
580
|
const {
|
|
561
581
|
locale
|
|
@@ -565,6 +585,7 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
565
585
|
this._viewer = scenceView._viewer;
|
|
566
586
|
this.callbackParams = callbackParams;
|
|
567
587
|
this._measureHandler = new Cesium.Kq3dMeasureHandler(scenceView._viewer);
|
|
588
|
+
// 自定义绘制提示样式
|
|
568
589
|
if (scenceView._props.showDrawTipsStyle) {
|
|
569
590
|
this._measureHandler.showDrawTips = scenceView._props.showDrawTipsStyle;
|
|
570
591
|
this._measureHandler.drawTipsStyle = {
|
|
@@ -575,10 +596,12 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
575
596
|
}
|
|
576
597
|
};
|
|
577
598
|
}
|
|
599
|
+
// 测量完成事件:隐藏测量结果标签
|
|
578
600
|
this._measureHandler.measureEvent.addEventListener(function (result) {
|
|
579
601
|
if (result.measureResult.labels) result.measureResult.labels.show = false;
|
|
580
602
|
});
|
|
581
603
|
let that = this;
|
|
604
|
+
// 测量激活状态事件:测量结束(ret==false)时根据操作类型执行地质体分析
|
|
582
605
|
this._measureHandler.activeEvent.addEventListener(function (ret) {
|
|
583
606
|
if (ret == false) {
|
|
584
607
|
if (that._measureHandler.measureResults && that._measureHandler.measureResults.length > 0) {
|
|
@@ -603,6 +626,7 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
603
626
|
break;
|
|
604
627
|
case 3:
|
|
605
628
|
// 钻孔
|
|
629
|
+
// 收集所有测量点位置作为钻孔位置
|
|
606
630
|
let positions = [];
|
|
607
631
|
for (let i = that._measureHandler.measureResults.length - 1; i >= 0; i--) {
|
|
608
632
|
positions.push(that._measureHandler.measureResults[i].entities[0].position._value);
|
|
@@ -627,6 +651,9 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
627
651
|
// 添加图层数据源变化监听
|
|
628
652
|
_gisUtils.mapViewUtils.bindViewEvents("resetLayerDatas", this._resetListData, scenceView._viewerId);
|
|
629
653
|
}
|
|
654
|
+
/** @description 图层数据重置回调,响应图层数据源变化事件
|
|
655
|
+
* @param {Object} e 事件对象
|
|
656
|
+
*/
|
|
630
657
|
_resetListData(e) {
|
|
631
658
|
// 如果图层变化事件是自己触发的 则不继续执行 避免死循环
|
|
632
659
|
if (e.eventTarget && e.eventTarget === this) {
|
|
@@ -639,8 +666,11 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
639
666
|
let geologys = [];
|
|
640
667
|
const geologyBodyCollection = this._viewer.geologyBodyCollection;
|
|
641
668
|
for (let i = 0; i < geologyBodyCollection.length; i++) {
|
|
669
|
+
// 仅处理包含地质体图元集合的对象
|
|
642
670
|
if (geologyBodyCollection[i].geologyPrimitiveCollection) {
|
|
671
|
+
// 缺少guid则自动生成
|
|
643
672
|
if (!geologyBodyCollection[i].guid) geologyBodyCollection[i].guid = Cesium.createGuid();
|
|
673
|
+
// 隐藏的地质体跳过
|
|
644
674
|
if (geologyBodyCollection[i]?.show == false) continue;
|
|
645
675
|
geologys.push({
|
|
646
676
|
guid: geologyBodyCollection[i].guid,
|
|
@@ -651,7 +681,9 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
651
681
|
return geologys;
|
|
652
682
|
}
|
|
653
683
|
|
|
654
|
-
|
|
684
|
+
/** @description 设置地质体分析对象,根据guid查找对应地质体
|
|
685
|
+
* @param {string} guid 地质体唯一标识
|
|
686
|
+
*/
|
|
655
687
|
setLayer(guid) {
|
|
656
688
|
this.clear();
|
|
657
689
|
this._geologyBody = this._viewer.geologyBodyCollection.find(function (item) {
|
|
@@ -664,6 +696,7 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
664
696
|
// 判断是否添加了地质体
|
|
665
697
|
if (this._viewer.geologyBodyCollection.length > 0 && this._geologyBody) {
|
|
666
698
|
this.clear();
|
|
699
|
+
// 根据操作类型启动对应的测量模式
|
|
667
700
|
switch (this._options.operationType) {
|
|
668
701
|
case 1:
|
|
669
702
|
// 剖切
|
|
@@ -681,6 +714,7 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
681
714
|
break;
|
|
682
715
|
}
|
|
683
716
|
} else {
|
|
717
|
+
// 未选择地质体则提示
|
|
684
718
|
(0, _message.default)({
|
|
685
719
|
message: this._language.value.webgl["addGeologyBodyTips"],
|
|
686
720
|
type: "warning"
|
|
@@ -691,7 +725,9 @@ class GeologicalBodyAnalysisViewModel {
|
|
|
691
725
|
//清除全部
|
|
692
726
|
clear() {
|
|
693
727
|
if (this._geologyBody) {
|
|
728
|
+
// 移除剖切结果图元
|
|
694
729
|
this._viewer.scene.primitives.remove(this._geologyBody.sectionPrimitives);
|
|
730
|
+
// 地质体图元已被清空时重新创建
|
|
695
731
|
if (this._geologyBody.geologyPrimitiveCollection.length == 0) {
|
|
696
732
|
this._geologyBody.createGeology(this._geologyBody.data).then(function (that) {
|
|
697
733
|
if (!that.viewer.scene.primitives.contains(that.geologyPrimitives)) {
|
|
@@ -723,11 +759,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
723
759
|
value: true
|
|
724
760
|
}));
|
|
725
761
|
exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
|
|
726
|
-
|
|
762
|
+
const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
|
|
727
763
|
__webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
|
|
728
|
-
|
|
764
|
+
const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
|
|
729
765
|
__webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
|
|
730
|
-
|
|
766
|
+
const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
|
|
731
767
|
__webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
|
|
732
768
|
|
|
733
769
|
/***/ })
|
package/gpuspatialquery/index.js
CHANGED
|
@@ -393,6 +393,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
393
393
|
mapTarget: {
|
|
394
394
|
type: String
|
|
395
395
|
},
|
|
396
|
+
propertyName: {
|
|
397
|
+
type: String,
|
|
398
|
+
default: "id"
|
|
399
|
+
},
|
|
396
400
|
//图形
|
|
397
401
|
volumeType: {
|
|
398
402
|
type: Number,
|
|
@@ -488,6 +492,8 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
488
492
|
// 绕Z轴旋转最小值
|
|
489
493
|
maxZRotate: props?.settingParams?.maxZRotate ?? 90 // 绕Z轴旋转最大值
|
|
490
494
|
});
|
|
495
|
+
|
|
496
|
+
// GPU空间查询视图模型实例
|
|
491
497
|
let viewModel = null;
|
|
492
498
|
|
|
493
499
|
// 组件容器Ref
|
|
@@ -495,6 +501,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
495
501
|
|
|
496
502
|
// 生成组件默认header
|
|
497
503
|
let headerTemp = (0, _vue.ref)();
|
|
504
|
+
// header组件引用Ref
|
|
498
505
|
let headerTempRef = (0, _vue.ref)();
|
|
499
506
|
(0, _vue.onMounted)(() => {
|
|
500
507
|
(0, _util.updatePosition)(boxRef.value, props);
|
|
@@ -510,6 +517,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
510
517
|
_gisUtils.utils.getWebMap(props.mapTarget, scenceView => {
|
|
511
518
|
if (scenceView) {
|
|
512
519
|
viewModel = new _GPUSpatialQueryViewModel.default(scenceView, {
|
|
520
|
+
propertyName: props.propertyName,
|
|
513
521
|
volumeType: formItem.volumeType,
|
|
514
522
|
positionMode: formItem.positionMode,
|
|
515
523
|
scale: formItem.scale,
|
|
@@ -531,24 +539,32 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
531
539
|
}
|
|
532
540
|
};
|
|
533
541
|
|
|
534
|
-
|
|
542
|
+
/** @description 参数切换处理,根据参数类型更新查询体属性
|
|
543
|
+
* @param {string} key 变化的参数类型(type/mode/scale/xRotate/yRotate/zRotate)
|
|
544
|
+
*/
|
|
535
545
|
function paramsChanged(key) {
|
|
536
546
|
switch (key) {
|
|
547
|
+
// 查询体类型变化
|
|
537
548
|
case "type":
|
|
538
549
|
viewModel.setType(formItem.volumeType);
|
|
539
550
|
break;
|
|
551
|
+
// 空间关系模式变化
|
|
540
552
|
case "mode":
|
|
541
553
|
viewModel.setMode(formItem.positionMode);
|
|
542
554
|
break;
|
|
555
|
+
// 缩放比例变化
|
|
543
556
|
case "scale":
|
|
544
557
|
viewModel.setScale(formItem.scale);
|
|
545
558
|
break;
|
|
559
|
+
// X轴旋转角度变化
|
|
546
560
|
case "xRotate":
|
|
547
561
|
viewModel.setXangle(formItem.xRotate);
|
|
548
562
|
break;
|
|
563
|
+
// Y轴旋转角度变化
|
|
549
564
|
case "yRotate":
|
|
550
565
|
viewModel.setYangle(formItem.yRotate);
|
|
551
566
|
break;
|
|
567
|
+
// Z轴旋转角度变化
|
|
552
568
|
case "zRotate":
|
|
553
569
|
viewModel.setZangle(formItem.zRotate);
|
|
554
570
|
break;
|
|
@@ -1007,6 +1023,11 @@ var _useGlobalConfig = __webpack_require__(22686);
|
|
|
1007
1023
|
//GPU空间查询逻辑类
|
|
1008
1024
|
|
|
1009
1025
|
class GPUSpatialQueryViewModel {
|
|
1026
|
+
//是否使用数据库ID作为匹配字段
|
|
1027
|
+
/** @description 构造函数,初始化GPU空间查询视图模型并绑定查询完成事件
|
|
1028
|
+
* @param {Object} scenceView 三维场景视图对象
|
|
1029
|
+
* @param {Object} options 空间查询配置参数
|
|
1030
|
+
*/
|
|
1010
1031
|
constructor(scenceView, options) {
|
|
1011
1032
|
this._gpuSpatialQuery = null;
|
|
1012
1033
|
//GPU查询三维对象
|
|
@@ -1018,13 +1039,16 @@ class GPUSpatialQueryViewModel {
|
|
|
1018
1039
|
//绘制图形的坐标
|
|
1019
1040
|
this._options = null;
|
|
1020
1041
|
//传入参数
|
|
1021
|
-
this.finishedQuery = null;
|
|
1022
|
-
//绘制后的查询事件
|
|
1023
1042
|
this._language = {};
|
|
1043
|
+
//多语言资源对象
|
|
1044
|
+
this._propertyName = "id";
|
|
1045
|
+
// 模型属性匹配字段名称
|
|
1046
|
+
this._useDBId = true;
|
|
1024
1047
|
const {
|
|
1025
1048
|
locale
|
|
1026
1049
|
} = (0, _useGlobalConfig.useLocale)();
|
|
1027
1050
|
this._language = locale;
|
|
1051
|
+
if (options.propertyName) this._propertyName = options.propertyName;
|
|
1028
1052
|
options.viewer = scenceView._viewer;
|
|
1029
1053
|
options.viewer.scene.globe.depthTestAgainstTerrain = true;
|
|
1030
1054
|
options.viewer.scene.logarithmicDepthBuffer = true;
|
|
@@ -1033,9 +1057,11 @@ class GPUSpatialQueryViewModel {
|
|
|
1033
1057
|
this._gpuSpatialQuery = new Cesium.Kq3dSpatialQuery({
|
|
1034
1058
|
viewer: options.viewer
|
|
1035
1059
|
});
|
|
1036
|
-
this.
|
|
1060
|
+
this._gpuSpatialQuery.useDBId = this._useDBId;
|
|
1061
|
+
this._gpuSpatialQuery.keyPropertyName = this._propertyName;
|
|
1037
1062
|
this._drawManager = scenceView._drawManager;
|
|
1038
1063
|
var that = this;
|
|
1064
|
+
// 查询结束后的回调事件,高亮结果
|
|
1039
1065
|
this._gpuSpatialQuery.finishSQ.addEventListener(function () {
|
|
1040
1066
|
// 查询结束后的回调事件,高亮结果
|
|
1041
1067
|
for (let l = 0; l < that._gpuSpatialQuery._layers.length; l++) {
|
|
@@ -1046,17 +1072,21 @@ class GPUSpatialQueryViewModel {
|
|
|
1046
1072
|
const tile = tileset._selectedTiles[n];
|
|
1047
1073
|
const content = tile.content;
|
|
1048
1074
|
if (content) {
|
|
1075
|
+
// 遍历瓦片中所有要素,命中查询结果则高亮显示
|
|
1049
1076
|
for (let i = 0; i < content.featuresLength; i++) {
|
|
1050
1077
|
const feature = content.getFeature(i);
|
|
1078
|
+
const idname = feature.getProperty(that._propertyName);
|
|
1051
1079
|
let bFind = false;
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1080
|
+
let id = null;
|
|
1081
|
+
if (feature.pickId) id = feature.pickId.key;
|
|
1082
|
+
if (that._useDBId) id = idname;
|
|
1083
|
+
// 比对要素ID与查询结果ID
|
|
1084
|
+
for (let j = 0; j < queryIds.length; j++) {
|
|
1085
|
+
if (queryIds[j] == id) {
|
|
1086
|
+
bFind = true;
|
|
1058
1087
|
}
|
|
1059
1088
|
}
|
|
1089
|
+
// 命中高亮为青色,否则还原为白色
|
|
1060
1090
|
if (bFind) {
|
|
1061
1091
|
feature.color = Cesium.Color.AQUA;
|
|
1062
1092
|
} else {
|
|
@@ -1082,6 +1112,7 @@ class GPUSpatialQueryViewModel {
|
|
|
1082
1112
|
flag = true;
|
|
1083
1113
|
}
|
|
1084
1114
|
}
|
|
1115
|
+
// 存在模型则启动绘制,否则提示添加模型
|
|
1085
1116
|
if (flag) {
|
|
1086
1117
|
this.clear();
|
|
1087
1118
|
this.findLayers();
|
|
@@ -1091,6 +1122,7 @@ class GPUSpatialQueryViewModel {
|
|
|
1091
1122
|
}, (feature, {
|
|
1092
1123
|
shape
|
|
1093
1124
|
}) => {
|
|
1125
|
+
// 过滤非当前查询组绘制的要素
|
|
1094
1126
|
if (!shape.groupName || shape.groupName !== "GPUSpatialQueryDraw") return;
|
|
1095
1127
|
if (shape) {
|
|
1096
1128
|
that._center = shape.position;
|
|
@@ -1103,6 +1135,7 @@ class GPUSpatialQueryViewModel {
|
|
|
1103
1135
|
}, "GPUSpatialQueryDraw", true);
|
|
1104
1136
|
}
|
|
1105
1137
|
} else {
|
|
1138
|
+
// 场景中无模型则提示
|
|
1106
1139
|
(0, _message.default)({
|
|
1107
1140
|
message: this._language.value.webgl["addModelAnalysisTips"],
|
|
1108
1141
|
type: "warning"
|
|
@@ -1131,6 +1164,16 @@ class GPUSpatialQueryViewModel {
|
|
|
1131
1164
|
this.clear();
|
|
1132
1165
|
// this._gpuSpatialQuery && this._gpuSpatialQuery.destroy();
|
|
1133
1166
|
this._gpuSpatialQuery = null;
|
|
1167
|
+
// 清除所有3dtiles对象的监听事件
|
|
1168
|
+
const primitives = this._options.viewer.scene.primitives._primitives;
|
|
1169
|
+
for (let m = 0; m < primitives.length; m++) {
|
|
1170
|
+
if (primitives[m] instanceof Cesium.Cesium3DTileset) {
|
|
1171
|
+
if (primitives[m].tileVisibleRemoveCallback) {
|
|
1172
|
+
primitives[m].tileVisibleRemoveCallback();
|
|
1173
|
+
delete primitives[m].tileVisibleRemoveCallback;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1134
1177
|
}
|
|
1135
1178
|
|
|
1136
1179
|
// 查找所有3dtiles模型对象
|
|
@@ -1140,6 +1183,53 @@ class GPUSpatialQueryViewModel {
|
|
|
1140
1183
|
for (let m = 0; m < primitives.length; m++) {
|
|
1141
1184
|
if (primitives[m] instanceof Cesium.Cesium3DTileset) {
|
|
1142
1185
|
this._options.layers.push(new Cesium.Kq3dLayerQuery(primitives[m]));
|
|
1186
|
+
if (!primitives[m].tileVisibleRemoveCallback) {
|
|
1187
|
+
primitives[m].tileVisibleRemoveCallback = primitives[m].tileVisible.addEventListener(this.tileVisibleListener, this);
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/** @description 3dtiles瓦片刷新时重新高亮模型
|
|
1194
|
+
* @param {Object} tile 瓦片对象
|
|
1195
|
+
*/
|
|
1196
|
+
tileVisibleListener(tile) {
|
|
1197
|
+
let tileset = tile.tileset;
|
|
1198
|
+
let content = tile.content;
|
|
1199
|
+
let queryIds;
|
|
1200
|
+
// 查找当前瓦片集对应的查询结果ID集合
|
|
1201
|
+
if (this._gpuSpatialQuery) {
|
|
1202
|
+
for (let c = 0; c < this._gpuSpatialQuery._layers.length; c++) {
|
|
1203
|
+
if (this._gpuSpatialQuery._layers[c].layer == tileset) {
|
|
1204
|
+
queryIds = this._gpuSpatialQuery._layers[c].sqResult;
|
|
1205
|
+
break;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
// 有查询结果时按ID匹配高亮,无结果时还原为白色
|
|
1211
|
+
if (queryIds && queryIds.length > 0) {
|
|
1212
|
+
for (let i = 0; i < content.featuresLength; i++) {
|
|
1213
|
+
let feature = content.getFeature(i);
|
|
1214
|
+
let idname = feature.getProperty(this._propertyName);
|
|
1215
|
+
let bFind = false;
|
|
1216
|
+
let id = null;
|
|
1217
|
+
if (feature.pickId) id = feature.pickId.key;
|
|
1218
|
+
let accId = id;
|
|
1219
|
+
if (this._useDBId) accId = idname;
|
|
1220
|
+
for (var j = 0; j < queryIds.length; j++) {
|
|
1221
|
+
if (queryIds[j] == accId) {
|
|
1222
|
+
bFind = true;
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
if (bFind) feature.color = Cesium.Color.AQUA;else feature.color = Cesium.Color.WHITE;
|
|
1226
|
+
}
|
|
1227
|
+
tileset.makeStyleDirty();
|
|
1228
|
+
} else {
|
|
1229
|
+
// 无查询结果,还原所有要素颜色
|
|
1230
|
+
for (let i = 0; i < content.featuresLength; i++) {
|
|
1231
|
+
let feature = content.getFeature(i);
|
|
1232
|
+
feature.color = Cesium.Color.WHITE;
|
|
1143
1233
|
}
|
|
1144
1234
|
}
|
|
1145
1235
|
}
|
|
@@ -1147,6 +1237,7 @@ class GPUSpatialQueryViewModel {
|
|
|
1147
1237
|
//创建查询体
|
|
1148
1238
|
createGeometry() {
|
|
1149
1239
|
switch (this._options.volumeType) {
|
|
1240
|
+
// 立方体
|
|
1150
1241
|
case 0:
|
|
1151
1242
|
var options0 = {
|
|
1152
1243
|
length: 260,
|
|
@@ -1156,6 +1247,7 @@ class GPUSpatialQueryViewModel {
|
|
|
1156
1247
|
};
|
|
1157
1248
|
this._geometry = new Cesium.Kq3dGeoBox(options0);
|
|
1158
1249
|
break;
|
|
1250
|
+
// 球体
|
|
1159
1251
|
case 1:
|
|
1160
1252
|
var options1 = {
|
|
1161
1253
|
position: this._center,
|
|
@@ -1163,6 +1255,7 @@ class GPUSpatialQueryViewModel {
|
|
|
1163
1255
|
};
|
|
1164
1256
|
this._geometry = new Cesium.Kq3dGeoSphere(options1);
|
|
1165
1257
|
break;
|
|
1258
|
+
// 圆柱体
|
|
1166
1259
|
case 2:
|
|
1167
1260
|
var options2 = {
|
|
1168
1261
|
position: this._center,
|
|
@@ -1172,6 +1265,7 @@ class GPUSpatialQueryViewModel {
|
|
|
1172
1265
|
};
|
|
1173
1266
|
this._geometry = new Cesium.Kq3dGeoCylinder(options2);
|
|
1174
1267
|
break;
|
|
1268
|
+
// 椭球体
|
|
1175
1269
|
case 3:
|
|
1176
1270
|
var options3 = {
|
|
1177
1271
|
position: this._center,
|
|
@@ -1181,6 +1275,7 @@ class GPUSpatialQueryViewModel {
|
|
|
1181
1275
|
};
|
|
1182
1276
|
this._geometry = new Cesium.Kq3dGeoEllipsoid(options3);
|
|
1183
1277
|
break;
|
|
1278
|
+
// 圆锥体
|
|
1184
1279
|
case 4:
|
|
1185
1280
|
var options4 = {
|
|
1186
1281
|
position: this._center,
|
|
@@ -1192,6 +1287,7 @@ class GPUSpatialQueryViewModel {
|
|
|
1192
1287
|
default:
|
|
1193
1288
|
break;
|
|
1194
1289
|
}
|
|
1290
|
+
// 应用缩放与旋转参数到查询体
|
|
1195
1291
|
if (this._geometry) {
|
|
1196
1292
|
this._geometry.scaleX = this._options.scale;
|
|
1197
1293
|
this._geometry.scaleY = this._options.scale;
|
|
@@ -1202,7 +1298,9 @@ class GPUSpatialQueryViewModel {
|
|
|
1202
1298
|
}
|
|
1203
1299
|
}
|
|
1204
1300
|
|
|
1205
|
-
|
|
1301
|
+
/** @description 设置查询体类型并重新执行查询
|
|
1302
|
+
* @param {number} type 查询体类型(0:立方体 1:球体 2:圆柱 3:椭球 4:圆锥)
|
|
1303
|
+
*/
|
|
1206
1304
|
setType(type) {
|
|
1207
1305
|
this._options.volumeType = type;
|
|
1208
1306
|
this.createGeometry();
|
|
@@ -1213,7 +1311,9 @@ class GPUSpatialQueryViewModel {
|
|
|
1213
1311
|
//this.startQuery();
|
|
1214
1312
|
}
|
|
1215
1313
|
|
|
1216
|
-
|
|
1314
|
+
/** @description 设置查询体空间关系模式(相交/相离/包含)
|
|
1315
|
+
* @param {number} mode 空间关系模式(0:相交 1:相离 2:包含)
|
|
1316
|
+
*/
|
|
1217
1317
|
setMode(mode) {
|
|
1218
1318
|
this._options.positionMode = mode;
|
|
1219
1319
|
if (this._gpuSpatialQuery) {
|
|
@@ -1223,7 +1323,9 @@ class GPUSpatialQueryViewModel {
|
|
|
1223
1323
|
//this.startQuery();
|
|
1224
1324
|
}
|
|
1225
1325
|
|
|
1226
|
-
|
|
1326
|
+
/** @description 设置查询体缩放比例
|
|
1327
|
+
* @param {number} scale 缩放比例
|
|
1328
|
+
*/
|
|
1227
1329
|
setScale(scale) {
|
|
1228
1330
|
this._options.scale = scale;
|
|
1229
1331
|
if (this._geometry) {
|
|
@@ -1234,7 +1336,9 @@ class GPUSpatialQueryViewModel {
|
|
|
1234
1336
|
}
|
|
1235
1337
|
//this.startQuery();
|
|
1236
1338
|
}
|
|
1237
|
-
|
|
1339
|
+
/** @description 设置查询体绕X轴旋转角度
|
|
1340
|
+
* @param {number} xAngle X轴旋转角度
|
|
1341
|
+
*/
|
|
1238
1342
|
setXangle(xAngle) {
|
|
1239
1343
|
this._options.xAngle = xAngle;
|
|
1240
1344
|
if (this._geometry) {
|
|
@@ -1243,7 +1347,9 @@ class GPUSpatialQueryViewModel {
|
|
|
1243
1347
|
}
|
|
1244
1348
|
//this.startQuery();
|
|
1245
1349
|
}
|
|
1246
|
-
|
|
1350
|
+
/** @description 设置查询体绕Y轴旋转角度
|
|
1351
|
+
* @param {number} yAngle Y轴旋转角度
|
|
1352
|
+
*/
|
|
1247
1353
|
setYangle(yAngle) {
|
|
1248
1354
|
this._options.yAngle = yAngle;
|
|
1249
1355
|
if (this._geometry) {
|
|
@@ -1252,7 +1358,9 @@ class GPUSpatialQueryViewModel {
|
|
|
1252
1358
|
}
|
|
1253
1359
|
//this.startQuery();
|
|
1254
1360
|
}
|
|
1255
|
-
|
|
1361
|
+
/** @description 设置查询体绕Z轴旋转角度
|
|
1362
|
+
* @param {number} zAngle Z轴旋转角度
|
|
1363
|
+
*/
|
|
1256
1364
|
setZangle(zAngle) {
|
|
1257
1365
|
this._options.zAngle = zAngle;
|
|
1258
1366
|
if (this._geometry) {
|
|
@@ -2615,11 +2723,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2615
2723
|
value: true
|
|
2616
2724
|
}));
|
|
2617
2725
|
exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
|
|
2618
|
-
|
|
2726
|
+
const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
|
|
2619
2727
|
__webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
|
|
2620
|
-
|
|
2728
|
+
const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
|
|
2621
2729
|
__webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
|
|
2622
|
-
|
|
2730
|
+
const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
|
|
2623
2731
|
__webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
|
|
2624
2732
|
|
|
2625
2733
|
/***/ })
|