|
@@ -53275,11 +53275,11 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- var Common$1 = {
|
|
|
+ var Common = {
|
|
|
|
|
|
|
|
|
sortByScore: function(list, request, rank){
|
|
|
- var i = request ? Common$1.filterAll(list, request) : list;
|
|
|
+ var i = request ? Common.filterAll(list, request) : list;
|
|
|
return 0 === i.length ? [] : i = i.map(function(e) {
|
|
|
let results = rank.map(function(f){return f(e)});
|
|
|
let scores = results.map(e=>e.score != void 0 ? e.score : e);
|
|
@@ -53316,9 +53316,9 @@
|
|
|
var r = this.sortByScore(list, request, rank);
|
|
|
return r[0] && r[0].item
|
|
|
}else {
|
|
|
- var i = request ? Common$1.filterAll(list, request) : list;
|
|
|
+ var i = request ? Common.filterAll(list, request) : list;
|
|
|
return 0 === i.length ? null : (rank && rank.forEach(function(e) {
|
|
|
- i = Common$1.stableSort(i, e);
|
|
|
+ i = Common.stableSort(i, e);
|
|
|
}),
|
|
|
i[0])
|
|
|
}
|
|
@@ -53464,7 +53464,7 @@
|
|
|
var _object2 = object2.slice(0);
|
|
|
|
|
|
for(let i=0;i<object1.length;i++){
|
|
|
- var u = _object2.find(e=>Common$1.ifSame(object1[i], e, simpleEqualClass));
|
|
|
+ var u = _object2.find(e=>Common.ifSame(object1[i], e, simpleEqualClass));
|
|
|
if(u == void 0 && !_object2.includes(u) && !object1.includes(u))return false;
|
|
|
else {
|
|
|
let index = _object2.indexOf(u);
|
|
@@ -53484,10 +53484,10 @@
|
|
|
}else if(typeof object1 == "object"){
|
|
|
var keys1 = Object.keys(object1);
|
|
|
var keys2 = Object.keys(object2);
|
|
|
- if(!Common$1.ifSame(keys1,keys2,simpleEqualClass))return false;
|
|
|
+ if(!Common.ifSame(keys1,keys2,simpleEqualClass))return false;
|
|
|
|
|
|
for(let i in object1){
|
|
|
- var same = Common$1.ifSame(object1[i], object2[i],simpleEqualClass);
|
|
|
+ var same = Common.ifSame(object1[i], object2[i],simpleEqualClass);
|
|
|
if(!same)return false
|
|
|
}
|
|
|
return true
|
|
@@ -53607,7 +53607,7 @@
|
|
|
if(atGroups.length>1){//如果在不同组,说明这两个组需要合并
|
|
|
var combineGroup = [];
|
|
|
atGroups.forEach(group=>{
|
|
|
- combineGroup = Common$1.getUnionSet(combineGroup, group);
|
|
|
+ combineGroup = Common.getUnionSet(combineGroup, group);
|
|
|
groups.splice(groups.indexOf(group),1);
|
|
|
|
|
|
});
|
|
@@ -53650,7 +53650,7 @@
|
|
|
|
|
|
getSlice : function(name, items , {stopWhenAllUsed, min=5,max=100, durBound1 , durBound2, useEquals , maxUseCount}){
|
|
|
if(items.length == 0 ||
|
|
|
- ((maxUseCount = maxUseCount == void 0 ? Common$1.getBestCount(name, min,max , durBound1, durBound2 /* , true */ ) : maxUseCount), !maxUseCount) //本次最多可以使用的个数
|
|
|
+ ((maxUseCount = maxUseCount == void 0 ? Common.getBestCount(name, min,max , durBound1, durBound2 /* , true */ ) : maxUseCount), !maxUseCount) //本次最多可以使用的个数
|
|
|
){
|
|
|
return {list:[]}
|
|
|
}
|
|
@@ -53726,7 +53726,7 @@
|
|
|
|
|
|
};
|
|
|
|
|
|
- Potree.Common = Common$1;
|
|
|
+ Potree.Common = Common;
|
|
|
|
|
|
class View{//base
|
|
|
constructor () {
|
|
@@ -53976,11 +53976,11 @@
|
|
|
}
|
|
|
|
|
|
copy(a){
|
|
|
- Common$1.CopyClassObject(this, a, {ignoreList: ['_listeners']});
|
|
|
+ Common.CopyClassObject(this, a, {ignoreList: ['_listeners']});
|
|
|
}
|
|
|
|
|
|
clone () {
|
|
|
- return Common$1.CloneClassObject(this, {ignoreList: ['_listeners']})
|
|
|
+ return Common.CloneClassObject(this, {ignoreList: ['_listeners']})
|
|
|
}
|
|
|
|
|
|
//----------
|
|
@@ -55875,7 +55875,8 @@
|
|
|
|
|
|
pointDensity:{
|
|
|
magnifier:{
|
|
|
- maxLevelPercent: 1
|
|
|
+ maxLevelPercent: 1,
|
|
|
+ pointBudget: 1*1000*1000,
|
|
|
},
|
|
|
panorama:{//显示全景时的漫游。因为点只能显示1个像素的大小,所以必须很密集,但又要限制点的数量
|
|
|
maxLevelPercent: 0.6,
|
|
@@ -71913,10 +71914,10 @@ void main()
|
|
|
this.textBorderThick = options.textBorderThick || 0;
|
|
|
this.fontface = 'Arial';
|
|
|
this.fontsize = options.fontsize || 16;
|
|
|
- this.textBorderColor = options.textBorderColor ? Common$1.CloneObject(options.textBorderColor):{ r: 0, g: 0, b: 0, a: 0.0 };
|
|
|
- this.backgroundColor = options.backgroundColor ? Common$1.CloneObject(options.backgroundColor):{ r: 255, g: 255, b: 255, a: 1.0 };
|
|
|
- this.textColor = options.textColor ? Common$1.CloneObject(options.textColor):{r: 0, g: 0, b: 0, a: 1.0};
|
|
|
- this.borderColor = options.borderColor ? Common$1.CloneObject(options.borderColor):{ r: 0, g: 0, b: 0, a: 0.0 };
|
|
|
+ this.textBorderColor = options.textBorderColor ? Common.CloneObject(options.textBorderColor):{ r: 0, g: 0, b: 0, a: 0.0 };
|
|
|
+ this.backgroundColor = options.backgroundColor ? Common.CloneObject(options.backgroundColor):{ r: 255, g: 255, b: 255, a: 1.0 };
|
|
|
+ this.textColor = options.textColor ? Common.CloneObject(options.textColor):{r: 0, g: 0, b: 0, a: 1.0};
|
|
|
+ this.borderColor = options.borderColor ? Common.CloneObject(options.borderColor):{ r: 0, g: 0, b: 0, a: 0.0 };
|
|
|
this.borderRadius = options.borderRadius || 6;
|
|
|
this.margin = options.margin;
|
|
|
if(options.text != void 0)this.setText(options.text);
|
|
@@ -71937,19 +71938,19 @@ void main()
|
|
|
}
|
|
|
|
|
|
setTextColor(color){
|
|
|
- this.textColor = Common$1.CloneObject(color);
|
|
|
+ this.textColor = Common.CloneObject(color);
|
|
|
|
|
|
this.updateTexture();
|
|
|
}
|
|
|
|
|
|
setBorderColor(color){
|
|
|
- this.borderColor = Common$1.CloneObject(color);
|
|
|
+ this.borderColor = Common.CloneObject(color);
|
|
|
|
|
|
this.updateTexture();
|
|
|
}
|
|
|
|
|
|
setBackgroundColor(color){
|
|
|
- this.backgroundColor = Common$1.CloneObject(color);
|
|
|
+ this.backgroundColor = Common.CloneObject(color);
|
|
|
|
|
|
this.updateTexture();
|
|
|
}
|
|
@@ -73752,6 +73753,8 @@ void main()
|
|
|
let old_clipBoxes_out = new Map();
|
|
|
let old_bigClipInBox = new Map();
|
|
|
let old_highlightBoxes = new Map();
|
|
|
+ let old_visibleNodes = new Map();
|
|
|
+
|
|
|
|
|
|
//bigClipInBox 最好也写下
|
|
|
let density;
|
|
@@ -73768,13 +73771,11 @@ 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;
|
|
|
-
|
|
|
- e.changePointSize(Potree.config.material.realPointSize*2, true);//更改点云大小到能铺满为止,否则容易识别不到
|
|
|
+ e.material.pointSizeType = Potree.config.material.pointSizeType;
|
|
|
+ //e.changePointSize(Potree.config.material.realPointSize*2, true)//更改点云大小到能铺满为止,否则容易识别不到
|
|
|
});
|
|
|
needsUpdate = true;
|
|
|
}else {
|
|
@@ -73797,7 +73798,21 @@ void main()
|
|
|
}
|
|
|
|
|
|
if(needsUpdate){
|
|
|
- Potree.updatePointClouds(pointclouds, camera, viewport.resolution ); //最好只更新pick的范围的resolution
|
|
|
+ for(let pointcloud of pointclouds){
|
|
|
+ old_visibleNodes.set(pointcloud, pointcloud.visibleNodes);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(window.notViewOffset){
|
|
|
+ Potree.updatePointClouds(pointclouds, camera, viewport.resolution );
|
|
|
+ }else {
|
|
|
+ //尽量减少点云加载的范围,集中在pick的空间。但似乎感觉这部分空间没加载到最密
|
|
|
+ let viewWidth = 100;//viewer.magnifier ? viewer.magnifier.viewport.resolution.x : 200
|
|
|
+ let camera_ = camera.clone();
|
|
|
+ camera_.setViewOffset( viewport.resolution.x, viewport.resolution.y, pickParams.x-viewWidth/2, pickParams.y-viewWidth/2, viewWidth, viewWidth );
|
|
|
+ Potree.updatePointClouds(pointclouds, camera_, viewport.resolution );
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
//------------------------------------------------
|
|
|
|
|
@@ -73832,7 +73847,7 @@ void main()
|
|
|
pointclouds.forEach(e=>{
|
|
|
if(e.visible){
|
|
|
e.material.pointSizeType = sizeType;
|
|
|
- e.changePointSize(size.get(e));
|
|
|
+ //e.changePointSize(size.get(e))
|
|
|
}
|
|
|
e.visible = visiMap.get(e);
|
|
|
});
|
|
@@ -73841,12 +73856,21 @@ void main()
|
|
|
viewport.afterRender && viewport.afterRender()
|
|
|
} */
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
if(!pickParams.pickClipped){//add
|
|
|
for(let pointcloud of pointclouds){
|
|
|
pointcloud.material.setClipBoxes(old_bigClipInBox.get(pointcloud), old_clipBoxes_in.get(pointcloud), old_clipBoxes_out.get(pointcloud), old_highlightBoxes.get(pointcloud));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ if(needsUpdate){
|
|
|
+ for(let pointcloud of pointclouds){ //不恢复的话(尤其cameraChanged时),在下次render前,再次pick可能是错的。表现为多数据集刚开始reticule消失了,直到ifPointBlockedByIntersect停止
|
|
|
+ pointcloud.visibleNodes = old_visibleNodes.get(pointcloud);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (selectedPointcloud) {
|
|
|
return {
|
|
|
location: closestIntersection,
|
|
@@ -74947,7 +74971,7 @@ void main()
|
|
|
unloadedGeometry[i].node.load(unloadedGeometry[i].pointcloud.pcoGeometry);
|
|
|
} */
|
|
|
|
|
|
- let maxNodesLoading = Common$1.getBestCount('unloadedGeometry', viewer.lastFrameChanged?2:4, 10, 4, 15 /* , true */ );//dur在iphoneX中静止有7,pc是2 //!lastFrameChanged静止时加速下载
|
|
|
+ let maxNodesLoading = Common.getBestCount('unloadedGeometry', viewer.lastFrameChanged?2:4, 10, 4, 15 /* , true */ );//dur在iphoneX中静止有7,pc是2 //!lastFrameChanged静止时加速下载
|
|
|
//THREE.Math.clamp(Math.round(9 - dur), 1, 6 )
|
|
|
//console.log('unloadedGeometry',unloadedGeometry.length, 'maxNodesLoading',maxNodesLoading)
|
|
|
//主要在手机端有效果。不改之前在展示的点云较多时前进会卡。
|
|
@@ -76350,11 +76374,16 @@ void main()
|
|
|
viewer.addTimeMark('pick','start');
|
|
|
|
|
|
let getVal = (a, b) => a != void 0 ? a : b;
|
|
|
-
|
|
|
-
|
|
|
- let pickWindowSize_ = MathUtils$1.clamp( Math.round((1.1-this.maxLevel/this.nodeMaxLevel)*80), 5, 100);
|
|
|
- let pickWindowSize = getVal(params.pickWindowSize, pickWindowSize_ ); /* 65 */ //拾取像素边长,越小越精准,但点云稀疏的话可能容易出现识别不到的情况。 另外左下侧会有缝隙无法识别到,缝隙大小和这个值有关//突然发现pickWindowSize在一百以内的变化对pick费时影响甚微,1和100差1毫秒不到,但400时会多4毫秒
|
|
|
-
|
|
|
+ let pickWindowSize = params.pickWindowSize; //拾取像素边长,越小越精准,但点云稀疏的话可能容易出现识别不到的情况。 另外左下侧会有缝隙无法识别到,缝隙大小和这个值有关//突然发现pickWindowSize在一百以内的变化对pick费时影响甚微,1和100差1毫秒不到,但400时会多4毫秒
|
|
|
+ if(pickWindowSize == void 0){
|
|
|
+ if(Potree.settings.displayMode == 'showPanos'){
|
|
|
+ pickWindowSize = 50;
|
|
|
+ }else {
|
|
|
+ let r0 = this.nodeMaxLevel > 0 ? this.maxLevel/this.nodeMaxLevel : 0.5;
|
|
|
+ pickWindowSize = MathUtils$1.clamp( Math.round((1.1-r0)*80), 15, 100);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(camera.type == 'OrthographicCamera'){
|
|
|
var cameraDir = new Vector3(0,0,-1).applyQuaternion(camera.quaternion);
|
|
|
pickWindowSize *= 4; //pointsize比较大时截取太小会没多少点可以选
|
|
@@ -76371,7 +76400,7 @@ void main()
|
|
|
if(window.testScreen){
|
|
|
let dataUrl = Potree.Utils.renderTargetToDataUrl(pickState.renderTarget, width, height, renderer);
|
|
|
|
|
|
- Common.downloadFile(dataUrl, 'screenshot.jpg'); //为什么图片上不是只有pickWindowSize区域有颜色??
|
|
|
+ Potree.Common.downloadFile(dataUrl, 'screenshot.jpg'); //为什么图片上不是只有pickWindowSize区域有颜色??
|
|
|
window.testScreen = 0;
|
|
|
}
|
|
|
};
|
|
@@ -76441,12 +76470,8 @@ void main()
|
|
|
let pixelPos = new Vector2(params.x, params.y);
|
|
|
|
|
|
let gl = renderer.getContext();
|
|
|
- gl.enable(gl.SCISSOR_TEST);
|
|
|
- gl.scissor( //规定渲染范围,只渲染一小块
|
|
|
- parseInt(pixelPos.x - (pickWindowSize - 1) / 2),
|
|
|
- parseInt(pixelPos.y - (pickWindowSize - 1) / 2),
|
|
|
- parseInt(pickWindowSize), parseInt(pickWindowSize));
|
|
|
-
|
|
|
+ pickState.renderTarget.scissor.set(parseInt(pixelPos.x - (pickWindowSize - 1) / 2), parseInt(pixelPos.y - (pickWindowSize - 1) / 2),parseInt(pickWindowSize), parseInt(pickWindowSize));
|
|
|
+ pickState.renderTarget.scissorTest = true;
|
|
|
|
|
|
renderer.state.buffers.depth.setTest(pickMaterial.depthTest);
|
|
|
renderer.state.buffers.depth.setMask(pickMaterial.depthWrite);
|
|
@@ -76456,7 +76481,7 @@ void main()
|
|
|
{ // RENDER
|
|
|
renderer.setRenderTarget(pickState.renderTarget);
|
|
|
gl.clearColor(0, 0, 0, 0);
|
|
|
- renderer.clear(true, true, true);
|
|
|
+ //renderer.clear(true, true, true);
|
|
|
|
|
|
let tmp = this.material;
|
|
|
this.material = pickMaterial;
|
|
@@ -76480,7 +76505,8 @@ void main()
|
|
|
//w<pickWindowSize会报错
|
|
|
|
|
|
gl.readPixels(x, y, pickWindowSize, pickWindowSize, gl.RGBA, gl.UNSIGNED_BYTE, buffer); //这句花费最多时间 pc:2-4, 即使只有1*1像素
|
|
|
-
|
|
|
+ renderer.clear(true, true, true); //绘制完就clear否则download的图会有上次的轨迹
|
|
|
+
|
|
|
renderer.setRenderTarget(null);
|
|
|
renderer.state.reset();
|
|
|
renderer.setScissorTest(false);
|
|
@@ -76639,12 +76665,12 @@ void main()
|
|
|
|
|
|
let nearest = sorted1[0]; //return nearest.point; //直接用最近点 在点云稀疏时不太跟手,如地面上,最近点往往在鼠标下方
|
|
|
|
|
|
- let r = 10;
|
|
|
+ let pickFrontRatio = 20;
|
|
|
|
|
|
hits.forEach( hit=>{
|
|
|
let disDiff = hit.disSquare - nearest.disSquare; //和最近点的偏差
|
|
|
hit.disDiff = disDiff;
|
|
|
- hit.score = -hit.distanceToCenter - disDiff * r;
|
|
|
+ hit.score = -hit.distanceToCenter - disDiff * pickFrontRatio;
|
|
|
});
|
|
|
|
|
|
let sorted2 = hits.sort( (a, b) => b.score - a.score );
|
|
@@ -76673,7 +76699,7 @@ void main()
|
|
|
}
|
|
|
num_ = num_ / (Potree.config.material.realPointSize / Potree.config.material.pointSize); //兼容
|
|
|
|
|
|
- num_ = Math.pow(num_, 1.05) * 5;
|
|
|
+ //num_ = Math.pow(num_, 1.05) * 5
|
|
|
|
|
|
|
|
|
nodeMaxLevel = this.testMaxNodeCount >= Potree.config.testNodeCount1 ? this.nodeMaxLevel : this.nodeMaxLevelPredict.max; //防止刚开始因nodeMaxLevel没涨完,导致过大的点云突然出现
|
|
@@ -76688,7 +76714,7 @@ void main()
|
|
|
let base = this.material.spacing / Math.pow(2, this.maxLevel); //点云大小在level为0时设置为spacing,每长一级,大小就除以2. (不同场景还是会有偏差)
|
|
|
base *= nodeMaxLevel > 0 ? Math.max(0.1, Math.pow(this.maxLevel / nodeMaxLevel, 1.4)) : 0.1; //低质量的缩小点,因为视觉上看太大了。navvis是不铺满的,我们也留一点缝隙(但是ortho是不用缩小的,如果能分开判断就好了)
|
|
|
|
|
|
- size = base * 5 * num_;/* * window.devicePixelRatio */
|
|
|
+ size = base * 20 * num_;/* * window.devicePixelRatio */
|
|
|
//在t-8BCqxQAr93 会议室 和 t-e2Kb2iU 隧道 两个场景里调节,因为它们的spacing相差较大,观察会议室墙壁的龟裂程度
|
|
|
this.temp.sizeFitToLevel[str] = size;
|
|
|
}
|
|
@@ -76697,7 +76723,7 @@ void main()
|
|
|
/* let base = 0.007; */ let base = this.material.spacing / Math.pow(2, nodeMaxLevel); //点云大小在level为0时设置为spacing,每长一级,大小就除以2
|
|
|
//base的数值理论上应该是右侧算出来的,但发现有的场景nodeMaxLevel和nodeMaxLevelPredict差别较大的点云显示也过大,而直接换成固定值反而可以适应所有场景。该固定值来源于 getHighestNodeSpacing 最小值,修改了下。(会不会是我们的相机其实该值是固定的,根据该值算出的spacing才是有误差的? 如果换了相机是否要改值?)
|
|
|
//2022-12-21又换回非固定值。因为有的场景如SS-t-t01myDqnfE的两个数据集密集程度差别很大,应该将稀疏点云的大小设置的大些。 但是这样的缺点是两个数据集因相接处有大有小无法融合。
|
|
|
- size = base * 5 * num_; /* * window.devicePixelRatio */
|
|
|
+ size = base * 20 * num_; /* * window.devicePixelRatio */
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -89436,7 +89462,7 @@ void main()
|
|
|
|
|
|
|
|
|
clone(){
|
|
|
- return Common$1.CloneClassObject(this)
|
|
|
+ return Common.CloneClassObject(this)
|
|
|
|
|
|
}
|
|
|
|
|
@@ -89663,8 +89689,8 @@ void main()
|
|
|
|
|
|
//使用当前touches的平均
|
|
|
if(e.touches.length > 1){
|
|
|
- let pageX = Common$1.average(e.touches, "pageX");
|
|
|
- let pageY = Common$1.average(e.touches, "pageY");
|
|
|
+ let pageX = Common.average(e.touches, "pageX");
|
|
|
+ let pageY = Common.average(e.touches, "pageY");
|
|
|
let a = this.getPointerInViewport(pageX, pageY, viewport, new Vector2);
|
|
|
this.pointer.copy(a.pointer);
|
|
|
//console.log('updateTouchesInfo', this.pointer.clone())
|
|
@@ -90349,7 +90375,7 @@ void main()
|
|
|
camera,
|
|
|
this.viewer,
|
|
|
this.viewer.scene.pointclouds,
|
|
|
- {pickClipped: true, measuring: this.measuring.length>0, pickWindowSize, cameraChanged: !!point }
|
|
|
+ {pickClipped: true, isMeasuring: this.measuring.length>0, pickWindowSize, cameraChanged: !!point }
|
|
|
|
|
|
);
|
|
|
|
|
@@ -90396,17 +90422,13 @@ void main()
|
|
|
if(!intersect){
|
|
|
let canUseDepthTex = !Potree.settings.unableUseDepTexPick && (Potree.settings.displayMode == 'showPanos' || useDepthTex)
|
|
|
&& viewer.images360.currentPano.pointcloud.hasDepthTex && viewport == viewer.mainViewport && !usePointcloud;
|
|
|
-
|
|
|
-
|
|
|
- /* if(canUseDepthTex)getByDepthTex()
|
|
|
- else getByCloud() */
|
|
|
- if(canUseDepthTex && !this.isMeasuring){
|
|
|
+ //交通的深度图不准,先只用在reticule上
|
|
|
+
|
|
|
+ if(canUseDepthTex && this.measuring.length == 0){
|
|
|
getByDepthTex();
|
|
|
}else {
|
|
|
getByCloud();
|
|
|
- /* if(!intersectPoint && canUseDepthTex ){ //若在测量,先尝试点云,再用全景 //后来发现有深度图的点云全景visibleNode为空,pick不到的//如果允许的话,裁剪掉的点云也会得到intersect
|
|
|
- getByDepthTex()
|
|
|
- } */
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -97656,7 +97678,7 @@ ENDSEC
|
|
|
|
|
|
findNearestPano(pos){
|
|
|
pos = pos ? new Vector3().copy(pos) : this.position;
|
|
|
- let result = Common$1.sortByScore(this.panos,[Images360.filters.isEnabled()],[e=>-e.position.distanceTo(pos)]);
|
|
|
+ let result = Common.sortByScore(this.panos,[Images360.filters.isEnabled()],[e=>-e.position.distanceTo(pos)]);
|
|
|
let pano = result[0] && result[0].item;
|
|
|
return pano
|
|
|
|
|
@@ -98269,7 +98291,7 @@ ENDSEC
|
|
|
n && (n.candidates = null, //candidates 缓存顺序--如果需要打印的话
|
|
|
n.pano = null),
|
|
|
e || (e = 0);
|
|
|
- var r = Common$1.sortByScore(this.panos, t, i);
|
|
|
+ var r = Common.sortByScore(this.panos, t, i);
|
|
|
//console.log('findRankedByScore', r && r.map(u=>u.item.id + '| ' + math.toPrecision(u.score,4) + " | " + math.toPrecision(u.scores,4)))
|
|
|
|
|
|
|
|
@@ -98294,7 +98316,7 @@ ENDSEC
|
|
|
intersect = intersect && intersect.location;
|
|
|
if(!intersect)return
|
|
|
let sortFuncs = Potree.settings.editType != 'pano'? [Images360.sortFunctions.floorDisSquaredToPoint(intersect)] : [Images360.sortFunctions.disSquaredToPoint(intersect)];
|
|
|
- pano = Common$1.find(this.panos, filterFuncs, sortFuncs);
|
|
|
+ pano = Common.find(this.panos, filterFuncs, sortFuncs);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -98452,7 +98474,7 @@ ENDSEC
|
|
|
);
|
|
|
|
|
|
|
|
|
- var g = Common$1.sortByScore(panos, require, rank);
|
|
|
+ var g = Common.sortByScore(panos, require, rank);
|
|
|
//console.log(g)
|
|
|
|
|
|
/* let result1 = g && g.slice(0, 10)
|
|
@@ -98654,7 +98676,7 @@ ENDSEC
|
|
|
|
|
|
var s = [Images360.filters.not(this.currentPano )],
|
|
|
l = [Images360.scoreFunctions.distanceSquared(this.currentPano ), Images360.scoreFunctions.direction(this.position, this.getDirection())];
|
|
|
- this.nearPanos = Common$1.sortByScore(this.panos, s, l).map(e=>e.item);
|
|
|
+ this.nearPanos = Common.sortByScore(this.panos, s, l).map(e=>e.item);
|
|
|
|
|
|
//下载深度图
|
|
|
let depTexDlCount = browser.isMobile() ? 1 : 2;
|
|
@@ -98710,7 +98732,7 @@ ENDSEC
|
|
|
let others = panos.slice(i+1, j);
|
|
|
lastIndex = i;
|
|
|
|
|
|
- var g = Common$1.sortByScore(others, [ ], [
|
|
|
+ var g = Common.sortByScore(others, [ ], [
|
|
|
Images360.scoreFunctions.distanceSquared(pano.position)
|
|
|
]);
|
|
|
|
|
@@ -102931,7 +102953,7 @@ ENDSEC
|
|
|
|
|
|
this.priorityEvent.forEach(e=>{//刚开始Potree.resourcePath没值,现在换
|
|
|
for(let i in e){
|
|
|
- e[i] = Common$1.replaceAll(e[i],'{Potree.resourcePath}',Potree.resourcePath);
|
|
|
+ e[i] = Common.replaceAll(e[i],'{Potree.resourcePath}',Potree.resourcePath);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -134998,19 +135020,23 @@ ENDSEC
|
|
|
return pointDensity
|
|
|
},
|
|
|
set: (density)=>{
|
|
|
- if(density && density != pointDensity){
|
|
|
- let pointBudget;
|
|
|
- var config = Potree.config.pointDensity[density];
|
|
|
- pointBudget = config.pointBudget;
|
|
|
+ if(density){
|
|
|
+
|
|
|
+ let config = Potree.config.pointDensity[density];
|
|
|
+ let pointBudget = config.pointBudget;
|
|
|
+ if(density == 'magnifier'){//尽可能不变pointBudget,否则点云可能会闪烁,因点云被释放又加载,如SS-t-7DUfWAUZ3V
|
|
|
+ pointBudget = Math.max(Potree.pointBudget, Potree.config.pointDensity['magnifier'].pointBudget);
|
|
|
+ }else if(this.magnifier.visible){//放大镜打开时要保证最低点云数量(全景模式没点)
|
|
|
+ pointBudget = Math.max(pointBudget, Potree.config.pointDensity['magnifier'].pointBudget);
|
|
|
+ }
|
|
|
viewer.setMinNodeSize(config.minNodeSize || Potree.config.minNodeSize);
|
|
|
- viewer.setPointBudget(pointBudget );
|
|
|
- //Potree.maxPointLevel = config.maxLevel
|
|
|
+ viewer.setPointBudget(pointBudget );
|
|
|
|
|
|
pointDensity = density;
|
|
|
|
|
|
this.setPointLevels();
|
|
|
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -135103,7 +135129,7 @@ ENDSEC
|
|
|
|
|
|
if(Potree.settings.ifShowMarker && Potree.settings.editType != 'merge'){
|
|
|
|
|
|
- Common$1. intervalTool.isWaiting('updateMarkerVisibles', ()=>{
|
|
|
+ Common. intervalTool.isWaiting('updateMarkerVisibles', ()=>{
|
|
|
if(!this.mainViewport.view.isFlying() ){
|
|
|
this.updateMarkerVisibles();
|
|
|
}
|
|
@@ -135134,7 +135160,7 @@ ENDSEC
|
|
|
}) */
|
|
|
this.images360.addEventListener('getNeighbourAuto',(e)=>{
|
|
|
if(/* Potree.settings.displayMode == 'showPanos' && */e.panos.includes(this.images360.currentPano)){
|
|
|
- Common$1.intervalTool.isWaiting('updateMarkerVisibles', ()=>{
|
|
|
+ Common.intervalTool.isWaiting('updateMarkerVisibles', ()=>{
|
|
|
this.updateMarkerVisibles();
|
|
|
},500);
|
|
|
}
|
|
@@ -135256,7 +135282,7 @@ ENDSEC
|
|
|
let byTex=0, byCloud=0;
|
|
|
let len = shelterHistory.length;
|
|
|
let waitCloud = [];
|
|
|
- let maxTexCount = Common$1.getBestCount('shelterMaxDepthSample', 1, 50, 1, 13 /* ,true */ );
|
|
|
+ let maxTexCount = Common.getBestCount('shelterMaxDepthSample', 1, 50, 1, 13 /* ,true */ );
|
|
|
|
|
|
|
|
|
|
|
@@ -135293,7 +135319,7 @@ ENDSEC
|
|
|
|
|
|
let maxCloudCount;
|
|
|
if(byTex < maxTexCount && waitCloud.length){
|
|
|
- maxCloudCount = this.lastFrameChanged ? Common$1.getBestCount('shelterMaxCloud', 0, 2, 4, 8 /* ,true */ ) : 5;
|
|
|
+ maxCloudCount = this.lastFrameChanged ? Common.getBestCount('shelterMaxCloud', 0, 2, 4, 8 /* ,true */ ) : 5;
|
|
|
let waitCloud2 = [];
|
|
|
if(maxCloudCount){
|
|
|
for(let i=0; i<waitCloud.length; i++){
|
|
@@ -135316,7 +135342,7 @@ ENDSEC
|
|
|
|
|
|
|
|
|
let list = waitCloud2.map(e=>e.point);
|
|
|
- let result = Common$1.batchHandling.getSlice('shelterByCloud', list, {maxUseCount:maxCloudCount,useEquals:true, stopWhenAllUsed:true} ); //iphonex稳定后大概在7-10。
|
|
|
+ let result = Common.batchHandling.getSlice('shelterByCloud', list, {maxUseCount:maxCloudCount,useEquals:true, stopWhenAllUsed:true} ); //iphonex稳定后大概在7-10。
|
|
|
//list.length>0 && console.log('list',list, maxCloudCount)
|
|
|
|
|
|
result.list.forEach(e=>{
|
|
@@ -135342,7 +135368,7 @@ ENDSEC
|
|
|
|
|
|
if(byTex || byCloud){
|
|
|
//console.log('shelterComputed',byTex,byCloud, maxTexCount, maxCloudCount)
|
|
|
- Common$1.intervalTool.isWaiting('shelterComputed', ()=>{
|
|
|
+ Common.intervalTool.isWaiting('shelterComputed', ()=>{
|
|
|
//console.log('shelterComputed update')
|
|
|
this.dispatchEvent('shelterComputed');
|
|
|
},340);
|
|
@@ -135360,7 +135386,7 @@ ENDSEC
|
|
|
&& e.ifContainsPoint(currPos)
|
|
|
);
|
|
|
|
|
|
- if(Common$1.getDifferenceSet(at, this.atDatasets).length){
|
|
|
+ if(Common.getDifferenceSet(at, this.atDatasets).length){
|
|
|
//console.log('atDatasets', at)
|
|
|
this.atDatasets = at;
|
|
|
|
|
@@ -135371,7 +135397,7 @@ ENDSEC
|
|
|
};
|
|
|
|
|
|
if(force)fun();
|
|
|
- else Common$1.intervalTool.isWaiting('atWhichDataset', fun , 300);
|
|
|
+ else Common.intervalTool.isWaiting('atWhichDataset', fun , 300);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -135543,7 +135569,7 @@ ENDSEC
|
|
|
|
|
|
camera = e.camera || this.scene.getActiveCamera();
|
|
|
|
|
|
- Common$1.intervalTool.isWaiting('testPointcloudsMaxLevel', ()=>{
|
|
|
+ Common.intervalTool.isWaiting('testPointcloudsMaxLevel', ()=>{
|
|
|
if(!camera_changed && count>50 || Potree.settings.displayMode == 'showPanos' )return //只有当camera_changed后才继续循环, 除了最开始几次需要连续加载下
|
|
|
|
|
|
camera_changed = false;
|
|
@@ -137699,7 +137725,7 @@ ENDSEC
|
|
|
}
|
|
|
|
|
|
if(!Potree.settings.isOfficial){
|
|
|
- Common$1.downloadFile(dataUrl, 'screenshot.jpg');
|
|
|
+ Common.downloadFile(dataUrl, 'screenshot.jpg');
|
|
|
}
|
|
|
|
|
|
|
|
@@ -138472,7 +138498,7 @@ ENDSEC
|
|
|
let rank = [
|
|
|
Images360.scoreFunctions.distanceSquared({position: center})
|
|
|
];
|
|
|
- let r = Common$1.sortByScore(pointcloud.panos, request, rank);
|
|
|
+ let r = Common.sortByScore(pointcloud.panos, request, rank);
|
|
|
if(r.length){
|
|
|
return r[0].item
|
|
|
}
|
|
@@ -138955,7 +138981,7 @@ ENDSEC
|
|
|
}
|
|
|
|
|
|
pointInWhichPointcloud(pos){//选择最接近中心的那个 使用boundSphere
|
|
|
- let result = Common$1.sortByScore(this.scene.pointclouds,[],[
|
|
|
+ let result = Common.sortByScore(this.scene.pointclouds,[],[
|
|
|
(pointcloud)=>{
|
|
|
var size = pointcloud.pcoGeometry.tightBoundingBox.getSize(new Vector3);
|
|
|
var center = pointcloud.bound.getCenter(new Vector3);
|
|
@@ -139039,7 +139065,7 @@ ENDSEC
|
|
|
*/
|
|
|
|
|
|
async loadModel(fileInfo, done, onProgress_, onError){
|
|
|
- console.log('开始加载', Common$1.getNameFromURL(fileInfo.name) );
|
|
|
+ console.log('开始加载', Common.getNameFromURL(fileInfo.name) );
|
|
|
|
|
|
let boundingBox = new Box3();
|
|
|
/* if(!Potree.settings.boundAddObjs){
|
|
@@ -139055,7 +139081,7 @@ ENDSEC
|
|
|
fileInfo.loadedCount = 0;
|
|
|
fileInfo.modelGroup = new Object3D; //parentGroup.name = fileInfo.title
|
|
|
fileInfo.url.forEach((url,i)=>{
|
|
|
- let fileInfoS = Common$1.CloneObject(fileInfo);
|
|
|
+ let fileInfoS = Common.CloneObject(fileInfo);
|
|
|
fileInfoS.url = url;
|
|
|
fileInfoS.name = 'child-'+i;
|
|
|
fileInfoS.parentInfo = fileInfo;
|
|
@@ -139064,7 +139090,7 @@ ENDSEC
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- fileInfo.url = Common$1.dealURL(fileInfo.url); //去除'+'
|
|
|
+ fileInfo.url = Common.dealURL(fileInfo.url); //去除'+'
|
|
|
fileInfo.loadStartTime = Date.now();
|
|
|
//let fileType = fileInfo.tilesUrl ? '3dTiles' : fileInfo.objurl ? 'obj' : 'glb'
|
|
|
|
|
@@ -139095,7 +139121,7 @@ ENDSEC
|
|
|
|
|
|
fileInfo_.loadCostTime = Date.now() - fileInfo_.loadStartTime;
|
|
|
/* let weight = Math.round((total / 1024 / 1024) * 100) / 100;*/
|
|
|
- console.log( '加载完毕:', Common$1.getNameFromURL(fileInfo_.name), '耗时(ms)', fileInfo_.loadCostTime, /* 模型数据量:' + weight + 'M' */);
|
|
|
+ console.log( '加载完毕:', Common.getNameFromURL(fileInfo_.name), '耗时(ms)', fileInfo_.loadCostTime, /* 模型数据量:' + weight + 'M' */);
|
|
|
|
|
|
|
|
|
if(fileInfo_.fileType == '3dTiles'){
|