Skip to content

Commit 71191a6

Browse files
committed
【杨琨】【添加注释】
1 parent 483ba60 commit 71191a6

File tree

3 files changed

+63
-24
lines changed

3 files changed

+63
-24
lines changed

src/service/3DPlot/Primitive/BasePlotPrimitive.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class BasePlotPrimitive {
117117

118118
/**
119119
* @description 标绘图元更新方法,有这个方法,则被cesium视为一个primitive
120-
* @function module:3DPlot.BasePlotPrimitive.setAdjustScale
120+
* @function module:3DPlot.BasePlotPrimitive.update
121121
* @public
122122
*
123123
* @param {Boolean} frameState 是否更新
@@ -150,6 +150,10 @@ class BasePlotPrimitive {
150150
this._primitive && this._primitive.update(frameState);
151151
}
152152

153+
/**
154+
* @description 生成cesium的geometry对象方法
155+
* @private
156+
* */
153157
_createGeomInstance() {
154158
return [];
155159
}
@@ -220,7 +224,7 @@ class BasePlotPrimitive {
220224

221225
/**
222226
* @description: 从json导入数据
223-
* @function @function module:3DPlot.BasePlotPrimitive.fromGeoJSON
227+
* @function module:3DPlot.BasePlotPrimitive.fromGeoJSON
224228
* @public
225229
*
226230
* @param {Object} geoJson 要导入的数据
@@ -250,7 +254,7 @@ class BasePlotPrimitive {
250254

251255
/**
252256
* @description: 初始化保存属性(必须和extend扩展数组对应)
253-
* @function @function module:3DPlot.BasePlotPrimitive.initBaseSaveAttributes
257+
* @function module:3DPlot.BasePlotPrimitive.initBaseSaveAttributes
254258
* @public
255259
*/
256260
initBaseSaveAttributes() {
@@ -259,7 +263,7 @@ class BasePlotPrimitive {
259263

260264
/**
261265
* @description: 获取需要保存的字段数组
262-
* @function @function module:3DPlot.BasePlotPrimitive.initBaseSaveAttributes
266+
* @function module:3DPlot.BasePlotPrimitive.initBaseSaveAttributes
263267
* @public
264268
*
265269
* @return {Array} Attributes 字段数组
@@ -270,7 +274,7 @@ class BasePlotPrimitive {
270274

271275
/**
272276
* @description: 获取需要保存的属性组对象
273-
* @function @function module:3DPlot.BasePlotPrimitive.getBaseSaveAttributesValues
277+
* @function module:3DPlot.BasePlotPrimitive.getBaseSaveAttributesValues
274278
* @public
275279
*
276280
* @return {Object} v 属性组对象
@@ -286,7 +290,7 @@ class BasePlotPrimitive {
286290

287291
/**
288292
* @description: 检验是否需要开启透明度渲染
289-
* @function @function module:3DPlot.BasePlotPrimitive.isTranslucentInstance
293+
* @function module:3DPlot.BasePlotPrimitive.isTranslucentInstance
290294
* @public
291295
*
292296
* @param {Array} geomInstance 几何实例数组
@@ -301,7 +305,7 @@ class BasePlotPrimitive {
301305

302306
/**
303307
* @description: 实体转换
304-
* @function @function module:3DPlot.BasePlotPrimitive.instancesToPrimitives
308+
* @function module:3DPlot.BasePlotPrimitive.instancesToPrimitives
305309
* @public
306310
*
307311
* @param {Array} instances 几何实例数组
@@ -325,7 +329,7 @@ class BasePlotPrimitive {
325329

326330
/**
327331
* @description: 墙实体转换
328-
* @function @function module:3DPlot.BasePlotPrimitive.wallInstancesToPrimitive
332+
* @function module:3DPlot.BasePlotPrimitive.wallInstancesToPrimitive
329333
* @public
330334
*
331335
* @param {Array} wallInstances 墙的几何实例数组
@@ -368,7 +372,7 @@ class BasePlotPrimitive {
368372

369373
/**
370374
* @description: 更新实体状态
371-
* @function @function module:3DPlot.BasePlotPrimitive.updatePrimitive
375+
* @function module:3DPlot.BasePlotPrimitive.updatePrimitive
372376
* @public
373377
*
374378
* @param {Boolean} flag 是否更新
@@ -384,7 +388,7 @@ class BasePlotPrimitive {
384388

385389
/**
386390
* @description: 作用选中后透明度效果
387-
* @function @function @function module:3DPlot.BasePlotPrimitive.applySelectStatus
391+
* @function @function module:3DPlot.BasePlotPrimitive.applySelectStatus
388392
* @public
389393
*
390394
* @param {Array} geomInstances 几何实例数组
@@ -401,7 +405,7 @@ class BasePlotPrimitive {
401405

402406
/**
403407
* @description: 获取渐变材料的canvas
404-
* @function @function @function module:3DPlot.BasePlotPrimitive.getColorRamp
408+
* @function @function module:3DPlot.BasePlotPrimitive.getColorRamp
405409
* @public
406410
*
407411
* @param {Array} elevationRamp 渐变范围
@@ -428,7 +432,7 @@ class BasePlotPrimitive {
428432

429433
/**
430434
* @description: 设置标绘图元样式,必须通过此方法设置,修改样式的属性无效
431-
* @function @function @function module:3DPlot.BasePlotPrimitive.setStyle
435+
* @function @function module:3DPlot.BasePlotPrimitive.setStyle
432436
* @public
433437
*
434438
* @param key {String} 样式名
@@ -443,7 +447,7 @@ class BasePlotPrimitive {
443447

444448
/**
445449
* @description: 获取标绘图元样式
446-
* @function @function @function module:3DPlot.BasePlotPrimitive.getStyle
450+
* @function @function module:3DPlot.BasePlotPrimitive.getStyle
447451
* @public
448452
*
449453
* @return {Object} style 图元样式

src/service/3DPlot/Primitive/ElementInstance/IrregularElementInstance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defined } from "../../../../service/PlotUtilBase/Check";
1+
import { defined } from "../../../PlotUtilBase/Check";
22
import RegularLineElementInstance from "./RegularLineElementInstance";
33
import GeomUtil from "../../../../service/PlotUtilBase/Geometry/GeomUtil";
44

src/service/3DPlot/Primitive/IrregularPrimitive/BaseIrregularPrimitive.js

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
1-
/*
2-
* @Author: your name
3-
* @Date: 2021-10-25 10:17:42
4-
* @LastEditTime: 2022-04-01 09:46:07
5-
* @LastEditors: Do not edit
6-
* @Description: In User Settings Edit
7-
* @FilePath: \MapGISPlotBase\src\3DPlot\Primitive\IrregularPrimitive\BaseIrregularPrimitive.js
8-
*/
91
import Point from "../../../../service/PlotUtilBase/Geometry/Point";
102
import {Vector2} from "../../../PlotUtilBase/Math/Vector2";
113
import BasePlotPrimitive from "../BasePlotPrimitive";
124
import IrregularElementInstance from "../ElementInstance/IrregularElementInstance";
135

6+
/**
7+
* @class module:3DPlot.BaseIrregularPrimitive
8+
* @description 非规则标绘图元基类
9+
* @author 基础平台-杨琨
10+
*
11+
* @param {Object} options 初始化参数
12+
*/
1413
class BaseIrregularPrimitive extends BasePlotPrimitive {
1514
constructor(options) {
1615
super(options);
1716
}
1817

18+
/**
19+
* @function module:3DPlot.BaseIrregularPrimitive.update
20+
* @description 重载父类的update方法
21+
* @public
22+
* @override
23+
*
24+
* @param {Boolean} frameState 是否更新
25+
*/
1926
update(frameState) {
2027
if (!this._elem || !this._elem.show) {
2128
return;
@@ -39,8 +46,9 @@ class BaseIrregularPrimitive extends BasePlotPrimitive {
3946

4047
/**
4148
* @description: 处理最后两点绘制不闭合
42-
* @param {*} coords
43-
* @return {*}
49+
* @private
50+
*
51+
* @param {Array} coords 坐标点数组
4452
*/
4553
_closeCoordsPath(coords) {
4654
if (!coords || coords.length < 3) return;
@@ -57,6 +65,13 @@ class BaseIrregularPrimitive extends BasePlotPrimitive {
5765
}
5866
}
5967

68+
/**
69+
* @description 重载父类的_createGeomInstance方法
70+
* @private
71+
* @override
72+
*
73+
* @param {function} callback 回调函数
74+
* */
6075
_createGeomInstance(callback) {
6176
const webMercatorProjection = new Cesium.WebMercatorProjection();
6277
const projectPos = this._positions.map((s) => {
@@ -76,6 +91,12 @@ class BaseIrregularPrimitive extends BasePlotPrimitive {
7691
});
7792
}
7893

94+
/**
95+
* @description 处理非规则几何方法
96+
* @private
97+
*
98+
* @param {function} callback 回调函数
99+
* */
79100
_elementInstance(callback) {
80101
new IrregularElementInstance(this._elem, {
81102
...this.getBaseSaveAttributesValues(),
@@ -85,6 +106,12 @@ class BaseIrregularPrimitive extends BasePlotPrimitive {
85106
});
86107
}
87108

109+
/**
110+
* @description: 重载父类的initBaseSaveAttributes方法
111+
* @function module:3DPlot.BaseIrregularPrimitive.initBaseSaveAttributes
112+
* @public
113+
* @override
114+
*/
88115
initBaseSaveAttributes() {
89116
this.dimModHeight = this._modHeight;
90117
this.isOpenWall = true;
@@ -93,6 +120,14 @@ class BaseIrregularPrimitive extends BasePlotPrimitive {
93120
this.wallGradColor = "rgba(255,0,0,0.3)";
94121
}
95122

123+
/**
124+
* @description: 重载父类的getPrimitiveBaseSaveAttributes方法
125+
* @function module:3DPlot.BaseIrregularPrimitive.initBaseSaveAttributes
126+
* @public
127+
* @override
128+
*
129+
* @return {Array} Attributes 字段数组
130+
*/
96131
getPrimitiveBaseSaveAttributes() {
97132
return BaseIrregularPrimitive.extendPrimitiveAttributes.concat([]);
98133
}

0 commit comments

Comments
 (0)