mxcad 1.0.172 → 1.0.174
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.
- package/dist/mxcad.d.ts +45 -50
- package/dist/mxcad.es.js +1107 -431
- package/dist/mxcad.umd.js +2 -2
- package/dist/wasm/2d/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-st/mxdrawassembly_minst.wasm +0 -0
- package/dist/wasm/3d/mxdraw3d_min.js +36 -27
- package/dist/wasm/3d/mxdraw3d_min.wasm +0 -0
- package/package.json +3 -2
package/dist/mxcad.d.ts
CHANGED
|
@@ -255,7 +255,9 @@ export declare class McGePoint3d {
|
|
|
255
255
|
* @param dZ Z 坐标。
|
|
256
256
|
*/
|
|
257
257
|
constructor(dX?: number | object, dY?: number, dZ?: number);
|
|
258
|
+
/** 得对应的three.js 向量 */
|
|
258
259
|
toVector3(): THREE.Vector3;
|
|
260
|
+
/** 将three.js 的向量设置成点 */
|
|
259
261
|
setFromVector3(val: THREE.Vector3): this;
|
|
260
262
|
/**
|
|
261
263
|
* 复制对象的值
|
|
@@ -312,9 +314,13 @@ export declare class McGePoint3d {
|
|
|
312
314
|
* 表示三维向量的对象。
|
|
313
315
|
*/
|
|
314
316
|
export declare class McGeVector3d {
|
|
317
|
+
/** X轴 */
|
|
315
318
|
static kXAxis: McGeVector3d;
|
|
319
|
+
/** Y轴 */
|
|
316
320
|
static kYAxis: McGeVector3d;
|
|
321
|
+
/** Z轴 */
|
|
317
322
|
static kZAxis: McGeVector3d;
|
|
323
|
+
/** 取反z轴 */
|
|
318
324
|
static kNegateZAxis: McGeVector3d;
|
|
319
325
|
imp: any;
|
|
320
326
|
/**
|
|
@@ -347,7 +353,7 @@ export declare class McGeVector3d {
|
|
|
347
353
|
/** 计算角度 */
|
|
348
354
|
angleTo1(vec: McGeVector3d): number;
|
|
349
355
|
/** 计算角度 */
|
|
350
|
-
angleTo2(vec: McGeVector3d, refVec
|
|
356
|
+
angleTo2(vec: McGeVector3d, refVec?: McGeVector3d): number;
|
|
351
357
|
/** 归一化操作 */
|
|
352
358
|
normalize(): this;
|
|
353
359
|
/** 向量长度 */
|
|
@@ -381,6 +387,7 @@ export declare class McGeVector3d {
|
|
|
381
387
|
set z(val: number);
|
|
382
388
|
}
|
|
383
389
|
export declare class McGeMatrix3d {
|
|
390
|
+
/** 乘法的单位矩阵 */
|
|
384
391
|
static kIdentity: McGeMatrix3d;
|
|
385
392
|
imp: any;
|
|
386
393
|
/**
|
|
@@ -2738,6 +2745,8 @@ export declare class McCmColor {
|
|
|
2738
2745
|
*得到颜色值字符串,十六进制格式,layerId:颜色随层时会取layerId指向的层颜色,blkRefId:颜色随块时,会取blkRefId指向的块颜色.
|
|
2739
2746
|
*/
|
|
2740
2747
|
getColorValue(layerId?: McObjectId, blkRefId?: McObjectId): string;
|
|
2748
|
+
/** 获取 css 颜色的样式 如rgb(0, 0, 0) */
|
|
2749
|
+
getStyle(): string;
|
|
2741
2750
|
}
|
|
2742
2751
|
/**
|
|
2743
2752
|
* 表示一个线形表记录对象。
|
|
@@ -3116,7 +3125,17 @@ export declare class McObject {
|
|
|
3116
3125
|
* 构造函数
|
|
3117
3126
|
* @param imp 对象实现
|
|
3118
3127
|
*/
|
|
3119
|
-
constructor(imp
|
|
3128
|
+
constructor(imp?: any);
|
|
3129
|
+
/**
|
|
3130
|
+
* 初始对象
|
|
3131
|
+
* @param imp 对象实现,默认该函数会被系统自动调用。
|
|
3132
|
+
*/
|
|
3133
|
+
init(imp: any): void;
|
|
3134
|
+
/**
|
|
3135
|
+
* 创建mxcad对象 。
|
|
3136
|
+
* @param imp
|
|
3137
|
+
*/
|
|
3138
|
+
create(config: MxCadConfig): void;
|
|
3120
3139
|
/** 监听对象选择事件
|
|
3121
3140
|
* @example
|
|
3122
3141
|
* ```ts
|
|
@@ -3129,7 +3148,12 @@ export declare class McObject {
|
|
|
3129
3148
|
* ```
|
|
3130
3149
|
* */
|
|
3131
3150
|
on(name: "selectChange", fun: (ids: McObjectId[]) => void | ((ids: McObjectId[]) => void)[]): void;
|
|
3132
|
-
|
|
3151
|
+
on(name: "openFileComplete", fun: () => void): void;
|
|
3152
|
+
on(name: "init", fun: () => void): void;
|
|
3153
|
+
on(name: "init_mxdraw", fun: (mxdraw: MxDrawObject) => void): void;
|
|
3154
|
+
on(name: "init_mxcad", fun: (mxcad: McObject) => void): void;
|
|
3155
|
+
on(name: "databaseModify", fun: () => void): void;
|
|
3156
|
+
callEvent(sEventName: string, param?: any): boolean;
|
|
3133
3157
|
/**
|
|
3134
3158
|
* 初始化对象模型
|
|
3135
3159
|
* @description
|
|
@@ -4124,7 +4148,7 @@ export interface MxCadConfig {
|
|
|
4124
4148
|
networkFonts?: string[];
|
|
4125
4149
|
/** 打开文件参数设置 */
|
|
4126
4150
|
openParameter?: object;
|
|
4127
|
-
|
|
4151
|
+
/**鼠标中间键操作设置,默认为鼠标中间移动视区 */
|
|
4128
4152
|
middlePan?: number | boolean;
|
|
4129
4153
|
/**注册数据 */
|
|
4130
4154
|
registdata?: string;
|
|
@@ -4136,7 +4160,10 @@ export interface MxCadConfig {
|
|
|
4136
4160
|
green: number;
|
|
4137
4161
|
blue: number;
|
|
4138
4162
|
};
|
|
4163
|
+
/**地图模块 */
|
|
4139
4164
|
map?: any;
|
|
4165
|
+
/**多选模式 */
|
|
4166
|
+
multipleSelect?: boolean;
|
|
4140
4167
|
}
|
|
4141
4168
|
/** 创建MxCad实例
|
|
4142
4169
|
* @example
|
|
@@ -4149,7 +4176,7 @@ export interface MxCadConfig {
|
|
|
4149
4176
|
* })
|
|
4150
4177
|
* ```
|
|
4151
4178
|
*/
|
|
4152
|
-
export declare const createMxCad: (config?: MxCadConfig) => Promise<McObject>;
|
|
4179
|
+
export declare const createMxCad: (config?: MxCadConfig, mxcadobj?: McObject) => Promise<McObject>;
|
|
4153
4180
|
/** 排除接口包含某些类型的属性名称 */
|
|
4154
4181
|
export type NonPropertyNames<T, P> = {
|
|
4155
4182
|
[K in keyof T]: T[K] extends P ? never : K;
|
|
@@ -4218,51 +4245,6 @@ export type CreateColorArgs = THREEColorArgs | [
|
|
|
4218
4245
|
export declare const getColorUtils: (...ages: THREEColorArgs) => THREE.Color;
|
|
4219
4246
|
export declare const createMcCmColor: (...ages: CreateColorArgs) => McCmColor;
|
|
4220
4247
|
export declare const setMcCmColor: (mcCmColor: McCmColor, ...ages: CreateColorArgs) => void;
|
|
4221
|
-
/** 根据McCmColor颜色 生成css颜色值 */
|
|
4222
|
-
export declare const getStyle: (mcCmColor: McCmColor | McCmColorJSON) => string;
|
|
4223
|
-
/** 对象继承 */
|
|
4224
|
-
export declare class ObjectInheritance {
|
|
4225
|
-
constructor(obj: any);
|
|
4226
|
-
}
|
|
4227
|
-
export declare const getIndexColors: () => Color[];
|
|
4228
|
-
/***
|
|
4229
|
-
* Color 颜色类
|
|
4230
|
-
* @param ages 与new THREE.Color 的参数一样 也可以是自身
|
|
4231
|
-
* @example
|
|
4232
|
-
* ```js
|
|
4233
|
-
* import { Color, ColorIndexType } from "mxcad"
|
|
4234
|
-
* new Color()
|
|
4235
|
-
* new Color("#fff")
|
|
4236
|
-
* new Color("rgb(255, 255, 255)")
|
|
4237
|
-
* new Color(255, 255, 255)
|
|
4238
|
-
* new Color(0XFFFFFF)
|
|
4239
|
-
* new Color(new Mx.MxFun.getMxFunTHREE().Color())
|
|
4240
|
-
* new Color({
|
|
4241
|
-
* colorIndex: ColorIndexType.kByblock,
|
|
4242
|
-
* })
|
|
4243
|
-
* // 获取css 颜色样式
|
|
4244
|
-
* new Color().getStyle()
|
|
4245
|
-
* ```
|
|
4246
|
-
* */
|
|
4247
|
-
export declare class Color extends ObjectInheritance {
|
|
4248
|
-
/** 全部的颜色索引 */
|
|
4249
|
-
static get indexColors(): Color[];
|
|
4250
|
-
toJSON: () => McCmColorJSON;
|
|
4251
|
-
/** 获取css样式 */
|
|
4252
|
-
getStyle: () => string;
|
|
4253
|
-
/** 设置颜色 */
|
|
4254
|
-
set: (...ages: CreateColorArgs) => this;
|
|
4255
|
-
h: number;
|
|
4256
|
-
s: number;
|
|
4257
|
-
l: number;
|
|
4258
|
-
/** 设置HSL 值 */
|
|
4259
|
-
setHSL: (h: number, s: number, l: number) => this;
|
|
4260
|
-
constructor(...ages: CreateColorArgs | [
|
|
4261
|
-
Color
|
|
4262
|
-
]);
|
|
4263
|
-
}
|
|
4264
|
-
export interface Color extends McCmColor {
|
|
4265
|
-
}
|
|
4266
4248
|
/** 绘制文字
|
|
4267
4249
|
* @param height 文字高度
|
|
4268
4250
|
* @param text 文字内容
|
|
@@ -4435,6 +4417,12 @@ export interface MxDraw3d extends WasmConfig {
|
|
|
4435
4417
|
highLightSelLabelShape(labelEntryStr: string): void;
|
|
4436
4418
|
/** 通过Entry来进行删除对象 */
|
|
4437
4419
|
removeObjectByEntry(theEntry: string): void;
|
|
4420
|
+
/** 激活选择模式 */
|
|
4421
|
+
activateSelectionMode(selectionType: MdGe.MxShapeEnum): void;
|
|
4422
|
+
/** 失活所有选择模式 */
|
|
4423
|
+
deactivateAllSelectionMode(): void;
|
|
4424
|
+
/** 开启关闭操作器 */
|
|
4425
|
+
setManipulatorEnabled(isEnabled: boolean): void;
|
|
4438
4426
|
/** 显示隐藏 */
|
|
4439
4427
|
setObjectShowStateByLabel(labelEntryStr: string, theToShow: boolean): void;
|
|
4440
4428
|
/** 更新画布大小 */
|
|
@@ -7329,6 +7317,7 @@ export declare class MdGeBRep {
|
|
|
7329
7317
|
getLabelAttributes(theEntry: string): string;
|
|
7330
7318
|
refreshDocTree(): string;
|
|
7331
7319
|
saveStepFile(fileName: string): void;
|
|
7320
|
+
ptCanvasToView(x: number, y: number): MdGePoint;
|
|
7332
7321
|
RemoveAllLights(): void;
|
|
7333
7322
|
AddLight(theLight: MdGeLight): void;
|
|
7334
7323
|
EnableAllLights(): void;
|
|
@@ -7351,6 +7340,11 @@ export declare class MdGeBRep {
|
|
|
7351
7340
|
AddClipPlane(pln: MdGePlane): void;
|
|
7352
7341
|
GetSelectedShapes(): MdGeListOfShape;
|
|
7353
7342
|
setObjectColor(theEntry: string, theColor: MdGeColor): void;
|
|
7343
|
+
selPoint(): Promise<MdGePoint>;
|
|
7344
|
+
selFace(): Promise<[
|
|
7345
|
+
face: MdGeFace,
|
|
7346
|
+
pt: MdGePoint
|
|
7347
|
+
]>;
|
|
7354
7348
|
}
|
|
7355
7349
|
/**
|
|
7356
7350
|
* 表示颜色
|
|
@@ -7906,6 +7900,7 @@ export declare class MxMap {
|
|
|
7906
7900
|
private meterInCADUnits;
|
|
7907
7901
|
private modelAltitude;
|
|
7908
7902
|
private loadOldEditionMethod;
|
|
7903
|
+
mxcad: McObject;
|
|
7909
7904
|
constructor();
|
|
7910
7905
|
setLoadOldEditionMethod(): void;
|
|
7911
7906
|
getMapbox(): Map;
|