소스 검색

Merge branch 'master' of http://192.168.0.115:3000/bill/traffic-laser

xushiting 2 년 전
부모
커밋
fbc415fcb9

+ 45 - 26
public/static/lib/potree/potree.js

@@ -73160,6 +73160,8 @@ void main()
 	            visiMap.set(e,e.visible);
 	            e.visible = Potree.Utils.getObjVisiByReason(e, 'datasetSelection'); //先将隐藏的点云显示
 	            if(!e.visible)return
+	             
+	            
 	            size.set(e, e.temp.pointSize);    
 	            sizeType = e.material.pointSizeType;  
 	            e.material.pointSizeType = Potree.config.material.pointSizeType; 
@@ -73916,7 +73918,7 @@ void main()
 				priorityQueue.push({pointcloud: i, node: pointcloud.root, weight: Number.MAX_VALUE});
 			}  */    
 	       
-			if (pointcloud.visible || !pointcloud.hasDepthTex && pointcloud.unvisibleReasons && pointcloud.unvisibleReasons.length == 1 && pointcloud.unvisibleReasons[0].reason == 'displayMode'   &&  pointcloud.root !== null) {//改 visible -> 
+			if (pointcloud.visible || /* !pointcloud.hasDepthTex && */ pointcloud.unvisibleReasons && pointcloud.unvisibleReasons.length == 1 && pointcloud.unvisibleReasons[0].reason == 'displayMode'   &&  pointcloud.root !== null) {//改 visible -> 
 	            priorityQueue.push({pointcloud: i, node: pointcloud.root, weight: Number.MAX_VALUE});
 	        }else {
 	            continue
@@ -74014,7 +74016,7 @@ void main()
 		let pointcloudTransformVersion = Potree._pointcloudTransformVersion;
 		for(let pointcloud of pointclouds){
 
-			if(pointcloud.hasDepthTex ? !pointcloud.visible : !Potree.Utils.getObjVisiByReason(pointcloud, 'datasetSelection')){//改 visible ->  
+			if(/* pointcloud.hasDepthTex ? !pointcloud.visible : */ !Potree.Utils.getObjVisiByReason(pointcloud, 'datasetSelection')){//改 visible ->   这一版的深度图不准,就只用在贴图里,pick时需要点云,所以要一直有, 否则但pick时显示的话visibleNodes只能加载出一点点
 				continue;
 			} 
 	        
@@ -82494,13 +82496,12 @@ void main()
 	        
 	    }
 	    
-	    focus(){  
-	    
+	    focus({dontMoveCamera=false}={}){  
 	    
-	        let dontChangeCamDir = viewer.mainViewport.camera.type == 'OrthographicCamera'; /* && math.closeTo( viewer.mainViewport.view.pitch , -1.57079632)  */ // 不改角度
-	    
-	        viewer.focusOnObject(this, 'measure', null, {dontChangeCamDir});
-	        
+	        if(!dontMoveCamera){
+	            let dontChangeCamDir = viewer.mainViewport.camera.type == 'OrthographicCamera'; /* && math.closeTo( viewer.mainViewport.view.pitch , -1.57079632)  */ // 不改角度
+	            viewer.focusOnObject(this, 'measure', null, {dontChangeCamDir});
+	        }
 	        if(this.clickSelected)return
 	        this.setSelected(true, 'focus');
 	        this.dispatchEvent({type:'selected', state:true});
@@ -83730,10 +83731,14 @@ void main()
 	         
 	            if(ifAtWrongPlace(e))return  
 	            if(e.clickElement || e.drag.object)return  //如点击label时focusOnObject, 或拖拽marker
-	             
-	            
+	              
 	            if(e.button === MOUSE.RIGHT )return  
 	            
+	            
+	            if(e.type == 'global_touchstart' && e.hoveredElement && e.hoveredElement.object.parent instanceof Measure$1 ){
+	                return //点到测量线时要focus测量线而不是画新线
+	            }
+	            
 	            if(isMobile){
 	                viewer.controls.setEnable(false);
 	            }
@@ -89837,16 +89842,16 @@ void main()
 	            && viewer.images360.currentPano.pointcloud.hasDepthTex && viewport == viewer.mainViewport && !usePointcloud; 
 	        
 	        
-	        if(canUseDepthTex)getByDepthTex();
-	        else getByCloud(); 
-	        /* if(canUseDepthTex && !this.isMeasuring){
-	            getByDepthTex()
-	        }else{
-	            getByCloud() 
+	        /* if(canUseDepthTex)getByDepthTex()
+	        else getByCloud()  */
+	        if(canUseDepthTex && !this.isMeasuring){
+	            getByDepthTex();
+	        }else {
+	            getByCloud(); 
 	            if(!intersectPoint && canUseDepthTex  ){  //若在测量,先尝试点云,再用全景 //后来发现有深度图的点云全景visibleNode为空,pick不到的
-	                getByDepthTex()
+	                getByDepthTex();
 	            }
-	        }  */ 
+	        }  
 	        
 	        
 	                   
@@ -91857,10 +91862,11 @@ void main()
 	            
 	            
 	            viewer.images360.addEventListener('beginChangeMode',(e)=>{
-	                if(e.mode == 'showPanos')this.switchView('perspective',{}, ()=>{
+	                if(e.mode == 'showPanos'){ 
+	                    this.switchView('perspective',{}, ()=>{
 	                      Potree.settings.displayMode = viewer.images360.latestRequestMode;
-	                });
-	                
+	                    });
+	                }
 	            }); 
 	            
 	            
@@ -91920,6 +91926,7 @@ void main()
 	    switchView(type, {yaw, pitch, dir}={}, done){
 	        if(viewer.mainViewport.view.isFlying())return
 	        let view = viewer.mainViewport.view;
+	        let oldlastView = this.lastView; 
 	        this.lastView = view.clone();
 	        if(viewer.mainViewport.camera.type == 'OrthographicCamera'){
 	            this.lastView.isOrtho = true;
@@ -91962,6 +91969,12 @@ void main()
 	        }else {
 	            
 	            if(viewer.mainViewport.camera == viewer.scene.cameraO){
+	                 
+	                return this.switchView2(oldlastView, done)
+	                
+	                
+	                
+	                
 	                //viewer.scene.cameraP.position.copy(viewer.mainViewport.camera.position)
 	                //viewer.scene.cameraP.quaternion.copy(viewer.mainViewport.camera.quaternion)
 	                viewer.mainViewport.camera = viewer.scene.cameraP;
@@ -91978,6 +91991,11 @@ void main()
 	                
 	                let position = new Vector3().copy(viewer.mainViewport.shiftTarget).sub(view.direction.clone().multiplyScalar(dis)); 
 	                //view.position.copy(viewer.mainViewport.shiftTarget).sub(view.direction.clone().multiplyScalar(dis)); 
+	                
+	                 
+	                
+	                 
+	                 
 	                this.controls.setEnable(true);
 	                //viewer.dispatchEvent('leaveTopView')
 	                console.log('变回透视');
@@ -91998,7 +92016,7 @@ void main()
 	    
 	    
 	    
-	    switchView2(viewInfo){ //直接输入view改变
+	    switchView2(viewInfo, done){ //直接输入view改变
 	        
 	        let view = viewer.mainViewport.view;
 	        let startCamera, endCamera; 
@@ -92014,9 +92032,9 @@ void main()
 	                view.moveOrthoCamera(viewer.mainViewport,  {endPosition:viewInfo.position,
 	                    endPitch: viewInfo.pitch, endYaw: viewInfo.yaw ,  zoom: viewInfo.zoom, 
 	                    callback:()=>{ 
-	                        
+	                        done && done();
 	                    }, 
-	                }, 500);
+	                }, 800);
 	            }
 	        }else {
 	            if(viewer.mainViewport.camera == viewer.scene.cameraO){
@@ -92030,7 +92048,7 @@ void main()
 	                    callback:()=>{ 
 	                       
 	                    }, 
-	                }, 500);
+	                }, 800);
 	            }
 	            
 	        }
@@ -92051,8 +92069,9 @@ void main()
 	                    }else {
 	                        viewer.dispatchEvent({type:'viewChanged', name:'perspective' });
 	                    }
+	                    done && done();
 	                }, 
-	            }, 500);
+	            }, 800);
 	        } 
 	        
 	    }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
public/static/lib/potree/potree.js.map


+ 2 - 2
src/sdk/laser/core/enter.js

@@ -356,10 +356,10 @@ var enter = ({
             /* highlight: (isHight) => {
                 measure.setSelected(isHight, "byList");
             }, */
-            selected: (state) => {
+            selected: (state, dontMoveCamera ) => {
                 //measure.setSelected(state, "byList");
                 if(state){
-                    measure.focus()
+                    measure.focus({dontMoveCamera})
                 }else{
                     measure.dispatchEvent('cancelSelect')
                 }

+ 21 - 21
src/views/graphic/geos/roadEdge.vue

@@ -35,27 +35,27 @@ const lineTypeMenu = [
     text: "单虚线",
     onClick: clickHandlerFactory(VectorStyle.SingleDashedLine),
   },
-  {
-    hide: props.geo.type === VectorType.CurveRoadEdge,
-    key: VectorStyle.DoubleSolidLine,
-    icon: "line_df",
-    text: "双实线",
-    onClick: clickHandlerFactory(VectorStyle.DoubleSolidLine),
-  },
-  {
-    hide: props.geo.type === VectorType.CurveRoadEdge,
-    key: VectorStyle.DoubleDashedLine,
-    icon: "line_dd",
-    text: "双虚线",
-    onClick: clickHandlerFactory(VectorStyle.DoubleDashedLine),
-  },
-  {
-    hide: props.geo.type === VectorType.CurveRoadEdge,
-    key: VectorStyle.BrokenLine,
-    icon: "line_broken",
-    text: "折线",
-    onClick: clickHandlerFactory(VectorStyle.BrokenLine),
-  },
+  // {
+  //   hide: props.geo.type === VectorType.CurveRoadEdge,
+  //   key: VectorStyle.DoubleSolidLine,
+  //   icon: "line_df",
+  //   text: "双实线",
+  //   onClick: clickHandlerFactory(VectorStyle.DoubleSolidLine),
+  // },
+  // {
+  //   hide: props.geo.type === VectorType.CurveRoadEdge,
+  //   key: VectorStyle.DoubleDashedLine,
+  //   icon: "line_dd",
+  //   text: "双虚线",
+  //   onClick: clickHandlerFactory(VectorStyle.DoubleDashedLine),
+  // },
+  // {
+  //   hide: props.geo.type === VectorType.CurveRoadEdge,
+  //   key: VectorStyle.BrokenLine,
+  //   icon: "line_broken",
+  //   text: "折线",
+  //   onClick: clickHandlerFactory(VectorStyle.BrokenLine),
+  // },
   {
     key: VectorStyle.PointDrawLine,
     icon: "line_dot",

+ 1 - 1
src/views/scene/TrackMeasure.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="photo-btn">
     <ButtonPane class="item fun-ctrl" :size="80" @click="callback">
-      <ui-icon type="affirm" class="icon" />
+      <ui-icon type="return" class="icon" />
     </ButtonPane>
     <ButtonPane class="item fun-ctrl" :size="80" @click="active = !active">
       <ui-icon type="line_h" class="icon" :class="{ active }" />

+ 108 - 94
src/views/scene/menus/actions.ts

@@ -1,41 +1,54 @@
-import {findMenuByKey, menuEnum, MenuRaw} from "@/views/scene/menus/menus";
-import {continuedMeasure, startMeasure, stopMeasure as stopMeasureRaw} from "@/views/scene/linkage/measure";
-import {list, MeasureAtom, MeasureType} from "@/store/measure";
-import {baseLines} from '@/store/baseLine'
-import {basePoints} from "@/store/basePoint";
-import {Ref, watch} from "vue";
-import {activeBasePointStack, activeFixPointStack, customMap} from "@/hook";
-import {getCoverPos} from '../linkage/cover'
-import {Pos3D} from "@/sdk";
-import {fixPoints} from "@/store/fixPoint";
+import { findMenuByKey, menuEnum, MenuRaw } from "@/views/scene/menus/menus";
+import {
+  continuedMeasure,
+  startMeasure,
+  stopMeasure as stopMeasureRaw,
+} from "@/views/scene/linkage/measure";
+import { list, MeasureAtom, MeasureType } from "@/store/measure";
+import { baseLines } from "@/store/baseLine";
+import { basePoints } from "@/store/basePoint";
+import { Ref, watch } from "vue";
+import {
+  activeBasePointStack,
+  activeFixPointStack,
+  customMap,
+  useConfirm,
+} from "@/hook";
+import { getCoverPos } from "../linkage/cover";
+import { Pos3D } from "@/sdk";
+import { fixPoints } from "@/store/fixPoint";
 import Message from "@/components/base/components/message/message.vue";
-import { getId } from '@/utils'
+import { getId } from "@/utils";
 
-const trackPosMenuAction = (onComplete: () => void, onAddStore: (pos: Pos3D) => void, continued = false) => {
-  let onCleanup
-  let stop = false
+const trackPosMenuAction = (
+  onComplete: () => void,
+  onAddStore: (pos: Pos3D) => void,
+  continued = false
+) => {
+  let onCleanup;
+  let stop = false;
   const trackCoverPos = () => {
-    onCleanup && onCleanup()
-    onCleanup = getCoverPos(pos => {
-      onAddStore(pos)
+    onCleanup && onCleanup();
+    onCleanup = getCoverPos((pos) => {
+      onAddStore(pos);
       if (!continued) {
-        onComplete()
+        onComplete();
       } else if (!stop) {
-        trackCoverPos()
+        trackCoverPos();
       }
-    })
-  }
-  trackCoverPos()
+    });
+  };
+  trackCoverPos();
   return () => {
-    stop = true
-    onCleanup()
-  }
-}
+    stop = true;
+    onCleanup();
+  };
+};
 
 const stopMeasure = () => {
-  stopMeasureRaw()
+  stopMeasureRaw();
   // customMap.magnifier = false
-}
+};
 const trackMeasureMenuAction = (
   measureType: MeasureType,
   menu: MenuRaw,
@@ -44,156 +57,157 @@ const trackMeasureMenuAction = (
   name: string,
   color = "#3290ff"
 ) => {
-  let hide
-  let startTipEd = false
-  let endTipEd = false
+  let hide;
+  let startTipEd = false;
+  let endTipEd = false;
   const startTip = () => {
-    hide && hide()
+    hide && hide();
     if (!startTipEd) {
-      hide = Message.success({msg: `请绘制${name}`})
+      hide = Message.success({ msg: `请绘制${name}` });
       // 请选择一个位置单击,确定${name}的起点
-      startTipEd = true
+      startTipEd = true;
     }
-  }
+  };
   const firstTip = () => {
-    hide && hide()
+    hide && hide();
     if (!endTipEd) {
-      endTipEd = true
+      endTipEd = true;
       // hide = Message.success({msg: `再选择一个位置单击,确定${name}的终点`})
     }
-  }
-  startTip()
+  };
+  startTip();
   // customMap.magnifier = true
   const onAddMeasure = (data: MeasureAtom) => {
     if (data) {
       data.id = getId();
-      onAddStore(data)
-      onComplete()
+      onAddStore(data);
+      onComplete();
     }
     if (menu.continued) {
-      startTip()
+      startTip();
     }
-  }
-
+  };
 
   if (menu.continued) {
-    continuedMeasure(measureType as any, color, onAddMeasure, firstTip)
+    continuedMeasure(measureType as any, color, onAddMeasure, firstTip);
   } else {
-    startMeasure(measureType as any, color,  firstTip).then(onAddMeasure)
+    startMeasure(measureType as any, color, firstTip).then(onAddMeasure);
   }
 
   return () => {
-    stopMeasure()
-    hide()
-  }
-}
+    stopMeasure();
+    hide();
+  };
+};
 
 const menuActions = {
   [menuEnum.BASE_POINT]: (_, onComplete) => {
-    let hide = Message.success({ msg: "请单击选择基准点位置" })
+    let hide = Message.success({ msg: "请单击选择基准点位置" });
     const onDestroy = trackPosMenuAction(
       () => {
-        hide && hide()
-        onComplete()
+        hide && hide();
+        onComplete();
       },
-      pos => {
-        const len = basePoints.value.push({ id: getId(), pos })
-        activeBasePointStack.current.value.value = basePoints.value[len - 1]
+      (pos) => {
+        const len = basePoints.value.push({ id: getId(), pos });
+        activeBasePointStack.current.value.value = basePoints.value[len - 1];
         if (hide) {
-          hide()
-          hide = null
+          hide();
+          hide = null;
         }
       },
       true
-    )
+    );
     return () => {
-      onDestroy()
-      hide && hide()
-    }
+      onDestroy();
+      hide && hide();
+    };
   },
-  [menuEnum.FIX_POINT]:  (_, onComplete) => {
-    let hide = Message.success({ msg: "请单击选择固定点位置" })
+  [menuEnum.FIX_POINT]: (_, onComplete) => {
+    let hide = Message.success({ msg: "请单击选择固定点位置" });
     const onDestroy = trackPosMenuAction(
       () => {
-        hide && hide()
-        onComplete()
+        hide && hide();
+        onComplete();
       },
-      pos => {
-        const len = fixPoints.value.push({ id: getId(), pos, text: "固定点" })
-        activeFixPointStack.current.value.value = fixPoints.value[len - 1]
+      (pos) => {
+        const len = fixPoints.value.push({ id: getId(), pos, text: "固定点" });
+        activeFixPointStack.current.value.value = fixPoints.value[len - 1];
         if (hide) {
-          hide()
-          hide = null
+          hide();
+          hide = null;
         }
       },
       true
-    )
+    );
     return () => {
-      onDestroy()
-      hide && hide()
-    }
+      onDestroy();
+      hide && hide();
+    };
   },
   [menuEnum.MEASURE_ROW]: (menu, onComplete) => {
     return trackMeasureMenuAction(
-      'L_LINE',
+      "L_LINE",
       menu,
       (data) => list.value.push(data),
       onComplete,
       "测量线"
-    )
+    );
   },
   [menuEnum.MEASURE_COLUMN]: (menu, onComplete) => {
     return trackMeasureMenuAction(
-      'V_LINE',
+      "V_LINE",
       menu,
       (data) => list.value.push(data),
       onComplete,
       "测量线"
-    )
+    );
   },
   [menuEnum.MEASURE_FREE]: (menu, onComplete) => {
     return trackMeasureMenuAction(
-      'LINE',
+      "LINE",
       menu,
       (data) => list.value.push(data),
       onComplete,
       "测量线"
-    )
+    );
   },
   [menuEnum.BASE_LINE]: (menu, onComplete) => {
     return trackMeasureMenuAction(
-      'BASE_LINE',
+      "BASE_LINE",
       menu,
       (data) => baseLines.value.push(data),
       onComplete,
       "基准线",
       "#ED1C24"
-    )
+    );
   },
-  [menuEnum.CLEAR]: (menu, onComplete) => {
-    list.value = []
-    baseLines.value = []
-    basePoints.value = []
-    fixPoints.value = []
-    onComplete()
+  [menuEnum.CLEAR]: async (menu, onComplete) => {
+    if (await useConfirm("确认情况?该操作无法撤销")) {
+      list.value = [];
+      baseLines.value = [];
+      basePoints.value = [];
+      fixPoints.value = [];
+    }
+    onComplete();
   },
-}
+};
 
 export const joinActions = (activeKey: Ref<string>) => {
   return watch(
     () => activeKey.value,
     (key, oldKey, onCleanup) => {
       if (key && menuActions[key]) {
-        const menu = findMenuByKey(key as any)
+        const menu = findMenuByKey(key as any);
         const cleanup = menuActions[key](menu, () => {
           if (!menu.continued) {
             activeKey.value = null;
           }
         });
-        if (typeof cleanup === 'function') {
+        if (typeof cleanup === "function") {
           onCleanup(cleanup);
         }
       }
     }
-  )
-}
+  );
+};

+ 12 - 2
src/views/scene/mode.vue

@@ -12,6 +12,7 @@ import GroupButton from "@/components/group-button/index.vue";
 import { Mode } from "@/sdk";
 import { computed, ref, watch, watchEffect } from "vue";
 import { customMap, disabledMap } from "@/hook/custom/index";
+import { params } from "@/hook";
 
 const tabs = [
   {
@@ -26,7 +27,9 @@ const tabs = [
   },
 ];
 
-const activeKey = ref(tabs[0].mode);
+const key = params.m + "model";
+
+const activeKey = ref(Number(localStorage.getItem(key) || 0));
 const menus = computed(() =>
   tabs.map((tab) => ({
     icon: tab.mode === activeKey.value ? tab.activeIcon : tab.icon,
@@ -35,7 +38,14 @@ const menus = computed(() =>
   }))
 );
 
-watch(activeKey, () => (customMap.mode = activeKey.value));
+watch(
+  activeKey,
+  () => {
+    customMap.mode = activeKey.value;
+    localStorage.setItem(key, activeKey.value.toString());
+  },
+  { immediate: true }
+);
 </script>
 
 <style lang="scss" scoped>