@inweb/viewer-core 25.3.13

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.
@@ -0,0 +1,25 @@
1
+ import { Options } from "./Options";
2
+ /**
3
+ * An event that fires when options has been changed.
4
+ *
5
+ * @event
6
+ */
7
+ export interface OptionsChangeEvent {
8
+ /**
9
+ * Event type.
10
+ */
11
+ type: "optionschange";
12
+ /**
13
+ * New parameters.
14
+ */
15
+ data: Options;
16
+ }
17
+ /**
18
+ * Options events.
19
+ */
20
+ export interface OptionsEventMap {
21
+ /**
22
+ * An event that fires when options has been changed.
23
+ */
24
+ optionschange: OptionsChangeEvent;
25
+ }
@@ -0,0 +1 @@
1
+ export declare const CANVAS_EVENTS: string[];
@@ -0,0 +1,26 @@
1
+ import { IEventEmitter } from "@inweb/eventemitter2";
2
+ import { Assembly, Client, File, Model } from "@inweb/client";
3
+ import { ICommandService } from "../commands/ICommands";
4
+ import { Options } from "../options/Options";
5
+ import { IViewpoint } from "./IViewpoint";
6
+ export interface IViewer extends IEventEmitter, ICommandService {
7
+ client: Client | undefined;
8
+ options: Options;
9
+ canvas: HTMLCanvasElement | undefined;
10
+ canvasEvents: string[];
11
+ draggers: string[];
12
+ initialize(canvas: HTMLCanvasElement, onProgress?: (event: ProgressEvent) => void): Promise<this>;
13
+ dispose(): this;
14
+ isInitialized(): boolean;
15
+ update(forder?: boolean): void;
16
+ activeDragger(): any | null;
17
+ setActiveDragger(name: string): any;
18
+ resetActiveDragger(): void;
19
+ is3D(): boolean;
20
+ drawViewpoint(viewpoint: IViewpoint): void;
21
+ createViewpoint(): IViewpoint;
22
+ loadReferences(model: Model | File | Assembly): Promise<this>;
23
+ open(model: Model | File | Assembly): Promise<this>;
24
+ cancel(): this;
25
+ clear(): this;
26
+ }
@@ -0,0 +1,128 @@
1
+ export interface ILocation {
2
+ x: number;
3
+ y: number;
4
+ z: number;
5
+ }
6
+ export interface IDirection {
7
+ x: number;
8
+ y: number;
9
+ z: number;
10
+ }
11
+ export interface IPoint {
12
+ x: number;
13
+ y: number;
14
+ z: number;
15
+ }
16
+ export interface IBitmap {
17
+ guid: string;
18
+ location: ILocation;
19
+ normal: IDirection;
20
+ up: IDirection;
21
+ height: number;
22
+ }
23
+ export interface IOrthogonalCamera {
24
+ view_point: IPoint;
25
+ direction: IDirection;
26
+ up_vector: IDirection;
27
+ field_width: number;
28
+ field_height: number;
29
+ }
30
+ export interface IClippingPlane {
31
+ location: ILocation;
32
+ direction: IDirection;
33
+ }
34
+ export interface IPerspectiveCamera {
35
+ view_point: IPoint;
36
+ direction: IDirection;
37
+ up_vector: IDirection;
38
+ field_of_view: number;
39
+ }
40
+ export type LineType = "solid" | "dot" | "dash";
41
+ export interface ILine {
42
+ points: IPoint[];
43
+ type?: LineType;
44
+ width?: number;
45
+ color?: string;
46
+ id?: string;
47
+ }
48
+ export interface IText {
49
+ position: IPoint;
50
+ text: string;
51
+ angle?: number;
52
+ font_size?: number;
53
+ text_size?: number;
54
+ color?: string;
55
+ id?: string;
56
+ }
57
+ export interface IArrow {
58
+ start: IPoint;
59
+ end: IPoint;
60
+ color?: string;
61
+ id?: string;
62
+ }
63
+ export interface ICloud {
64
+ position: IPoint;
65
+ width?: number;
66
+ height?: number;
67
+ line_width?: number;
68
+ color?: string;
69
+ id?: string;
70
+ }
71
+ export interface IEllipse {
72
+ position: IPoint;
73
+ radius: {
74
+ x: number;
75
+ y: number;
76
+ };
77
+ line_width?: number;
78
+ color?: string;
79
+ id?: string;
80
+ }
81
+ export interface IImage {
82
+ position: IPoint;
83
+ src: string;
84
+ width: number;
85
+ height: number;
86
+ id?: string;
87
+ }
88
+ export interface IRectangle {
89
+ position: IPoint;
90
+ width?: number;
91
+ height?: number;
92
+ line_width?: number;
93
+ color?: string;
94
+ id?: string;
95
+ }
96
+ export interface IColoring {
97
+ handle: string;
98
+ color: string;
99
+ }
100
+ export interface IEntity {
101
+ handle: string;
102
+ }
103
+ export interface ISnapshot {
104
+ data: string;
105
+ }
106
+ export interface IViewpoint {
107
+ bitmaps?: IBitmap[];
108
+ guid?: string;
109
+ file_id?: string;
110
+ assembly_id?: string;
111
+ orthogonal_camera?: IOrthogonalCamera;
112
+ perspective_camera?: IPerspectiveCamera;
113
+ description?: string;
114
+ index?: number;
115
+ lines?: ILine[];
116
+ texts?: IText[];
117
+ clipping_planes?: IClippingPlane[];
118
+ selection?: IEntity[];
119
+ visibility?: IEntity[];
120
+ coloring?: IColoring[];
121
+ arrows?: IArrow[];
122
+ clouds?: ICloud[];
123
+ ellipses?: IEllipse[];
124
+ images?: IImage[];
125
+ rectangles?: IRectangle[];
126
+ custom_fields?: any;
127
+ snapshot?: ISnapshot;
128
+ }