@inweb/client 25.3.2 → 25.3.4
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/dist/client.js +14 -16
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +17 -20
- package/dist/client.module.js.map +1 -1
- package/lib/Viewer/IViewer.d.ts +3 -2
- package/lib/Viewer/Markup/Api/IMarkupLine.d.ts +0 -6
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaLine.d.ts +2 -1
- package/lib/Viewer/Markup/IMarkup.d.ts +3 -2
- package/lib/Viewer/Markup/IViewpoint.d.ts +130 -0
- package/lib/Viewer/Markup/Impl/Konva/KonvaMarkup.d.ts +3 -3
- package/lib/Viewer/Markup/Impl/Visualize/VisualizeMarkup.d.ts +3 -3
- package/lib/Viewer/Viewer.d.ts +3 -2
- package/package.json +1 -1
- package/src/Viewer/IViewer.ts +3 -2
- package/src/Viewer/Markup/Api/IMarkupLine.ts +0 -7
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaLine.ts +2 -1
- package/src/Viewer/Markup/IMarkup.ts +3 -2
- package/src/Viewer/Markup/IViewpoint.ts +146 -0
- package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +6 -6
- package/src/Viewer/Markup/Impl/Visualize/VisualizeMarkup.ts +4 -7
- package/src/Viewer/Viewer.ts +18 -16
package/lib/Viewer/IViewer.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Client } from "../Api/Client";
|
|
|
5
5
|
import { File } from "../Api/File";
|
|
6
6
|
import { Assembly } from "../Api/Assembly";
|
|
7
7
|
import { Model } from "../Api/Model";
|
|
8
|
+
import { IViewpoint } from "./Markup/IViewpoint";
|
|
8
9
|
export interface IViewer extends IEventEmitter, ICommandService {
|
|
9
10
|
client: Client | undefined;
|
|
10
11
|
options: Options;
|
|
@@ -19,8 +20,8 @@ export interface IViewer extends IEventEmitter, ICommandService {
|
|
|
19
20
|
setActiveDragger(name: string): any;
|
|
20
21
|
resetActiveDragger(): void;
|
|
21
22
|
is3D(): boolean;
|
|
22
|
-
drawViewpoint(viewpoint:
|
|
23
|
-
createViewpoint():
|
|
23
|
+
drawViewpoint(viewpoint: IViewpoint): void;
|
|
24
|
+
createViewpoint(): IViewpoint;
|
|
24
25
|
loadReferences(model: Model | File | Assembly): Promise<this>;
|
|
25
26
|
open(model: Model | File | Assembly): Promise<this>;
|
|
26
27
|
cancel(): this;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IMarkupLine
|
|
1
|
+
import { IMarkupLine } from "../../IMarkupLine";
|
|
2
2
|
import { IMarkupColorable } from "../../IMarkupColorable";
|
|
3
|
+
import { LineType } from "../../../IViewpoint";
|
|
3
4
|
export declare class KonvaLine implements IMarkupLine, IMarkupColorable {
|
|
4
5
|
private _ref;
|
|
5
6
|
constructor(params: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OdBaseDragger } from "../Draggers/Common/OdBaseDragger";
|
|
2
2
|
import { Viewer } from "../Viewer";
|
|
3
3
|
import { IMarkupObject } from "./Api/IMarkupObject";
|
|
4
|
+
import { IViewpoint } from "./IViewpoint";
|
|
4
5
|
export declare enum MarkupType {
|
|
5
6
|
Unknown = 0,
|
|
6
7
|
Konva = "Konva",
|
|
@@ -28,8 +29,8 @@ export interface IMarkup {
|
|
|
28
29
|
b: number;
|
|
29
30
|
};
|
|
30
31
|
colorizeAllMarkup(r: number, g: number, b: number): void;
|
|
31
|
-
setViewpoint(viewpoint:
|
|
32
|
-
getViewpoint():
|
|
32
|
+
setViewpoint(viewpoint: IViewpoint): void;
|
|
33
|
+
getViewpoint(): IViewpoint;
|
|
33
34
|
createObject(type: string, params: any): IMarkupObject;
|
|
34
35
|
getObjects(): IMarkupObject[];
|
|
35
36
|
getSelectedObjects(): IMarkupObject[];
|
|
@@ -0,0 +1,130 @@
|
|
|
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 declare enum LineType {
|
|
41
|
+
Unknown = 0,
|
|
42
|
+
Solid = "solid",
|
|
43
|
+
Dot = "dot",
|
|
44
|
+
Dash = "dash"
|
|
45
|
+
}
|
|
46
|
+
export interface ILine {
|
|
47
|
+
points: IPoint[];
|
|
48
|
+
color: string;
|
|
49
|
+
type: LineType;
|
|
50
|
+
width: number;
|
|
51
|
+
id: string;
|
|
52
|
+
}
|
|
53
|
+
export interface IText {
|
|
54
|
+
position: IPoint;
|
|
55
|
+
text: string;
|
|
56
|
+
angle: number;
|
|
57
|
+
text_size: number;
|
|
58
|
+
color: string;
|
|
59
|
+
id: string;
|
|
60
|
+
font_size: number;
|
|
61
|
+
}
|
|
62
|
+
export interface IArrow {
|
|
63
|
+
id: string;
|
|
64
|
+
start: IPoint;
|
|
65
|
+
end: IPoint;
|
|
66
|
+
color: string;
|
|
67
|
+
}
|
|
68
|
+
export interface ICloud {
|
|
69
|
+
id: string;
|
|
70
|
+
position: IPoint;
|
|
71
|
+
width: number;
|
|
72
|
+
height: number;
|
|
73
|
+
line_width: number;
|
|
74
|
+
color: string;
|
|
75
|
+
}
|
|
76
|
+
export interface IEllipse {
|
|
77
|
+
id: string;
|
|
78
|
+
position: IPoint;
|
|
79
|
+
radius: {
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
};
|
|
83
|
+
line_width: number;
|
|
84
|
+
color: string;
|
|
85
|
+
}
|
|
86
|
+
export interface IImage {
|
|
87
|
+
id: string;
|
|
88
|
+
position: IPoint;
|
|
89
|
+
src: string;
|
|
90
|
+
width: number;
|
|
91
|
+
height: number;
|
|
92
|
+
}
|
|
93
|
+
export interface IRectangle {
|
|
94
|
+
id: string;
|
|
95
|
+
position: IPoint;
|
|
96
|
+
width: number;
|
|
97
|
+
height: number;
|
|
98
|
+
line_width: number;
|
|
99
|
+
color: string;
|
|
100
|
+
}
|
|
101
|
+
export interface IColoring {
|
|
102
|
+
handle: string;
|
|
103
|
+
color: string;
|
|
104
|
+
}
|
|
105
|
+
export interface IEntity {
|
|
106
|
+
handle: string;
|
|
107
|
+
}
|
|
108
|
+
export interface IViewpoint {
|
|
109
|
+
bitmaps?: IBitmap[];
|
|
110
|
+
guid?: string;
|
|
111
|
+
file_id: string;
|
|
112
|
+
assembly_id?: string;
|
|
113
|
+
orthogonal_camera?: IOrthogonalCamera;
|
|
114
|
+
perspective_camera?: IPerspectiveCamera;
|
|
115
|
+
description?: string;
|
|
116
|
+
index?: number;
|
|
117
|
+
lines?: ILine[];
|
|
118
|
+
texts?: IText[];
|
|
119
|
+
clipping_planes?: IClippingPlane[];
|
|
120
|
+
selection?: IEntity[];
|
|
121
|
+
visibility?: IEntity[];
|
|
122
|
+
coloring?: IColoring[];
|
|
123
|
+
arrows?: IArrow[];
|
|
124
|
+
clouds?: ICloud[];
|
|
125
|
+
ellipses?: IEllipse[];
|
|
126
|
+
images?: IImage[];
|
|
127
|
+
rectangles?: IRectangle[];
|
|
128
|
+
custom_fields?: any;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=IViewpoint.d.ts.map
|
|
@@ -3,6 +3,7 @@ import { Viewer } from "../../../Viewer";
|
|
|
3
3
|
import { ChangeActiveDraggerEvent, PanEvent } from "../../../ViewerEvents";
|
|
4
4
|
import { OdBaseDragger } from "../../../Draggers/Common/OdBaseDragger";
|
|
5
5
|
import { IMarkupObject } from "../../Api/IMarkupObject";
|
|
6
|
+
import { IViewpoint } from "../../IViewpoint";
|
|
6
7
|
export declare class KonvaMarkup implements IMarkup {
|
|
7
8
|
private _isInitialized;
|
|
8
9
|
private _viewer;
|
|
@@ -20,7 +21,6 @@ export declare class KonvaMarkup implements IMarkup {
|
|
|
20
21
|
private _markupContainer;
|
|
21
22
|
private _zIndex;
|
|
22
23
|
private readonly _markupContainerName;
|
|
23
|
-
private readonly TEXT_FONT_FAMILY;
|
|
24
24
|
lineWidth: number;
|
|
25
25
|
initialize(viewer: Viewer, canvas: HTMLCanvasElement, canvasEvents?: string[]): void;
|
|
26
26
|
dispose(): void;
|
|
@@ -37,8 +37,8 @@ export declare class KonvaMarkup implements IMarkup {
|
|
|
37
37
|
};
|
|
38
38
|
setMarkupColor(r: number, g: number, b: number): void;
|
|
39
39
|
colorizeAllMarkup(r?: number, g?: number, b?: number): void;
|
|
40
|
-
setViewpoint(viewpoint:
|
|
41
|
-
getViewpoint():
|
|
40
|
+
setViewpoint(viewpoint: IViewpoint): void;
|
|
41
|
+
getViewpoint(): IViewpoint;
|
|
42
42
|
createObject(type: string, params: any): IMarkupObject;
|
|
43
43
|
getObjects(): IMarkupObject[];
|
|
44
44
|
getSelectedObjects(): IMarkupObject[];
|
|
@@ -2,6 +2,7 @@ import { IMarkup } from "../../IMarkup";
|
|
|
2
2
|
import { Viewer } from "../../../Viewer";
|
|
3
3
|
import { OdBaseDragger } from "../../../Draggers/Common/OdBaseDragger";
|
|
4
4
|
import { IMarkupObject } from "../../Api/IMarkupObject";
|
|
5
|
+
import { IViewpoint } from "../../IViewpoint";
|
|
5
6
|
export declare class VisualizeMarkup implements IMarkup {
|
|
6
7
|
private _viewer;
|
|
7
8
|
protected _markupColor: {
|
|
@@ -21,14 +22,13 @@ export declare class VisualizeMarkup implements IMarkup {
|
|
|
21
22
|
};
|
|
22
23
|
setMarkupColor(r: number, g: number, b: number): void;
|
|
23
24
|
colorizeAllMarkup(r?: number, g?: number, b?: number): void;
|
|
24
|
-
setViewpoint(viewpoint:
|
|
25
|
-
getViewpoint():
|
|
25
|
+
setViewpoint(viewpoint: IViewpoint): void;
|
|
26
|
+
getViewpoint(): IViewpoint;
|
|
26
27
|
getLayer(): any;
|
|
27
28
|
createObject(type: string, params: any): IMarkupObject;
|
|
28
29
|
getObjects(): IMarkupObject[];
|
|
29
30
|
getSelectedObjects(): IMarkupObject[];
|
|
30
31
|
selectObjects(objects: IMarkupObject[]): void;
|
|
31
32
|
clearSelected(): void;
|
|
32
|
-
private getPoint3dFromArray;
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=VisualizeMarkup.d.ts.map
|
package/lib/Viewer/Viewer.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Assembly } from "../Api/Assembly";
|
|
|
9
9
|
import { Model } from "../Api/Model";
|
|
10
10
|
import { Options, OptionsData } from "./Options";
|
|
11
11
|
import { IMarkup, MarkupType } from "./Markup/IMarkup";
|
|
12
|
+
import { IViewpoint } from "./Markup/IViewpoint";
|
|
12
13
|
/**
|
|
13
14
|
* The `Client.js` library class that provides methods to integrate with the
|
|
14
15
|
* [VisualizeJS](https://cloud.opendesign.com/docs/index.html#/visualizejs) library.
|
|
@@ -334,13 +335,13 @@ export declare class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventM
|
|
|
334
335
|
*
|
|
335
336
|
* @param viewpoint - Viewpoint.
|
|
336
337
|
*/
|
|
337
|
-
drawViewpoint(viewpoint:
|
|
338
|
+
drawViewpoint(viewpoint: IViewpoint): void;
|
|
338
339
|
/**
|
|
339
340
|
* Create a viewpoint. To add a viewpoint to the list of model viewpoints, use the
|
|
340
341
|
* {@link Model#saveViewpoint | Model.saveViewpoint()} or
|
|
341
342
|
* {@link File#saveViewpoint | File.saveViewpoint()}.
|
|
342
343
|
*/
|
|
343
|
-
createViewpoint():
|
|
344
|
+
createViewpoint(): IViewpoint;
|
|
344
345
|
private getPoint3dFromArray;
|
|
345
346
|
private getLogicalPoint3dAsArray;
|
|
346
347
|
private getOrthogonalCameraSettings;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/client",
|
|
3
|
-
"version": "25.3.
|
|
3
|
+
"version": "25.3.4",
|
|
4
4
|
"description": "Client.js is a library for implementing BIM Project management applications.",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
package/src/Viewer/IViewer.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { Client } from "../Api/Client";
|
|
|
28
28
|
import { File } from "../Api/File";
|
|
29
29
|
import { Assembly } from "../Api/Assembly";
|
|
30
30
|
import { Model } from "../Api/Model";
|
|
31
|
+
import { IViewpoint } from "./Markup/IViewpoint";
|
|
31
32
|
|
|
32
33
|
export interface IViewer extends IEventEmitter, ICommandService {
|
|
33
34
|
client: Client | undefined;
|
|
@@ -48,8 +49,8 @@ export interface IViewer extends IEventEmitter, ICommandService {
|
|
|
48
49
|
|
|
49
50
|
is3D(): boolean;
|
|
50
51
|
|
|
51
|
-
drawViewpoint(viewpoint:
|
|
52
|
-
createViewpoint():
|
|
52
|
+
drawViewpoint(viewpoint: IViewpoint): void;
|
|
53
|
+
createViewpoint(): IViewpoint;
|
|
53
54
|
|
|
54
55
|
loadReferences(model: Model | File | Assembly): Promise<this>;
|
|
55
56
|
open(model: Model | File | Assembly): Promise<this>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Konva from "konva";
|
|
2
|
-
import { IMarkupLine
|
|
2
|
+
import { IMarkupLine } from "../../IMarkupLine";
|
|
3
3
|
import { IMarkupColorable } from "../../IMarkupColorable";
|
|
4
|
+
import { LineType } from "../../../IViewpoint";
|
|
4
5
|
|
|
5
6
|
const LineTypeSpecs = new Map<LineType, number[]>([
|
|
6
7
|
[LineType.Solid, []],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OdBaseDragger } from "../Draggers/Common/OdBaseDragger";
|
|
2
2
|
import { Viewer } from "../Viewer";
|
|
3
3
|
import { IMarkupObject } from "./Api/IMarkupObject";
|
|
4
|
+
import { IViewpoint } from "./IViewpoint";
|
|
4
5
|
|
|
5
6
|
export enum MarkupType {
|
|
6
7
|
Unknown,
|
|
@@ -29,8 +30,8 @@ export interface IMarkup {
|
|
|
29
30
|
setMarkupColor(r: number, g: number, b: number): void;
|
|
30
31
|
getMarkupColor(): { r: number; g: number; b: number };
|
|
31
32
|
colorizeAllMarkup(r: number, g: number, b: number): void;
|
|
32
|
-
setViewpoint(viewpoint:
|
|
33
|
-
getViewpoint():
|
|
33
|
+
setViewpoint(viewpoint: IViewpoint): void;
|
|
34
|
+
getViewpoint(): IViewpoint;
|
|
34
35
|
|
|
35
36
|
createObject(type: string, params: any): IMarkupObject;
|
|
36
37
|
getObjects(): IMarkupObject[];
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export interface ILocation {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
z: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface IDirection {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
z: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IPoint {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
z: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface IBitmap {
|
|
20
|
+
guid: string;
|
|
21
|
+
location: ILocation;
|
|
22
|
+
normal: IDirection;
|
|
23
|
+
up: IDirection;
|
|
24
|
+
height: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface IOrthogonalCamera {
|
|
28
|
+
view_point: IPoint;
|
|
29
|
+
direction: IDirection;
|
|
30
|
+
up_vector: IDirection;
|
|
31
|
+
field_width: number;
|
|
32
|
+
field_height: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IClippingPlane {
|
|
36
|
+
location: ILocation;
|
|
37
|
+
direction: IDirection;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface IPerspectiveCamera {
|
|
41
|
+
view_point: IPoint;
|
|
42
|
+
direction: IDirection;
|
|
43
|
+
up_vector: IDirection;
|
|
44
|
+
field_of_view: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export enum LineType {
|
|
48
|
+
Unknown,
|
|
49
|
+
Solid = "solid",
|
|
50
|
+
Dot = "dot",
|
|
51
|
+
Dash = "dash",
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ILine {
|
|
55
|
+
points: IPoint[];
|
|
56
|
+
color: string;
|
|
57
|
+
type: LineType;
|
|
58
|
+
width: number;
|
|
59
|
+
id: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface IText {
|
|
63
|
+
position: IPoint;
|
|
64
|
+
text: string;
|
|
65
|
+
angle: number;
|
|
66
|
+
text_size: number;
|
|
67
|
+
color: string;
|
|
68
|
+
id: string;
|
|
69
|
+
font_size: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface IArrow {
|
|
73
|
+
id: string;
|
|
74
|
+
start: IPoint;
|
|
75
|
+
end: IPoint;
|
|
76
|
+
color: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface ICloud {
|
|
80
|
+
id: string;
|
|
81
|
+
position: IPoint;
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
line_width: number;
|
|
85
|
+
color: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface IEllipse {
|
|
89
|
+
id: string;
|
|
90
|
+
position: IPoint;
|
|
91
|
+
radius: {
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
};
|
|
95
|
+
line_width: number;
|
|
96
|
+
color: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface IImage {
|
|
100
|
+
id: string;
|
|
101
|
+
position: IPoint;
|
|
102
|
+
src: string;
|
|
103
|
+
width: number;
|
|
104
|
+
height: number;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface IRectangle {
|
|
108
|
+
id: string;
|
|
109
|
+
position: IPoint;
|
|
110
|
+
width: number;
|
|
111
|
+
height: number;
|
|
112
|
+
line_width: number;
|
|
113
|
+
color: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface IColoring {
|
|
117
|
+
handle: string;
|
|
118
|
+
color: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface IEntity {
|
|
122
|
+
handle: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface IViewpoint {
|
|
126
|
+
bitmaps?: IBitmap[];
|
|
127
|
+
guid?: string;
|
|
128
|
+
file_id: string;
|
|
129
|
+
assembly_id?: string;
|
|
130
|
+
orthogonal_camera?: IOrthogonalCamera;
|
|
131
|
+
perspective_camera?: IPerspectiveCamera;
|
|
132
|
+
description?: string;
|
|
133
|
+
index?: number;
|
|
134
|
+
lines?: ILine[];
|
|
135
|
+
texts?: IText[];
|
|
136
|
+
clipping_planes?: IClippingPlane[];
|
|
137
|
+
selection?: IEntity[];
|
|
138
|
+
visibility?: IEntity[];
|
|
139
|
+
coloring?: IColoring[];
|
|
140
|
+
arrows?: IArrow[];
|
|
141
|
+
clouds?: ICloud[];
|
|
142
|
+
ellipses?: IEllipse[];
|
|
143
|
+
images?: IImage[];
|
|
144
|
+
rectangles?: IRectangle[];
|
|
145
|
+
custom_fields?: any;
|
|
146
|
+
}
|
|
@@ -7,13 +7,13 @@ import * as utils from "../../../Draggers/MeasureLineDragger/MeasureUtils";
|
|
|
7
7
|
import { OdBaseDragger } from "../../../Draggers/Common/OdBaseDragger";
|
|
8
8
|
import { IMarkupObject } from "../../Api/IMarkupObject";
|
|
9
9
|
import { KonvaLine } from "../../Api/Impl/Konva/KonvaLine";
|
|
10
|
-
import { LineType } from "../../Api/IMarkupLine";
|
|
11
10
|
import { KonvaText } from "../../Api/Impl/Konva/KonvaText";
|
|
12
11
|
import { KonvaRectangle } from "../../Api/Impl/Konva/KonvaRectangle";
|
|
13
12
|
import { KonvaEllipse } from "../../Api/Impl/Konva/KonvaEllipse";
|
|
14
13
|
import { KonvaArrow } from "../../Api/Impl/Konva/KonvaArrow";
|
|
15
14
|
import { KonvaImage } from "../../Api/Impl/Konva/KonvaImage";
|
|
16
15
|
import { KonvaCloud } from "../../Api/Impl/Konva/KonvaCloud";
|
|
16
|
+
import { IViewpoint, LineType } from "../../IViewpoint";
|
|
17
17
|
|
|
18
18
|
class KonvaShape {
|
|
19
19
|
name: string;
|
|
@@ -106,7 +106,6 @@ export class KonvaMarkup implements IMarkup {
|
|
|
106
106
|
private _zIndex = 1;
|
|
107
107
|
|
|
108
108
|
private readonly _markupContainerName = "markupContainer";
|
|
109
|
-
private readonly TEXT_FONT_FAMILY = "Calibri";
|
|
110
109
|
|
|
111
110
|
public lineWidth = 4;
|
|
112
111
|
|
|
@@ -236,15 +235,16 @@ export class KonvaMarkup implements IMarkup {
|
|
|
236
235
|
this._konvaLayer.draw();
|
|
237
236
|
}
|
|
238
237
|
|
|
239
|
-
setViewpoint(viewpoint:
|
|
238
|
+
setViewpoint(viewpoint: IViewpoint): void {
|
|
240
239
|
const markupColor = viewpoint.custom_fields.markup_color || { r: 255, g: 0, b: 0 };
|
|
241
240
|
this.setMarkupColor(markupColor.r, markupColor.g, markupColor.b);
|
|
242
241
|
|
|
243
242
|
this.loadMarkup(viewpoint);
|
|
244
243
|
}
|
|
245
244
|
|
|
246
|
-
getViewpoint():
|
|
247
|
-
|
|
245
|
+
getViewpoint(): IViewpoint {
|
|
246
|
+
// TODO: at the current 25.2 state we need VisualizeJS here and below. In the future we need to use it as an external interface
|
|
247
|
+
if (!this._viewer.visualizeJs) return { file_id: "" };
|
|
248
248
|
|
|
249
249
|
const viewpoint = {
|
|
250
250
|
lines: [],
|
|
@@ -799,7 +799,7 @@ export class KonvaMarkup implements IMarkup {
|
|
|
799
799
|
return clouds;
|
|
800
800
|
}
|
|
801
801
|
|
|
802
|
-
private loadMarkup(viewpoint) {
|
|
802
|
+
private loadMarkup(viewpoint: IViewpoint) {
|
|
803
803
|
viewpoint.lines?.forEach((vpLine) => {
|
|
804
804
|
const linePoints = [];
|
|
805
805
|
vpLine.points.forEach((point) => {
|
|
@@ -4,6 +4,7 @@ import { OdBaseDragger } from "../../../Draggers/Common/OdBaseDragger";
|
|
|
4
4
|
import { MARKUP_ENTITY_LINE, OdaLineDragger } from "../../../Draggers/OdaLineDragger";
|
|
5
5
|
import { MARKUP_ENTITY_TEXT, OdaTextDragger } from "../../../Draggers/OdaTextDragger";
|
|
6
6
|
import { IMarkupObject } from "../../Api/IMarkupObject";
|
|
7
|
+
import { IViewpoint } from "../../IViewpoint";
|
|
7
8
|
|
|
8
9
|
export class VisualizeMarkup implements IMarkup {
|
|
9
10
|
private _viewer: Viewer;
|
|
@@ -66,7 +67,7 @@ export class VisualizeMarkup implements IMarkup {
|
|
|
66
67
|
this._viewer.update();
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
setViewpoint(viewpoint:
|
|
70
|
+
setViewpoint(viewpoint: IViewpoint): void {
|
|
70
71
|
function getLogicalPoint3dAsArray(point3d) {
|
|
71
72
|
return [point3d.x, point3d.y, point3d.z];
|
|
72
73
|
}
|
|
@@ -127,12 +128,12 @@ export class VisualizeMarkup implements IMarkup {
|
|
|
127
128
|
this._viewer.update();
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
getViewpoint():
|
|
131
|
+
getViewpoint(): IViewpoint {
|
|
131
132
|
function getLogicalPoint3dFromArray(array) {
|
|
132
133
|
return { x: array[0], y: array[1], z: array[2] };
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
if (!this._viewer.visualizeJs) return {};
|
|
136
|
+
if (!this._viewer.visualizeJs) return { file_id: "" };
|
|
136
137
|
|
|
137
138
|
const visLib = this._viewer.visLib();
|
|
138
139
|
const visViewer = visLib.getViewer();
|
|
@@ -224,8 +225,4 @@ export class VisualizeMarkup implements IMarkup {
|
|
|
224
225
|
clearSelected(): void {
|
|
225
226
|
throw new Error("Not implemented yet");
|
|
226
227
|
}
|
|
227
|
-
|
|
228
|
-
private getPoint3dFromArray(array) {
|
|
229
|
-
return { x: array[0], y: array[1], z: array[2] };
|
|
230
|
-
}
|
|
231
228
|
}
|
package/src/Viewer/Viewer.ts
CHANGED
|
@@ -52,6 +52,7 @@ import { Options, OptionsData } from "./Options";
|
|
|
52
52
|
import { LoaderFactory } from "./Loaders/LoaderFactory";
|
|
53
53
|
import { MarkupFactory } from "./Markup/MarkupFactory";
|
|
54
54
|
import { IMarkup, MarkupType } from "./Markup/IMarkup";
|
|
55
|
+
import { IClippingPlane, IOrthogonalCamera, IViewpoint } from "./Markup/IViewpoint";
|
|
55
56
|
|
|
56
57
|
const OVERLAY_VIEW_NAME = "$OVERLAY_VIEW_NAME";
|
|
57
58
|
|
|
@@ -216,6 +217,7 @@ export class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventMap> impl
|
|
|
216
217
|
canvas.style.width = "100%";
|
|
217
218
|
canvas.style.height = "100%";
|
|
218
219
|
}
|
|
220
|
+
canvas.parentElement.style.touchAction = "none";
|
|
219
221
|
canvas.style.touchAction = "none";
|
|
220
222
|
|
|
221
223
|
canvas.width = canvas.clientWidth * window.devicePixelRatio;
|
|
@@ -1082,9 +1084,9 @@ export class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventMap> impl
|
|
|
1082
1084
|
*
|
|
1083
1085
|
* @param viewpoint - Viewpoint.
|
|
1084
1086
|
*/
|
|
1085
|
-
drawViewpoint(viewpoint:
|
|
1086
|
-
this.setOrthogonalCameraSettings(viewpoint);
|
|
1087
|
-
this.setClippingPlanes(viewpoint);
|
|
1087
|
+
drawViewpoint(viewpoint: IViewpoint): void {
|
|
1088
|
+
this.setOrthogonalCameraSettings(viewpoint.orthogonal_camera);
|
|
1089
|
+
this.setClippingPlanes(viewpoint.clipping_planes);
|
|
1088
1090
|
this.markup.setViewpoint(viewpoint);
|
|
1089
1091
|
}
|
|
1090
1092
|
|
|
@@ -1093,7 +1095,7 @@ export class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventMap> impl
|
|
|
1093
1095
|
* {@link Model#saveViewpoint | Model.saveViewpoint()} or
|
|
1094
1096
|
* {@link File#saveViewpoint | File.saveViewpoint()}.
|
|
1095
1097
|
*/
|
|
1096
|
-
createViewpoint():
|
|
1098
|
+
createViewpoint(): IViewpoint {
|
|
1097
1099
|
const vp = this.markup.getViewpoint();
|
|
1098
1100
|
vp.orthogonal_camera = this.getOrthogonalCameraSettings();
|
|
1099
1101
|
vp.clipping_planes = this.getClippingPlanes();
|
|
@@ -1109,7 +1111,7 @@ export class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventMap> impl
|
|
|
1109
1111
|
return [point3d.x, point3d.y, point3d.z];
|
|
1110
1112
|
}
|
|
1111
1113
|
|
|
1112
|
-
private getOrthogonalCameraSettings():
|
|
1114
|
+
private getOrthogonalCameraSettings(): IOrthogonalCamera {
|
|
1113
1115
|
const visViewer = this.visViewer();
|
|
1114
1116
|
const activeView = visViewer.activeView;
|
|
1115
1117
|
|
|
@@ -1122,7 +1124,7 @@ export class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventMap> impl
|
|
|
1122
1124
|
};
|
|
1123
1125
|
}
|
|
1124
1126
|
|
|
1125
|
-
private setOrthogonalCameraSettings(
|
|
1127
|
+
private setOrthogonalCameraSettings(settings: IOrthogonalCamera) {
|
|
1126
1128
|
const visViewer = this.visViewer();
|
|
1127
1129
|
const activeView = visViewer.activeView;
|
|
1128
1130
|
|
|
@@ -1130,13 +1132,13 @@ export class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventMap> impl
|
|
|
1130
1132
|
this.clearSlices();
|
|
1131
1133
|
this.clearOverlay();
|
|
1132
1134
|
|
|
1133
|
-
if (
|
|
1135
|
+
if (settings) {
|
|
1134
1136
|
activeView.setView(
|
|
1135
|
-
this.getLogicalPoint3dAsArray(
|
|
1136
|
-
this.getLogicalPoint3dAsArray(
|
|
1137
|
-
this.getLogicalPoint3dAsArray(
|
|
1138
|
-
|
|
1139
|
-
|
|
1137
|
+
this.getLogicalPoint3dAsArray(settings.view_point),
|
|
1138
|
+
this.getLogicalPoint3dAsArray(settings.direction),
|
|
1139
|
+
this.getLogicalPoint3dAsArray(settings.up_vector),
|
|
1140
|
+
settings.field_width,
|
|
1141
|
+
settings.field_height,
|
|
1140
1142
|
true
|
|
1141
1143
|
);
|
|
1142
1144
|
}
|
|
@@ -1144,7 +1146,7 @@ export class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventMap> impl
|
|
|
1144
1146
|
this.syncOverlay();
|
|
1145
1147
|
}
|
|
1146
1148
|
|
|
1147
|
-
private getClippingPlanes():
|
|
1149
|
+
private getClippingPlanes(): IClippingPlane[] {
|
|
1148
1150
|
const visViewer = this.visViewer();
|
|
1149
1151
|
const activeView = visViewer.activeView;
|
|
1150
1152
|
|
|
@@ -1163,12 +1165,12 @@ export class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventMap> impl
|
|
|
1163
1165
|
return clipping_planes;
|
|
1164
1166
|
}
|
|
1165
1167
|
|
|
1166
|
-
private setClippingPlanes(
|
|
1167
|
-
if (
|
|
1168
|
+
private setClippingPlanes(clippingPlanes: IClippingPlane[]) {
|
|
1169
|
+
if (clippingPlanes) {
|
|
1168
1170
|
const visViewer = this.visViewer();
|
|
1169
1171
|
const activeView = visViewer.activeView;
|
|
1170
1172
|
|
|
1171
|
-
for (const plane of
|
|
1173
|
+
for (const plane of clippingPlanes) {
|
|
1172
1174
|
const cuttingPlane = new (this.visLib().OdTvPlane)();
|
|
1173
1175
|
cuttingPlane.set(this.getLogicalPoint3dAsArray(plane.location), this.getLogicalPoint3dAsArray(plane.direction));
|
|
1174
1176
|
|