|
@@ -42280,6 +42280,137 @@
|
|
|
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+ //处理cursor优先级
|
|
|
|
+
|
|
|
|
+ var CursorDeal = {
|
|
|
|
+ priorityEvent: [
|
|
|
|
+ //在前面的优先级高
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ pen_delPoint: "url({Potree.resourcePath}/images/polygon_mark/pic_pen_sub.png),auto"
|
|
|
|
+ }, {
|
|
|
|
+ pen_addPoint: "url({Potree.resourcePath}/images/polygon_mark/pic_pen_add.png),auto"
|
|
|
|
+ }, {
|
|
|
|
+ pen: "url({Potree.resourcePath}/images/polygon_mark/pic_pen.png),auto"
|
|
|
|
+ }, {
|
|
|
|
+ 'grabbing': 'grabbing'
|
|
|
|
+ },
|
|
|
|
+ //通用
|
|
|
|
+ {
|
|
|
|
+ 'hoverGrab': 'grab'
|
|
|
|
+ },
|
|
|
|
+ //通用
|
|
|
|
+ {
|
|
|
|
+ 'pointer': 'pointer'
|
|
|
|
+ },
|
|
|
|
+ //通用
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ 'zoomInCloud': 'zoom-in'
|
|
|
|
+ }, {
|
|
|
|
+ 'hoverPano': 'pointer'
|
|
|
|
+ }, {
|
|
|
|
+ "notAllowed-default": 'not-allowed'
|
|
|
|
+ }, {
|
|
|
|
+ 'connectPano': "url({Potree.resourcePath}/images/connect.png),auto"
|
|
|
|
+ }, {
|
|
|
|
+ 'disconnectPano': "url({Potree.resourcePath}/images/connect-dis.png),auto"
|
|
|
|
+ }, {
|
|
|
|
+ 'hoverLine': 'pointer'
|
|
|
|
+ }, {
|
|
|
|
+ 'hoverTranHandle': 'grab'
|
|
|
|
+ }, {
|
|
|
|
+ "movePointcloud": 'move'
|
|
|
|
+ }, {
|
|
|
|
+ "polygon_isIntersectSelf": 'not-allowed'
|
|
|
|
+ }, {
|
|
|
|
+ "polygon_AtWrongPlace": 'not-allowed'
|
|
|
|
+ }, {
|
|
|
|
+ 'delPoint': 'url("https://4dkk.4dage.com/v4-test/www/sdk/images/polygon_mark/pic_pen_sub.png"), auto'
|
|
|
|
+ }, {
|
|
|
|
+ "markerMove": 'grab'
|
|
|
|
+ }, {
|
|
|
|
+ 'addPoint': 'url("https://4dkk.4dage.com/v4-test/www/sdk/images/polygon_mark/pic_pen_add.png"), auto'
|
|
|
|
+ }, {
|
|
|
|
+ 'mapClipMove': 'move'
|
|
|
|
+ }, {
|
|
|
|
+ 'mapClipRotate': "url({Potree.resourcePath}/images/rotate-cursor.png),auto"
|
|
|
|
+ }, {
|
|
|
|
+ 'rotatePointcloud': "url({Potree.resourcePath}/images/rotate-cursor.png),auto"
|
|
|
|
+ }, {
|
|
|
|
+ 'siteModelFloorDrag': 'row-resize'
|
|
|
|
+ }, {
|
|
|
|
+ 'addSth': 'cell'
|
|
|
|
+ } //or crosshair
|
|
|
|
+ ],
|
|
|
|
+ list: [],
|
|
|
|
+ //当前存在的cursor状态
|
|
|
|
+ currentCursorIndex: null,
|
|
|
|
+ init: function init(viewer, viewers) {
|
|
|
|
+ this.priorityEvent.forEach(e => {
|
|
|
|
+ //刚开始Potree.resourcePath没值,现在换
|
|
|
|
+ for (var i in e) {
|
|
|
|
+ e[i] = Common.replaceAll(e[i], '{Potree.resourcePath}', Potree.resourcePath);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.domElements = viewers.map(e => e.renderArea);
|
|
|
|
+ viewer.addEventListener("CursorChange", e => {
|
|
|
|
+ if (e.action == 'add') {
|
|
|
|
+ this.add(e.name);
|
|
|
|
+ } else {
|
|
|
|
+ this.remove(e.name);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ add: function add(name) {
|
|
|
|
+ var priorityItem = this.priorityEvent.find(e => e[name]);
|
|
|
|
+ if (!priorityItem) {
|
|
|
|
+ console.error('CursorDeal 未定义优先级 name:' + name);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (!this.list.includes(name)) {
|
|
|
|
+ this.judge({
|
|
|
|
+ addItem: priorityItem,
|
|
|
|
+ name
|
|
|
|
+ });
|
|
|
|
+ this.list.push(name);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ remove: function remove(name) {
|
|
|
|
+ var index = this.list.indexOf(name);
|
|
|
|
+ if (index > -1) {
|
|
|
|
+ this.list.splice(index, 1);
|
|
|
|
+ this.judge();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ judge: function judge() {
|
|
|
|
+ var o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
|
|
+ //console.log(o,this.list)
|
|
|
|
+ if (o.addItem) {
|
|
|
|
+ var addIndex = this.priorityEvent.indexOf(o.addItem);
|
|
|
|
+ if (addIndex < this.currentCursorIndex || this.currentCursorIndex == void 0) {
|
|
|
|
+ this.domElements.forEach(e => e.style.cursor = o.addItem[o.name]);
|
|
|
|
+ this.currentCursorIndex = addIndex;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ var levelMax = {
|
|
|
|
+ index: Infinity,
|
|
|
|
+ cursor: null
|
|
|
|
+ };
|
|
|
|
+ this.list.forEach(name => {
|
|
|
|
+ var priorityItem = this.priorityEvent.find(e => e[name]);
|
|
|
|
+ var index = this.priorityEvent.indexOf(priorityItem);
|
|
|
|
+ if (index < levelMax.index) {
|
|
|
|
+ levelMax.index = index;
|
|
|
|
+ levelMax.cursor = priorityItem[name];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.currentCursorIndex = levelMax.index;
|
|
|
|
+ this.domElements.forEach(e => e.style.cursor = levelMax.cursor || '');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
var texLoader$7 = new TextureLoader();
|
|
var texLoader$7 = new TextureLoader();
|
|
var labelSizeInfo$1 = {
|
|
var labelSizeInfo$1 = {
|
|
width2d: 180
|
|
width2d: 180
|
|
@@ -42499,7 +42630,7 @@
|
|
{
|
|
{
|
|
//和measure不同的是它的边是连在一起的一整条
|
|
//和measure不同的是它的边是连在一起的一整条
|
|
this.edge = new Mesh(voidGeometry, new DepthBasicMaterial($.extend({}, depthProps, {
|
|
this.edge = new Mesh(voidGeometry, new DepthBasicMaterial($.extend({}, depthProps, {
|
|
- color: this.pathColor || '#fff',
|
|
|
|
|
|
+ color: this.pathColor,
|
|
opacity: 0.3,
|
|
opacity: 0.3,
|
|
side: 2,
|
|
side: 2,
|
|
transparent: true,
|
|
transparent: true,
|
|
@@ -42512,7 +42643,7 @@
|
|
this.edge.name = 'pathEdge';
|
|
this.edge.name = 'pathEdge';
|
|
var addHoverEvent = () => {
|
|
var addHoverEvent = () => {
|
|
var mouseover = e => {
|
|
var mouseover = e => {
|
|
- this.setSelected(true, 'edge');
|
|
|
|
|
|
+ this.setSelected('hover');
|
|
this.hoverStates.edge = true;
|
|
this.hoverStates.edge = true;
|
|
if (this.addOrRemovePoint && !this.isNew) {
|
|
if (this.addOrRemovePoint && !this.isNew) {
|
|
viewer.dispatchEvent({
|
|
viewer.dispatchEvent({
|
|
@@ -42523,7 +42654,7 @@
|
|
}
|
|
}
|
|
};
|
|
};
|
|
var mouseleave = e => {
|
|
var mouseleave = e => {
|
|
- this.setSelected(false, 'edge');
|
|
|
|
|
|
+ this.setSelected('unhover');
|
|
this.hoverStates.edge = false;
|
|
this.hoverStates.edge = false;
|
|
viewer.dispatchEvent({
|
|
viewer.dispatchEvent({
|
|
type: "CursorChange",
|
|
type: "CursorChange",
|
|
@@ -42566,7 +42697,7 @@
|
|
this.hideArrowUntilUpdate();
|
|
this.hideArrowUntilUpdate();
|
|
this.dispatchEvent('changed');
|
|
this.dispatchEvent('changed');
|
|
} else {
|
|
} else {
|
|
- this.isNew || viewer.measuringTool.isAdding || this.dispatchEvent('clicked'); //viewer.focusOnObject(this, 'measure') //正在添加测量线时不要focus其他线(容易误触)
|
|
|
|
|
|
+ this.isNew || viewer.measuringTool.isAdding || this.setSelected('click'); //viewer.focusOnObject(this, 'measure') //正在添加测量线时不要focus其他线(容易误触)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -43019,28 +43150,45 @@
|
|
viewer.mapViewer && viewer.mapViewer.dispatchEvent('content_changed');
|
|
viewer.mapViewer && viewer.mapViewer.dispatchEvent('content_changed');
|
|
viewer.dispatchEvent('content_changed');
|
|
viewer.dispatchEvent('content_changed');
|
|
}
|
|
}
|
|
- setSelected(state, hoverObject) {
|
|
|
|
- //console.log('setSelected',state, hoverObject)
|
|
|
|
-
|
|
|
|
- var absoluteState = !!state;
|
|
|
|
- if (hoverObject) {
|
|
|
|
- //如果没有hoverObject且state为false 就强制取消选中态
|
|
|
|
- this.selectStates[hoverObject] = state;
|
|
|
|
- for (var i in this.selectStates) {
|
|
|
|
- if (this.selectStates[i]) {
|
|
|
|
- absoluteState = true;
|
|
|
|
- break;
|
|
|
|
|
|
+ setSelected( /* state, hoverObject */state, byList) {
|
|
|
|
+ var _this$arrows2;
|
|
|
|
+ /* let absoluteState = !!state
|
|
|
|
+ if(hoverObject){//如果没有hoverObject且state为false 就强制取消选中态
|
|
|
|
+ this.selectStates[hoverObject] = state
|
|
|
|
+ for(var i in this.selectStates){
|
|
|
|
+ if(this.selectStates[i]){
|
|
|
|
+ absoluteState = true; break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.selected = absoluteState;
|
|
|
|
- if (hoverObject != 'byList') {
|
|
|
|
- //this.bus && this.bus.emit('highlight', this.selected)
|
|
|
|
- this.dispatchEvent({
|
|
|
|
- type: 'highlight',
|
|
|
|
- state: this.selected
|
|
|
|
- }); //列表高亮
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ this.selected = absoluteState*/
|
|
|
|
+ state == 'hover' && (this.selectStates.hover = true, byList || this.dispatchEvent({
|
|
|
|
+ type: 'highlight',
|
|
|
|
+ state: true
|
|
|
|
+ }), CursorDeal.add('pointer'));
|
|
|
|
+ state == 'unhover' && (this.selectStates.hover = false, byList || this.dispatchEvent({
|
|
|
|
+ type: 'highlight',
|
|
|
|
+ state: false
|
|
|
|
+ }), CursorDeal.remove('pointer'));
|
|
|
|
+ state == 'click' && (this.selectStates.click = true, byList || this.dispatchEvent({
|
|
|
|
+ type: 'chose',
|
|
|
|
+ state: true
|
|
|
|
+ }));
|
|
|
|
+ state == 'unclick' && (this.selectStates.click = false, byList || this.dispatchEvent({
|
|
|
|
+ type: 'chose',
|
|
|
|
+ state: false
|
|
|
|
+ }));
|
|
|
|
+ this.edge.material.color.set(this.selectStates.click ? '#00C8AF' : this.pathColor);
|
|
|
|
+ (_this$arrows2 = this.arrows) === null || _this$arrows2 === void 0 || _this$arrows2.material.color.set(this.selectStates.click ? '#ffffff' : this.pathColor);
|
|
|
|
+ [this.edge, this.endCaps[0].children[0]].forEach(e => e.material.opacity = this.selectStates.click ? 0.8 : this.selectStates.hover ? 0.6 : 0.3);
|
|
|
|
+ state == 'click' && setTimeout(() => {
|
|
|
|
+ viewer.addEventListener('global_click', e => {
|
|
|
|
+ //再点击取消
|
|
|
|
+ this.setSelected('unclick');
|
|
|
|
+ }, {
|
|
|
|
+ once: true
|
|
|
|
+ });
|
|
|
|
+ }, 10);
|
|
viewer.dispatchEvent('content_changed');
|
|
viewer.dispatchEvent('content_changed');
|
|
viewer.mapViewer && viewer.mapViewer.dispatchEvent('content_changed');
|
|
viewer.mapViewer && viewer.mapViewer.dispatchEvent('content_changed');
|
|
}
|
|
}
|
|
@@ -43106,12 +43254,12 @@
|
|
viewer.dispatchEvent('content_changed');
|
|
viewer.dispatchEvent('content_changed');
|
|
}
|
|
}
|
|
dispose() {
|
|
dispose() {
|
|
- var _this$arrows2, _this$arrows3;
|
|
|
|
|
|
+ var _this$arrows3, _this$arrows4;
|
|
super.dispose();
|
|
super.dispose();
|
|
this.titleLabel.dispose();
|
|
this.titleLabel.dispose();
|
|
this.markerLabels.forEach(e => e.dispose());
|
|
this.markerLabels.forEach(e => e.dispose());
|
|
- (_this$arrows2 = this.arrows) === null || _this$arrows2 === void 0 || _this$arrows2.dispose();
|
|
|
|
- (_this$arrows3 = this.arrows) === null || _this$arrows3 === void 0 || _this$arrows3.material.dispose();
|
|
|
|
|
|
+ (_this$arrows3 = this.arrows) === null || _this$arrows3 === void 0 || _this$arrows3.dispose();
|
|
|
|
+ (_this$arrows4 = this.arrows) === null || _this$arrows4 === void 0 || _this$arrows4.material.dispose();
|
|
this.edge.geometry.dispose();
|
|
this.edge.geometry.dispose();
|
|
this.edge.material.dispose();
|
|
this.edge.material.dispose();
|
|
}
|
|
}
|
|
@@ -43128,7 +43276,7 @@
|
|
transparent: true,
|
|
transparent: true,
|
|
side: 2,
|
|
side: 2,
|
|
fadeFar: this.fadeFar,
|
|
fadeFar: this.fadeFar,
|
|
- color: this.pathColor || '#fff'
|
|
|
|
|
|
+ color: this.selectStates.click ? '#ffffff' : this.pathColor
|
|
}));
|
|
}));
|
|
//let material = new THREE.MeshBasicMaterial({map )})
|
|
//let material = new THREE.MeshBasicMaterial({map )})
|
|
this.arrows = new InstancedMesh(planeGeo$2, material, arrowCountMax); //会自动向shader添加define和instanceMatrix
|
|
this.arrows = new InstancedMesh(planeGeo$2, material, arrowCountMax); //会自动向shader添加define和instanceMatrix
|
|
@@ -64393,132 +64541,6 @@
|
|
}
|
|
}
|
|
;
|
|
;
|
|
|
|
|
|
- //处理cursor优先级
|
|
|
|
-
|
|
|
|
- var CursorDeal = {
|
|
|
|
- priorityEvent: [
|
|
|
|
- //在前面的优先级高
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
- pen_delPoint: "url({Potree.resourcePath}/images/polygon_mark/pic_pen_sub.png),auto"
|
|
|
|
- }, {
|
|
|
|
- pen_addPoint: "url({Potree.resourcePath}/images/polygon_mark/pic_pen_add.png),auto"
|
|
|
|
- }, {
|
|
|
|
- pen: "url({Potree.resourcePath}/images/polygon_mark/pic_pen.png),auto"
|
|
|
|
- }, {
|
|
|
|
- 'grabbing': 'grabbing'
|
|
|
|
- },
|
|
|
|
- //通用
|
|
|
|
- {
|
|
|
|
- 'hoverGrab': 'grab'
|
|
|
|
- },
|
|
|
|
- //通用
|
|
|
|
- {
|
|
|
|
- 'zoomInCloud': 'zoom-in'
|
|
|
|
- }, {
|
|
|
|
- 'hoverPano': 'pointer'
|
|
|
|
- }, {
|
|
|
|
- "notAllowed-default": 'not-allowed'
|
|
|
|
- }, {
|
|
|
|
- 'connectPano': "url({Potree.resourcePath}/images/connect.png),auto"
|
|
|
|
- }, {
|
|
|
|
- 'disconnectPano': "url({Potree.resourcePath}/images/connect-dis.png),auto"
|
|
|
|
- }, {
|
|
|
|
- 'hoverLine': 'pointer'
|
|
|
|
- }, {
|
|
|
|
- 'hoverTranHandle': 'grab'
|
|
|
|
- }, {
|
|
|
|
- "movePointcloud": 'move'
|
|
|
|
- }, {
|
|
|
|
- "polygon_isIntersectSelf": 'not-allowed'
|
|
|
|
- }, {
|
|
|
|
- "polygon_AtWrongPlace": 'not-allowed'
|
|
|
|
- }, {
|
|
|
|
- 'delPoint': 'url("https://4dkk.4dage.com/v4-test/www/sdk/images/polygon_mark/pic_pen_sub.png"), auto'
|
|
|
|
- }, {
|
|
|
|
- "markerMove": 'grab'
|
|
|
|
- }, {
|
|
|
|
- 'addPoint': 'url("https://4dkk.4dage.com/v4-test/www/sdk/images/polygon_mark/pic_pen_add.png"), auto'
|
|
|
|
- }, {
|
|
|
|
- 'mapClipMove': 'move'
|
|
|
|
- }, {
|
|
|
|
- 'mapClipRotate': "url({Potree.resourcePath}/images/rotate-cursor.png),auto"
|
|
|
|
- }, {
|
|
|
|
- 'rotatePointcloud': "url({Potree.resourcePath}/images/rotate-cursor.png),auto"
|
|
|
|
- }, {
|
|
|
|
- 'siteModelFloorDrag': 'row-resize'
|
|
|
|
- }, {
|
|
|
|
- 'addSth': 'cell'
|
|
|
|
- } //or crosshair
|
|
|
|
- ],
|
|
|
|
- list: [],
|
|
|
|
- //当前存在的cursor状态
|
|
|
|
- currentCursorIndex: null,
|
|
|
|
- init: function init(viewer, viewers) {
|
|
|
|
- this.priorityEvent.forEach(e => {
|
|
|
|
- //刚开始Potree.resourcePath没值,现在换
|
|
|
|
- for (var i in e) {
|
|
|
|
- e[i] = Common.replaceAll(e[i], '{Potree.resourcePath}', Potree.resourcePath);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- this.domElements = viewers.map(e => e.renderArea);
|
|
|
|
- viewer.addEventListener("CursorChange", e => {
|
|
|
|
- if (e.action == 'add') {
|
|
|
|
- this.add(e.name);
|
|
|
|
- } else {
|
|
|
|
- this.remove(e.name);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- add: function add(name) {
|
|
|
|
- var priorityItem = this.priorityEvent.find(e => e[name]);
|
|
|
|
- if (!priorityItem) {
|
|
|
|
- console.error('CursorDeal 未定义优先级 name:' + name);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (!this.list.includes(name)) {
|
|
|
|
- this.judge({
|
|
|
|
- addItem: priorityItem,
|
|
|
|
- name
|
|
|
|
- });
|
|
|
|
- this.list.push(name);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- remove: function remove(name) {
|
|
|
|
- var index = this.list.indexOf(name);
|
|
|
|
- if (index > -1) {
|
|
|
|
- this.list.splice(index, 1);
|
|
|
|
- this.judge();
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- judge: function judge() {
|
|
|
|
- var o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
|
|
- //console.log(o,this.list)
|
|
|
|
- if (o.addItem) {
|
|
|
|
- var addIndex = this.priorityEvent.indexOf(o.addItem);
|
|
|
|
- if (addIndex < this.currentCursorIndex || this.currentCursorIndex == void 0) {
|
|
|
|
- this.domElements.forEach(e => e.style.cursor = o.addItem[o.name]);
|
|
|
|
- this.currentCursorIndex = addIndex;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- var levelMax = {
|
|
|
|
- index: Infinity,
|
|
|
|
- cursor: null
|
|
|
|
- };
|
|
|
|
- this.list.forEach(name => {
|
|
|
|
- var priorityItem = this.priorityEvent.find(e => e[name]);
|
|
|
|
- var index = this.priorityEvent.indexOf(priorityItem);
|
|
|
|
- if (index < levelMax.index) {
|
|
|
|
- levelMax.index = index;
|
|
|
|
- levelMax.cursor = priorityItem[name];
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- this.currentCursorIndex = levelMax.index;
|
|
|
|
- this.domElements.forEach(e => e.style.cursor = levelMax.cursor || '');
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
class SplitScreen extends EventDispatcher {
|
|
class SplitScreen extends EventDispatcher {
|
|
constructor() {
|
|
constructor() {
|
|
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|