@maqiuyao/dxf-viewer 0.2.22 → 0.2.24
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/README.md +2 -0
- package/dist/dxf-viewer.cjs +46 -46
- package/dist/dxf-viewer.js +2634 -2951
- package/dist/src/dxfViewer/core/compare/CompareDrawable.d.ts +7 -2
- package/dist/src/dxfViewer/core/helpers/TextSearchHelper.d.ts +4 -1
- package/dist/src/dxfViewer/core/viewers/Viewer2d.d.ts +9 -1
- package/package.json +1 -1
|
@@ -6,13 +6,16 @@ import * as THREE from "three";
|
|
|
6
6
|
export declare class CompareDrawable extends Drawable {
|
|
7
7
|
boxes: THREE.Box3[];
|
|
8
8
|
lineSegments: THREE.Vector3[][];
|
|
9
|
+
/** 边框样式:true 云线(修订云线花边),false 普通圆角矩形边框 */
|
|
10
|
+
private useCloudBorder;
|
|
9
11
|
/**
|
|
10
12
|
* @param id
|
|
11
|
-
* @param boxes
|
|
13
|
+
* @param boxes 需要绘制边框的包围盒集合
|
|
12
14
|
* @param lineColor 边框颜色 rgba 数组(0~1),默认红色
|
|
13
15
|
* @param fillColor 区域半透明填充色 rgba 数组(0~1),默认与边框同色、低透明度
|
|
16
|
+
* @param useCloudBorder 边框样式,默认 false 普通圆角矩形边框;传 true 为云线(修订云线)花边
|
|
14
17
|
*/
|
|
15
|
-
constructor(id: string, boxes: THREE.Box3[], lineColor?: number[], fillColor?: number[]);
|
|
18
|
+
constructor(id: string, boxes: THREE.Box3[], lineColor?: number[], fillColor?: number[], useCloudBorder?: boolean);
|
|
16
19
|
/**
|
|
17
20
|
* 按包围盒尺寸比例向外扩张,使云线框与变动内容之间留出间隙,避免框线压住文字/图形。
|
|
18
21
|
* 间隙取盒最长边的 12%(退化盒给最小值兜底)。
|
|
@@ -20,6 +23,8 @@ export declare class CompareDrawable extends Drawable {
|
|
|
20
23
|
private static expandBoxesWithGap;
|
|
21
24
|
private calculateCloudLineSegments;
|
|
22
25
|
draw(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
|
|
26
|
+
/** 普通圆角矩形边框:屏幕空间绘制,圆角半径固定像素(不随缩放变化) */
|
|
27
|
+
private drawRoundedRect;
|
|
23
28
|
private fillRect;
|
|
24
29
|
private drawBox;
|
|
25
30
|
static getControlPointByTwoPoints(p1: THREE.Vector2, p2: THREE.Vector2): THREE.Vector2;
|
|
@@ -68,8 +68,11 @@ export declare class TextSearchHelper {
|
|
|
68
68
|
}): TextSearchResult[];
|
|
69
69
|
/**
|
|
70
70
|
* 定位到一条搜索结果:切换到其所在布局、缩放至包围盒,并在叠加层高亮。
|
|
71
|
+
* @param zoomScale 视野缩放比例:定位后的视野约为文字包围盒对角线的 zoomScale 倍,
|
|
72
|
+
* 数值越大可视区域越大、文字占比越小(不要光看字);默认 8,
|
|
73
|
+
* 传 2 约等于旧版视野(文字占满视野)。
|
|
71
74
|
*/
|
|
72
|
-
focus(result: TextSearchResult): void;
|
|
75
|
+
focus(result: TextSearchResult, zoomScale?: number): void;
|
|
73
76
|
/**
|
|
74
77
|
* 在叠加层用云线框高亮指定结果(替换上一个高亮)。
|
|
75
78
|
*/
|
|
@@ -442,8 +442,16 @@ export declare class Viewer2d extends BaseViewer {
|
|
|
442
442
|
/**
|
|
443
443
|
* @description {en} Zooms to a text search result and highlights it with a cloud border.
|
|
444
444
|
* @description {zh} 定位到一条文本搜索结果并高亮(云线框)。
|
|
445
|
+
* @param zoomScale 视野缩放比例:定位后的视野约为文字包围盒对角线的 zoomScale 倍,
|
|
446
|
+
* 数值越大可视区域越大、文字占比越小;默认 8,传 2 约等于旧版视野。
|
|
447
|
+
* @example
|
|
448
|
+
* ```typescript
|
|
449
|
+
* const results = viewer.searchText("道岔");
|
|
450
|
+
* results.length > 0 && viewer.focusText(results[0]); // 默认视野(可视区域较大)
|
|
451
|
+
* results.length > 0 && viewer.focusText(results[0], 4); // 更贴近文字
|
|
452
|
+
* ```
|
|
445
453
|
*/
|
|
446
|
-
focusText(result: TextSearchResult): void;
|
|
454
|
+
focusText(result: TextSearchResult, zoomScale?: number): void;
|
|
447
455
|
/**
|
|
448
456
|
* @description {en} Clears the highlight of text search results.
|
|
449
457
|
* @description {zh} 清除文本搜索结果的高亮。
|