@inweb/client 25.3.7 → 25.3.9
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 +12 -12
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +11 -15
- package/dist/client.module.js.map +1 -1
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaCloud.d.ts +4 -4
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.d.ts +1 -1
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaLine.d.ts +3 -3
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.d.ts +4 -4
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaText.d.ts +3 -3
- package/lib/Viewer/Markup/IViewpoint.d.ts +30 -26
- package/package.json +1 -1
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaCloud.ts +4 -4
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.ts +1 -1
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaLine.ts +1 -1
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.ts +6 -6
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaText.ts +3 -3
- package/src/Viewer/Markup/IViewpoint.ts +31 -26
- package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +8 -8
- package/src/Viewer/Markup/Impl/Visualize/VisualizeMarkup.ts +6 -6
|
@@ -7,10 +7,10 @@ export declare class KonvaCloud implements IMarkupCloud, IMarkupColorable {
|
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
9
9
|
};
|
|
10
|
-
width
|
|
11
|
-
height
|
|
12
|
-
lineWidth
|
|
13
|
-
color
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
lineWidth?: number;
|
|
13
|
+
color?: string;
|
|
14
14
|
id?: string;
|
|
15
15
|
}, ref?: any);
|
|
16
16
|
ref(): import("konva/lib/Shape").Shape<import("konva/lib/Shape").ShapeConfig>;
|
|
@@ -8,9 +8,9 @@ export declare class KonvaLine implements IMarkupLine, IMarkupColorable {
|
|
|
8
8
|
x: number;
|
|
9
9
|
y: number;
|
|
10
10
|
}[];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
type?: LineType;
|
|
12
|
+
width?: number;
|
|
13
|
+
color?: string;
|
|
14
14
|
id?: string;
|
|
15
15
|
}, ref?: any);
|
|
16
16
|
ref(): import("konva/lib/shapes/Line").Line<import("konva/lib/shapes/Line").LineConfig>;
|
|
@@ -7,10 +7,10 @@ export declare class KonvaRectangle implements IMarkupRectangle, IMarkupColorabl
|
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
lineWidth?: number;
|
|
13
|
+
color?: string;
|
|
14
14
|
id?: string;
|
|
15
15
|
}, ref?: any);
|
|
16
16
|
getPosition(): {
|
|
@@ -9,9 +9,9 @@ export declare class KonvaText implements IMarkupText, IMarkupColorable {
|
|
|
9
9
|
y: number;
|
|
10
10
|
};
|
|
11
11
|
text: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
rotation?: number;
|
|
13
|
+
fontSize?: number;
|
|
14
|
+
color?: string;
|
|
15
15
|
id?: string;
|
|
16
16
|
}, ref?: any);
|
|
17
17
|
ref(): import("konva/lib/shapes/Text").Text;
|
|
@@ -40,58 +40,58 @@ export interface IPerspectiveCamera {
|
|
|
40
40
|
export type LineType = "solid" | "dot" | "dash";
|
|
41
41
|
export interface ILine {
|
|
42
42
|
points: IPoint[];
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
id
|
|
43
|
+
type?: LineType;
|
|
44
|
+
width?: number;
|
|
45
|
+
color?: string;
|
|
46
|
+
id?: string;
|
|
47
47
|
}
|
|
48
48
|
export interface IText {
|
|
49
49
|
position: IPoint;
|
|
50
50
|
text: string;
|
|
51
|
-
angle
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
angle?: number;
|
|
52
|
+
font_size?: number;
|
|
53
|
+
text_size?: number;
|
|
54
|
+
color?: string;
|
|
55
|
+
id?: string;
|
|
56
56
|
}
|
|
57
57
|
export interface IArrow {
|
|
58
|
-
id: string;
|
|
59
58
|
start: IPoint;
|
|
60
59
|
end: IPoint;
|
|
61
|
-
color
|
|
60
|
+
color?: string;
|
|
61
|
+
id?: string;
|
|
62
62
|
}
|
|
63
63
|
export interface ICloud {
|
|
64
|
-
id: string;
|
|
65
64
|
position: IPoint;
|
|
66
|
-
width
|
|
67
|
-
height
|
|
68
|
-
line_width
|
|
69
|
-
color
|
|
65
|
+
width?: number;
|
|
66
|
+
height?: number;
|
|
67
|
+
line_width?: number;
|
|
68
|
+
color?: string;
|
|
69
|
+
id?: string;
|
|
70
70
|
}
|
|
71
71
|
export interface IEllipse {
|
|
72
|
-
id: string;
|
|
73
72
|
position: IPoint;
|
|
74
73
|
radius: {
|
|
75
74
|
x: number;
|
|
76
75
|
y: number;
|
|
77
76
|
};
|
|
78
|
-
line_width
|
|
79
|
-
color
|
|
77
|
+
line_width?: number;
|
|
78
|
+
color?: string;
|
|
79
|
+
id?: string;
|
|
80
80
|
}
|
|
81
81
|
export interface IImage {
|
|
82
|
-
id: string;
|
|
83
82
|
position: IPoint;
|
|
84
83
|
src: string;
|
|
85
84
|
width: number;
|
|
86
85
|
height: number;
|
|
86
|
+
id?: string;
|
|
87
87
|
}
|
|
88
88
|
export interface IRectangle {
|
|
89
|
-
id: string;
|
|
90
89
|
position: IPoint;
|
|
91
|
-
width
|
|
92
|
-
height
|
|
93
|
-
line_width
|
|
94
|
-
color
|
|
90
|
+
width?: number;
|
|
91
|
+
height?: number;
|
|
92
|
+
line_width?: number;
|
|
93
|
+
color?: string;
|
|
94
|
+
id?: string;
|
|
95
95
|
}
|
|
96
96
|
export interface IColoring {
|
|
97
97
|
handle: string;
|
|
@@ -100,10 +100,13 @@ export interface IColoring {
|
|
|
100
100
|
export interface IEntity {
|
|
101
101
|
handle: string;
|
|
102
102
|
}
|
|
103
|
+
export interface ISnapshot {
|
|
104
|
+
data: string;
|
|
105
|
+
}
|
|
103
106
|
export interface IViewpoint {
|
|
104
107
|
bitmaps?: IBitmap[];
|
|
105
108
|
guid?: string;
|
|
106
|
-
file_id
|
|
109
|
+
file_id?: string;
|
|
107
110
|
assembly_id?: string;
|
|
108
111
|
orthogonal_camera?: IOrthogonalCamera;
|
|
109
112
|
perspective_camera?: IPerspectiveCamera;
|
|
@@ -121,5 +124,6 @@ export interface IViewpoint {
|
|
|
121
124
|
images?: IImage[];
|
|
122
125
|
rectangles?: IRectangle[];
|
|
123
126
|
custom_fields?: any;
|
|
127
|
+
snapshot?: ISnapshot;
|
|
124
128
|
}
|
|
125
129
|
//# sourceMappingURL=IViewpoint.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/client",
|
|
3
|
-
"version": "25.3.
|
|
3
|
+
"version": "25.3.9",
|
|
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",
|
|
@@ -8,10 +8,10 @@ export class KonvaCloud implements IMarkupCloud, IMarkupColorable {
|
|
|
8
8
|
constructor(
|
|
9
9
|
params: {
|
|
10
10
|
position: { x: number; y: number };
|
|
11
|
-
width
|
|
12
|
-
height
|
|
13
|
-
lineWidth
|
|
14
|
-
color
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
lineWidth?: number;
|
|
14
|
+
color?: string;
|
|
15
15
|
id?: string;
|
|
16
16
|
},
|
|
17
17
|
ref = null
|
|
@@ -13,7 +13,7 @@ export class KonvaLine implements IMarkupLine, IMarkupColorable {
|
|
|
13
13
|
private _ref: Konva.Line;
|
|
14
14
|
|
|
15
15
|
constructor(
|
|
16
|
-
params: { points: { x: number; y: number }[];
|
|
16
|
+
params: { points: { x: number; y: number }[]; type?: LineType; width?: number; color?: string; id?: string },
|
|
17
17
|
ref = null
|
|
18
18
|
) {
|
|
19
19
|
if (ref) {
|
|
@@ -8,10 +8,10 @@ export class KonvaRectangle implements IMarkupRectangle, IMarkupColorable {
|
|
|
8
8
|
constructor(
|
|
9
9
|
params: {
|
|
10
10
|
position: { x: number; y: number };
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
lineWidth?: number;
|
|
14
|
+
color?: string;
|
|
15
15
|
id?: string;
|
|
16
16
|
},
|
|
17
17
|
ref = null
|
|
@@ -31,8 +31,8 @@ export class KonvaRectangle implements IMarkupRectangle, IMarkupColorable {
|
|
|
31
31
|
lineJoin: "round",
|
|
32
32
|
x: params.position.x,
|
|
33
33
|
y: params.position.y,
|
|
34
|
-
width: params.width,
|
|
35
|
-
height: params.height,
|
|
34
|
+
width: params.width ?? 200,
|
|
35
|
+
height: params.height ?? 200,
|
|
36
36
|
draggable: true,
|
|
37
37
|
strokeScaleEnabled: false,
|
|
38
38
|
});
|
|
@@ -10,9 +10,9 @@ export class KonvaText implements IMarkupText, IMarkupColorable {
|
|
|
10
10
|
params: {
|
|
11
11
|
position: { x: number; y: number };
|
|
12
12
|
text: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
rotation?: number;
|
|
14
|
+
fontSize?: number;
|
|
15
|
+
color?: string;
|
|
16
16
|
id?: string;
|
|
17
17
|
},
|
|
18
18
|
ref = null
|
|
@@ -48,64 +48,64 @@ export type LineType = "solid" | "dot" | "dash";
|
|
|
48
48
|
|
|
49
49
|
export interface ILine {
|
|
50
50
|
points: IPoint[];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
id
|
|
51
|
+
type?: LineType;
|
|
52
|
+
width?: number;
|
|
53
|
+
color?: string;
|
|
54
|
+
id?: string;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export interface IText {
|
|
58
58
|
position: IPoint;
|
|
59
59
|
text: string;
|
|
60
|
-
angle
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
angle?: number;
|
|
61
|
+
font_size?: number;
|
|
62
|
+
text_size?: number;
|
|
63
|
+
color?: string;
|
|
64
|
+
id?: string;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export interface IArrow {
|
|
68
|
-
id: string;
|
|
69
68
|
start: IPoint;
|
|
70
69
|
end: IPoint;
|
|
71
|
-
color
|
|
70
|
+
color?: string;
|
|
71
|
+
id?: string;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
export interface ICloud {
|
|
75
|
-
id: string;
|
|
76
75
|
position: IPoint;
|
|
77
|
-
width
|
|
78
|
-
height
|
|
79
|
-
line_width
|
|
80
|
-
color
|
|
76
|
+
width?: number;
|
|
77
|
+
height?: number;
|
|
78
|
+
line_width?: number;
|
|
79
|
+
color?: string;
|
|
80
|
+
id?: string;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export interface IEllipse {
|
|
84
|
-
id: string;
|
|
85
84
|
position: IPoint;
|
|
86
85
|
radius: {
|
|
87
86
|
x: number;
|
|
88
87
|
y: number;
|
|
89
88
|
};
|
|
90
|
-
line_width
|
|
91
|
-
color
|
|
89
|
+
line_width?: number;
|
|
90
|
+
color?: string;
|
|
91
|
+
id?: string;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export interface IImage {
|
|
95
|
-
id: string;
|
|
96
95
|
position: IPoint;
|
|
97
96
|
src: string;
|
|
98
97
|
width: number;
|
|
99
98
|
height: number;
|
|
99
|
+
id?: string;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export interface IRectangle {
|
|
103
|
-
id: string;
|
|
104
103
|
position: IPoint;
|
|
105
|
-
width
|
|
106
|
-
height
|
|
107
|
-
line_width
|
|
108
|
-
color
|
|
104
|
+
width?: number;
|
|
105
|
+
height?: number;
|
|
106
|
+
line_width?: number;
|
|
107
|
+
color?: string;
|
|
108
|
+
id?: string;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
export interface IColoring {
|
|
@@ -117,10 +117,14 @@ export interface IEntity {
|
|
|
117
117
|
handle: string;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
export interface ISnapshot {
|
|
121
|
+
data: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
120
124
|
export interface IViewpoint {
|
|
121
125
|
bitmaps?: IBitmap[];
|
|
122
126
|
guid?: string;
|
|
123
|
-
file_id
|
|
127
|
+
file_id?: string;
|
|
124
128
|
assembly_id?: string;
|
|
125
129
|
orthogonal_camera?: IOrthogonalCamera;
|
|
126
130
|
perspective_camera?: IPerspectiveCamera;
|
|
@@ -138,4 +142,5 @@ export interface IViewpoint {
|
|
|
138
142
|
images?: IImage[];
|
|
139
143
|
rectangles?: IRectangle[];
|
|
140
144
|
custom_fields?: any;
|
|
145
|
+
snapshot?: ISnapshot;
|
|
141
146
|
}
|
|
@@ -243,10 +243,10 @@ export class KonvaMarkup implements IMarkup {
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
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 {
|
|
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 {};
|
|
248
248
|
|
|
249
|
-
const viewpoint = {
|
|
249
|
+
const viewpoint: IViewpoint = {
|
|
250
250
|
lines: [],
|
|
251
251
|
texts: [],
|
|
252
252
|
arrows: [],
|
|
@@ -254,7 +254,7 @@ export class KonvaMarkup implements IMarkup {
|
|
|
254
254
|
ellipses: [],
|
|
255
255
|
images: [],
|
|
256
256
|
rectangles: [],
|
|
257
|
-
}
|
|
257
|
+
};
|
|
258
258
|
|
|
259
259
|
viewpoint.snapshot = {
|
|
260
260
|
data: this.combineMarkupWithDrawing(),
|
|
@@ -931,9 +931,9 @@ export class KonvaMarkup implements IMarkup {
|
|
|
931
931
|
|
|
932
932
|
const konvaLine = new KonvaLine({
|
|
933
933
|
points,
|
|
934
|
-
color: color || this._markupColor.HexColor,
|
|
935
934
|
type: type || "solid",
|
|
936
935
|
width: width || this.lineWidth,
|
|
936
|
+
color: color || this._markupColor.HexColor,
|
|
937
937
|
id,
|
|
938
938
|
});
|
|
939
939
|
|
|
@@ -1009,9 +1009,9 @@ export class KonvaMarkup implements IMarkup {
|
|
|
1009
1009
|
const konvaText = new KonvaText({
|
|
1010
1010
|
position: { x: position.x, y: position.y },
|
|
1011
1011
|
text: specifiedText,
|
|
1012
|
+
rotation: angle,
|
|
1012
1013
|
fontSize,
|
|
1013
1014
|
color: color || this._markupColor.HexColor,
|
|
1014
|
-
rotation: angle,
|
|
1015
1015
|
id,
|
|
1016
1016
|
});
|
|
1017
1017
|
|
|
@@ -1042,10 +1042,10 @@ export class KonvaMarkup implements IMarkup {
|
|
|
1042
1042
|
|
|
1043
1043
|
const konvaRectangle = new KonvaRectangle({
|
|
1044
1044
|
position,
|
|
1045
|
-
color: color || this._markupColor.HexColor,
|
|
1046
|
-
lineWidth: lineWidth || this.lineWidth,
|
|
1047
1045
|
width,
|
|
1048
1046
|
height,
|
|
1047
|
+
lineWidth: lineWidth || this.lineWidth,
|
|
1048
|
+
color: color || this._markupColor.HexColor,
|
|
1049
1049
|
id,
|
|
1050
1050
|
});
|
|
1051
1051
|
|
|
@@ -4,7 +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
|
+
import { ILine, IText, IViewpoint } from "../../IViewpoint";
|
|
8
8
|
|
|
9
9
|
export class VisualizeMarkup implements IMarkup {
|
|
10
10
|
private _viewer: Viewer;
|
|
@@ -133,15 +133,15 @@ export class VisualizeMarkup implements IMarkup {
|
|
|
133
133
|
return { x: array[0], y: array[1], z: array[2] };
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
if (!this._viewer.visualizeJs) return {
|
|
136
|
+
if (!this._viewer.visualizeJs) return {};
|
|
137
137
|
|
|
138
138
|
const visLib = this._viewer.visLib();
|
|
139
139
|
const visViewer = visLib.getViewer();
|
|
140
140
|
|
|
141
|
-
const viewpoint = {
|
|
141
|
+
const viewpoint: IViewpoint = {
|
|
142
142
|
lines: [],
|
|
143
143
|
texts: [],
|
|
144
|
-
}
|
|
144
|
+
};
|
|
145
145
|
|
|
146
146
|
const model = visViewer.getMarkupModel();
|
|
147
147
|
const itr = model.getEntitiesIterator();
|
|
@@ -162,7 +162,7 @@ export class VisualizeMarkup implements IMarkup {
|
|
|
162
162
|
const polylinePtr = geometryId.openAsPolyline();
|
|
163
163
|
const points = polylinePtr.getPoints();
|
|
164
164
|
|
|
165
|
-
const line = {
|
|
165
|
+
const line: ILine = {
|
|
166
166
|
points: [],
|
|
167
167
|
};
|
|
168
168
|
for (const point of points) {
|
|
@@ -175,7 +175,7 @@ export class VisualizeMarkup implements IMarkup {
|
|
|
175
175
|
const textPtr = geometryId.openAsText();
|
|
176
176
|
const position = textPtr.getPosition();
|
|
177
177
|
|
|
178
|
-
const text = {
|
|
178
|
+
const text: IText = {
|
|
179
179
|
position: getLogicalPoint3dFromArray(position),
|
|
180
180
|
text: textPtr.getString(),
|
|
181
181
|
angle: textPtr.getRotation(),
|