|
@@ -59,81 +59,7 @@ export const enter = (dom, isLocal) => {
|
|
|
return info
|
|
|
}
|
|
|
|
|
|
- let getMeasureFunction = function (measure, bus) {
|
|
|
- measure.changeCallBack = () => {
|
|
|
- //拖拽结束后发送
|
|
|
- if (measure.parent) {
|
|
|
- //未被删除
|
|
|
- bus.emit('update')
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return {
|
|
|
- quit: () => {
|
|
|
- Potree.Log('quit结束且删除: ' + measure.id, '#00c7b2')
|
|
|
- viewer.dispatchEvent({ type: 'cancel_insertions', remove: true, measure })
|
|
|
- }, //触发结束。退出测量模式,清除之前操作
|
|
|
- clear: () => {
|
|
|
- //删除
|
|
|
- Potree.Log('clear删除: ' + measure.id, '#00c7b2')
|
|
|
-
|
|
|
- viewer.dispatchEvent({ type: 'cancel_insertions', remove: true, measure })
|
|
|
- viewer.scene.removeMeasurement(measure)
|
|
|
- },
|
|
|
-
|
|
|
- getPoints: () => {
|
|
|
- return measure.points
|
|
|
- },
|
|
|
- getDatasetLocations: () => {
|
|
|
- return measure.dataset_points
|
|
|
- },
|
|
|
- getDatasets: () => {
|
|
|
- return measure.points_datasets
|
|
|
- },
|
|
|
- getDatasetId: () => {
|
|
|
- return measure.datasetId
|
|
|
- },
|
|
|
-
|
|
|
- getArea: () => {
|
|
|
- return measure.area //{value:area, string:..}
|
|
|
- },
|
|
|
- getDistance: () => {
|
|
|
- if (measure.points.length < 2) return null
|
|
|
-
|
|
|
- var value = measure.points[0].distanceTo(measure.points[1])
|
|
|
-
|
|
|
- return {
|
|
|
- value, //米
|
|
|
- string: viewer.unitConvert.convert(value, 'distance', void 0, measure.unitSystem, 0.1, true),
|
|
|
- }
|
|
|
- },
|
|
|
- changeUnit: unit => {
|
|
|
- //公制|英制 , 1 | 2 单位
|
|
|
- measure.setUnitSystem(units[unit])
|
|
|
- },
|
|
|
- toDataURL: (width, height) => {
|
|
|
- //截图
|
|
|
- isScreenshoting = true
|
|
|
- var promise = viewer.startScreenshot({ type: 'measure', measurement: measure, hideMarkers: true }, width, height)
|
|
|
- promise.done(() => {
|
|
|
- isScreenshoting = false
|
|
|
- })
|
|
|
- return promise
|
|
|
- },
|
|
|
- //手动开启或关闭:
|
|
|
- show: () => {
|
|
|
- viewer.updateVisible(measure, 'inListByUser', true)
|
|
|
- },
|
|
|
- hide: () => {
|
|
|
- viewer.updateVisible(measure, 'inListByUser', false)
|
|
|
- },
|
|
|
- highlight: isHight => {
|
|
|
- measure.setSelected(isHight, 'byList')
|
|
|
- },
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -767,7 +693,7 @@ export const enter = (dom, isLocal) => {
|
|
|
},
|
|
|
() => {
|
|
|
//cancel
|
|
|
- bus.emit('quit'/* , ret */) //删除
|
|
|
+ bus.emit('cancel'/* , ret */) //删除
|
|
|
}
|
|
|
)
|
|
|
Potree.Log('startMeasure: ' + measure.id, '#00c7b2')
|
|
@@ -826,7 +752,7 @@ export const enter = (dom, isLocal) => {
|
|
|
|
|
|
|
|
|
let result = {
|
|
|
-
|
|
|
+ bus,
|
|
|
destroy(){
|
|
|
//删除
|
|
|
Potree.Log('clear删除: ' + measure.id, '#00c7b2')
|
|
@@ -841,10 +767,14 @@ export const enter = (dom, isLocal) => {
|
|
|
hide(){
|
|
|
viewer.updateVisible(measure, 'inListByUser', false)
|
|
|
},
|
|
|
- // 更新点位事件,选中取消时间
|
|
|
- // update 事件抛出positions positions就是上面的参数 , 选中事件 抛出true||fakse
|
|
|
-
|
|
|
- bus,
|
|
|
+
|
|
|
+ fly(){
|
|
|
+ let result = viewer.focusOnObject(measure.object, 'measure', 1200 )
|
|
|
+
|
|
|
+ return result.msg ? result.msg : result.promise
|
|
|
+ //返回值 1 deferred 表示即将位移 2 'posNoChange' 表示已在最佳位置 3 'tooFar' 表示距离最佳位置太远
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
changeSelect(isHight){
|
|
|
measure.setSelected(isHight, 'byList')
|