Skip to content

Commit 199b7a6

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

File tree

8 files changed

+174
-54
lines changed

8 files changed

+174
-54
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {getCenter, getCenterByCartesian} from "../Utils/PlotUtil"
55
* @description 标绘图元基类
66
* @author 基础平台-杨琨
77
*
8-
* @param options - {Object} 额外参数
8+
* @param options - {Object} 初始化参数
99
* @param {Object} [options.element] SVG符号对象
1010
*/
1111
class BasePlotPrimitive {

src/service/3DPlot/Primitive/RegularPrimitive/BaseRegularPrimitive.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
/**
2-
* 标绘primitive基类
3-
* @property positions 坐标信息
4-
* @property show 是否显示
5-
*/
61
import BasePlotPrimitive from "../BasePlotPrimitive";
72

3+
/**
4+
* @class module:3DPlot.BaseRegularPrimitive
5+
* @description 标绘图元(规则图元)基类
6+
* @author 基础平台-杨琨
7+
*
8+
* @param options - {Object} 初始化参数
9+
*/
810
export default class BaseRegularPrimitive extends BasePlotPrimitive{
911
constructor(options) {
1012
super(options);

src/service/3DPlot/Primitive/RegularPrimitive/KidneyAreaPrimitive.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
/*
2-
* @Author: your name
3-
* @Date: 2021-10-25 10:17:52
4-
* @LastEditTime: 2022-03-31 11:59:14
5-
* @LastEditors: Do not edit
6-
* @Description: In User Settings Edit
7-
* @FilePath: \MapGISPlotBase\src\3DPlot\Primitive\RegularLine1Primitive.js
8-
*/
91
import RegularLine2Primitive from "./RegularLine2Primitive";
102
import KidneyAreaElementInstance from "../ElementInstance/KidneyAreaElementInstance";
113

4+
/**
5+
* @class module:3DPlot.KidneyAreaPrimitive
6+
* @description 标绘图元(规则区二)基类
7+
* @author 基础平台-杨琨
8+
*
9+
* @param options - {Object} 初始化参数
10+
*/
1211
export default class KidneyAreaPrimitive extends RegularLine2Primitive {
1312
constructor(options) {
1413
super(options);
1514
}
1615

16+
/**
17+
* @description 重载了父类的生成Element对象的方法
18+
* @private
19+
*
20+
* @param {function} callback 回调函数
21+
*/
1722
_elementInstance(callback) {
1823
new KidneyAreaElementInstance(this._elem, {
1924
...this.getBaseSaveAttributesValues(),

src/service/3DPlot/Primitive/RegularPrimitive/RegularLine1Primitive.js

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
/*
2-
* @Author: your name
3-
* @Date: 2021-10-25 10:17:52
4-
* @LastEditTime: 2022-05-20 10:38:22
5-
* @LastEditors: zk
6-
* @Description: In User Settings Edit
7-
* @FilePath: \MapGISPlotBase\src\3DPlot\Primitive\RegularLine1Primitive.js
8-
*/
91
import BaseRegularPrimitive from "./BaseRegularPrimitive";
102
import RegularLine1ElementInstance from "../ElementInstance/RegularLine1ElementInstance";
113

4+
/**
5+
* @class module:3DPlot.RegularLine1Primitive
6+
* @description 标绘图元(规则线一)基类
7+
* @author 基础平台-杨琨
8+
*
9+
* @param options - {Object} 初始化参数
10+
*/
1211
class RegularLine1Primitive extends BaseRegularPrimitive {
1312
constructor(options) {
1413
super(options);
1514
}
1615

16+
/**
17+
* @description 重载父类的update方法
18+
* @function module:3DPlot.RegularLine1Primitive.update
19+
* @public
20+
*
21+
* @param {Boolean} frameState 是否更新
22+
* */
1723
update(frameState) {
1824
if (!this._elem || !this._elem.show) {
1925
return;
@@ -35,6 +41,12 @@ class RegularLine1Primitive extends BaseRegularPrimitive {
3541
}
3642
}
3743

44+
/**
45+
* @description 重载父类的_createGeomInstance方法
46+
* @private
47+
*
48+
* @param {function} callback 回调函数
49+
* */
3850
_createGeomInstance(callback) {
3951
const webMercatorProjection = new Cesium.WebMercatorProjection();
4052

@@ -53,6 +65,12 @@ class RegularLine1Primitive extends BaseRegularPrimitive {
5365
});
5466
}
5567

68+
/**
69+
* @description 重载父类的_elementInstance方法
70+
* @private
71+
*
72+
* @param {function} callback 回调函数
73+
* */
5674
_elementInstance(callback) {
5775
new RegularLine1ElementInstance(
5876
this._elem,
@@ -62,6 +80,11 @@ class RegularLine1Primitive extends BaseRegularPrimitive {
6280
});
6381
}
6482

83+
/**
84+
* @description 重载父类的initBaseSaveAttributes方法
85+
* @function module:3DPlot.RegularLine1Primitive.initBaseSaveAttributes
86+
* @public
87+
* */
6588
initBaseSaveAttributes() {
6689
super.initBaseSaveAttributes()
6790
this.dimModAttitude = "1";
@@ -71,6 +94,13 @@ class RegularLine1Primitive extends BaseRegularPrimitive {
7194
this.wallGradColor = 'rgba(255,0,0,0.3)'
7295
}
7396

97+
/**
98+
* @description 重载父类的getPrimitiveBaseSaveAttributes方法
99+
* @function module:3DPlot.RegularLine1Primitive.getPrimitiveBaseSaveAttributes
100+
* @public
101+
*
102+
* @return {Array} Attributes 属性字段数组
103+
* */
74104
getPrimitiveBaseSaveAttributes() {
75105
return RegularLine1Primitive.extendPrimitiveAttributes.concat([]);
76106
}

src/service/3DPlot/Primitive/RegularPrimitive/RegularLine2Primitive.js

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
/*
2-
* @Author: your name
3-
* @Date: 2021-10-25 10:17:52
4-
* @LastEditTime: 2022-04-01 16:40:35
5-
* @LastEditors: Do not edit
6-
* @Description: In User Settings Edit
7-
* @FilePath: \MapGISPlotBase\src\3DPlot\Primitive\RegularLine1Primitive.js
8-
*/
91
import RegularLine1Primitive from "./RegularLine1Primitive";
102
import RegularLine2ElementInstance from "../ElementInstance/RegularLine2ElementInstance";
113

4+
/**
5+
* @class module:3DPlot.RegularLine2Primitive
6+
* @description 标绘图元(规则线二)基类
7+
* @author 基础平台-杨琨
8+
*
9+
* @param options - {Object} 初始化参数
10+
*/
1211
class RegularLine2Primitive extends RegularLine1Primitive {
1312
constructor(options) {
1413
super(options);
1514
}
1615

16+
/**
17+
* @description 重载父类的_elementInstance方法
18+
* @private
19+
*
20+
* @param {function} callback 回调函数
21+
* */
1722
_elementInstance(callback) {
1823
new RegularLine2ElementInstance(this._elem, {
1924
...this.getBaseSaveAttributesValues(),
@@ -23,6 +28,11 @@ class RegularLine2Primitive extends RegularLine1Primitive {
2328
});
2429
}
2530

31+
/**
32+
* @description 重载父类的initBaseSaveAttributes方法
33+
* @function module:3DPlot.RegularLine2Primitive.initBaseSaveAttributes
34+
* @public
35+
* */
2636
initBaseSaveAttributes() {
2737
this.dimModHeight = this._modHeight
2838
this.isOpenWall = true
@@ -31,6 +41,13 @@ class RegularLine2Primitive extends RegularLine1Primitive {
3141
this.wallGradColor = 'rgba(255,0,0,0.3)'
3242
}
3343

44+
/**
45+
* @description 重载父类的getPrimitiveBaseSaveAttributes方法
46+
* @function module:3DPlot.RegularLine2Primitive.getPrimitiveBaseSaveAttributes
47+
* @public
48+
*
49+
* @return {Array} Attributes 属性字段数组
50+
* */
3451
getPrimitiveBaseSaveAttributes() {
3552
const attrs = super.getPrimitiveBaseSaveAttributes();
3653
return attrs.concat(RegularLine2Primitive.extendPrimitiveAttributes);

src/service/3DPlot/Primitive/RegularPrimitive/RegularPointPrimitive.js

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
/*
2-
* @Author: your name
3-
* @Date: 2021-10-20 10:57:25
4-
* @LastEditTime: 2022-05-20 10:38:14
5-
* @LastEditors: zk
6-
* @Description: In User Settings Edit
7-
* @FilePath: \MapGISPlotBase\src\3DPlot\Primitive\RegularPointPrimitive.js
8-
*/
91
import BaseRegularPrimitive from "./BaseRegularPrimitive";
102
import RegularPointElementInstance from "../ElementInstance/RegularPointElementInstance";
113

4+
/**
5+
* @class module:3DPlot.RegularPointPrimitive
6+
* @description 标绘图元(规则点)基类
7+
* @author 基础平台-杨琨
8+
*
9+
* @param options - {Object} 初始化参数
10+
*/
1211
class RegularPointPrimitive extends BaseRegularPrimitive {
1312
constructor(options) {
1413
super(options);
@@ -31,6 +30,12 @@ class RegularPointPrimitive extends BaseRegularPrimitive {
3130
this._isTranslate = false
3231
}
3332

33+
/**
34+
* @description 重写父类的_elemPropsUpdateHandler方法
35+
* @private
36+
*
37+
* @param {Object} event 事件对象
38+
*/
3439
_elemPropsUpdateHandler(event) {
3540
if (event.type === "positions") {
3641
this._positions = [];
@@ -47,6 +52,13 @@ class RegularPointPrimitive extends BaseRegularPrimitive {
4752

4853
}
4954

55+
/**
56+
* @description 重写父类的update方法
57+
* @function module:3DPlot.RegularPointPrimitive.update
58+
* @public
59+
*
60+
* @param {Boolean} frameState 是否更新
61+
*/
5062
update(frameState) {
5163
if (!this._elem || !this._elem.show) {
5264
return;
@@ -88,12 +100,24 @@ class RegularPointPrimitive extends BaseRegularPrimitive {
88100
return false;
89101
}
90102

103+
/**
104+
* @description 重写父类的_createGeomInstance方法
105+
* @private
106+
*
107+
* @param {function} callback 回调函数
108+
*/
91109
_createGeomInstance(callback) {
92110
this._elementInstance(function (instances) {
93111
callback(instances);
94112
});
95113
}
96114

115+
/**
116+
* @description 重写父类的_elementInstancee方法
117+
* @private
118+
*
119+
* @param {function} callback 回调函数
120+
*/
97121
_elementInstance(callback) {
98122
new RegularPointElementInstance(
99123
this._elem,
@@ -103,15 +127,33 @@ class RegularPointPrimitive extends BaseRegularPrimitive {
103127
});
104128
}
105129

130+
/**
131+
* @description 重写父类的initBaseSaveAttributes方法
132+
* @function module:3DPlot.RegularPointPrimitive.initBaseSaveAttributes
133+
* @public
134+
*/
106135
initBaseSaveAttributes() {
107136
this.dimModHeight = 0;
108137
this.dimModAttitude = "1";
109138
}
110139

140+
/**
141+
* @description 重写父类的getPrimitiveBaseSaveAttributes方法
142+
* @function module:3DPlot.RegularPointPrimitive.getPrimitiveBaseSaveAttributes
143+
* @public
144+
*
145+
* @return {Array} Attributes 属性字段数组
146+
*/
111147
getPrimitiveBaseSaveAttributes() {
112148
return RegularPointPrimitive.extendPrimitiveAttributes.concat([]);
113149
}
114150

151+
/**
152+
* @description 重写父类的instancesToPrimitives方法
153+
* @function module:3DPlot.RegularPointPrimitive.instancesToPrimitives
154+
* @public
155+
* @param {Array} instances 几何实例数组
156+
*/
115157
instancesToPrimitives(instances) {
116158
if (instances && instances.length > 0) {
117159
this.destroy()

src/service/3DPlot/Primitive/RegularPrimitive/RegularSurfacePrimitive.js

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
/*
2-
* @Author: your name
3-
* @Date: 2021-10-25 11:03:09
4-
* @LastEditTime: 2022-05-23 15:49:43
5-
* @LastEditors: zk
6-
* @Description: In User Settings Edit
7-
* @FilePath: \MapGISPlotBase\src\3DPlot\Primitive\RegularSurfacePrimitive.js
8-
*/
91
import RegularSurfaceElementInstance from '../ElementInstance/RegularSurfaceElementInstance';
102
import RegularLine1Primitive from './RegularLine1Primitive';
113

4+
/**
5+
* @class module:3DPlot.RegularSurfacePrimitive
6+
* @description 标绘图元(规则区一)基类
7+
* @author 基础平台-杨琨
8+
*
9+
* @param options - {Object} 初始化参数
10+
*/
1211
class RegularSurfacePrimitive extends RegularLine1Primitive {
1312
constructor(options) {
1413
super(options);
@@ -66,6 +65,13 @@ class RegularSurfacePrimitive extends RegularLine1Primitive {
6665
});
6766
}
6867

68+
/**
69+
* @description 重写父类的update方法
70+
* @function module:3DPlot.RegularSurfacePrimitive.update
71+
* @public
72+
*
73+
* @param {Boolean} frameState 是否更新
74+
*/
6975
update(frameState) {
7076
if (!this._elem || !this._elem.show) {
7177
return;
@@ -93,6 +99,13 @@ class RegularSurfacePrimitive extends RegularLine1Primitive {
9399
this._primitive && this._primitive.update(frameState);
94100
}
95101
}
102+
103+
/**
104+
* @description 重写父类的_elementInstance方法
105+
* @private
106+
*
107+
* @param {function} callback 回调函数
108+
*/
96109
_elementInstance(callback) {
97110
new RegularSurfaceElementInstance(this._elem, {
98111
...this.getBaseSaveAttributesValues(),
@@ -102,10 +115,22 @@ class RegularSurfacePrimitive extends RegularLine1Primitive {
102115
});
103116
}
104117

118+
/**
119+
* @description 重写父类的initBaseSaveAttributes方法
120+
* @function module:3DPlot.RegularSurfacePrimitive.initBaseSaveAttributes
121+
* @public
122+
*/
105123
initBaseSaveAttributes() {
106124
this.surfaceBorderWidth = 3;
107125
}
108126

127+
/**
128+
* @description 重写父类的getPrimitiveBaseSaveAttributes方法
129+
* @function module:3DPlot.RegularSurfacePrimitive.getPrimitiveBaseSaveAttributes
130+
* @public
131+
*
132+
* @return {Array} Attributes 属性字段数组
133+
*/
109134
getPrimitiveBaseSaveAttributes() {
110135
return RegularSurfacePrimitive.extendPrimitiveAttributes.concat([]);
111136
}

0 commit comments

Comments
 (0)