|
@@ -59888,29 +59888,37 @@ void main() {
|
|
|
|
|
|
initData(prop){
|
|
|
//开始加数据
|
|
|
+ if(Potree.settings.editType == 'merge'){ //融合页面没有地图,measure的不需要指定datasetId,每个点都有各自的datasetId,跟着各自的模型走
|
|
|
+ prop.points = prop.dataset_points.map((p,i)=>{
|
|
|
+ return Potree.Utils.datasetPosTransform({fromDataset:true, datasetId:prop.points_datasets[i], position: new Vector3().copy(p)})
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if(prop.points){
|
|
|
|
|
|
for(const p of prop.points){
|
|
|
const pos = new Vector3().copy(p);
|
|
|
this.addMarker({point:pos});
|
|
|
}
|
|
|
-
|
|
|
- if(this.datasetId != void 0){//初始化位置
|
|
|
- if(this.dataset_points){
|
|
|
- this.dataset_points = this.dataset_points.map(e=>{
|
|
|
- return e && new Vector3().copy(e)
|
|
|
- });
|
|
|
- this.transformByPointcloud(); //根据dataset_points生成points
|
|
|
- }
|
|
|
- }else {
|
|
|
- if(prop.dataset_points && prop.dataset_points.some(e=>e != void 0)){
|
|
|
- console.error('存在测量线的datasetId为空而dataset_points有值,请检查并删除:'+this.sid);//存在过的bug,原因未知,可能是后台处理dataset时替换的错误:http://192.168.0.21/index.php?m=bug&f=view&bugID=23601
|
|
|
- console.log(this);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
|
|
|
-
|
|
|
+ if(Potree.settings.editType != 'merge'){
|
|
|
+ if(this.datasetId != void 0){//初始化位置
|
|
|
+ if(this.dataset_points){
|
|
|
+ this.dataset_points = this.dataset_points.map(e=>{
|
|
|
+ return e && new Vector3().copy(e)
|
|
|
+ });
|
|
|
+ this.transformByPointcloud(); //根据dataset_points生成points
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if(prop.dataset_points && prop.dataset_points.some(e=>e != void 0)){
|
|
|
+ console.error('存在测量线的datasetId为空而dataset_points有值,请检查并删除:'+this.sid);//存在过的bug,原因未知,可能是后台处理dataset时替换的错误:http://192.168.0.21/index.php?m=bug&f=view&bugID=23601
|
|
|
+ console.log(this);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
this.getFacePlane();
|
|
|
this.getPoint2dInfo(this.points);
|
|
@@ -60288,7 +60296,7 @@ void main() {
|
|
|
|
|
|
e.drag.endDragFun && e.drag.endDragFun(e);// addmarker
|
|
|
|
|
|
- if(this.changeCallBack)this.changeCallBack();
|
|
|
+ //if(this.changeCallBack)this.changeCallBack()
|
|
|
|
|
|
return true
|
|
|
};
|
|
@@ -60643,7 +60651,7 @@ void main() {
|
|
|
|
|
|
|
|
|
this.addEventListener('marker_dropped',(e)=>{
|
|
|
- this.updateDatasetBelong();
|
|
|
+ this.updateDatasetBelong(e.index);
|
|
|
});
|
|
|
|
|
|
|
|
@@ -60663,7 +60671,21 @@ void main() {
|
|
|
}
|
|
|
|
|
|
|
|
|
- updateDatasetBelong(){//更新所属数据集
|
|
|
+ updateDatasetBelong(changeIndex){//更新所属数据集
|
|
|
+
|
|
|
+ if(Potree.settings.editType == "merge"){//无地图
|
|
|
+ /* this.dataset_points = this.points.map((e,i)=>{
|
|
|
+ return Potree.Utils.datasetPosTransform({toDataset:true, datasetId:this.points_datasets[i], position:e.clone()})
|
|
|
+ }) */
|
|
|
+ this.dataset_points[changeIndex] = Potree.Utils.datasetPosTransform({toDataset:true, datasetId:this.points_datasets[changeIndex], position:this.points.clone()});
|
|
|
+
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
let old = this.datasetId;
|
|
|
|
|
|
let maxCount = {id:null,count:0};
|
|
@@ -60689,16 +60711,10 @@ void main() {
|
|
|
if(this.datasetId == void 0){
|
|
|
this.dataset_points = null; //可能为空或[null,null...]
|
|
|
}else {
|
|
|
- if(Potree.settings.editType == 'merge'){//无地图
|
|
|
- this.dataset_points = this.points.map((e,i)=>{
|
|
|
- return Potree.Utils.datasetPosTransform({toDataset:true, datasetId:this.points_datasets[i], position:e.clone()})
|
|
|
- });
|
|
|
- }else {
|
|
|
- this.dataset_points = this.points.map(e=>{
|
|
|
- return Potree.Utils.datasetPosTransform({toDataset:true,datasetId:this.datasetId, position:e.clone()})
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+ this.dataset_points = this.points.map(e=>{
|
|
|
+ return Potree.Utils.datasetPosTransform({toDataset:true,datasetId:this.datasetId, position:e.clone()})
|
|
|
+ });
|
|
|
}
|
|
|
//}
|
|
|
}
|
|
@@ -61011,7 +61027,8 @@ void main() {
|
|
|
this.selected = absoluteState;
|
|
|
viewer.mapViewer && viewer.mapViewer.dispatchEvent('content_changed');
|
|
|
if(hoverObject != 'byList'){
|
|
|
- this.bus && this.bus.emit('highlight', this.selected);//列表高亮
|
|
|
+ //this.bus && this.bus.emit('highlight', this.selected)
|
|
|
+ this.dispatchEvent({type:'highlight',state:this.selected});//列表高亮
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -77878,7 +77895,8 @@ void main() {
|
|
|
|
|
|
|
|
|
|
|
|
- createMeasureFromData(data){//add
|
|
|
+ createMeasureFromData(data){//add
|
|
|
+
|
|
|
const measure = new Measure(data);
|
|
|
|
|
|
viewer.scene.addMeasurement(measure);
|
|
@@ -117728,13 +117746,19 @@ ENDSEC
|
|
|
model.updateMatrixWorld();
|
|
|
if(model.matrixWorld.equals(model.lastMatrixWorld))return
|
|
|
viewer.scene.measurements.forEach(measure=>{
|
|
|
+ let changed;
|
|
|
measure.points_datasets.forEach((dataset_id,i)=>{
|
|
|
if(dataset_id == model.dataset_id){
|
|
|
+ changed = true;
|
|
|
measure.points[i] = Potree.Utils.datasetPosTransform({fromDataset:true,datasetId:dataset_id, position:measure.dataset_points[i].clone()});
|
|
|
measure.updateMarker(measure.markers[i], measure.points[i]);
|
|
|
- measure.update();
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
+ if(changed){
|
|
|
+ measure.getPoint2dInfo(measure.points);
|
|
|
+ measure.update();
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
|