|
@@ -42337,7 +42337,7 @@
|
|
|
this.addEventListener('marker_dropped', e => {
|
|
|
this.updateDatasetBelong(e.index);
|
|
|
});
|
|
|
- this.setPathWidth(prop.width || 0.6);
|
|
|
+ this.setPathWidth(prop.width || 0.2);
|
|
|
this.setPathColor(prop.color || '#fff');
|
|
|
this.selectStates = {};
|
|
|
this.setEditEnable(true);
|
|
@@ -42465,6 +42465,7 @@
|
|
|
var OA = new Vector3().subVectors(A, O).setZ(0).normalize(); //只保证俯视角度正确。(如果两点有高度差,该段四个点不会在同一平面,看起来有扭转,有的地方会肥大,但从俯视角度看是正确的。)
|
|
|
var OB = new Vector3().subVectors(B, O).setZ(0).normalize();
|
|
|
var angle = math.getAngle(OA, OB, 'z');
|
|
|
+ if (angle == 0) return console.log('updatePath 180度折回了,不绘制'); //添加点的时候偶会这样,拉开就好
|
|
|
var midVecLength = this.halfPathWidth / Math.sin(angle / 2);
|
|
|
sideVec = new Vector3().addVectors(OA, OB).normalize().multiplyScalar(midVecLength); //角平分线 ( 和上一个方向保持在同一侧,故而顺时针和逆时针方向不同 )
|
|
|
}
|
|
@@ -42526,19 +42527,7 @@
|
|
|
if (this.addOrRemovePoint) {
|
|
|
//点击删除点
|
|
|
|
|
|
- viewer.measuringTool.history.beforeChange(this);
|
|
|
- var _index = this.markers.indexOf(marker);
|
|
|
- this.removeMarker(_index);
|
|
|
- this.hideArrowUntilUpdate();
|
|
|
- viewer.measuringTool.history.afterChange(this);
|
|
|
- this.dispatchEvent('changed');
|
|
|
- if (this.points.length == 0) {
|
|
|
- //viewer.measuringTool.changeToAddState(this)
|
|
|
- viewer.measuringTool.startInsertion({
|
|
|
- resume: true,
|
|
|
- measure: this
|
|
|
- });
|
|
|
- }
|
|
|
+ this.removePoint(this.markers.indexOf(marker));
|
|
|
} else {
|
|
|
//点击选中点
|
|
|
this.dispatchEvent({
|
|
@@ -42678,6 +42667,20 @@
|
|
|
}
|
|
|
this.isEditing = state;
|
|
|
}
|
|
|
+ removePoint(index) {
|
|
|
+ viewer.measuringTool.history.beforeChange(this);
|
|
|
+ this.removeMarker(index);
|
|
|
+ this.hideArrowUntilUpdate();
|
|
|
+ viewer.measuringTool.history.afterChange(this);
|
|
|
+ this.dispatchEvent('changed');
|
|
|
+ if (this.points.length == 0) {
|
|
|
+ //viewer.measuringTool.changeToAddState(this)
|
|
|
+ viewer.measuringTool.startInsertion({
|
|
|
+ resume: true,
|
|
|
+ measure: this
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
setMarkerSelected(marker, state) {
|
|
|
state == 'hover' && (marker.markerSelectStates.hover = true);
|
|
|
state == 'unhover' && (marker.markerSelectStates.hover = false);
|
|
@@ -43002,7 +43005,7 @@
|
|
|
}
|
|
|
writeIn(data) {
|
|
|
this.redoList.length = 0; //一旦录入新的操作,就不允许undo了
|
|
|
-
|
|
|
+ console.log('writeIn', data);
|
|
|
this.undoList.push(data);
|
|
|
//console.log('新增undo', data)
|
|
|
}
|
|
@@ -43297,12 +43300,13 @@
|
|
|
if (data.measure.parent && data.measure.visible) {
|
|
|
if (viewer.scene.measurements.indexOf(data.measure) != viewer.scene.measurements.length - 1) {
|
|
|
//非最新加的
|
|
|
- if (data.points.length < data.measure.minMarkers) return; //不允许减少点数至minMarkers以下
|
|
|
+ if ( /* data.points.length < data.measure.minMarkers || */data.isNew) return; //不允许减少点数至minMarkers以下, 也不允许
|
|
|
}
|
|
|
data = Potree.Common.CloneObject(data); //避免使用后更改数据又被使用
|
|
|
data.measure.reDraw();
|
|
|
data.measure.initData(data);
|
|
|
data.measure.isNew = data.isNew;
|
|
|
+ console.log('changeByHistory points', data.points.length);
|
|
|
data.measure.dispatchEvent('changeByHistory');
|
|
|
|
|
|
/* if(data.measure.isPrism){
|
|
@@ -43678,6 +43682,10 @@
|
|
|
measure.removeMarker(measure.points.length - 1);
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ //仅两个点的
|
|
|
+ _this.history.beforeChange(measure);
|
|
|
+ _this.history.afterChange(measure);
|
|
|
}
|
|
|
measure.isNew = false;
|
|
|
var length = measure.points.length;
|
|
@@ -86647,8 +86655,8 @@
|
|
|
}
|
|
|
function loadNeighborFile() {
|
|
|
if (Potree.config.neighbourPath) {
|
|
|
- var path = "".concat(Potree.scriptPath, "/").concat(Potree.config.neighbourPath);
|
|
|
- loadFile(path, null, data => {
|
|
|
+ var _path = "".concat(Potree.scriptPath, "/").concat(Potree.config.neighbourPath);
|
|
|
+ loadFile(_path, null, data => {
|
|
|
Potree.extraNeighbours = data;
|
|
|
var _loop = function _loop(datasetid) {
|
|
|
var pointcloud = viewer.scene.pointclouds.find(e => e.dataset_id == datasetid);
|
|
@@ -86961,17 +86969,14 @@
|
|
|
});
|
|
|
}
|
|
|
async function loadPanos(datasetId, callback, number) {
|
|
|
- var path;
|
|
|
+ number = number || Potree.settings.number;
|
|
|
//let query = `?datasetId=${datasetId}` //`?lat=${center.lat}&lon=${center.lon}&radius=200000`
|
|
|
if (Potree.fileServer) {
|
|
|
- path = "/laser/filter/".concat(Potree.settings.number, "/query");
|
|
|
- } else if (Potree.settings.mergeType2) {
|
|
|
- //每个场景只加载初始数据集
|
|
|
+ path = "/laser/filter/".concat(number, "/query");
|
|
|
+ } /* else if(Potree.settings.mergeType2){ //每个场景只加载初始数据集
|
|
|
+ path = `${Potree.settings.urls.prefix}/laser/filter/${number}/query`
|
|
|
+ } */else {
|
|
|
path = "".concat(Potree.settings.urls.prefix, "/laser/filter/").concat(number, "/query");
|
|
|
- } else {
|
|
|
- //path = `${Potree.settings.urls.prefix2}/indoor/${Potree.settings.number}/api/images/filter` + query
|
|
|
- //path = `${Potree.scriptPath}/data/${Potree.settings.number}/panos-${datasetId}.json`
|
|
|
- path = "".concat(Potree.settings.urls.prefix, "/laser/filter/").concat(Potree.settings.number, "/query");
|
|
|
}
|
|
|
return loadFile(path, {
|
|
|
datasetId: datasetId
|