xzw 8 months ago
parent
commit
ebdbcf2bfc
3 changed files with 60 additions and 41 deletions
  1. 46 33
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 13 7
      src/sdk/cover/index.js

+ 46 - 33
public/lib/potree/potree.js

@@ -42171,7 +42171,6 @@
 	 */
 
 	var texLoader$7 = new TextureLoader();
-	var markerMats$1;
 	var labelSizeInfo$1 = {
 	  width2d: 180
 	}; //稍微小点防止字体模糊
@@ -42193,36 +42192,37 @@
 	};
 	var planeGeo$2 = new PlaneBufferGeometry(1, 1);
 	var voidGeometry = new BufferGeometry();
-	var getMarkerMat = function () {
-	  var mats;
-	  return function (name) {
-	    if (!mats) {
-	      mats = {
-	        default: new DepthBasicMaterial($.extend({}, depthProps, {
-	          transparent: true,
-	          map: texLoader$7.load(Potree.resourcePath + '/textures/dot_n.png')
-	        })),
-	        drag: new MeshBasicMaterial({
-	          transparent: true,
-	          map: texLoader$7.load(Potree.resourcePath + '/textures/dot_s.png')
-	        }),
-	        delete: new MeshBasicMaterial({
-	          transparent: true,
-	          map: texLoader$7.load(Potree.resourcePath + '/textures/dot_r.png')
-	        }),
-	        adding: new MeshBasicMaterial({
-	          transparent: true,
-	          opacity: 0.3,
-	          map: texLoader$7.load(Potree.resourcePath + '/textures/dot_n.png')
-	        })
-	      };
-	      for (var i in mats) {
-	        mats[i].map.anisotropy = 4;
-	      }
+	var markerMats$1;
+	var getMarkerMat = function getMarkerMat(name) {
+	  if (!markerMats$1) {
+	    markerMats$1 = {
+	      default: new DepthBasicMaterial($.extend({}, depthProps, {
+	        transparent: true,
+	        map: texLoader$7.load(Potree.resourcePath + '/textures/dot_n.png')
+	      })),
+	      drag: new DepthBasicMaterial({
+	        transparent: true,
+	        useDepth: false,
+	        map: texLoader$7.load(Potree.resourcePath + '/textures/dot_s.png')
+	      }),
+	      delete: new DepthBasicMaterial({
+	        transparent: true,
+	        useDepth: false,
+	        map: texLoader$7.load(Potree.resourcePath + '/textures/dot_r.png')
+	      }),
+	      adding: new DepthBasicMaterial({
+	        transparent: true,
+	        opacity: 0.3,
+	        useDepth: false,
+	        map: texLoader$7.load(Potree.resourcePath + '/textures/dot_n.png')
+	      })
+	    };
+	    for (var i in markerMats$1) {
+	      markerMats$1[i].map.anisotropy = 4;
 	    }
-	    return mats[name];
-	  };
-	}();
+	  }
+	  return markerMats$1[name];
+	};
 	var getMeshQuaInPath = lineDir => {
 	  var quaBase = new Quaternion().setFromEuler(new Euler(-Math.PI / 2, 0, Math.PI / 2));
 	  return math.getQuaFromPosAim(new Vector3(), lineDir).multiply(quaBase);
@@ -42232,6 +42232,7 @@
 	  return function (path) {
 	    if (!endCap) {
 	      map = texLoader$7.load(Potree.resourcePath + '/textures/whiteCircle.png');
+	      map.anisotropy = 3;
 	      map.repeat.set(0.5, 1);
 	      //map.magFilter = THREE.NearestFilter
 	      var mesh = new Mesh(planeGeo$2);
@@ -42437,7 +42438,7 @@
 	            this.hideArrowUntilUpdate();
 	            this.dispatchEvent('changed');
 	          } else {
-	            //this.isNew || viewer.measuringTool.isAdding || viewer.focusOnObject(this, 'measure') //正在添加测量线时不要focus其他线(容易误触)
+	            this.isNew || viewer.measuringTool.isAdding || this.dispatchEvent('click'); //viewer.focusOnObject(this, 'measure') //正在添加测量线时不要focus其他线(容易误触)
 	          }
 	        });
 	      };
@@ -42757,6 +42758,12 @@
 	    this.editEnable = !!state;
 	    this.markers.forEach(e => Potree.Utils.updateVisible(e, 'editEnable', this.editEnable));
 	    this.endCaps.forEach((e, i) => Potree.Utils.updateVisible(e, 'editEnable', !this.editEnable));
+	    if (markerMats$1) {
+	      //因为marker材质每条path都共用,所以isOfficial时请保证只有一条在编辑
+	      for (var i in markerMats$1) {
+	        markerMats$1[i].fadeFar = this.fadeFar;
+	      }
+	    }
 	    if (!state) {
 	      this.updateEndCaps();
 	      /* viewer.dispatchEvent({
@@ -42952,12 +42959,18 @@
 	    //消失距离 
 	    this.traverse(e => {
 	      var _e$material;
-	      if (e.name == 'marker') return; //因为marker材质共用的所以不改。因此正式编辑时(有marker时)别设置消失距离。
+	      //if(e.name == 'marker')return //因为marker材质共用的所以不改。因此正式编辑时(有marker时)别设置消失距离。
 	      if ((_e$material = e.material) !== null && _e$material !== void 0 && (_e$material = _e$material.uniforms) !== null && _e$material !== void 0 && _e$material.fadeFar) {
 	        e.material.fadeFar = far;
 	      }
 	    });
 	    this.fadeFar = far;
+	    if (markerMats$1) {
+	      //因为marker材质每条path都共用,所以isOfficial时请保证只有一条在编辑
+	      for (var i in markerMats$1) {
+	        markerMats$1[i].fadeFar = this.fadeFar;
+	      }
+	    }
 	    viewer.dispatchEvent('content_changed');
 	  }
 	  dispose() {
@@ -42976,7 +42989,7 @@
 	        var map = texLoader$7.load(Potree.resourcePath + '/textures/arrow.png');
 	        //map.anisotropy = 2
 	        map.generateMipmaps = false;
-	        map.minFilter = LinearFilter; //防止边缘黑边
+	        map.minFilter = LinearFilter; //防止边缘黑边, 但会造成锯齿
 
 	        var material = new DepthBasicMaterial(Object.assign({}, depthProps, {
 	          map,

File diff suppressed because it is too large
+ 1 - 1
public/lib/potree/potree.js.map


+ 13 - 7
src/sdk/cover/index.js

@@ -1363,12 +1363,15 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                         pos:  Potree.Utils.datasetPosTransform({toDataset:true, position: e.position.clone(),  datasetId: e.root.dataset_id })
                     }) 
                 })
+                path.addEventListener('click',(e)=>{
+                    bus.emit('focus') 
+                })
                  
             }
             let funs = getMeasureFunction(path, bus) 
 
 
-            let fadeFar = -1 
+            //let fadeFar = -1 
               
             let functions = Object.assign(funs,{
                 bus,
@@ -1379,7 +1382,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                     }
  
                     path.setEditEnable(state)
-                    functions.changeVisibilityRange(fadeFar)
+                    //functions.changeVisibilityRange(fadeFar)
                 },
                 
                 changeCanEdit(state){//是否点击pen图标以加点和删点 
@@ -1422,10 +1425,13 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                     path.setPathColor(color)
                 },
                 changeVisibilityRange(far){//设置消失距离
-                    fadeFar = far 
-                    path.setFadeFar(( far== -1 || path.editEnable) ? null : far) //注意:编辑时显示全部
+                    //fadeFar = far 
+                    //path.setFadeFar(( far== -1 || path.editEnable) ? null : far) //注意:编辑时显示全部
+                    path.setFadeFar(far== -1 ? null : far) 
+                },
+                focus(){//highlight
+                    
                 },
-                
                 changeDirection(show,reverse){
                     path.setArrowDisplay(show)
                     if(path.reverse != reverse){
@@ -1528,7 +1534,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
             })
             
             
-            for(let i in functions){
+            /* for(let i in functions){
                 if(functions[i] instanceof Function){
                     let oldFun = functions[i]
                     functions[i] = function(){
@@ -1536,7 +1542,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                         oldFun.apply(this, arguments)
                     }
                 }
-            } 
+            } */ 
             
             path.functions = functions