Skip to content

Commit 9aa1f4f

Browse files
committed
【杨琨】【添加注释】
1 parent 7cb8359 commit 9aa1f4f

File tree

5 files changed

+138
-70
lines changed

5 files changed

+138
-70
lines changed

src/service/3DPlot/Draw/DrawPlotObjectFactory3D.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/*
2-
* @Author: your name
3-
* @Date: 2021-09-17 11:24:51
4-
* @LastEditTime: 2022-05-23 14:22:22
5-
* @LastEditors: zk
6-
* @Description: In User Settings Edit
7-
* @FilePath: \MapGISPlotBase\src\base\Draw\DrawObjectFactory.js
8-
*/
91
import SimpleFactory from "../../../service/PlotUtilBase/SimpleFactory";
102
import DrawPoint from "./DrawPoint";
113
import DrawPolyline from "./DrawPolyline";

src/service/3DPlot/Draw/DrawPoint.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
/*
2-
* @Author: your name
3-
* @Date: 2021-09-17 11:51:33
4-
* @LastEditTime: 2021-12-27 11:54:35
5-
* @LastEditors: Do not edit
6-
* @Description: In User Settings Edit
7-
* @FilePath: \MapGISPlotBase\src\3DPlot\Draw\DrawRegularPoint.js
8-
*/
9-
101
import DrawObject from "../../../service/PlotBase/Draw/DrawObject";
112
import {PrimitiveFactory} from "../Primitive/PrimitiveFactory";
123
import {CesiumUtil} from "../Utils/CesiumUtil";
134

5+
/**
6+
* @class module:3DPlot.DrawPoint
7+
* @description 绘制点工具
8+
* @author 基础平台-杨琨
9+
*
10+
* @param {Object} viewer 三维视图容器对象
11+
* @param {Object} symbol 标绘符号对象
12+
* @param {Object} plotLayer 标绘图层
13+
* @param options - {Object} 额外参数
14+
* @param {Function} [options.addedPlot] 添加标绘图元完成后的回调函数
15+
*/
1416
export default class DrawPoint extends DrawObject {
1517
constructor(viewer, symbol, plotLayer, options) {
1618
super();
@@ -24,6 +26,10 @@ export default class DrawPoint extends DrawObject {
2426
this._addedPlot = addedPlot;
2527
}
2628

29+
/**
30+
* @description 添加点击事件
31+
* @function module:3DPlot.DrawPoint.addHooks
32+
*/
2733
addHooks() {
2834
const viewer = this._viewer;
2935
const symbol = this._symbol;
@@ -69,6 +75,10 @@ export default class DrawPoint extends DrawObject {
6975
this._handler = handler;
7076
}
7177

78+
/**
79+
* @description 移除点击事件
80+
* @function module:3DPlot.DrawPoint.removeHooks
81+
*/
7282
removeHooks() {
7383
const handler = this._handler;
7484
handler.destroy();

src/service/3DPlot/Draw/DrawPolyline.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
/*
2-
* @Author: your name
3-
* @Date: 2021-09-17 11:51:33
4-
* @LastEditTime: 2022-03-30 11:04:29
5-
* @LastEditors: Do not edit
6-
* @Description: In User Settings Edit
7-
* @FilePath: \MapGISPlotBase\src\3DPlot\Draw\DrawRegularPoint.js
8-
*/
9-
101
import DrawObject from "../../../service/PlotBase/Draw/DrawObject";
112
import PrimitiveFactory from "../Primitive/index";
123
import {CesiumUtil} from "../Utils/CesiumUtil";
@@ -31,6 +22,17 @@ function look(viewer, center, offset) {
3122
}, 100);
3223
}
3324

25+
/**
26+
* @class module:3DPlot.DrawPolyline
27+
* @description 绘制线工具
28+
* @author 基础平台-杨琨
29+
*
30+
* @param {Object} viewer 三维视图容器对象
31+
* @param {Object} symbol 标绘符号对象
32+
* @param {Object} plotLayer 标绘图层
33+
* @param options - {Object} 额外参数
34+
* @param {Function} [options.addedPlot] 添加标绘图元完成后的回调函数
35+
*/
3436
export default class DrawPolyline extends DrawObject {
3537
constructor(viewer, symbol, plotLayer, options) {
3638
super();
@@ -48,7 +50,7 @@ export default class DrawPolyline extends DrawObject {
4850

4951
/**
5052
* @description 添加点击事件
51-
* @private
53+
* @function module:3DPlot.DrawPolyline.addHooks
5254
*/
5355
addHooks() {
5456
const viewer = this._viewer;
@@ -124,6 +126,10 @@ export default class DrawPolyline extends DrawObject {
124126
this._handler = handler;
125127
}
126128

129+
/**
130+
* @description 移除点击事件
131+
* @function module:3DPlot.DrawPolyline.removeHooks
132+
*/
127133
removeHooks() {
128134
const handler = this._handler;
129135
this._primitive = null;

src/service/3DPlot/EditTool/EditTool.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ import Point from "../../PlotUtilBase/Geometry/Point"
66
import * as turf from "@turf/turf";
77

88
/**
9-
* @class module:3DPlot.PlotLayer3D
10-
* @description 行业标绘图层
9+
* @class module:3DPlot.EditTool
10+
* @description 三维编辑工具
1111
* @author 基础平台-杨琨
1212
*
13-
* @param {PlotLayer3D} layer
13+
* @param {Object} layer 标绘图层
14+
* @param options - {Object} 额外参数
15+
* @param {Object} [options.positionIcon] 位置控制点的绘制参数,参考cesium的billboard参数
16+
* @param {Object} [options.shapeIcon] 形状控制点的绘制参数,参考cesium的billboard参数
1417
*/
1518
export default class EditTool {
1619
constructor(layer, options) {
@@ -347,6 +350,10 @@ export default class EditTool {
347350
// this._dragging = false;
348351
}
349352

353+
/**
354+
* @description 启用编辑工具
355+
* @function module:3DPlot.EditTool.enable
356+
*/
350357
enable() {
351358
this._plotLayer.on("selected", this.onSelected);
352359
this._billboards = new Cesium.BillboardCollection();
@@ -369,6 +376,10 @@ export default class EditTool {
369376
);
370377
}
371378

379+
/**
380+
* @description 停用编辑工具
381+
* @function module:3DPlot.EditTool.disable
382+
*/
372383
disable() {
373384
this._leftDownHandler = CesiumUtil.destroyEventHandler(
374385
this._leftDownHandler
@@ -402,6 +413,8 @@ export default class EditTool {
402413

403414
/**
404415
* @description 获取几何中心点
416+
* @private
417+
*
405418
* @param positions - {Array} 必选项,点数组
406419
* @return {Object} center 中心点
407420
*/
@@ -416,6 +429,8 @@ export default class EditTool {
416429

417430
/**
418431
* @description 设置位置控制点
432+
* @private
433+
*
419434
* @param position - {Cartesian3} 必选项,控制点坐标
420435
* @param name - {String} 可选项,控制点名称
421436
* @param primitive - {Object} 必选项,标绘图元
@@ -447,6 +462,8 @@ export default class EditTool {
447462

448463
/**
449464
* @description 设置形状控制点
465+
* @private
466+
*
450467
* @param positions - {Array} 必选项,控制点坐标
451468
* @param options - {Object} 可选项,额外参数
452469
* @param {Number} [options.height = 0] 可选项,控制点高度

0 commit comments

Comments
 (0)