dxfview 0.0.4-beta.21 → 0.0.4-beta.22
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.
|
@@ -1308,7 +1308,7 @@ export declare class DxfViewer extends BaseViewer {
|
|
|
1308
1308
|
* viewer.zoomToBBox(box);
|
|
1309
1309
|
* ```
|
|
1310
1310
|
*/
|
|
1311
|
-
zoomToBBox(bbox: Box2): void;
|
|
1311
|
+
zoomToBBox(bbox: Box2, animate?: boolean): void;
|
|
1312
1312
|
/**
|
|
1313
1313
|
* @description {en} Zooms to view extent.
|
|
1314
1314
|
* @description {zh} 缩放到视图范图
|
|
@@ -2,6 +2,9 @@ import * as THREE from "three";
|
|
|
2
2
|
import { BaseAnnotationDrawable, AnnotationModeType, AnnotationData } from "./BaseAnnotationDrawable";
|
|
3
3
|
import type { BaseViewer } from "../../core/viewers";
|
|
4
4
|
import { Plugin } from "../../core/viewers/Plugin";
|
|
5
|
+
export interface AnnotationPluginOptions {
|
|
6
|
+
segmentLabelScaleWithZoom?: boolean;
|
|
7
|
+
}
|
|
5
8
|
export declare class AnnotationPlugin extends Plugin {
|
|
6
9
|
static DEFAULT_ID: string;
|
|
7
10
|
selectedDrawable: BaseAnnotationDrawable | undefined;
|
|
@@ -21,8 +24,9 @@ export declare class AnnotationPlugin extends Plugin {
|
|
|
21
24
|
private snapObjectsDirty;
|
|
22
25
|
private pendingSnapDrawableIds;
|
|
23
26
|
private snapLineMaterial?;
|
|
27
|
+
private segmentLabelScaleWithZoom;
|
|
24
28
|
private readonly partitionLabels;
|
|
25
|
-
constructor(viewer: BaseViewer);
|
|
29
|
+
constructor(viewer: BaseViewer, options?: AnnotationPluginOptions);
|
|
26
30
|
getDrawableList(): {
|
|
27
31
|
id: string;
|
|
28
32
|
position: THREE.Vector3;
|
|
@@ -90,6 +94,9 @@ export declare class AnnotationPlugin extends Plugin {
|
|
|
90
94
|
private initEvents;
|
|
91
95
|
protected get canvas(): HTMLCanvasElement;
|
|
92
96
|
protected get raycaster(): any;
|
|
97
|
+
setSegmentLabelScaleWithZoom(enabled: boolean): void;
|
|
98
|
+
getSegmentLabelScaleWithZoom(): boolean;
|
|
99
|
+
private applyDrawableRuntimeContext;
|
|
93
100
|
add(drawable: BaseAnnotationDrawable, needFireEvent?: boolean): void;
|
|
94
101
|
create(data: AnnotationData): BaseAnnotationDrawable;
|
|
95
102
|
remove(drawable: BaseAnnotationDrawable, needFireEvent?: boolean): void;
|
|
@@ -65,6 +65,10 @@ export declare abstract class BaseAnnotationDrawable extends Drawable {
|
|
|
65
65
|
protected segmentLabelFontSize: number;
|
|
66
66
|
protected segmentLabelPaddingX: number;
|
|
67
67
|
protected segmentLabelPaddingY: number;
|
|
68
|
+
protected segmentLabelScaleWithZoom: boolean;
|
|
69
|
+
protected segmentLabelReferencePixelSizeInWorldCoord?: number;
|
|
70
|
+
protected segmentLabelAdaptiveBaseScale?: number;
|
|
71
|
+
protected segmentLabelAdaptiveBaseScaleSignature?: string;
|
|
68
72
|
protected annotationType?: AnnotationType;
|
|
69
73
|
protected titleText?: string;
|
|
70
74
|
protected annotationProperty?: AnnotationProperty;
|
|
@@ -74,6 +78,20 @@ export declare abstract class BaseAnnotationDrawable extends Drawable {
|
|
|
74
78
|
* 设置选中态填充颜色
|
|
75
79
|
*/
|
|
76
80
|
setSelectedFillColor(color: number[]): this;
|
|
81
|
+
setViewer(viewer?: BaseViewer): this;
|
|
82
|
+
setSegmentLabelScaleWithZoom(enabled: boolean): this;
|
|
83
|
+
captureSegmentLabelScaleReference(force?: boolean): this;
|
|
84
|
+
protected getSegmentLabelScaleFactor(): number;
|
|
85
|
+
private getSegmentLabelReferencePixelSize;
|
|
86
|
+
private isSegmentLabelRectOverlap;
|
|
87
|
+
private getSortedSegmentLabelEntries;
|
|
88
|
+
private measureSegmentLabelRect;
|
|
89
|
+
private layoutSegmentLabelEntries;
|
|
90
|
+
private estimateSegmentLabelAdaptiveBaseScale;
|
|
91
|
+
private buildSegmentLabelAdaptiveBaseScaleSignature;
|
|
92
|
+
private resolveSegmentLabelAdaptiveBaseScale;
|
|
93
|
+
private collectSegmentLabelEntries;
|
|
94
|
+
private prepareSegmentLabelEntries;
|
|
77
95
|
/**
|
|
78
96
|
* 开始拖拽顶点(仅外环 points)
|
|
79
97
|
*/
|
|
@@ -156,6 +174,10 @@ export declare abstract class BaseAnnotationDrawable extends Drawable {
|
|
|
156
174
|
* 停用射线检测器
|
|
157
175
|
*/
|
|
158
176
|
deactivateRaycaster(): void;
|
|
177
|
+
private static readonly LABEL_WIDTH_RATIO;
|
|
178
|
+
private static readonly MIN_LABEL_SCALE;
|
|
179
|
+
private static readonly SCREEN_HIDE_THRESHOLD;
|
|
180
|
+
private static readonly MIN_SCREEN_SEGMENT;
|
|
159
181
|
protected drawSegmentLengths(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
|
|
160
182
|
private drawSegmentLengthLabel;
|
|
161
183
|
private drawRoundedRect;
|