|
@@ -60946,7 +60946,7 @@ void main() {
|
|
|
this.editStateTimer = setTimeout(()=>{
|
|
|
if(!this.isEditing){
|
|
|
this.dispatchEvent({type:'editStateChange',state:false});
|
|
|
- this.setEdgesDisplay(false);
|
|
|
+ this.setEdgesDisplay(false);
|
|
|
}
|
|
|
},100);
|
|
|
}else {
|
|
@@ -63843,8 +63843,17 @@ void main() {
|
|
|
|
|
|
let loadDone = (model)=>{
|
|
|
model.dataset_id = prop.id; //唯一标识
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ if(prop.position){
|
|
|
+ model.position.copy(prop.position);
|
|
|
+ }
|
|
|
+ if(prop.rotation){
|
|
|
+ model.rotation.setFromVector3(prop.rotation);
|
|
|
+ }
|
|
|
+ if(prop.scale){
|
|
|
+ model.scale.set(prop.scale,prop.scale,prop.scale);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if(prop.isFirstLoad){
|
|
|
modelEditing = model;
|
|
@@ -63962,11 +63971,11 @@ void main() {
|
|
|
name: prop.type,
|
|
|
id: prop.id,
|
|
|
unlit:true,
|
|
|
- transform : {
|
|
|
+ /* transform : {
|
|
|
position : prop.position,
|
|
|
- rotation : new Euler().setFromVector3(prop.rotation),
|
|
|
- scale: new Vector3(prop.scale,prop.scale,prop.scale),
|
|
|
- }
|
|
|
+ rotation : new THREE.Euler().setFromVector3(prop.rotation),
|
|
|
+ scale: new THREE.Vector3(prop.scale,prop.scale,prop.scale),
|
|
|
+ } */
|
|
|
};
|
|
|
|
|
|
if(prop.type == 'glb'){
|
|
@@ -78159,11 +78168,15 @@ void main() {
|
|
|
} */
|
|
|
}
|
|
|
}
|
|
|
- if (!e.finish && measure.markers.length > 3) {
|
|
|
+ if (/* !e.finish && */measure.markers.length > 3) {
|
|
|
measure.removeMarker(measure.points.length - 1);
|
|
|
measure.markers[0].removeEventListener('mouseover', mouseover);
|
|
|
measure.markers[0].removeEventListener('mouseleave', mouseleave);
|
|
|
measure.markers[0].removeEventListener('click'/* 'mousedown' */,Exit);
|
|
|
+
|
|
|
+ if(e.byClickMarker && measure.markers.length > 3){//通过点击第一个marker而结束的话,会多一个marker
|
|
|
+ measure.removeMarker(measure.points.length - 1);
|
|
|
+ }
|
|
|
}
|
|
|
measure.isNew = false;
|
|
|
let length = measure.points.length;
|
|
@@ -78205,21 +78218,27 @@ void main() {
|
|
|
}
|
|
|
|
|
|
measure.editStateChange(false);
|
|
|
- if(this.viewer.inputHandler.drag && !e.remove){//还未触发drop的话
|
|
|
- this.viewer.inputHandler.drag.object.dispatchEvent({
|
|
|
+ measure.cannotConfirmNormal = false; //一些dropMarker中的句子
|
|
|
+ measure.guideLine &&(measure.guideLine.visible = false);
|
|
|
+ /*
|
|
|
+ if(this.viewer.inputHandler.drag && !e.remove ){//还未触发drop的话
|
|
|
+ this.viewer.inputHandler.drag.object.dispatchEvent({ //这句会导致又增一个marker
|
|
|
type: 'drop',
|
|
|
drag: this.viewer.inputHandler.drag,
|
|
|
viewer: this.viewer,
|
|
|
pressDistance:0,
|
|
|
- button : MOUSE.RIGHT
|
|
|
- });
|
|
|
+ button : THREE.MOUSE.RIGHT
|
|
|
+ });
|
|
|
|
|
|
- }else {
|
|
|
- end({finish:true, remove:e.remove}); //未结束时添加新的measure时会触发
|
|
|
- }
|
|
|
- this.viewer.inputHandler.drag = null;
|
|
|
+ } else {*///未结束时添加新的measure时会触发
|
|
|
+ end({finish:true, remove:e.remove, byClickMarker: e.type == 'click'});
|
|
|
+ //}
|
|
|
+ this.viewer.inputHandler.drag && (this.viewer.inputHandler.drag.object = null);
|
|
|
|
|
|
};
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.viewer.addEventListener('cancel_insertions', Exit);
|
|
|
|
|
|
/*let pressExit
|
|
@@ -78291,7 +78310,7 @@ void main() {
|
|
|
|
|
|
|
|
|
//console.log('measure clicked')
|
|
|
-
|
|
|
+ e.consume && e.consume();
|
|
|
|
|
|
return {stopContinue:true}//防止继续执行别的侦听,如flytopano
|
|
|
};
|
|
@@ -85311,8 +85330,8 @@ void main() {
|
|
|
|
|
|
|
|
|
if (this.drag) {
|
|
|
- //拖拽结束
|
|
|
-
|
|
|
+ //拖拽结束
|
|
|
+
|
|
|
if (this.drag.object/* && e.button == THREE.MOUSE.LEFT */) {//add LEFT
|
|
|
if (this.logMessages) console.log(`${this.constructor.name}: drop ${this.drag.object.name}`);
|
|
|
|
|
@@ -85335,16 +85354,16 @@ void main() {
|
|
|
));
|
|
|
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- // check for a click
|
|
|
+ }
|
|
|
+
|
|
|
+ // check for a click
|
|
|
|
|
|
if(pressDistance < Potree.config.clickMaxDragDis && pressTime<Potree.config.clickMaxPressTime){
|
|
|
let clickElement;
|
|
|
if(this.hoveredElements){
|
|
|
clickElement = this.hoveredElements.find(e=>e.object._listeners['click']);
|
|
|
if(clickElement){
|
|
|
- console.log('clickElement',clickElement);
|
|
|
+ //console.log('clickElement',clickElement)
|
|
|
if (this.logMessages) console.log(`${this.constructor.name}: click ${clickElement.name}`);
|
|
|
clickElement.object.dispatchEvent($.extend(
|
|
|
this.getEventDesc(e,isTouch),
|
|
@@ -85368,6 +85387,7 @@ void main() {
|
|
|
{
|
|
|
type: 'global_click',
|
|
|
pressDistance,
|
|
|
+ clickElement,
|
|
|
consume
|
|
|
}
|
|
|
));
|
|
@@ -85400,8 +85420,7 @@ void main() {
|
|
|
|
|
|
this.lastClickTime = now;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
this.drag = null;
|
|
|
|
|
|
}
|
|
@@ -103655,11 +103674,12 @@ ENDSEC
|
|
|
|
|
|
zoomToLocation(mouse){
|
|
|
let I = viewer.inputHandler.intersect;
|
|
|
+
|
|
|
+ if(!I)return
|
|
|
+
|
|
|
let object = I.object || I.pointcloud;
|
|
|
+ I = I.location;
|
|
|
|
|
|
- if(I){
|
|
|
- I = I.location;
|
|
|
- }
|
|
|
|
|
|
if(!I || !object)return;
|
|
|
|
|
@@ -117442,7 +117462,7 @@ ENDSEC
|
|
|
|| e.drag && e.drag.notPressMouse //在加测量线
|
|
|
|| viewer.mainViewport.view.isFlying() //有其他校准
|
|
|
|| this.split //分屏中
|
|
|
- //e.clickElement && e.clickElement != e.intersect.object
|
|
|
+ || e.clickElement //触发别的点击事件,如测量时click marker /* && e.clickElement != e.intersect.object */
|
|
|
){
|
|
|
return
|
|
|
}
|
|
@@ -117582,9 +117602,14 @@ ENDSEC
|
|
|
Potree.settings.pointDensity = 'fourViewports'; //强制降低点云质量
|
|
|
/* viewer.scene.pointclouds.forEach(e=>{
|
|
|
e.material.activeAttributeName = "color"
|
|
|
- e.material.useFilterByNormal = true
|
|
|
-
|
|
|
- }) */
|
|
|
+ e.material.useFilterByNormal = true
|
|
|
+ }) */
|
|
|
+ //取消outline,改点云颜色为和outline一样的颜色
|
|
|
+ /* if(this.selected && this.selected.isPointcloud){
|
|
|
+ this.showModelOutline(this.selected, false)
|
|
|
+ this.selected.material.activeAttributeName = "color"
|
|
|
+ this.selected.material.color = viewer.outlinePass.visibleEdgeColor
|
|
|
+ } */
|
|
|
|
|
|
|
|
|
viewer.setControls(viewer.fpControls);
|
|
@@ -117599,7 +117624,10 @@ ENDSEC
|
|
|
viewer.setControls(viewer.orbitControls);
|
|
|
|
|
|
Potree.settings.pointDensity = this.beforeSplit.pointDensity;
|
|
|
-
|
|
|
+ /* if(this.selected && this.selected.isPointcloud){
|
|
|
+ this.showModelOutline(this.selected, true)
|
|
|
+ this.selected.material.activeAttributeName = "rgba"
|
|
|
+ } */
|
|
|
},
|
|
|
|
|
|
rotateSideCamera(angle){
|
|
@@ -117807,7 +117835,8 @@ ENDSEC
|
|
|
});
|
|
|
if(changed){
|
|
|
measure.getPoint2dInfo(measure.points);
|
|
|
- measure.update();
|
|
|
+ measure.update();
|
|
|
+ measure.setSelected(false);//隐藏edgelabel
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -129980,21 +130009,22 @@ ENDSEC
|
|
|
|
|
|
object.name = fileInfo.name != void 0 ? fileInfo.name : 'obj';
|
|
|
this.objs.add(object);
|
|
|
- object.boundingBox = boundingBox;
|
|
|
-
|
|
|
- let setTransfrom = (name)=>{
|
|
|
- let value = fileInfo.transform[name];
|
|
|
- if(!value)return
|
|
|
- if(value instanceof Array){
|
|
|
- object[name].fromArray(value);
|
|
|
- }else {
|
|
|
- object[name].copy(value);
|
|
|
- }
|
|
|
- };
|
|
|
- setTransfrom('position');
|
|
|
- setTransfrom('rotation');
|
|
|
- setTransfrom('scale');
|
|
|
-
|
|
|
+ object.boundingBox = boundingBox; //未乘上matrixWorld的本地boundingBox
|
|
|
+
|
|
|
+ if(fileInfo.transform){
|
|
|
+ let setTransfrom = (name)=>{
|
|
|
+ let value = fileInfo.transform[name];
|
|
|
+ if(!value)return
|
|
|
+ if(value instanceof Array){
|
|
|
+ object[name].fromArray(value);
|
|
|
+ }else {
|
|
|
+ object[name].copy(value);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ setTransfrom('position');
|
|
|
+ setTransfrom('rotation');
|
|
|
+ setTransfrom('scale');
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if(fileInfo.moveWithPointcloud){
|