mxcad 1.0.135 → 1.0.136

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 CHANGED
@@ -2024,21 +2024,21 @@ export declare class McDbArc extends McDbCurve {
2024
2024
  */
2025
2025
  set radius(r: number);
2026
2026
  /**
2027
- * 获取圆半径。
2027
+ * 获取开始角度。
2028
2028
  */
2029
2029
  get startAngle(): number;
2030
2030
  /**
2031
- * 设置圆半径。
2032
- * @param r 圆半径。
2031
+ * 设置开始角度。
2032
+ * @param r 角度。
2033
2033
  */
2034
2034
  set startAngle(r: number);
2035
2035
  /**
2036
- * 获取圆半径。
2036
+ * 获取结束角度。
2037
2037
  */
2038
2038
  get endAngle(): number;
2039
2039
  /**
2040
- * 设置圆半径。
2041
- * @param r 圆半径。
2040
+ * 设置结束角度。
2041
+ * @param r 角度。
2042
2042
  */
2043
2043
  set endAngle(r: number);
2044
2044
  /**
@@ -3706,6 +3706,32 @@ export declare function drawArc(): Promise<void>;
3706
3706
  export declare function drawEllipticalArc(): void;
3707
3707
  export declare function Mx_Erase(): Promise<void>;
3708
3708
  declare const getWasmURL: (wasmURL: string, baseURL?: string | URL) => string;
3709
+ export type EventType = string | symbol;
3710
+ export type PubSubEvent = Record<EventType, (...ages: any) => any>;
3711
+ declare class PubSub<Events extends PubSubEvent = PubSubEvent> {
3712
+ events: {
3713
+ [x: EventType]: Events[keyof Events][];
3714
+ };
3715
+ constructor();
3716
+ /**
3717
+ * 订阅
3718
+ * @param event 事件名称
3719
+ * @param callback 事件回调
3720
+ */
3721
+ on<Key extends keyof Events>(event: Key, callback: Events[keyof Events]): void;
3722
+ /**
3723
+ * 发布
3724
+ * @param event 事件名称
3725
+ * @param data 载荷
3726
+ */
3727
+ emit<Key extends keyof Events>(event: Key | number, ...data: Parameters<Events[Key]>): void;
3728
+ /**
3729
+ * 销毁事件
3730
+ * @param event 事件名称
3731
+ * @param callback 事件方法
3732
+ */
3733
+ off<Key extends keyof Events>(event: Key, callback?: Events[keyof Events]): void;
3734
+ }
3709
3735
  /** wasm importObject 的可配置选项 */
3710
3736
  export interface WasmConfig {
3711
3737
  /** 二进制数据 设置wasmBinary 则 locateFile 不生效**/
@@ -3730,7 +3756,9 @@ export interface MxDraw3dConfig extends WasmConfig {
3730
3756
  /** 指定更新Canvas大小的函数,不指定则默认自动处理(指定该函数则 minHeight, minWidth无效) */
3731
3757
  updateCanvasSize?: () => void;
3732
3758
  }
3733
- export declare class MxDraw3d implements MxDraw3dConfig {
3759
+ export declare class MxDraw3d extends PubSub<{
3760
+ "eventModesSelected": (ids: number[]) => void;
3761
+ }> implements MxDraw3dConfig {
3734
3762
  [x: string]: any;
3735
3763
  /** 监听wasm 文件加载成功事件 */
3736
3764
  static onloadWasmMxDraw3dModel: (mxDraw3d: MxDraw3d) => void;
@@ -3788,6 +3816,8 @@ export interface MxDraw3d extends WasmConfig {
3788
3816
  getViewCursorZ: () => number;
3789
3817
  /** 删除选中实体 */
3790
3818
  removeSelectedObjects: () => void;
3819
+ /** 设置显示/隐藏模型 */
3820
+ setObjectShowState: (theId: number, theToShow: boolean) => void;
3791
3821
  /** 加载贴图图片 */
3792
3822
  loadTextureImg: (fileUrl: string, fileName: string) => void;
3793
3823
  /** 适应选中的对象 */
@@ -3812,6 +3842,8 @@ export interface MxDraw3d extends WasmConfig {
3812
3842
  fitAllObjects(is: boolean): void;
3813
3843
  /** 删除所有对象 */
3814
3844
  removeAllObjects(): void;
3845
+ /** 高亮entry对应模型 */
3846
+ highLightSelShape(theEntry: number): void;
3815
3847
  /** 更新画布大小 */
3816
3848
  updateCanvasSize: () => void;
3817
3849
  /** 通过浏览器器File对象打开3D文件
@@ -6470,7 +6502,14 @@ export declare class MdGeBRep {
6470
6502
  openGltfFromUrl(theModelPath: string): MdGeShape;
6471
6503
  openVrmlFromUrl(theModelPath: string): MdGeShape;
6472
6504
  openStepFromUrlByOCAF(theModelPath: string): string;
6505
+ openIgesFromUrlByOCAF(theModelPath: string): string;
6506
+ openObjFromUrlByOCAF(theModelPath: string): string;
6507
+ openStlFromUrlByOCAF(theModelPath: string): string;
6508
+ openGltfFromUrlByOCAF(theModelPath: string): string;
6509
+ openVrmlFromUrlByOCAF(theModelPath: string): string;
6473
6510
  getLabelAttributes(theEntry: string): string;
6511
+ refreshDocTree(): string;
6512
+ saveStepFile(fileName: string): void;
6474
6513
  RemoveAllLights(): void;
6475
6514
  AddLight(theLight: MdGeLight): void;
6476
6515
  EnableAllLights(): void;