|
|
@@ -29,7 +29,7 @@ import {EDLRenderer} from "../../viewer/EDLRendererNew.js";
|
|
|
import {HQSplatRenderer} from "../../viewer/HQSplatRenderer.js";
|
|
|
import {MapViewer} from "./map/MapViewer.js";
|
|
|
|
|
|
-import {NavigationCube} from '../../viewer/NavigationCube.js'
|
|
|
+//import {NavigationCube} from '../../viewer/NavigationCube.js'
|
|
|
|
|
|
//import {MapView} from "../viewer/map.js";
|
|
|
import {ProfileWindow, ProfileWindowController} from "../../viewer/profile.js";
|
|
|
@@ -618,8 +618,8 @@ export class Viewer extends ViewerBase{
|
|
|
|
|
|
this.clippingTool = new ClippingTool(this);
|
|
|
this.transformationTool = new TransformationTool(this);
|
|
|
- this.navigationCube = new NavigationCube(this);
|
|
|
- this.navigationCube.visible = false;
|
|
|
+ /* this.navigationCube = new NavigationCube(this);
|
|
|
+ this.navigationCube.visible = false; */
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1396,7 +1396,15 @@ export class Viewer extends ViewerBase{
|
|
|
//console.error('updatePanosVisibles', currentFloor)
|
|
|
let SiteModel = this.modules.SiteModel
|
|
|
viewer.images360.panos.forEach(pano=>{
|
|
|
- let visible = inEntity ? inEntity.panos.includes(pano) : this.atDatasets.some(e=>e.panos.includes(pano))
|
|
|
+
|
|
|
+ let visible
|
|
|
+
|
|
|
+ if(Potree.settings.markerMode == 'permanent'){//2026 要求常驻必须至少显示一处漫游点,那就和当前地图显示的fp的一致吧
|
|
|
+ visible = this.fpVisiDatasets.some(e=>e.panos.includes(pano))
|
|
|
+ }else{
|
|
|
+ visible = inEntity ? inEntity.panos.includes(pano) : this.atDatasets.some(e=>e.panos.includes(pano))
|
|
|
+
|
|
|
+ }
|
|
|
/* if(!visible && inEntity && SiteModel.noEditBefore && !SiteModel.entities.some(e=>e.panos.includes(pano))){
|
|
|
//没编辑过的空间模型很有错的可能,如果pano不在任何楼里就显示2025.3 for https://laser.4dkankan.com/?lang=zh&m=SG-y2wVWYmrM7u#/
|
|
|
visible = true
|
|
|
@@ -1415,7 +1423,12 @@ export class Viewer extends ViewerBase{
|
|
|
|
|
|
updateMarkerVisibles(){//限制显示的marker个数,因镜头内marker多的时候可能会卡
|
|
|
if(!Potree.settings.ifShowMarker)return
|
|
|
-
|
|
|
+ if(Potree.settings.markerMode == 'permanent'){//一直显示
|
|
|
+ viewer.images360.panos.forEach(pano=>{
|
|
|
+ Potree.Utils.updateVisible(pano.marker, 'limitMarkerShow', true )
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
const minRadius = 8 * this.images360.zoomLevel, //当视线垂直于marker时的最小可见距离,此范围内可见的pano绝对可见
|
|
|
maxRadius = 50 * this.images360.zoomLevel, //当视线垂直于marker时的最大可见距离,此范围外绝对不可见
|
|
|
@@ -3115,9 +3128,9 @@ export class Viewer extends ViewerBase{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- { // update navigation cube
|
|
|
+ /* { // update navigation cube
|
|
|
this.navigationCube.update(camera.rotation);
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
this.updateAnnotations();
|
|
|
|
|
|
@@ -3899,8 +3912,8 @@ export class Viewer extends ViewerBase{
|
|
|
let finishDeferred = info.finishDeferred || $.Deferred();
|
|
|
|
|
|
let viewerMaster = info.map ? this.mapViewer : this; //截图主体
|
|
|
- let useMap = info.map || info.type == 'measure' || info.type.includes('prism2d')
|
|
|
-
|
|
|
+ let useMap = info.map || info.type == 'measure' || info.type.includes('prism2d');
|
|
|
+ (info.type == 'measure' || info.type.includes('prism2d')) && (info.hideMapCursor = true)
|
|
|
|
|
|
|
|
|
if(Potree.settings.displayMode == 'showPanos' && viewer.mainViewport.view.isFlying('pos')){//如果在飞,飞完再截图
|
|
|
@@ -3945,8 +3958,13 @@ export class Viewer extends ViewerBase{
|
|
|
let render = async ()=>{
|
|
|
|
|
|
this.needRender = true
|
|
|
- viewports.forEach(e=>e.active = true)
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ //viewports.forEach(e=>e.active = true)
|
|
|
+ oldStates.viewports.forEach(old=>{
|
|
|
+ var viewport = viewports.find(v=>v.name == old.name);
|
|
|
+ viewport.active = old.active
|
|
|
+ })
|
|
|
if(info.useRenderTarget){
|
|
|
//离屏渲染 有抗锯齿问题、在手机上速度慢 主视图一样会变内容,还是不用这个了
|
|
|
var { dataUrl } = viewerMaster.makeScreenshot( new THREE.Vector2(width,height), null, compressRatio );
|
|
|
@@ -4013,8 +4031,8 @@ export class Viewer extends ViewerBase{
|
|
|
if(viewport.camera.isOrthographicCamera){
|
|
|
viewport.camera.zoom = viewport.view.zoom
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
+
|
|
|
+ })
|
|
|
viewerMaster.updateScreenSize({forceUpdateSize:true})//更新像素
|
|
|
|
|
|
/* oldStates.viewports.forEach(old=>{//恢复相机
|
|
|
@@ -4133,7 +4151,7 @@ export class Viewer extends ViewerBase{
|
|
|
let mainViewport = info.mainViewport || this.mainViewport
|
|
|
let viewports = [], oldStates = {
|
|
|
viewports:[],
|
|
|
- pano: Potree.settings.displayMode == 'showPanos' ? viewer.images360.currentPano : null,
|
|
|
+ pano: Potree.settings.displayMode == 'showPanos' ? this.images360.currentPano : null,
|
|
|
bgOpacity : this.backgroundOpacity,
|
|
|
background: this.background
|
|
|
}
|
|
|
@@ -4142,7 +4160,7 @@ export class Viewer extends ViewerBase{
|
|
|
mainViewport.camera.isOrthographicCamera && (mainViewport.view.zoom = mainViewport.camera.zoom)
|
|
|
oldStates.viewports.push(mainViewport.clone())
|
|
|
}
|
|
|
- if(useMap){
|
|
|
+ //if(useMap){
|
|
|
mapViewport = this.mapViewer.viewports[0]
|
|
|
mapViewport.view.zoom = mapViewport.camera.zoom
|
|
|
viewports.push(mapViewport)
|
|
|
@@ -4151,11 +4169,18 @@ export class Viewer extends ViewerBase{
|
|
|
oldStates.noPointcloud = mapViewport.noPointcloud
|
|
|
oldStates.displayMode = Potree.settings.displayMode
|
|
|
|
|
|
- Potree.Utils.updateVisible(this.mapViewer.cursor, 'screenshot', false)//令mapCursor不可见
|
|
|
- }
|
|
|
-
|
|
|
+ useMap && info.hideMapCursor && Potree.Utils.updateVisible(this.mapViewer.cursor, 'screenshot', false)//令mapCursor不可见
|
|
|
+ //}
|
|
|
+ this.viewports.forEach(viewport=>{
|
|
|
+ if(!viewports.includes(viewport)){
|
|
|
+ viewports.push(viewport)
|
|
|
+ oldStates.viewports.push(viewport.clone())
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
viewports.forEach(e=>e.active = false) //暂停渲染
|
|
|
|
|
|
+
|
|
|
if(info.hideMarkers){
|
|
|
this.images360.panos.forEach(pano=>{//令漫游点不可见
|
|
|
Potree.Utils.updateVisible(pano, 'screenshot', false)
|
|
|
@@ -4203,7 +4228,7 @@ export class Viewer extends ViewerBase{
|
|
|
oldStates.oldSplitDir = this.mapViewer.splitDir
|
|
|
this.mapViewer.attachToMainViewer(true, 'measure', 0.5 , {dir:'leftRight'} )
|
|
|
}
|
|
|
- viewer.updateScreenSize({forceUpdateSize:true, width, height, forTarget:info.useRenderTarget}) //更新viewports相机透视 使focusOnObject在此窗口大小下
|
|
|
+ viewerMaster.updateScreenSize({forceUpdateSize:true, width, height, forTarget:info.useRenderTarget}) //更新viewports相机透视 使focusOnObject在此窗口大小下
|
|
|
|
|
|
let begin = ()=>{
|
|
|
useMap = this.mapViewer.attachedToViewer
|
|
|
@@ -4242,7 +4267,7 @@ export class Viewer extends ViewerBase{
|
|
|
let floorplanShowed = this.mapViewer.mapLayer.maps.some(e => e.name.includes('floorplan') && e.objectGroup.visible)//如果没有floorplan展示就不分屏(如果focus时飞出数据集从而不展示怎么办。尤其是俯瞰比较长的线时容易这样,或许要根据其所在数据集强制显示)
|
|
|
if(!floorplanShowed && this.mapViewer.attachedToViewer){
|
|
|
this.mapViewer.attachToMainViewer(false) //取消分屏
|
|
|
- viewer.updateScreenSize({forceUpdateSize:true, width, height, forTarget:info.useRenderTarget}) //更新viewports相机透视
|
|
|
+ viewerMaster.updateScreenSize({forceUpdateSize:true, width, height, forTarget:info.useRenderTarget}) //更新viewports相机透视
|
|
|
let {promise} = this.focusOnObject(info.measurement, 'measure', 0, {basePanoSize:1024,gotoBestView:true,} )//因画面比例更改,重新focus
|
|
|
promise.done(()=>{
|
|
|
begin()
|
|
|
@@ -4258,7 +4283,7 @@ export class Viewer extends ViewerBase{
|
|
|
|
|
|
this.mapViewer.attachToMainViewer(true, 'screenshot', 1 , {/* dir:'leftRight' */} )
|
|
|
|
|
|
- viewer.updateScreenSize({forceUpdateSize:true, width, height, forTarget:info.useRenderTarget}) //更新viewports相机透视 使focusOnObject在此窗口大小下
|
|
|
+ viewerMaster.updateScreenSize({forceUpdateSize:true, width, height, forTarget:info.useRenderTarget}) //更新viewports相机透视 使focusOnObject在此窗口大小下
|
|
|
|
|
|
prisms.forEach(prism=>{
|
|
|
|
|
|
@@ -4309,13 +4334,13 @@ export class Viewer extends ViewerBase{
|
|
|
|
|
|
let done = ()=>{
|
|
|
updateCamera()
|
|
|
- if(info.splitRenderInfo){
|
|
|
+ if(info.splitRenderInfo || info.map){
|
|
|
screenshot()
|
|
|
}else{
|
|
|
this.waitPointLoad(screenshot, info.maxTimeForPointLoad, mainViewport)
|
|
|
}
|
|
|
}
|
|
|
- viewer.updateScreenSize({forceUpdateSize:true, width, height, forTarget:info.useRenderTarget}) //更新viewports相机透视 使focusOnObject在此窗口大小下
|
|
|
+ viewerMaster.updateScreenSize({forceUpdateSize:true, width, height, forTarget:info.useRenderTarget}) //更新viewports相机透视 使focusOnObject在此窗口大小下
|
|
|
if(info.focusObjectInfo){
|
|
|
let {promise} = this.focusOnObject( ...info.focusObjectInfo)
|
|
|
promise.done(()=>{
|
|
|
@@ -4428,7 +4453,11 @@ export class Viewer extends ViewerBase{
|
|
|
let camera = o.endCamera || viewport.camera
|
|
|
let cameraPos = camera.position.clone()
|
|
|
let boundSize
|
|
|
-
|
|
|
+ if(object instanceof THREE.Vector3){
|
|
|
+ object = {position: object}, type = 'point'
|
|
|
+ }else if(object instanceof THREE.Box3){
|
|
|
+ object = {boundingBox: object}, type = 'boundingBox'
|
|
|
+ }
|
|
|
|
|
|
if(o.dontChangeCamDir && (o.endYaw == void 0 || o.endPitch == void 0)){ //在俯视时仅靠dir来算不准
|
|
|
o.endYaw = viewport.view.yaw
|