|
|
@@ -155,8 +155,36 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
{
|
|
|
let oldfun = Potree.Path.prototype.getDifferentPoint
|
|
|
Potree.Path.prototype.getDifferentPoint = function(points){
|
|
|
- return oldfun.call(this, points.filter((e,i)=>{return !this.pointHideList[i]}) )
|
|
|
+ return oldfun.call(this, this.getVisiPoints(points) )
|
|
|
+ }
|
|
|
+
|
|
|
+ Potree.Path.prototype.getVisiPoints = function(points=this.points){
|
|
|
+ return points.filter((e,i)=>{return !this.pointHideList[i]})
|
|
|
}
|
|
|
+ Potree.Path.prototype.updateEndCaps = function(){
|
|
|
+ let points = this.getVisiPoints() //这里points改了!!!
|
|
|
+ let len = points.length
|
|
|
+ let pts = this.geoPoints.length>0 ? this.geoPoints : this.points
|
|
|
+ let len2 = pts.length
|
|
|
+
|
|
|
+
|
|
|
+ this.endCaps.forEach((e,i)=>{
|
|
|
+ Potree.Utils.updateVisible(e, 'hasPoints', len>0)
|
|
|
+ if(len){
|
|
|
+ if(len>1){
|
|
|
+ let dir = i==0 ? new THREE.Vector3().subVectors(pts[1], pts[0])
|
|
|
+ : new THREE.Vector3().subVectors(pts[len2-2], pts[len2-1])
|
|
|
+ e.quaternion.copy(this.getMeshQuaInPath(dir))
|
|
|
+ }else{
|
|
|
+ i==0 ? e.quaternion.set(0,0,0,1) : e.quaternion.set(0,0,1,0)
|
|
|
+ }
|
|
|
+ e.position.copy(points[i==0 ? 0 : len-1])
|
|
|
+ let s = this.halfPathWidth * 2.15
|
|
|
+ e.scale.set(s,s,s)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1103,7 +1131,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}
|
|
|
|
|
|
msg = Potree.Common.CloneObject(msg)
|
|
|
- console.log(model.name, msg)
|
|
|
+ //console.log(model.name, msg)
|
|
|
bus.emit('transformChanged', msg)
|
|
|
}
|
|
|
model.addEventListener('transformChanged', (e) => {
|
|
|
@@ -1973,6 +2001,10 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
path.addEventListener('dragLineLen',(e)=>{
|
|
|
bus.emit('changeLineHeight', path.lineHeight)
|
|
|
})
|
|
|
+ path.addEventListener('updated',(e)=>{
|
|
|
+ updatePathHideLine(path)
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
}
|
|
|
let funs = getMeasureFunction(path, bus)
|
|
|
@@ -1995,6 +2027,9 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
viewer.dispatchEvent({ type: 'cancel_insertions', dontRemove: true, measure:path })
|
|
|
}
|
|
|
path.setEditEnable(state)
|
|
|
+ path.fakeLines.forEach(e=>{
|
|
|
+ e && Potree.Utils.updateVisible(e,'editEnable', state)
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
changeCanEdit(state){//是否点击pen图标以加点和删点
|
|
|
@@ -2045,6 +2080,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
path.pointHideList[index] = !show
|
|
|
updatePathHideLine(path)
|
|
|
path.updateEdge(true)
|
|
|
+ path.updateEndCaps()
|
|
|
viewer.dispatchEvent('content_changed')
|
|
|
},
|
|
|
|