xzw 8 months ago
parent
commit
5cc3a27d29
3 changed files with 18 additions and 7 deletions
  1. 15 4
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 2 2
      src/sdk/cover/index.js

+ 15 - 4
public/lib/potree/potree.js

@@ -42180,7 +42180,6 @@
 	var arrowCountMax = 100; //箭头总数不能超过这个值。 The count value passed into the constructor represents the maximum number of instances of this mesh. You can change the number of instances at runtime to an integer value in the range [0, count].If you need more instances than the original count value, you have to create a new InstancedMesh.
 	var arrowCountMax = 100; //箭头总数不能超过这个值。 The count value passed into the constructor represents the maximum number of instances of this mesh. You can change the number of instances at runtime to an integer value in the range [0, count].If you need more instances than the original count value, you have to create a new InstancedMesh.
 	var lastArrowCamPos,
 	var lastArrowCamPos,
 	  lastArrowCount = 0;
 	  lastArrowCount = 0;
-	var pathOpacity = 0.5;
 	var depthProps = {
 	var depthProps = {
 	  useDepth: true,
 	  useDepth: true,
 	  //startClipDis  : 0.5,
 	  //startClipDis  : 0.5,
@@ -42372,7 +42371,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 || '#fff',
-	        opacity: pathOpacity,
+	        opacity: 0.4,
 	        side: 2,
 	        side: 2,
 	        transparent: true,
 	        transparent: true,
 	        fadeFar: this.fadeFar
 	        fadeFar: this.fadeFar
@@ -42563,9 +42562,11 @@
 	    this.hideArrowUntilUpdate();
 	    this.hideArrowUntilUpdate();
 	  }
 	  }
 	  setPathColor(color) {
 	  setPathColor(color) {
+	    var _this$arrows;
 	    if (this.pathColor == color) return;
 	    if (this.pathColor == color) return;
 	    this.pathColor = color;
 	    this.pathColor = color;
 	    this.edge.material.color.set(color);
 	    this.edge.material.color.set(color);
+	    (_this$arrows = this.arrows) === null || _this$arrows === void 0 || _this$arrows.material.color.set(color);
 	    this.endCaps[0].children[0].material.color.set(color);
 	    this.endCaps[0].children[0].material.color.set(color);
 	    viewer.dispatchEvent('content_changed');
 	    viewer.dispatchEvent('content_changed');
 	  }
 	  }
@@ -42578,6 +42579,7 @@
 	    var geo;
 	    var geo;
 	    var points = this.getDifferentPoint(this.points);
 	    var points = this.getDifferentPoint(this.points);
 	    var len = points.length;
 	    var len = points.length;
+	    this.edge.geometry.dispose();
 	    if (len <= 1) {
 	    if (len <= 1) {
 	      geo = voidGeometry;
 	      geo = voidGeometry;
 	    } else {
 	    } else {
@@ -42959,20 +42961,29 @@
 	    viewer.dispatchEvent('content_changed');
 	    viewer.dispatchEvent('content_changed');
 	  }
 	  }
 	  dispose() {
 	  dispose() {
+	    var _this$arrows2, _this$arrows3;
 	    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.edge.geometry.dispose();
+	    this.edge.material.dispose();
 	  }
 	  }
 	  setArrowDisplay(show) {
 	  setArrowDisplay(show) {
 	    if (show) {
 	    if (show) {
 	      if (!this.arrows) {
 	      if (!this.arrows) {
 	        var map = texLoader$7.load(Potree.resourcePath + '/textures/arrow.png');
 	        var map = texLoader$7.load(Potree.resourcePath + '/textures/arrow.png');
-	        map.anisotropy = 2;
+	        //map.anisotropy = 2
+	        map.generateMipmaps = false;
+	        map.minFilter = LinearFilter; //防止边缘黑边
+
 	        var material = new DepthBasicMaterial(Object.assign({}, depthProps, {
 	        var material = new DepthBasicMaterial(Object.assign({}, depthProps, {
 	          map,
 	          map,
 	          transparent: true,
 	          transparent: true,
 	          side: 2,
 	          side: 2,
-	          fadeFar: this.fadeFar
+	          fadeFar: this.fadeFar,
+	          color: this.pathColor || '#fff'
 	        }));
 	        }));
 	        //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

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


+ 2 - 2
src/sdk/cover/index.js

@@ -1329,9 +1329,9 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                 info.dataset_points = props.points.map(e=>e.position)
                 info.dataset_points = props.points.map(e=>e.position)
                 path = viewer.measuringTool.createMeasureFromData(info);
                 path = viewer.measuringTool.createMeasureFromData(info);
                 
                 
-                path.points_dataset.forEach((id,i)=>{
+                path.points_datasets.forEach((id,i)=>{
                     if(id == void 0){ //当该点不在任何模型上时,dataset_point记录的其实是point,现在还原
                     if(id == void 0){ //当该点不在任何模型上时,dataset_point记录的其实是point,现在还原
-                        path.points[i] = info.dataset_points[i] 
+                        path.points[i] = new THREE.Vector3().copy(info.dataset_points[i])
                         path.dataset_points[i] = null 
                         path.dataset_points[i] = null 
                     }
                     }
                 })
                 })