Skip to content

Commit 83d83d6

Browse files
Add libs
Co-authored-by: ZhangQiankun <[email protected]>
1 parent 3a50743 commit 83d83d6

File tree

366 files changed

+25378
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

366 files changed

+25378
-0
lines changed

libs/x-viewer-core/dist/index.esm.js

Lines changed: 11785 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export declare const en: {
2+
ProgressBar: {
3+
Loading: string;
4+
Comparing: string;
5+
};
6+
Tooltip: {
7+
boxSelect: string;
8+
pickMarkup: string;
9+
};
10+
};
11+
export declare const cn: {
12+
ProgressBar: {
13+
Loading: string;
14+
Comparing: string;
15+
};
16+
Tooltip: {
17+
boxSelect: string;
18+
pickMarkup: string;
19+
};
20+
};
21+
export declare const i18n: import("i18next").i18n;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { Viewer2d } from "../../core/viewers";
2+
export declare class DxfLayoutBar {
3+
protected readonly viewer: Viewer2d;
4+
private element?;
5+
private content?;
6+
private itemList;
7+
constructor(viewer: Viewer2d);
8+
init(): void;
9+
private handleMouseWheel;
10+
private createItem;
11+
destroy(): void;
12+
show(): void;
13+
hide(): void;
14+
}
15+
export declare class ModelLayoutSwitchItem {
16+
protected readonly viewer: Viewer2d;
17+
private eventBus;
18+
element: HTMLElement;
19+
resetActivate?: () => void;
20+
active: boolean;
21+
constructor(viewer: Viewer2d, name: string);
22+
private createItem;
23+
setActive(active: boolean): void;
24+
resetActive(): void;
25+
destroy(): void;
26+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./DxfLayoutBar";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export declare const DecimalPrecisionRange: {
2+
[key: string]: number;
3+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./ProjectSettingsDef";
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
interface TooltipConfig {
2+
showOnCreate?: boolean;
3+
followPointer?: boolean;
4+
parentNode?: HTMLElement;
5+
target?: HTMLElement;
6+
}
7+
export declare class Tooltip {
8+
private node;
9+
private parentNode;
10+
private target;
11+
private childNode;
12+
constructor(id: string, content?: string | HTMLElement | null, cfg?: TooltipConfig);
13+
setContent(content: string | HTMLElement): void;
14+
updateChildContent(content: string | HTMLElement): void;
15+
follow: (event: MouseEvent) => void;
16+
show: () => false | void;
17+
hide: () => false | void;
18+
destroy: () => void;
19+
}
20+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./Tooltip";
Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
import * as THREE from "three";
2+
/**
3+
* Camera projection type.
4+
*/
5+
export declare enum CameraProjection {
6+
Perspective = "Perspective",
7+
Orthographic = "Orthographic"
8+
}
9+
/**
10+
* Camera info
11+
*/
12+
export interface CameraInfo {
13+
/**
14+
* Camera projection type
15+
*/
16+
projection: CameraProjection;
17+
/**
18+
* The camera position
19+
*/
20+
position: THREE.Vector3;
21+
/**
22+
* The target that the camera looks to
23+
*/
24+
target: THREE.Vector3;
25+
/**
26+
* @internal
27+
*/
28+
up?: THREE.Vector3;
29+
/**
30+
* The camera zoom
31+
*/
32+
zoom?: number;
33+
/**
34+
* The camera's near clip plane
35+
*/
36+
near?: number;
37+
/**
38+
* The camera's far clip plane
39+
*/
40+
far?: number;
41+
/**
42+
* Used by perspective camera
43+
*/
44+
fov?: number;
45+
/**
46+
* Used by perspective camera
47+
*/
48+
aspect?: number;
49+
/**
50+
* Used by orthographic camera
51+
*/
52+
left?: number;
53+
/**
54+
* Used by orthographic camera
55+
*/
56+
right?: number;
57+
/**
58+
* Used by orthographic camera
59+
*/
60+
bottom?: number;
61+
/**
62+
* Used by orthographic camera
63+
*/
64+
top?: number;
65+
}
66+
/**
67+
* Model config
68+
*/
69+
export interface ModelConfig {
70+
/**
71+
* Unique id of the model
72+
*/
73+
modelId?: string;
74+
/**
75+
* Model name
76+
*/
77+
name?: string;
78+
/**
79+
* Source url of the model
80+
*/
81+
src: string;
82+
/**
83+
* Used to distinguish format, because it may be hard to know the format by src!
84+
* @internal
85+
*/
86+
fileFormat?: string;
87+
/**
88+
* File encoding, can be used by dxf. Common encoding include "UTF-8", "gb2312", etc.
89+
* @internal
90+
*/
91+
encoding?: string;
92+
/**
93+
* A float array of length 16, definds model's position, rotation and scale
94+
*/
95+
matrix?: number[];
96+
/**
97+
* If we want to merge meshes/lines/points with the same material
98+
* @internal
99+
* @default false
100+
*/
101+
merge?: boolean;
102+
/**
103+
* If we want to generate and show edges/outlines to the modle.
104+
* It is useful for Viewer3d.
105+
* @internal
106+
*/
107+
edges?: boolean;
108+
/**
109+
* If this model is visible by default.
110+
* @internal
111+
*/
112+
visible?: boolean;
113+
/**
114+
* This is only useful for obj model, mtl is material file.
115+
* @internal
116+
*/
117+
mtlUrls?: string[];
118+
}
119+
/**
120+
* 2d model config
121+
*/
122+
export interface Model2dConfig extends ModelConfig {
123+
/**
124+
* If to ignore anything of paper space.
125+
* There are some scenarios to ignore paper space by default, includes:
126+
* - Dxf overlay, aka, loading more than one dxf files into a viewer. We'll only load model space for the first file.
127+
* - Dxf compare. Since we'll only compare model space, it won't load paper space at all.
128+
*
129+
* This option is useful when user want to explicitly ignore paper space.
130+
* @default false
131+
*/
132+
ignorePaperSpace?: boolean;
133+
/**
134+
* Applies this color to everything in this model.
135+
* This allows user to show a drawing with a pure color (black, white, etc.).
136+
* Color value is between 0 and 1, e.g., [1, 0, 0] means 'red'.
137+
*/
138+
overrideColor?: number[];
139+
}
140+
/**
141+
* Common viewer config
142+
*/
143+
export interface BaseViewerConfig {
144+
/**
145+
* @description canvas id to contain the viewer.
146+
*/
147+
containerId: string;
148+
/**
149+
* Language of the viewer.
150+
* @description Default is `en`.
151+
*/
152+
language?: "cn" | "en";
153+
/**
154+
* @internal
155+
*/
156+
logLevel?: "debug" | "info" | "warn" | "error" | "silent";
157+
/**
158+
* @internal
159+
*/
160+
enableSpinner?: boolean;
161+
/**
162+
* @internal
163+
*/
164+
enableProgressBar?: boolean;
165+
/**
166+
* @description just for react native
167+
* @internal
168+
*/
169+
context?: WebGLRenderingContext | WebGL2RenderingContext;
170+
/**
171+
* @description just for react native
172+
* @internal
173+
*/
174+
context2d?: CanvasRenderingContext2D;
175+
}
176+
/**
177+
* This wrappers most config for Viewer3d
178+
*/
179+
export interface Viewer3dConfig extends BaseViewerConfig {
180+
/**
181+
* Default is `meters`
182+
* @internal
183+
*/
184+
units?: string;
185+
}
186+
/**
187+
* This wrappers most config for Viewer2d
188+
*/
189+
export interface Viewer2dConfig extends BaseViewerConfig {
190+
/**
191+
* Enables layout bar so we can switch to other layouts.
192+
* The default layout bar is an example UI of the viewer, since plenty of APIs are exposed,
193+
* you are recommended to create your own layout bar with customized style, location, etc.
194+
*/
195+
enableLayoutBar?: boolean;
196+
/**
197+
* If to cache model into indexeddb (or maybe local storage in future).
198+
* If enabled, it will get model data from cache the next time model is loaded.
199+
* @internal
200+
* @default true
201+
*/
202+
enableLocalCache?: boolean;
203+
}
204+
/**
205+
* Dxf compare config.
206+
*/
207+
export interface DxfCompareConfig {
208+
/**
209+
* Enables to compare properties (color, linetype, line width, etc.)
210+
*/
211+
enableDetailComparision: boolean;
212+
}
213+
/**
214+
* A default Viewer3dConfig as a template, which enables most plugins.
215+
* @internal
216+
*/
217+
export declare const DefaultViewer3dConfig: Viewer3dConfig;
218+
/**
219+
* @internal
220+
*/
221+
export interface IsolateObjectsParam {
222+
id: string;
223+
modelId: string;
224+
}
225+
/**
226+
* @internal
227+
*/
228+
export interface IsolateObjectsParams {
229+
familyInstanceIds: IsolateObjectsParam[];
230+
}
231+
/**
232+
* @internal
233+
*/
234+
export interface ScreenshotConfig {
235+
type: string;
236+
quality: number;
237+
includeOverlay: boolean;
238+
}
239+
/**
240+
* Viewpoint definition.
241+
*/
242+
export interface Viewpoint {
243+
/**
244+
* The camera location
245+
*/
246+
eye: THREE.Vector3;
247+
/**
248+
* The location that the camera looks to
249+
*/
250+
look: THREE.Vector3;
251+
/**
252+
* @internal
253+
*/
254+
up?: THREE.Vector3;
255+
/**
256+
* The camera zoom, used by Orthographic camera.
257+
*/
258+
zoom?: number;
259+
}
260+
/**
261+
* View direction.
262+
*/
263+
export declare enum ViewDirection {
264+
Top = "Top",
265+
Bottom = "Bottom",
266+
Front = "Front",
267+
Back = "Back",
268+
Left = "Left",
269+
Right = "Right"
270+
}
271+
/**
272+
* Icon class.
273+
* Used by toolbar and bottom bar icons, etc.
274+
*/
275+
export interface IconClass {
276+
/**
277+
* The default icon.
278+
*/
279+
default: string;
280+
/**
281+
* The icon when item is actived.
282+
*/
283+
active?: string;
284+
/**
285+
* The icon font class name.
286+
*/
287+
iconFont?: string;
288+
}

0 commit comments

Comments
 (0)