mxdraw 0.1.337 → 0.1.339

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/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+
2
+
3
+ ### 0.1.338 (2025-09-17)
4
+
5
+
6
+ ### 🐛问题修复
7
+
8
+ * pub init ([c0c121b](https://github.com/mxcad/mxdraw_docs/commit/c0c121bedde48302e54133fd45703fb191866554))
9
+ * test ([f50e185](https://github.com/mxcad/mxdraw_docs/commit/f50e18516ef3c46adb059247b915fc312e6889c8))
10
+
11
+ ### 0.1.339 (2025-09-08)
12
+
13
+
14
+ ### 🐛问题修复
15
+
16
+ * test ([f50e185](https://github.com/mxcad/mxdraw_docs/commit/f50e18516ef3c46adb059247b915fc312e6889c8))
package/LICENSE CHANGED
@@ -1,39 +1,21 @@
1
- Custom License Agreement - mxdraw
2
-
3
- Copyright © 2022 Chengdu Dream Cloud Technology Co., Ltd.
4
-
5
- This license agreement ("Agreement") is made by and between Chengdu Dream Cloud Technology Co., Ltd. ("Licensor") and the user of the software named "mxdraw" ("User"). By using the Software, User agrees to be bound by the terms and conditions set forth in this Agreement.
6
-
7
- 1. **Non-Commercial Use**: The Software is intended for non-commercial use only. Non-commercial use refers to the utilization of the Software without the intent to generate profit, including but not limited to personal learning, research, and testing. You may freely use, study, test, modify, and redistribute the source code of the Software for non-commercial purposes without any restrictions.
8
-
9
- 2. **Redistribution of Source Code**: If you redistribute the source code of the Software, you must include the original copyright notice and this License Agreement. Redistribution should also retain all existing copyright notices, trademark notices, and other legal disclaimers unchanged.
10
-
11
- 3. **Binary Files**: The compiled binary form of the Software, including but not limited to WASM, EXE, and front-end packaged resources, shall not be reverse engineered, decompiled, or disassembled. This restriction applies to all versions of the Software, including any updated or modified versions.
12
-
13
- 4. **Watermark Retention**: All watermarks, logos, and brand elements within the Software must remain intact and unaltered. Violation of this clause will result in immediate termination of this License.
14
-
15
- 5. **Commercial Use**: Unless you have entered into a separate commercial license agreement with Chengdu Dream Cloud Technology Co., Ltd. and obtained written permission, you are prohibited from using the Software for commercial purposes. If you have not signed such an agreement, you do not have the right to use the Software commercially. For inquiries about commercial licenses, please contact the Licensor for more information.
16
-
17
- 6. **Disclaimer of Warranty**: The Software is provided "AS IS" without warranty of any kind, express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the Licensor be liable for any claims, damages, or other liabilities arising out of or in connection with the Software or its use, whether based on contract, tort, or any other theory. This disclaimer does not affect any consumer rights you may have under applicable Chinese law.
18
-
19
- 7. **Commercial Licensing**: Users who have signed a purchase contract with Chengdu Dream Cloud Technology Co., Ltd. are governed by that contract if it conflicts with this License. Users who have not signed such a contract are exclusively governed by this License. Specific terms of commercial licensing, such as licensing fees and validity period, will be detailed in the commercial license agreement.
20
-
21
-
22
- 8. ** Contact information ** : For commercial license inquiries, please contact:
23
- - Chengdu Dream Cade Technology Co., LTD
24
- - Address: 522, 5th Floor, Building 1, No. 1388, Middle Tianfu Avenue, High-tech Zone, Chengdu, China (Sichuan) Pilot Free Trade Zone
25
- - Phone: 18784290597
26
- - Email: 710714273@qq.com
27
- - Customer service link: https://www.mxdraw.com/
28
-
29
- 9. **Governing Law and Dispute Resolution**: This License is governed by the laws of the People's Republic of China. Any disputes arising out of or in connection with this License shall first be resolved through friendly negotiations between the parties; if negotiations fail, either party may submit the dispute to the courts of competent jurisdiction at the location of the Licensor for litigation resolution.
30
-
31
- 10. **Amendment and Termination**:
32
- - The Licensor reserves the right to amend the terms and conditions of this License at any time. Amendments will be notified to users through the official website or other appropriate means.
33
- - The User may terminate this License at any time by ceasing to use the Software. Upon termination, the User must destroy all copies of the Software and any derivative works.
34
-
35
- 11. **Intellectual Property Statement**: The Software and all related intellectual property rights (including but not limited to patents, copyrights, trademarks, and trade secrets) are owned by Chengdu Dream Cloud Technology Co., Ltd. Without the written consent of the Licensor, the User may not infringe or attempt to infringe these rights in any manner.
36
-
37
- By using the Software, you acknowledge that you have read and understood this License Agreement and agree to be bound by its terms and conditions.
38
-
39
- Chengdu Dream Cloud Technology Co., Ltd.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 mxcad
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/LICENSE_CN CHANGED
@@ -21,7 +21,6 @@
21
21
  8. **联系方式**:关于商业许可的查询,请联系:
22
22
  - 成都梦想凯德科技技术有限公司
23
23
  - 地址:中国(四川)自由贸易试验区成都高新区天府大道中段1388号1栋5层522号
24
- - 电话:18784290597
25
24
  - 邮箱:710714273@qq.com
26
25
  - 客服链接:https://www.mxdraw.com/
27
26
 
package/README.md CHANGED
@@ -1,210 +1,10 @@
1
- [English](https://mxcad.github.io/mxdraw_docs/en/) | [中文](https://mxcad.github.io/mxdraw_docs/)
2
1
  <!-- START doctoc generated TOC please keep comment here to allow auto update -->
3
2
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
4
3
  目录
5
4
 
6
- - [快速上手](#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B)
7
- - [简介](#%E7%AE%80%E4%BB%8B)
8
- - [安装](#%E5%AE%89%E8%A3%85)
9
- - [用法](#%E7%94%A8%E6%B3%95)
10
- - [Mx模块集](#mx%E6%A8%A1%E5%9D%97%E9%9B%86)
11
- - [loadCoreCode 动态加载核心(初始化)](#loadcorecode-%E5%8A%A8%E6%80%81%E5%8A%A0%E8%BD%BD%E6%A0%B8%E5%BF%83%E5%88%9D%E5%A7%8B%E5%8C%96)
12
- - [MxFun 方法集合](#mxfun-%E6%96%B9%E6%B3%95%E9%9B%86%E5%90%88)
13
- - [MxDrawObject 控件对象](#mxdrawobject-%E6%8E%A7%E4%BB%B6%E5%AF%B9%E8%B1%A1)
14
- - [McEdGetPointWorldDrawObject / MrxDbgUiPrPoint / MrxDbgUiPrBaseReturn 动态绘制](#mcedgetpointworlddrawobject--mrxdbguiprpoint--mrxdbguiprbasereturn-%E5%8A%A8%E6%80%81%E7%BB%98%E5%88%B6)
15
- - [MxDbEntity / McGiWorldDraw / McGiWorldDrawType 自定义对象](#mxdbentity--mcgiworlddraw--mcgiworlddrawtype-%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AF%B9%E8%B1%A1)
16
- - [按需引入配置](#%E6%8C%89%E9%9C%80%E5%BC%95%E5%85%A5%E9%85%8D%E7%BD%AE)
17
- - [License](#license)
5
+ - [mxdraw_docs](#mxdraw_docs)
18
6
 
19
7
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
20
8
 
21
- ## 快速上手
22
- ### 简介
23
- #### mxdraw 是什么?
24
- > mxdraw 是个在线CAD的JS库,实现在线CAD,DWG图纸浏览和编辑等功能的一套解决方案, 支持大部分现代主流浏览器比如Chrome、Edge等, 不支持IE浏览器。
25
- > DWG文件通过后端程序格式转换后[后端程序详见](https://help.mxdraw.com/?pid=111),就可使用mxdraw在线打开。
26
- #### 使用人群
27
- > 面向前端开发者 熟悉了解`JavaScript` 并且会使用 `three.js`框架。
28
- > 如从未接触过three.js建议先阅读[three.js中文文档](http://www.yanhuangxueyuan.com/threejs/docs/index.html#manual/zh/) 后再进行开发使用。
29
-
30
- ### 安装
31
- #### npm
32
- ``` sh
33
- yarn add mxdraw 或 npm install mxdraw
34
- ```
35
-
36
- ### 用法
37
-
38
- #### 引入
39
-
40
- ``` javascript
41
- import Mx from "mxdraw"
42
- ```
43
-
44
- #### 加载
45
- > html
46
- ``` html
47
- <canvas id="mxcad">
48
- </canvas>
49
- ```
50
- -------------
51
- > js
52
- ``` javascript
53
- import Mx from "mxdraw"
54
- // 动态加载 js库核心代码
55
- Mx.loadCoreCode().then(()=> {
56
- // 创建控件对象
57
- Mx.MxFun.createMxObject({
58
- canvasId:"mxcad", // canvas元素的id
59
- cadFile:"http://localhost:8088/demo/buf/hhhh.dwg.mxb1.wgh", // 后端程序转换dwg文件后的文件位置。
60
- callback: (mxDrawObject, {
61
- canvas,
62
- canvasParent
63
- }) => {
64
- // 可以拿到canvas元素和它的父级元素
65
- //console.log(canvas, canvasParent)
66
- //console.log(mxDrawObject)
67
- // 图纸加载完成
68
- mxDrawObject.addEvent("loadComplete", () => {
69
- console.log("mx loadComplete");
70
- });
71
- }
72
- })
73
- })
74
- ```
75
-
76
-
77
- #### 如何实现一个画线的功能命令?
78
- ##### 1.实现画线功能
79
- 参考内容:
80
- * [MrxDbgUiPrPointClass | getPoint](https://mxcad.github.io/mxdraw_api_docs/classes/MrxDbgUiPrPointClass.html) 构建取点对象
81
- * [status](https://mxcad.github.io/mxdraw_api_docs/enums/MrxDbgUiPrBaseReturn.html) MrxDbgUiPrBaseReturn 表示对应状态
82
- * [McEdGetPointWorldDrawObjectClass | pWorldDraw](https://mxcad.github.io/mxdraw_api_docs/classes/McEdGetPointWorldDrawObjectClass.html) 用于构建一个动态绘制回调对象
83
-
84
- ``` javascript
85
- import Mx from "mxdraw"
86
- // 画线的函数
87
- export async function BR_Line() {
88
-
89
- // 让用在图上点取直线的开始点.
90
- const getPoint = new MrxDbgUiPrPoint();
91
- getPoint.setMessage("\n指定第一点:");
92
- let pt1:THREE.Vector3|null = await getPoint.go();
93
- if(pt1 == null){
94
- return;
95
-
96
- }
97
- getPoint.setBasePt(pt1.clone());
98
- getPoint.setUseBasePt(true);
99
- getPoint.setMessage("\n指定第二点:");
100
-
101
- // 让用在图上点取直线的结束点.
102
- let pt2:THREE.Vector3|null = await getPoint.go();
103
- if(pt2 == null){
104
- return;
105
- }
106
-
107
- // 创建一个直线对象,添加到图上。
108
- let line = new MxDbLine()
109
- line.pt1 = pt1;
110
- line.pt2 = pt2;
111
-
112
- line.setDashLineDisplay(true);
113
- line.setLineWidth(10);
114
- line.setLineWidthByPixels(true);
115
-
116
- MxFun.addToCurrentSpace(line);
117
- }
118
- ```
119
-
120
-
121
-
122
- ##### 2.注册使用命名
123
- 参考内容:
124
- * [MxFun.addCommand](https://mxcad.github.io/mxdraw_api_docs/classes/MxFun.html#addCommand) 注册命名方法
125
- * [MxFun.sendStringToExecute](https://mxcad.github.io/mxdraw_api_docs/classes/MxFun.html#sendStringToExecute) 执行命名方法
126
- * [MxFun.isRunningCommand](https://mxcad.github.io/mxdraw_api_docs/classes/MxFun.html#isRunningCommand) 检查是否有命令在运行
127
-
128
- ``` javascript
129
- import Mx from "mxdraw"
130
- // 注册命名
131
- Mx.MxFun.addCommand("BR_Line", ()=> {
132
- if(Mx.MxFun.isRunningCommand()) {
133
- return
134
- }
135
- BR_Line()
136
- })
137
- // 执行命令
138
- Mx.MxFun.sendStringToExecute("BR_Line")
139
-
140
- ```
141
-
142
-
143
- > 更多Api使用说明请参考[Mx模块集](https://mxcad.github.io/mxdraw_api_docs/modules.html)对应模块中的Api接口说明
144
-
145
- ## Mx模块集
146
- > 暴露出来的函数/类/对象 包括接口/枚举等Ts的类型
147
-
148
- ### loadCoreCode 动态加载核心(初始化)
149
- > CoreCode 这里加载了核心程序(包括three.js)以及jquery.js库 请在需要时自行调用(所有模块都需要等待CoreCode加载完成才能使用) 列如:
150
- ``` javascript
151
- import { loadCoreCode } from "mxdraw"
152
- loadCoreCode().then(()=> {
153
- console.log('CoreCode加载完成')
154
- })
155
- ```
156
- ### MxFun 方法集合
157
- > MxFun提供了核心方法, 其中最重要的两个方法就是[setMxServer](https://mxcad.github.io/mxdraw_api_docs/classes/MxFun.html#setMxServer)设置服务器地址
158
- 以及 [createMxObject](https://mxcad.github.io/mxdraw_api_docs/classes/MxFun.html#createMxObject) 创建控制对象
159
- * 服务器地址就是[MxDraw云图开发包](https://www.mxdraw.com/download.html) 所启动的后台服务地址...[详情](https://help.mxdraw.com/?pid=32&keywords=)
160
-
161
- ### MxDrawObject 控件对象
162
- > [MxFun.createMxObject](https://mxcad.github.io/mxdraw_api_docs/classes/MxFun.html#createMxObject) 创建的控件对象可以对canvas画布上展示的图纸进行控制修改以及添加three.js中各种组合图形等功能[详情](https://mxcad.github.io/mxdraw_api_docs/classes/MxDrawObject.html)
163
-
164
-
165
- ### McEdGetPointWorldDrawObject / MrxDbgUiPrPoint / MrxDbgUiPrBaseReturn 动态绘制
166
- * [McEdGetPointWorldDrawObject](https://mxcad.github.io/mxdraw_api_docs/classes/McEdGetPointWorldDrawObject.html)是动态绘制对象的类, 一个McEdGetPointWorldDrawObject实例可以使用setDraw方法设置动态的回调函数,一般情况下回调函数中会通过drawCustomEntity或者提供的其他方法绘制出需要动态绘制的部分(鼠标移动将会触发动态回调函数)
167
- * [MrxDbgUiPrPoint](https://mxcad.github.io/mxdraw_api_docs/classes/MrxDbgUiPrPoint.html)是一个配合动态绘制的鼠标去点的类,实例化后通过go或者goWhile 方式设置鼠标点击回调事件, 通过setUserDraw方法设置动态绘制对象, 此时动态绘制对象生效,在鼠标移动时会触发其动态回调函数
168
- * [MrxDbgUiPrBaseReturn](https://mxcad.github.io/mxdraw_api_docs/classes/MrxDbgUiPrBaseReturn.html)是MrxDbgUiPrPoint的go或者goWhile的回调参数判断点击类型的一个枚举类型。
169
- * McEdGetPointWorldDrawObject / MrxDbgUiPrPoint 配合使用 就能够完成大部分图形动态绘制的需求,例:[如何实现一个画线的功能命令?](#%E7%94%A8%E6%B3%95)
170
-
171
- ### MxDbEntity / McGiWorldDraw / McGiWorldDrawType 自定义对象
172
- > 自定义对象是为了更加方便的控制一个图形物体对象创建的一个控制器, 在需要对已经绘制在画布上的图形物体进行动态改动操作时,有一系列繁琐的过程,选取对象/选取状态/生成可改动的顶点/拖动改变顶点位置/动态绘制...
173
-
174
- > 如果遵循自定义对象的规范(实现MxDbEntity抽象类),就可以忽略这些步骤,在实现了预设行为(抽象方法)后,鼠标操作就可以完成对物体对象的顶点操作,从而改变图形物体。
175
-
176
-
177
- * [MxDbEntity](https://mxcad.github.io/mxdraw_api_docs/classes/MxDbEntity.html)抽象类 通过继承的方式实现一个自定义对象
178
- * [McGiWorldDraw](https://mxcad.github.io/mxdraw_api_docs/classes/McGiWorldDraw.html) 是 [MxDbEntity.worldDraw](https://mxcad.github.io/mxdraw_api_docs/classes/MxDbEntity.html#worldDraw)抽象方法的回调对象 可以实现再鼠标拖动过程中的一些动态绘制任务
179
- * [McGiWorldDrawType](https://mxcad.github.io/mxdraw_api_docs/classes/McGiWorldDrawType.html) 是[McGiWorldDraw.getType](https://mxcad.github.io/mxdraw_api_docs/classes/McGiWorldDraw.html#getType)方法返回的枚举类型表示MxDbEntity.worldDraw的绘制类型
180
-
181
-
182
- ## 按需引入配置
183
-
184
- 自"0.1.164"起不再需要配置按需引入, "0.1.164"以下可以选择以下配置:
185
-
186
- > 使用`babel` 插件`babel-plugin-import` 实现按需引入
187
- > 需要安装 `npm i babel-plugin-import -D` 然后找到或创建项目根目录的`.babelrc`文件新增如下内容
188
- ```json
189
- {
190
- "plugins": [
191
- [
192
- "import", {
193
- "libraryName": "mxdraw",
194
- "libraryDirectory": "dist/lib/MxModule",
195
- "camel2UnderlineComponentName": false,
196
- "camel2DashComponentName": false
197
- }
198
- ]
199
- ]
200
- }
201
- ```
202
-
203
- > 基于`babel-plugin-import`按需引入
204
- ``` javascript
205
- import { MxFun } from "mxdraw"
206
- ```
207
- > 或者直接通过`import MxFun from "mxdraw/dist/lib/MxModule/MxFun"` 这样的方式直接引入对应模块
208
-
209
- ## License
210
- 版权所有 (c) 2021 成都梦想凯德科技有限公司
9
+ # mxdraw_docs
10
+ Mxdraw is to build CAD web page online drawing JS library, to achieve online CAD drawing preview and editing functions of a set of solutions
package/dist/mxdraw.d.ts CHANGED
@@ -172,7 +172,10 @@ declare enum MxCommandFlag {
172
172
  MCRX_CMD_MODAL = 0,
173
173
  MCRX_CMD_TRANSPARENT = 1,
174
174
  MCRX_CMD_NO_UNDO_MARKER = 2,
175
- MCRX_CMD_NOPRV = 4
175
+ MCRX_CMD_NOPRV = 4,
176
+ MCRX_CMD_NO_RECORD_PRVCMD = 8,
177
+ MCRX_CMD_NO_CLEAR_SELECT = 16,
178
+ MCRX_CMD_NO_CLEAR_SELECT_GRIP_POINT = 32
176
179
  }
177
180
  /**
178
181
  * 控件对象缺省的绘制顺序