mxdraw 0.1.31 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  /** @module McGeTool */
2
+ import THREE from 'three';
2
3
  import McGePoint3d from '../McGePoint3d';
3
4
  import McGePoint3dArray from '../McGePoint3dArray';
4
5
  /**
@@ -1,5 +1,6 @@
1
1
  /** @module McGiWorldDraw*/
2
2
  import McGiWorldDrawType from '../McGiWorldDrawType';
3
+ import MxDbEntity from '../MxDbEntity';
3
4
  import MxDrawObject from '../MxDrawObject';
4
5
  /**
5
6
  * McGiWorldDraw 用于构建一个动态绘制回调对象的规范接口
@@ -220,4 +221,44 @@ export default interface McGiWorldDraw {
220
221
  *
221
222
  */
222
223
  drawSelectLine(pt1: THREE.Vector3 | number, pt2: THREE.Vector3 | number, x2?: number, y2?: number): void;
224
+ /**
225
+ *设置透明度
226
+ * @returns
227
+ * @example
228
+ * ``` typescript
229
+ *
230
+ * ```
231
+ *
232
+ */
233
+ setOpacity(opacity: number): void;
234
+ /**
235
+ *返回透明度
236
+ * @returns
237
+ * @example
238
+ * ``` typescript
239
+ *
240
+ * ```
241
+ *
242
+ */
243
+ getOpacity(): number;
244
+ /**
245
+ *绘制纯色填充
246
+ * @returns
247
+ * @example
248
+ * ``` typescript
249
+ *
250
+ * ```
251
+ *
252
+ */
253
+ drawSolid(points: THREE.Vector3[]): void;
254
+ /**
255
+ *把一个对象的绘图属性设置到当前绘图上下文
256
+ * @returns
257
+ * @example
258
+ * ``` typescript
259
+ *
260
+ * ```
261
+ *
262
+ */
263
+ setupForEntity(ent: MxDbEntity): void;
223
264
  }
@@ -2,12 +2,16 @@
2
2
  import * as THREE from 'three';
3
3
  import McGiWorldDraw from '../McGiWorldDraw';
4
4
  import MxDbEntity from '../MxDbEntity';
5
+ import { MxColorType } from '../MxType/MxType';
5
6
  /**
6
7
  * MxDbArea 任意不规则多边形
7
8
  * */
8
9
  export default class MxDbArea extends MxDbEntity {
9
10
  /** 构成多边形的顶点集合 */
10
11
  points: Array<THREE.Vector3>;
12
+ isFill: boolean;
13
+ fillColor: MxColorType;
14
+ fillOpacity: number;
11
15
  getTypeName(): string;
12
16
  create(): MxDbEntity;
13
17
  /** 在worldDraw动态绘制时会计算当前顶点坐标集合的面积,并显示渲染计算后的计算结果
@@ -44,6 +44,10 @@ export default abstract class MxDbEntity {
44
44
  userData: {
45
45
  [key: string]: any;
46
46
  };
47
+ private dLineWidth;
48
+ private lineWidthByPixels;
49
+ private dDashArray;
50
+ private dDashRatio;
47
51
  /**
48
52
  * 自定义对象的绘制函数。在方法中定义如何绘制图形
49
53
  * @param pWorldDraw 绘制对象{@link McGiWorldDraw }
@@ -209,4 +213,44 @@ export default abstract class MxDbEntity {
209
213
  * @returns number
210
214
  */
211
215
  getRenderOrder(): number;
216
+ /**
217
+ * 设置虚线数据
218
+ * @returns number
219
+ */
220
+ setDash(dDashArray: number, dDashRatio: number): void;
221
+ /**
222
+ * 得到虚线数据
223
+ * @returns number
224
+ */
225
+ getDash(): any;
226
+ /**
227
+ * 设置虚线显示。并初始化一个默认值。
228
+ * @returns number
229
+ */
230
+ setDashLineDisplay(isDashLine: boolean): void;
231
+ /**
232
+ * 是否虚线显示
233
+ * @returns number
234
+ */
235
+ isDashLineDisplay(): boolean;
236
+ /**
237
+ * 设置线宽是否随像素
238
+ * @returns number
239
+ */
240
+ setLineWidthByPixels(isPixels: boolean): void;
241
+ /**
242
+ * 线宽是否随像素
243
+ * @returns number
244
+ */
245
+ getLineWidthByPixels(): boolean;
246
+ /**
247
+ * 设置线宽
248
+ * @returns number
249
+ */
250
+ setLineWidth(dLineWidth: number): void;
251
+ /**
252
+ * 得到线宽
253
+ * @returns number
254
+ */
255
+ getLineWidth(): number;
212
256
  }
@@ -0,0 +1,16 @@
1
+ import * as THREE from 'three';
2
+ import McGiWorldDraw from '../McGiWorldDraw';
3
+ import MxDbEntity from '../MxDbEntity';
4
+ /**
5
+ * MxDbHatch 填充对象
6
+ */
7
+ export default class MxDbHatch extends MxDbEntity {
8
+ points: THREE.Vector3[];
9
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
10
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
11
+ /** 设置顶点坐标 */
12
+ setPoints(points: THREE.Vector3[]): void;
13
+ getGripPoints(): THREE.Vector3[];
14
+ dwgIn(obj: any): boolean;
15
+ dwgOut(obj: any): any;
16
+ }
@@ -0,0 +1,3 @@
1
+ /** @module McEdGetPointWorldDrawObject*/
2
+ import MxDbHatch from './MxDbHatch';
3
+ export default MxDbHatch;
@@ -11,14 +11,22 @@ declare enum MxCloneType {
11
11
  /** 动态拖动Clone */
12
12
  kDragClone = 2
13
13
  }
14
- declare enum MxCloneType2 {
15
- /** 正常Clone */
16
- kClone = 1,
17
- /** 动态拖动Clone */
18
- kDragClone = 2
14
+ /**
15
+ * 控件对象缺省的绘制顺序
16
+ * @example ```typescript
17
+
18
+ * ```
19
+ */
20
+ export declare enum MxDefaultRenderOrder {
21
+ kCADMeshRenderOrder = 10,
22
+ kCADCurveRenderOrder = 20,
23
+ kMxEntityRenderOrder = 30,
24
+ kGripRenderOrder = 110,
25
+ kDynJigRenderOrder = 120
19
26
  }
20
27
  declare const _default: {
21
28
  MxCloneType: typeof MxCloneType;
22
- MxCloneType2: typeof MxCloneType2;
29
+ MxDefaultRenderOrder: typeof MxDefaultRenderOrder;
23
30
  };
24
31
  export default _default;
32
+ export declare type MxColorType = number | string | THREE.Color;
@@ -1,6 +1,6 @@
1
1
  import loadCoreCode from './MxModule/loadCoreCode';
2
2
  import store from './MxModule/store';
3
- import MxFun from './MxModule/MxFun';
3
+ import MxFun from './MxModule/MxFun/MxFun';
4
4
  import MxThreeJS from './MxModule/MxThreeJS';
5
5
  import MrxDbgUiPrPoint from './MxModule/MrxDbgUiPrPoint';
6
6
  import McEdGetPointWorldDrawObject from './MxModule/McEdGetPointWorldDrawObject';
@@ -33,4 +33,5 @@ import MxDbLeadComment from './MxModule/MxDbLeadComment';
33
33
  import MxDbRectBoxLeadComment from './MxModule/MxDbRectBoxLeadComment';
34
34
  import MxDbEllipse from './MxModule/MxDbEllipse';
35
35
  import MxDbText from './MxModule/MxDbText';
36
- export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGePoint3d, McGePoint3dArray, McGeTool, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbPolyline, Mx3PointArc, MxDbCoord, MxDb2LineAngularDimension, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType, MxDbArea, MxDbAnyLine, MxDbCloudLine, MxDbLeadComment, MxDbRectBoxLeadComment, MxDbEllipse, MxDbText, MxDbRegularPolygon };
36
+ import MxDrawObject from './MxModule/MxDrawObject';
37
+ export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGePoint3d, McGePoint3dArray, McGeTool, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbPolyline, Mx3PointArc, MxDbCoord, MxDb2LineAngularDimension, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, MxDrawObject, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType, MxDbArea, MxDbAnyLine, MxDbCloudLine, MxDbLeadComment, MxDbRectBoxLeadComment, MxDbEllipse, MxDbText, MxDbRegularPolygon };
@@ -33,12 +33,14 @@ import MxDbLeadComment from './MxModule/MxDbLeadComment';
33
33
  import MxDbRectBoxLeadComment from './MxModule/MxDbRectBoxLeadComment';
34
34
  import MxDbEllipse from './MxModule/MxDbEllipse';
35
35
  import MxDbText from './MxModule/MxDbText';
36
- export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGePoint3d, McGePoint3dArray, McGeTool, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbPolyline, Mx3PointArc, MxDbCoord, MxDb2LineAngularDimension, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType, MxDbArea, MxDbAnyLine, MxDbCloudLine, MxDbLeadComment, MxDbRectBoxLeadComment, MxDbEllipse, MxDbText, MxDbRegularPolygon };
36
+ import MxDrawObject from './MxModule/MxDrawObject';
37
+ import MxDbHatch from './MxModule/MxDbHatch';
38
+ export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGePoint3d, McGePoint3dArray, McGeTool, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbPolyline, Mx3PointArc, MxDbCoord, MxDbHatch, MxDb2LineAngularDimension, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxDrawObject, MxType, MxDbArea, MxDbAnyLine, MxDbCloudLine, MxDbLeadComment, MxDbRectBoxLeadComment, MxDbEllipse, MxDbText, MxDbRegularPolygon };
37
39
  declare const _default: {
38
40
  MxFun: import("./doc").MxFun;
39
41
  Mxassembly: import("./MxModule/Mxassembly/Mxassembly").default;
40
42
  McGeTool: import("./MxModule/McGeTool/McGeTool").default;
41
- MxThreeJS: import("./doc").MxThreeJS;
43
+ MxThreeJS: import("./MxModule/MxThreeJS/MxThreeJS").default;
42
44
  McEdGetPointWorldDrawObject: typeof McEdGetPointWorldDrawObject;
43
45
  MrxDbgUiPrPoint: typeof MrxDbgUiPrPoint;
44
46
  MxDbEntity: typeof MxDbEntity;
@@ -50,6 +52,7 @@ declare const _default: {
50
52
  MxDbPolyline: typeof MxDbPolyline;
51
53
  Mx3PointArc: typeof Mx3PointArc;
52
54
  MxDbCoord: typeof MxDbCoord;
55
+ MxDbHatch: typeof MxDbHatch;
53
56
  MxDb2LineAngularDimension: typeof MxDb2LineAngularDimension;
54
57
  MxDbRect: typeof MxDbRect;
55
58
  MxDbAlignedDimension: typeof MxDbAlignedDimension;
@@ -66,3 +66,8 @@ export declare function computeRegularPolygonVertices(centerPt?: Vector3, pt?: V
66
66
  * @param segments 边数
67
67
  * */
68
68
  export declare function createThreeRegularPolygon(centerPt: Vector3, pt: Vector3, segments: number, color: number | string | THREE.Color): LineLoop;
69
+ export declare function computeBounding(points: Vector3[]): {
70
+ centerPoint: Vector3;
71
+ minPoint: Vector3;
72
+ maxPoint: Vector3;
73
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mxdraw",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/mxdraw.umd.js",