|
@@ -254,7 +254,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
|
|
|
|
|
|
|
viewer.objs.children.forEach(model=>{
|
|
viewer.objs.children.forEach(model=>{
|
|
- model.result_?.updateVisiByRange()
|
|
|
|
|
|
+ model.result_.updateVisiByRange && model.result_.updateVisiByRange()
|
|
})
|
|
})
|
|
|
|
|
|
}
|
|
}
|
|
@@ -962,7 +962,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
|
|
|
let done = (model_) => {
|
|
let done = (model_) => {
|
|
model = model_
|
|
model = model_
|
|
- model.result_ = result
|
|
|
|
|
|
+ model.result_ = result
|
|
model.props = props
|
|
model.props = props
|
|
result.model = model
|
|
result.model = model
|
|
model.fromType = ModelTypes[props.fromType].name
|
|
model.fromType = ModelTypes[props.fromType].name
|
|
@@ -1450,7 +1450,6 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
model.titleLabel.updateTexture();
|
|
model.titleLabel.updateTexture();
|
|
viewer.dispatchEvent('content_changed')
|
|
viewer.dispatchEvent('content_changed')
|
|
},
|
|
},
|
|
-
|
|
|
|
// 添加模型帧
|
|
// 添加模型帧
|
|
addFrame(frame){
|
|
addFrame(frame){
|
|
console.log('addFrame',frame)
|
|
console.log('addFrame',frame)
|
|
@@ -1480,6 +1479,9 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ getSupportActions(){
|
|
|
|
+ return model.actions.map(e=>e._clip.name)
|
|
|
|
+ },
|
|
addAction(frame){// 添加模型动作
|
|
addAction(frame){// 添加模型动作
|
|
console.log('addAction',frame)
|
|
console.log('addAction',frame)
|
|
let key = Object.assign({},frame)
|
|
let key = Object.assign({},frame)
|
|
@@ -2457,20 +2459,47 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
|
|
|
|
|
|
|
function load4dkkMedias(model){//加载四维看看的一些媒体物品
|
|
function load4dkkMedias(model){//加载四维看看的一些媒体物品
|
|
|
|
+ if(model.isPointcloud)return
|
|
let {sceneJsonPath,surveillancePath} = model.props.raw
|
|
let {sceneJsonPath,surveillancePath} = model.props.raw
|
|
-
|
|
|
|
|
|
+
|
|
if(sceneJsonPath){//box图片视频
|
|
if(sceneJsonPath){//box图片视频
|
|
Potree.loadFile(sceneJsonPath,null,(json)=>{
|
|
Potree.loadFile(sceneJsonPath,null,(json)=>{
|
|
- console.log(model, 'sceneJsonPath', json)
|
|
|
|
- //json.surveillances //监控开关?
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ console.log(model, 'sceneJson', json)
|
|
|
|
+ //json.surveillances //监控开关? 'video'
|
|
|
|
+ if(json.boxPhotos || json.boxVideos){
|
|
|
|
+
|
|
|
|
+ let boxPhotos = json.boxPhotos ? JSON.parse(json.boxPhotos) : []
|
|
|
|
+ let boxVideos = json.boxVideos ? JSON.parse(json.boxVideos) : []
|
|
|
|
+ let medias = boxPhotos.concat(boxVideos)
|
|
|
|
+
|
|
|
|
+ medias.forEach(prop=>{
|
|
|
|
+ //Potree.addModel(prop, prop.done, prop.progressFun, prop.onError)
|
|
|
|
+ prop.type = 'media'
|
|
|
|
+ prop.model = model
|
|
|
|
+ prop.position = Potree.Utils.tran4dkkVecInModel(new THREE.Vector3().fromArray(prop.pos), model) ,
|
|
|
|
+ prop.rotation = new THREE.Euler().setFromQuaternion(new THREE.Quaternion().fromArray(prop.qua)),
|
|
|
|
+ prop.url = 'oss/scene_view_data/'+ model.props.raw.num + '/user/'+prop.url,
|
|
|
|
+ prop.id = prop.sid
|
|
|
|
+ //Potree.settings.urls.getPrefix(8,model)
|
|
|
|
+ //isNew:true, //是否新创建而非加载
|
|
|
|
+ Potree.addModel(prop,(overlay)=>{
|
|
|
|
+ //overlay.scale.set(10,10,10)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
})
|
|
})
|
|
|
|
|
|
}
|
|
}
|
|
if(surveillancePath){//监控
|
|
if(surveillancePath){//监控
|
|
Potree.loadFile(surveillancePath,null,(json)=>{
|
|
Potree.loadFile(surveillancePath,null,(json)=>{
|
|
- console.log(model, 'surveillancePath', json)
|
|
|
|
|
|
+
|
|
|
|
+ console.log(model, 'surveillance', json)
|
|
|
|
+ json.forEach((e)=>{
|
|
|
|
+ viewer.addMonitor(e,model)
|
|
|
|
+ })
|
|
|
|
+
|
|
})
|
|
})
|
|
|
|
|
|
}
|
|
}
|