@inweb/client 25.2.2

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.
Files changed (218) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +70 -0
  3. package/dist/client.js +21126 -0
  4. package/dist/client.js.map +1 -0
  5. package/dist/client.min.js +1 -0
  6. package/dist/client.module.js +7151 -0
  7. package/dist/client.module.js.map +1 -0
  8. package/lib/Api/Assembly.d.ts +339 -0
  9. package/lib/Api/ClashTest.d.ts +176 -0
  10. package/lib/Api/Client.d.ts +452 -0
  11. package/lib/Api/ClientEvents.d.ts +29 -0
  12. package/lib/Api/File.d.ts +568 -0
  13. package/lib/Api/HttpClient.d.ts +13 -0
  14. package/lib/Api/IAssembly.d.ts +14 -0
  15. package/lib/Api/IFile.d.ts +46 -0
  16. package/lib/Api/IHttpClient.d.ts +11 -0
  17. package/lib/Api/IUser.d.ts +11 -0
  18. package/lib/Api/Job.d.ts +142 -0
  19. package/lib/Api/Member.d.ts +85 -0
  20. package/lib/Api/Model.d.ts +147 -0
  21. package/lib/Api/Permission.d.ts +93 -0
  22. package/lib/Api/Project.d.ts +247 -0
  23. package/lib/Api/Role.d.ts +82 -0
  24. package/lib/Api/User.d.ts +197 -0
  25. package/lib/Api/impl/FetchError.d.ts +18 -0
  26. package/lib/Api/impl/Utils.d.ts +33 -0
  27. package/lib/Api/impl/http.d.ts +67 -0
  28. package/lib/ConvetMath.d.ts +29 -0
  29. package/lib/Viewer/CanvasEvents.d.ts +2 -0
  30. package/lib/Viewer/Commands/ApplyModelTransform.d.ts +2 -0
  31. package/lib/Viewer/Commands/ClearMarkup.d.ts +2 -0
  32. package/lib/Viewer/Commands/ClearSlices.d.ts +2 -0
  33. package/lib/Viewer/Commands/CreatePreview.d.ts +2 -0
  34. package/lib/Viewer/Commands/Explode.d.ts +2 -0
  35. package/lib/Viewer/Commands/GetDefaultViewPositions.d.ts +2 -0
  36. package/lib/Viewer/Commands/GetModels.d.ts +2 -0
  37. package/lib/Viewer/Commands/GetSelected.d.ts +2 -0
  38. package/lib/Viewer/Commands/HideSelected.d.ts +2 -0
  39. package/lib/Viewer/Commands/IsolateSelected.d.ts +2 -0
  40. package/lib/Viewer/Commands/RegenerateAll.d.ts +2 -0
  41. package/lib/Viewer/Commands/ResetView.d.ts +2 -0
  42. package/lib/Viewer/Commands/SelectModel.d.ts +2 -0
  43. package/lib/Viewer/Commands/SetActiveDragger.d.ts +2 -0
  44. package/lib/Viewer/Commands/SetDefaultViewPosition.d.ts +2 -0
  45. package/lib/Viewer/Commands/SetMarkupColor.d.ts +2 -0
  46. package/lib/Viewer/Commands/SetSelected.d.ts +2 -0
  47. package/lib/Viewer/Commands/ShowAll.d.ts +2 -0
  48. package/lib/Viewer/Commands/Unselect.d.ts +2 -0
  49. package/lib/Viewer/Commands/ZoomToExtents.d.ts +2 -0
  50. package/lib/Viewer/Commands/ZoomToObjects.d.ts +2 -0
  51. package/lib/Viewer/Commands/ZoomToSelected.d.ts +2 -0
  52. package/lib/Viewer/Commands.d.ts +3 -0
  53. package/lib/Viewer/Draggers/Actions/OrbitAction.d.ts +22 -0
  54. package/lib/Viewer/Draggers/Actions/PanAction.d.ts +18 -0
  55. package/lib/Viewer/Draggers/Actions/ZoomAction.d.ts +8 -0
  56. package/lib/Viewer/Draggers/Common/Geometry.d.ts +115 -0
  57. package/lib/Viewer/Draggers/Common/GestureManager.d.ts +41 -0
  58. package/lib/Viewer/Draggers/Common/OdBaseDragger.d.ts +54 -0
  59. package/lib/Viewer/Draggers/Common/OdaGeAction.d.ts +30 -0
  60. package/lib/Viewer/Draggers/MeasureLineDragger/MeasureLineItem.d.ts +31 -0
  61. package/lib/Viewer/Draggers/MeasureLineDragger/MeasureUtils.d.ts +20 -0
  62. package/lib/Viewer/Draggers/MeasureLineDragger/index.d.ts +24 -0
  63. package/lib/Viewer/Draggers/OdBaseCuttingPlaneDragger.d.ts +27 -0
  64. package/lib/Viewer/Draggers/OdCuttingPlaneXAxisDragger.d.ts +8 -0
  65. package/lib/Viewer/Draggers/OdCuttingPlaneYAxisDragger.d.ts +8 -0
  66. package/lib/Viewer/Draggers/OdCuttingPlaneZAxisDragger.d.ts +8 -0
  67. package/lib/Viewer/Draggers/OdOrbitDragger.d.ts +15 -0
  68. package/lib/Viewer/Draggers/OdPanDragger.d.ts +12 -0
  69. package/lib/Viewer/Draggers/OdZoomDragger.d.ts +12 -0
  70. package/lib/Viewer/Draggers/OdZoomWheelDragger.d.ts +11 -0
  71. package/lib/Viewer/Draggers/OdZoomWindowDragger/OdSelectionFrame.d.ts +19 -0
  72. package/lib/Viewer/Draggers/OdZoomWindowDragger/index.d.ts +14 -0
  73. package/lib/Viewer/Draggers/OdaLineDragger.d.ts +15 -0
  74. package/lib/Viewer/Draggers/OdaTextDragger.d.ts +16 -0
  75. package/lib/Viewer/Draggers/OdaWalkDragger.d.ts +30 -0
  76. package/lib/Viewer/Draggers/OrbitAroundBuildingDragger.d.ts +19 -0
  77. package/lib/Viewer/EventEmitter2.d.ts +54 -0
  78. package/lib/Viewer/ICommands.d.ts +25 -0
  79. package/lib/Viewer/IEventEmitter2.d.ts +13 -0
  80. package/lib/Viewer/IViewer.d.ts +27 -0
  81. package/lib/Viewer/Loaders/BaseLoader.d.ts +11 -0
  82. package/lib/Viewer/Loaders/LoaderFactory.d.ts +10 -0
  83. package/lib/Viewer/Loaders/TCSLoader.d.ts +5 -0
  84. package/lib/Viewer/Loaders/UpdaterController.d.ts +15 -0
  85. package/lib/Viewer/Loaders/VsfXLoader.d.ts +5 -0
  86. package/lib/Viewer/Loaders/VsfXPartialLoader.d.ts +5 -0
  87. package/lib/Viewer/Markup/Api/IMarkupArrow.d.ts +12 -0
  88. package/lib/Viewer/Markup/Api/IMarkupColorable.d.ts +5 -0
  89. package/lib/Viewer/Markup/Api/IMarkupEllipse.d.ts +15 -0
  90. package/lib/Viewer/Markup/Api/IMarkupImage.d.ts +15 -0
  91. package/lib/Viewer/Markup/Api/IMarkupLine.d.ts +11 -0
  92. package/lib/Viewer/Markup/Api/IMarkupObject.d.ts +12 -0
  93. package/lib/Viewer/Markup/Api/IMarkupRectangle.d.ts +15 -0
  94. package/lib/Viewer/Markup/Api/IMarkupText.d.ts +13 -0
  95. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaArrow.d.ts +32 -0
  96. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.d.ts +40 -0
  97. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaImage.d.ts +36 -0
  98. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaLine.d.ts +32 -0
  99. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.d.ts +38 -0
  100. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaText.d.ts +37 -0
  101. package/lib/Viewer/Markup/IMarkup.d.ts +38 -0
  102. package/lib/Viewer/Markup/Impl/Konva/KonvaMarkup.d.ts +63 -0
  103. package/lib/Viewer/Markup/Impl/Konva/MarkupColor.d.ts +19 -0
  104. package/lib/Viewer/Markup/Impl/Visualize/VisualizeMarkup.d.ts +33 -0
  105. package/lib/Viewer/Markup/MarkupFactory.d.ts +7 -0
  106. package/lib/Viewer/Options.d.ts +228 -0
  107. package/lib/Viewer/OptionsEvents.d.ts +26 -0
  108. package/lib/Viewer/Viewer.d.ts +353 -0
  109. package/lib/Viewer/ViewerCommands.d.ts +23 -0
  110. package/lib/Viewer/ViewerEvents.d.ts +601 -0
  111. package/lib/Viewer/utils.d.ts +4 -0
  112. package/lib/index.d.ts +24 -0
  113. package/package.json +32 -0
  114. package/src/Api/Assembly.ts +678 -0
  115. package/src/Api/ClashTest.ts +290 -0
  116. package/src/Api/Client.ts +816 -0
  117. package/src/Api/ClientEvents.ts +31 -0
  118. package/src/Api/File.ts +962 -0
  119. package/src/Api/HttpClient.ts +73 -0
  120. package/src/Api/IAssembly.ts +37 -0
  121. package/src/Api/IFile.ts +74 -0
  122. package/src/Api/IHttpClient.ts +50 -0
  123. package/src/Api/IUser.ts +33 -0
  124. package/src/Api/Job.ts +253 -0
  125. package/src/Api/Member.ts +161 -0
  126. package/src/Api/Model.ts +259 -0
  127. package/src/Api/Permission.ts +173 -0
  128. package/src/Api/Project.ts +479 -0
  129. package/src/Api/Role.ts +158 -0
  130. package/src/Api/User.ts +357 -0
  131. package/src/Api/impl/FetchError.ts +48 -0
  132. package/src/Api/impl/Utils.ts +367 -0
  133. package/src/Api/impl/http.ts +92 -0
  134. package/src/ConvetMath.ts +372 -0
  135. package/src/Viewer/CanvasEvents.ts +41 -0
  136. package/src/Viewer/Commands/ApplyModelTransform.ts +70 -0
  137. package/src/Viewer/Commands/ClearMarkup.ts +28 -0
  138. package/src/Viewer/Commands/ClearSlices.ts +27 -0
  139. package/src/Viewer/Commands/CreatePreview.ts +33 -0
  140. package/src/Viewer/Commands/Explode.ts +38 -0
  141. package/src/Viewer/Commands/GetDefaultViewPositions.ts +36 -0
  142. package/src/Viewer/Commands/GetModels.ts +43 -0
  143. package/src/Viewer/Commands/GetSelected.ts +58 -0
  144. package/src/Viewer/Commands/HideSelected.ts +37 -0
  145. package/src/Viewer/Commands/IsolateSelected.ts +37 -0
  146. package/src/Viewer/Commands/RegenerateAll.ts +37 -0
  147. package/src/Viewer/Commands/ResetView.ts +43 -0
  148. package/src/Viewer/Commands/SelectModel.ts +52 -0
  149. package/src/Viewer/Commands/SetActiveDragger.ts +29 -0
  150. package/src/Viewer/Commands/SetDefaultViewPosition.ts +50 -0
  151. package/src/Viewer/Commands/SetMarkupColor.ts +29 -0
  152. package/src/Viewer/Commands/SetSelected.ts +47 -0
  153. package/src/Viewer/Commands/ShowAll.ts +37 -0
  154. package/src/Viewer/Commands/Unselect.ts +37 -0
  155. package/src/Viewer/Commands/ZoomToExtents.ts +43 -0
  156. package/src/Viewer/Commands/ZoomToObjects.ts +47 -0
  157. package/src/Viewer/Commands/ZoomToSelected.ts +39 -0
  158. package/src/Viewer/Commands.ts +81 -0
  159. package/src/Viewer/Draggers/Actions/OrbitAction.ts +250 -0
  160. package/src/Viewer/Draggers/Actions/PanAction.ts +102 -0
  161. package/src/Viewer/Draggers/Actions/ZoomAction.ts +45 -0
  162. package/src/Viewer/Draggers/Common/Geometry.ts +152 -0
  163. package/src/Viewer/Draggers/Common/GestureManager.ts +263 -0
  164. package/src/Viewer/Draggers/Common/OdBaseDragger.ts +270 -0
  165. package/src/Viewer/Draggers/Common/OdaGeAction.ts +146 -0
  166. package/src/Viewer/Draggers/MeasureLineDragger/MeasureLineItem.ts +248 -0
  167. package/src/Viewer/Draggers/MeasureLineDragger/MeasureUtils.ts +182 -0
  168. package/src/Viewer/Draggers/MeasureLineDragger/index.ts +166 -0
  169. package/src/Viewer/Draggers/OdBaseCuttingPlaneDragger.ts +182 -0
  170. package/src/Viewer/Draggers/OdCuttingPlaneXAxisDragger.ts +53 -0
  171. package/src/Viewer/Draggers/OdCuttingPlaneYAxisDragger.ts +53 -0
  172. package/src/Viewer/Draggers/OdCuttingPlaneZAxisDragger.ts +53 -0
  173. package/src/Viewer/Draggers/OdOrbitDragger.ts +70 -0
  174. package/src/Viewer/Draggers/OdPanDragger.ts +62 -0
  175. package/src/Viewer/Draggers/OdZoomDragger.ts +59 -0
  176. package/src/Viewer/Draggers/OdZoomWheelDragger.ts +103 -0
  177. package/src/Viewer/Draggers/OdZoomWindowDragger/OdSelectionFrame.ts +123 -0
  178. package/src/Viewer/Draggers/OdZoomWindowDragger/index.ts +75 -0
  179. package/src/Viewer/Draggers/OdaLineDragger.ts +80 -0
  180. package/src/Viewer/Draggers/OdaTextDragger.ts +118 -0
  181. package/src/Viewer/Draggers/OdaWalkDragger.ts +278 -0
  182. package/src/Viewer/Draggers/OrbitAroundBuildingDragger.ts +184 -0
  183. package/src/Viewer/EventEmitter2.ts +116 -0
  184. package/src/Viewer/ICommands.ts +53 -0
  185. package/src/Viewer/IEventEmitter2.ts +36 -0
  186. package/src/Viewer/IViewer.ts +55 -0
  187. package/src/Viewer/Loaders/BaseLoader.ts +40 -0
  188. package/src/Viewer/Loaders/LoaderFactory.ts +44 -0
  189. package/src/Viewer/Loaders/TCSLoader.ts +82 -0
  190. package/src/Viewer/Loaders/UpdaterController.ts +36 -0
  191. package/src/Viewer/Loaders/VsfXLoader.ts +87 -0
  192. package/src/Viewer/Loaders/VsfXPartialLoader.ts +208 -0
  193. package/src/Viewer/Markup/Api/IMarkupArrow.ts +15 -0
  194. package/src/Viewer/Markup/Api/IMarkupColorable.ts +4 -0
  195. package/src/Viewer/Markup/Api/IMarkupEllipse.ts +15 -0
  196. package/src/Viewer/Markup/Api/IMarkupImage.ts +15 -0
  197. package/src/Viewer/Markup/Api/IMarkupLine.ts +10 -0
  198. package/src/Viewer/Markup/Api/IMarkupObject.ts +15 -0
  199. package/src/Viewer/Markup/Api/IMarkupRectangle.ts +15 -0
  200. package/src/Viewer/Markup/Api/IMarkupText.ts +12 -0
  201. package/src/Viewer/Markup/Api/Impl/Konva/KonvaArrow.ts +119 -0
  202. package/src/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.ts +113 -0
  203. package/src/Viewer/Markup/Api/Impl/Konva/KonvaImage.ts +121 -0
  204. package/src/Viewer/Markup/Api/Impl/Konva/KonvaLine.ts +99 -0
  205. package/src/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.ts +113 -0
  206. package/src/Viewer/Markup/Api/Impl/Konva/KonvaText.ts +104 -0
  207. package/src/Viewer/Markup/IMarkup.ts +39 -0
  208. package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +872 -0
  209. package/src/Viewer/Markup/Impl/Konva/MarkupColor.ts +39 -0
  210. package/src/Viewer/Markup/Impl/Visualize/VisualizeMarkup.ts +273 -0
  211. package/src/Viewer/Markup/MarkupFactory.ts +32 -0
  212. package/src/Viewer/Options.ts +502 -0
  213. package/src/Viewer/OptionsEvents.ts +28 -0
  214. package/src/Viewer/Viewer.ts +1109 -0
  215. package/src/Viewer/ViewerCommands.ts +45 -0
  216. package/src/Viewer/ViewerEvents.ts +700 -0
  217. package/src/Viewer/utils.ts +74 -0
  218. package/src/index.ts +48 -0
@@ -0,0 +1,19 @@
1
+ export declare class MarkupColor {
2
+ R: number;
3
+ G: number;
4
+ B: number;
5
+ private _hex;
6
+ /**
7
+ * Color in #000000 format
8
+ */
9
+ get HexColor(): string;
10
+ get RGB(): {
11
+ r: number;
12
+ g: number;
13
+ b: number;
14
+ };
15
+ constructor(r: number, g: number, b: number);
16
+ setColor(r: number, g: number, b: number): void;
17
+ private rgbToHex;
18
+ }
19
+ //# sourceMappingURL=MarkupColor.d.ts.map
@@ -0,0 +1,33 @@
1
+ import { IMarkup } from "../../IMarkup";
2
+ import { Viewer } from "../../../Viewer";
3
+ import { OdBaseDragger } from "../../../Draggers/Common/OdBaseDragger";
4
+ import { IMarkupObject } from "../../Api/IMarkupObject";
5
+ export declare class VisualizeMarkup implements IMarkup {
6
+ private _viewer;
7
+ protected _markupColor: {
8
+ r: number;
9
+ g: number;
10
+ b: number;
11
+ };
12
+ lineWidth: number;
13
+ initialize(viewer: Viewer, canvas: HTMLCanvasElement, canvasEvents: string[]): void;
14
+ dispose(): void;
15
+ getDraggers(): Map<string, typeof OdBaseDragger>;
16
+ clearOverlay(): void;
17
+ getMarkupColor(): {
18
+ r: number;
19
+ g: number;
20
+ b: number;
21
+ };
22
+ setMarkupColor(r: number, g: number, b: number): void;
23
+ colorizeAllMarkup(r?: number, g?: number, b?: number): void;
24
+ drawViewpoint(viewpoint: any): void;
25
+ createViewpoint(): object;
26
+ getLayer(): any;
27
+ createObject(type: string, params: any): IMarkupObject;
28
+ getObjects(): IMarkupObject[];
29
+ getSelectedObjects(): IMarkupObject[];
30
+ selectObjects(objects: IMarkupObject[]): void;
31
+ clearSelected(): void;
32
+ }
33
+ //# sourceMappingURL=VisualizeMarkup.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { IMarkup, MarkupType } from "./IMarkup";
2
+ export declare class MarkupFactory {
3
+ static createMarkup(markupType: MarkupType): IMarkup;
4
+ private static createKonva;
5
+ private static createVisualize;
6
+ }
7
+ //# sourceMappingURL=MarkupFactory.d.ts.map
@@ -0,0 +1,228 @@
1
+ import { EventEmitter2 } from "./EventEmitter2";
2
+ export interface RGB {
3
+ red: number;
4
+ green: number;
5
+ blue: number;
6
+ }
7
+ /**
8
+ * `VisualizeJS` parameters.
9
+ */
10
+ export interface OptionsData {
11
+ /**
12
+ * Show WCS
13
+ *
14
+ * @defaultValue true
15
+ */
16
+ showWCS?: boolean;
17
+ /**
18
+ * Enable camera animation
19
+ *
20
+ * @defaultValue true
21
+ */
22
+ cameraAnimation?: boolean;
23
+ /**
24
+ * Enable antialiasing use FXAA
25
+ *
26
+ * @defaultValue true
27
+ */
28
+ antialiasing?: boolean;
29
+ /**
30
+ * Enable ground shadows
31
+ *
32
+ * @defaultValue false
33
+ */
34
+ groundShadow?: boolean;
35
+ /**
36
+ * Enable shadows
37
+ *
38
+ * @defaultValue false
39
+ */
40
+ shadows?: boolean;
41
+ /**
42
+ * Camera speed on X axis
43
+ *
44
+ * @defaultValue 4
45
+ */
46
+ cameraAxisXSpeed?: number;
47
+ /**
48
+ * Camera speed on Y axis
49
+ *
50
+ * @defaultValue 1
51
+ */
52
+ cameraAxisYSpeed?: number;
53
+ /**
54
+ * Ambient occlusion
55
+ *
56
+ * @defaultValue false
57
+ */
58
+ ambientOcclusion?: boolean;
59
+ /**
60
+ * Enable partial load mode to be able open large drawing If enablePartialMode enabled, then
61
+ * sceneGraph will be switched off
62
+ *
63
+ * @defaultValue false
64
+ */
65
+ enablePartialMode?: boolean;
66
+ /**
67
+ * The size of the memory buffer that the Viewer can use for graphics data
68
+ *
69
+ * @defaultValue 3294967296
70
+ */
71
+ memoryLimit?: number;
72
+ /**
73
+ * Cutting plane fill color
74
+ *
75
+ * @defaultValue { red: 0xff, green: 0x98, blue: 0x00 }
76
+ */
77
+ cuttingPlaneFillColor?: RGB;
78
+ /**
79
+ * Outline edges color in RGB format.
80
+ */
81
+ edgesColor?: {
82
+ r: number;
83
+ g: number;
84
+ b: number;
85
+ };
86
+ /**
87
+ * Faces color in the RGB format.
88
+ */
89
+ facesColor?: {
90
+ r: number;
91
+ g: number;
92
+ b: number;
93
+ };
94
+ /**
95
+ * Show or hide edges.
96
+ */
97
+ edgesVisibility?: boolean;
98
+ /**
99
+ * Show edges over drawing.
100
+ */
101
+ edgesOverlap?: boolean;
102
+ /**
103
+ * Show faces over drawing.
104
+ */
105
+ facesOverlap?: boolean;
106
+ /**
107
+ * Faces transparency value from 0 to 255.
108
+ */
109
+ facesTransparancy?: number;
110
+ /**
111
+ * Enable custom highlight settings.
112
+ */
113
+ enableCustomHighlight?: boolean;
114
+ /**
115
+ * Enable or disable scene graph, it increases perfomance improvement, but consumes memory
116
+ * Large drawings can take up a lot of memory. If sceneGraph enabled, then enablePartialMode
117
+ * will be switched off
118
+ */
119
+ sceneGraph: boolean;
120
+ /**
121
+ * Edge display models. No edges is usefull for less memory consumption: `false` - no edges
122
+ * are displayed, `true` - display isolines.
123
+ */
124
+ edgeModel: boolean;
125
+ /**
126
+ * Reverse the mouse wheel direction for zooming: false - moving the wheel up zooms in,
127
+ * moving down zooms out, `true` - moving the wheel up zooms out, moving down zooms in.
128
+ */
129
+ reverseZoomWheel: boolean;
130
+ /**
131
+ * Enable mouse wheel zooming.
132
+ */
133
+ enableZoomWheel: boolean;
134
+ /**
135
+ * Enable touch gestures. This option will be ignored when enableZoomWheel is disabled, since
136
+ * gestures contains touch zoom.
137
+ */
138
+ enableGestures: boolean;
139
+ /**
140
+ * Default file geometry data type. Can be one of:
141
+ *
142
+ * - `vsfx` - `VSFX` (default), for opening a file in `VisualizeJS` viewer.
143
+ * - `gltf` - `glTF`, for opening a file in `Three.js` viewer.
144
+ */
145
+ geometryType?: string;
146
+ }
147
+ export declare class Options {
148
+ protected _emitter?: EventEmitter2;
149
+ protected _data: OptionsData;
150
+ constructor(emitter?: EventEmitter2);
151
+ static defaults(): OptionsData;
152
+ notifierChangeEvent(): void;
153
+ saveToStorage(): void;
154
+ loadFromStorage(): void;
155
+ /**
156
+ * Reset options to default
157
+ *
158
+ * @param fields - Name of fields to be reset
159
+ */
160
+ resetToDefaults(fields?: string[]): void;
161
+ get data(): OptionsData;
162
+ set data(value: OptionsData);
163
+ get showWCS(): boolean;
164
+ set showWCS(value: boolean);
165
+ get cameraAnimation(): boolean;
166
+ set cameraAnimation(value: boolean);
167
+ get antialiasing(): boolean;
168
+ set antialiasing(value: boolean);
169
+ get groundShadow(): boolean;
170
+ set groundShadow(value: boolean);
171
+ get shadows(): boolean;
172
+ set shadows(value: boolean);
173
+ get cameraAxisXSpeed(): number;
174
+ set cameraAxisXSpeed(value: number);
175
+ get cameraAxisYSpeed(): number;
176
+ set cameraAxisYSpeed(value: number);
177
+ get ambientOcclusion(): boolean;
178
+ set ambientOcclusion(value: boolean);
179
+ get enablePartialMode(): boolean;
180
+ set enablePartialMode(value: boolean);
181
+ get memoryLimit(): number;
182
+ set memoryLimit(value: number);
183
+ get cuttingPlaneFillColor(): RGB;
184
+ set cuttingPlaneFillColor(value: RGB);
185
+ get edgesColor(): {
186
+ r: number;
187
+ g: number;
188
+ b: number;
189
+ };
190
+ set edgesColor(value: {
191
+ r: number;
192
+ g: number;
193
+ b: number;
194
+ });
195
+ get facesColor(): {
196
+ r: number;
197
+ g: number;
198
+ b: number;
199
+ };
200
+ set facesColor(value: {
201
+ r: number;
202
+ g: number;
203
+ b: number;
204
+ });
205
+ get edgesVisibility(): boolean;
206
+ set edgesVisibility(value: boolean);
207
+ get edgesOverlap(): boolean;
208
+ set edgesOverlap(value: boolean);
209
+ get facesOverlap(): boolean;
210
+ set facesOverlap(value: boolean);
211
+ get facesTransparancy(): number;
212
+ set facesTransparancy(value: number);
213
+ get enableCustomHighlight(): boolean;
214
+ set enableCustomHighlight(value: boolean);
215
+ get sceneGraph(): boolean;
216
+ set sceneGraph(value: boolean);
217
+ get edgeModel(): boolean;
218
+ set edgeModel(value: boolean);
219
+ get reverseZoomWheel(): boolean;
220
+ set reverseZoomWheel(value: boolean);
221
+ get enableZoomWheel(): boolean;
222
+ set enableZoomWheel(value: boolean);
223
+ get enableGestures(): boolean;
224
+ set enableGestures(value: boolean);
225
+ get geometryType(): string;
226
+ set geometryType(value: string);
227
+ }
228
+ //# sourceMappingURL=Options.d.ts.map
@@ -0,0 +1,26 @@
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
+ }
26
+ //# sourceMappingURL=OptionsEvents.d.ts.map
@@ -0,0 +1,353 @@
1
+ import { IViewer } from "./IViewer";
2
+ import { EventEmitter2 } from "./EventEmitter2";
3
+ import { ViewerEventMap } from "./ViewerEvents";
4
+ import { OptionsEventMap } from "./OptionsEvents";
5
+ import { OdBaseDragger } from "./Draggers/Common/OdBaseDragger";
6
+ import { Client } from "../Api/Client";
7
+ import { File } from "../Api/File";
8
+ import { Assembly } from "../Api/Assembly";
9
+ import { Model } from "../Api/Model";
10
+ import { Options, OptionsData } from "./Options";
11
+ import { IMarkup, MarkupType } from "./Markup/IMarkup";
12
+ /**
13
+ * The `Client.js` library class that provides methods to integrate with the
14
+ * [VisualizeJS](https://cloud.opendesign.com/docs/index.html#/visualizejs) library.
15
+ */
16
+ export declare class Viewer extends EventEmitter2<ViewerEventMap & OptionsEventMap> implements IViewer {
17
+ private _activeDragger;
18
+ private _zoomWheelDragger;
19
+ private _gestureManager;
20
+ private _enableAutoUpdate;
21
+ private _isNeedRender;
22
+ private _isRunAsyncUpdate;
23
+ private _renderTime;
24
+ protected _options: Options;
25
+ protected _visualizeJsUrl: string;
26
+ protected _abortControllerForReferences: AbortController | undefined;
27
+ private clientoptionschange;
28
+ private canvaseventlistener;
29
+ draggerFactory: Map<string, typeof OdBaseDragger>;
30
+ canvasEvents: string[];
31
+ private frameId;
32
+ private _resizeObserver;
33
+ canvas: HTMLCanvasElement | undefined;
34
+ markup: IMarkup;
35
+ visualizeJs: any;
36
+ _abortController: AbortController | undefined;
37
+ _abortControllerForRequestMap: Map<string, AbortController> | undefined;
38
+ client: Client;
39
+ /**
40
+ * @param client - The `Client` instance that provides access to a server. Do not specify
41
+ * `Client` if you need a standalone viewer instance without access to server models.
42
+ * @param params - An object containing viewer configuration parameters.
43
+ * @param params.visualizeJsUrl - `VisualizeJS` library URL. Set this URL to use your own
44
+ * library instance, or leave it undefined or blank to use the default URL defined by
45
+ * `Client.js` you are using.
46
+ *
47
+ * _Note: Your own `VisualizeJS` library version must match the version of the `Client.js`
48
+ * you are using._
49
+ * @param params.enableAutoUpdate - Enable auto-update of the viewer after any changes. If
50
+ * the auto-update is disabled, you need to update the `VisualizeJS` viewer and the active
51
+ * dragger manually using the `update` event. Default is `true`.
52
+ */
53
+ constructor(client?: Client, params?: {
54
+ visualizeJsUrl?: string;
55
+ enableAutoUpdate?: boolean;
56
+ markupType?: MarkupType;
57
+ });
58
+ /**
59
+ * `VisualizeJS` parameters.
60
+ *
61
+ * Use this only for standalone viewer instances. Use {@link Client#options | Client.options}
62
+ * instead if the viewer was created with a `Client` reference using
63
+ * {@link Viewer | Viewer.create(client)}. Changes in client options will be automatically
64
+ * applied to the viewer options.
65
+ */
66
+ get options(): Options;
67
+ /**
68
+ * `VisualizeJS` library URL. Use {@link Viewer#configure | configure()} to change library URL.
69
+ *
70
+ * @readonly
71
+ */
72
+ get visualizeJsUrl(): string;
73
+ /**
74
+ * Change the viewer configuration parameters.
75
+ *
76
+ * @param params - An object containing new configuration parameters.
77
+ * @param params.visualizeJsUrl - `VisualizeJS` library URL. Set this URL to use your own
78
+ * library instance or leave it blank to use the default URL defined by `Client.js`.
79
+ */
80
+ configure(params: {
81
+ visualizeJsUrl?: string;
82
+ }): this;
83
+ /**
84
+ * A [Viewer]{@link Viewer} event measuring progress of loading a `VisualizeJS` library.
85
+ *
86
+ * @property {string} type - `visualizeprogress`
87
+ * @property {number} loaded - A 64-bit unsigned integer value indicating the amount of work
88
+ * already performed by the underlying process. The ratio of work done can be calculated by
89
+ * dividing total by the value of this property.
90
+ * @property {number} total - A 64-bit unsigned integer representing the total amount of work
91
+ * that the underlying process is in the progress of performing.
92
+ * @event visualizeprogress
93
+ */
94
+ /**
95
+ * Load `VisualizeJS` module and initialize it with the specified canvas. Call
96
+ * {@link Viewer#dispose | dispose()} to release allocated resources.
97
+ *
98
+ * @async
99
+ * @param canvas - HTML `<canvas>` element for `VisualizeJS`.
100
+ * @param onProgress - A callback function that handles events measuring progress of loading
101
+ * of the `VisualizeJS` library. Retrieves {@link event:visualizeprogress | visualizeprogress} event.
102
+ */
103
+ initialize(canvas: HTMLCanvasElement, onProgress?: (event: ProgressEvent) => void): Promise<this>;
104
+ /**
105
+ * Releases all resources allocated by this `Viewer` instance. Call this method before
106
+ * release the `Viewer` instance.
107
+ */
108
+ dispose(): this;
109
+ /**
110
+ * Returns `true` if `VisualizeJS` module has been loaded andinitialized.
111
+ */
112
+ isInitialized(): boolean;
113
+ private render;
114
+ resize(): this;
115
+ /**
116
+ * Updates the viewer. Do nothing if the auto-update mode is disabled in the constructor (use
117
+ * the `update` event to update viewer manually).
118
+ *
119
+ * Fires:
120
+ *
121
+ * - {@link UpdateEvent | update}
122
+ *
123
+ * @param force - If `true` updates the viewer immidietly. Otherwise updates on next
124
+ * animation frame. Default is `false`.
125
+ */
126
+ update(force?: boolean): void;
127
+ /**
128
+ * Update with internal schedule, need after change operation when have long update for
129
+ * update without lock UI
130
+ *
131
+ * @param maxScheduleUpdateTimeInMs - Maximum time for one update, by default 30 ms
132
+ * @param maxScheduleUpdateCount - Maximum count of schedule update
133
+ * @returns return void Promise
134
+ */
135
+ private scheduleUpdateAsync;
136
+ updateAsync(maxScheduleUpdateTimeInMs?: number, maxScheduleUpdateCount?: number): Promise<void>;
137
+ /**
138
+ * Returns `VisualizeJS`
139
+ * {@link https://cloud.opendesign.com/docs/index.html#/visualizejs_api | module} instance.
140
+ */
141
+ visLib(): any;
142
+ /**
143
+ * Returns `VisualizeJS`
144
+ * {@link https://cloud.opendesign.com/docs/index.html#/vis/Viewer | Viewer} instance.
145
+ */
146
+ visViewer(): any;
147
+ syncOpenCloudVisualStyle(isInitializing: boolean): this;
148
+ syncOptions(options?: OptionsData): this;
149
+ syncHighlightingOptions(options?: OptionsData): this;
150
+ /**
151
+ * List of names of available draggers:
152
+ *
153
+ * - `Line`
154
+ * - `Text`
155
+ * - `Pan`
156
+ * - `Orbit`
157
+ * - `Zoom`
158
+ * - `ZoomWindow`
159
+ * - `OrbitAroundBuilding`
160
+ * - `MeasureLine`
161
+ * - `CuttingPlaneXAxis`
162
+ * - `CuttingPlaneYAxis`
163
+ * - `CuttingPlaneZAxis`
164
+ * - `Walk`
165
+ *
166
+ * @readonly
167
+ */
168
+ get draggers(): string[];
169
+ /**
170
+ * Register dragger on draggerFactory.
171
+ *
172
+ * @param name - Dragger name.
173
+ * @param dragger - Dragger class.
174
+ */
175
+ registerDragger(name: string, dragger: typeof OdBaseDragger): void;
176
+ /**
177
+ * Returns active dragger instance or `null` if there is no active dragger.
178
+ */
179
+ activeDragger(): any | null;
180
+ /**
181
+ * Set active dragger. `Viewer` must be {@link Viewer#initialize | initialized} before enable
182
+ * dragger or exception is thrown.
183
+ *
184
+ * Fires:
185
+ *
186
+ * - {@link ChangeActiveDragger | changeactivedragger}
187
+ *
188
+ * @param name - Dragger name. Can be one of the {@link Viewer#draggers | draggers} list.
189
+ * @returns Returns active dragger instance or `null` if there is no dragger with the given name.
190
+ */
191
+ setActiveDragger(name: string): OdBaseDragger | null;
192
+ /**
193
+ * Reset the state of the active dragger.
194
+ */
195
+ resetActiveDragger(): void;
196
+ /**
197
+ * Remove all cutting planes.
198
+ */
199
+ clearSlices(): void;
200
+ /**
201
+ * Remove markup overlay.
202
+ */
203
+ clearOverlay(): void;
204
+ /**
205
+ * Synchronize markup overlay.
206
+ */
207
+ syncOverlay(): any;
208
+ /**
209
+ * Returns `true` if current drawing is 3D drawing.
210
+ */
211
+ is3D(): boolean;
212
+ /**
213
+ * Returns a list of original handles for the selected entities.
214
+ */
215
+ getSelected(): string[];
216
+ /**
217
+ * Select model entities by original handles that are obtained using
218
+ * {@link File.getProperties | File.getProperties()} or
219
+ * {@link File.searchProperties | File.searchProperties()} methods.
220
+ *
221
+ * Fires:
222
+ *
223
+ * - {@link SelectEvent | select}
224
+ *
225
+ * @param handles - The list of original handles.
226
+ */
227
+ setSelected(handles?: string[]): void;
228
+ /**
229
+ * Load model references into the viewer. References are images, fonts, or any other files to
230
+ * correct rendering of the model.
231
+ *
232
+ * @async
233
+ * @param model - Instance of model with references. If a `File` instance is specified
234
+ * instead of a model, the file references will be loaded.
235
+ */
236
+ loadReferences(model: Model | File | Assembly): Promise<this>;
237
+ applyModelTransformMatrix(model: Model | Assembly): void;
238
+ applySceneGraphSettings(options?: Options): void;
239
+ /**
240
+ * Loads a model of a file or assembly into the viewer.
241
+ *
242
+ * This method requires a [Client]{@link Client | Client} instance to work. For standalone
243
+ * viewer instance use {@link Viewer#openVsfFile | openVsfFile()} or
244
+ * {@link Viewer#openVsfxFile | openVsfxFile()}.
245
+ *
246
+ * Fires:
247
+ *
248
+ * - {@link OpenEvent | open}
249
+ * - {@link GeometryStartEvent | geometrystart}
250
+ * - {@link GeometryProgressEvent | geometryprogress}
251
+ * - {@link DatabaseChunkEvent | databasechunk}
252
+ * - {@link GeometryChunkEvent | geometrychunk}
253
+ * - {@link GeometryEndEvent | geometryend}
254
+ * - {@link GeometryErrorEvent | geometryerror}
255
+ *
256
+ * @async
257
+ * @param model - Model instance to load. If a `File` instance with multiple models is
258
+ * specified, the default model will be loaded. If there is no default model, first
259
+ * availiable model will be loaded.
260
+ */
261
+ open(model: Model | File | Assembly): Promise<this>;
262
+ /**
263
+ * Loads a VSF file into the viewer.
264
+ *
265
+ * Fires:
266
+ *
267
+ * - {@link OpenEvent | open}
268
+ * - {@link GeometryStartEvent | geometrystart}
269
+ * - {@link GeometryProgressEvent | geometryprogress}
270
+ * - {@link DatabaseChunkEvent | databasechunk}
271
+ * - {@link GeometryEndEvent | geometryend}
272
+ * - {@link GeometryErrorEvent | geometryerror}
273
+ *
274
+ * @param buffer - Binary data buffer to load.
275
+ */
276
+ openVsfFile(buffer: Uint8Array | ArrayBuffer): this;
277
+ /**
278
+ * Loads a VSFX file into the viewer.
279
+ *
280
+ * Fires:
281
+ *
282
+ * - {@link OpenEvent | open}
283
+ * - {@link GeometryStartEvent | geometrystart}
284
+ * - {@link GeometryProgressEvent | geometryprogress}
285
+ * - {@link DatabaseChunkEvent | databasechunk}
286
+ * - {@link GeometryEndEvent | geometryend}
287
+ * - {@link GeometryErrorEvent | geometryerror}
288
+ *
289
+ * @param buffer - Binary data buffer to load.
290
+ */
291
+ openVsfxFile(buffer: Uint8Array | ArrayBuffer): this;
292
+ /**
293
+ * Cancels asynchronous model loading started by {@link Viewer#open | open()}.
294
+ */
295
+ cancel(): this;
296
+ /**
297
+ * Unloads the model and clears the viewer.
298
+ */
299
+ clear(): this;
300
+ /**
301
+ * Get markup color.
302
+ *
303
+ * @returns Color with `RGB` values.
304
+ */
305
+ getMarkupColor(): {
306
+ r: number;
307
+ g: number;
308
+ b: number;
309
+ };
310
+ /**
311
+ * Set markup color.
312
+ *
313
+ * @param r - `Red` part of color.
314
+ * @param g - `Green` part of color.
315
+ * @param b - `Blue` part of color.
316
+ */
317
+ setMarkupColor(r?: number, g?: number, b?: number): void;
318
+ /**
319
+ * Colorize all markup entities with the specified color.
320
+ *
321
+ * @param r - `Red` part of color.
322
+ * @param g - `Green` part of color.
323
+ * @param b - `Blue` part of color.
324
+ */
325
+ colorizeAllMarkup(r?: number, g?: number, b?: number): void;
326
+ /**
327
+ * Add an empty markup entity to the overlay.
328
+ */
329
+ addMarkupEntity(entityName: string): any;
330
+ /**
331
+ * Draw a viewpoint. To get a list of available model viewpoints, use the
332
+ * {@link Model#getViewpoints | Model.getViewpoints()} or
333
+ * {@link File#getViewpoints | File.getViewpoints()}.
334
+ *
335
+ * @param viewpoint - Viewpoint.
336
+ */
337
+ drawViewpoint(viewpoint: any): void;
338
+ /**
339
+ * Create a viewpoint. To add a viewpoint to the list of model viewpoints, use the
340
+ * {@link Model#saveViewpoint | Model.saveViewpoint()} or
341
+ * {@link File#saveViewpoint | File.saveViewpoint()}.
342
+ */
343
+ createViewpoint(): object;
344
+ /**
345
+ * Executes the command denoted by the given command identifier.
346
+ *
347
+ * @param id - Identifier of the command to execute.
348
+ * @param args - Parameters passed to the command function.
349
+ * @returns A returned value of the given command. Returns `undefined` when the command doesn't exists.
350
+ */
351
+ executeCommand(id: string, ...args: any[]): any;
352
+ }
353
+ //# sourceMappingURL=Viewer.d.ts.map
@@ -0,0 +1,23 @@
1
+ import "./Commands/ApplyModelTransform";
2
+ import "./Commands/ClearMarkup";
3
+ import "./Commands/ClearSlices";
4
+ import "./Commands/CreatePreview";
5
+ import "./Commands/Explode";
6
+ import "./Commands/GetDefaultViewPositions";
7
+ import "./Commands/GetModels";
8
+ import "./Commands/GetSelected";
9
+ import "./Commands/HideSelected";
10
+ import "./Commands/IsolateSelected";
11
+ import "./Commands/RegenerateAll";
12
+ import "./Commands/ResetView";
13
+ import "./Commands/SelectModel";
14
+ import "./Commands/SetActiveDragger";
15
+ import "./Commands/SetDefaultViewPosition";
16
+ import "./Commands/SetMarkupColor";
17
+ import "./Commands/SetSelected";
18
+ import "./Commands/ShowAll";
19
+ import "./Commands/Unselect";
20
+ import "./Commands/ZoomToExtents";
21
+ import "./Commands/ZoomToObjects";
22
+ import "./Commands/ZoomToSelected";
23
+ //# sourceMappingURL=ViewerCommands.d.ts.map