@inweb/client 25.3.12 → 25.3.15

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 (207) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +26 -41
  3. package/dist/client.js +34 -17365
  4. package/dist/client.js.map +1 -1
  5. package/dist/client.min.js +1 -1
  6. package/dist/client.module.js +9 -5553
  7. package/dist/client.module.js.map +1 -1
  8. package/lib/Api/Assembly.d.ts +0 -1
  9. package/lib/Api/ClashTest.d.ts +0 -1
  10. package/lib/Api/Client.d.ts +1 -2
  11. package/lib/Api/ClientEvents.d.ts +0 -1
  12. package/lib/Api/File.d.ts +0 -1
  13. package/lib/Api/HttpClient.d.ts +0 -1
  14. package/lib/Api/IAssembly.d.ts +0 -1
  15. package/lib/Api/IFile.d.ts +0 -1
  16. package/lib/Api/IHttpClient.d.ts +0 -1
  17. package/lib/Api/IUser.d.ts +0 -1
  18. package/lib/Api/Job.d.ts +0 -1
  19. package/lib/Api/Member.d.ts +0 -1
  20. package/lib/Api/Model.d.ts +14 -1
  21. package/lib/Api/Permission.d.ts +0 -1
  22. package/lib/Api/Project.d.ts +0 -1
  23. package/lib/Api/Role.d.ts +0 -1
  24. package/lib/Api/User.d.ts +0 -1
  25. package/lib/Api/impl/FetchError.d.ts +0 -1
  26. package/lib/Api/impl/Utils.d.ts +0 -1
  27. package/lib/Api/impl/http.d.ts +0 -1
  28. package/lib/ConvetMath.d.ts +0 -1
  29. package/lib/index.d.ts +1 -13
  30. package/package.json +5 -11
  31. package/src/Api/Client.ts +2 -1
  32. package/src/Api/Model.ts +20 -0
  33. package/src/index.ts +1 -13
  34. package/lib/Viewer/CanvasEvents.d.ts +0 -2
  35. package/lib/Viewer/Commands/ApplyModelTransform.d.ts +0 -2
  36. package/lib/Viewer/Commands/ClearMarkup.d.ts +0 -2
  37. package/lib/Viewer/Commands/ClearSlices.d.ts +0 -2
  38. package/lib/Viewer/Commands/CreatePreview.d.ts +0 -2
  39. package/lib/Viewer/Commands/Explode.d.ts +0 -2
  40. package/lib/Viewer/Commands/GetDefaultViewPositions.d.ts +0 -2
  41. package/lib/Viewer/Commands/GetModels.d.ts +0 -2
  42. package/lib/Viewer/Commands/GetSelected.d.ts +0 -2
  43. package/lib/Viewer/Commands/HideSelected.d.ts +0 -2
  44. package/lib/Viewer/Commands/IsolateSelected.d.ts +0 -2
  45. package/lib/Viewer/Commands/RegenerateAll.d.ts +0 -2
  46. package/lib/Viewer/Commands/ResetView.d.ts +0 -2
  47. package/lib/Viewer/Commands/SelectModel.d.ts +0 -2
  48. package/lib/Viewer/Commands/SetActiveDragger.d.ts +0 -2
  49. package/lib/Viewer/Commands/SetDefaultViewPosition.d.ts +0 -2
  50. package/lib/Viewer/Commands/SetMarkupColor.d.ts +0 -2
  51. package/lib/Viewer/Commands/SetSelected.d.ts +0 -2
  52. package/lib/Viewer/Commands/ShowAll.d.ts +0 -2
  53. package/lib/Viewer/Commands/Unselect.d.ts +0 -2
  54. package/lib/Viewer/Commands/ZoomToExtents.d.ts +0 -2
  55. package/lib/Viewer/Commands/ZoomToObjects.d.ts +0 -2
  56. package/lib/Viewer/Commands/ZoomToSelected.d.ts +0 -2
  57. package/lib/Viewer/Commands.d.ts +0 -3
  58. package/lib/Viewer/Draggers/Actions/OrbitAction.d.ts +0 -22
  59. package/lib/Viewer/Draggers/Actions/PanAction.d.ts +0 -18
  60. package/lib/Viewer/Draggers/Actions/ZoomAction.d.ts +0 -8
  61. package/lib/Viewer/Draggers/Common/Geometry.d.ts +0 -115
  62. package/lib/Viewer/Draggers/Common/GestureManager.d.ts +0 -41
  63. package/lib/Viewer/Draggers/Common/OdBaseDragger.d.ts +0 -54
  64. package/lib/Viewer/Draggers/Common/OdaGeAction.d.ts +0 -30
  65. package/lib/Viewer/Draggers/MeasureLineDragger/MeasureLineItem.d.ts +0 -31
  66. package/lib/Viewer/Draggers/MeasureLineDragger/MeasureUtils.d.ts +0 -20
  67. package/lib/Viewer/Draggers/MeasureLineDragger/index.d.ts +0 -24
  68. package/lib/Viewer/Draggers/OdBaseCuttingPlaneDragger.d.ts +0 -27
  69. package/lib/Viewer/Draggers/OdCuttingPlaneXAxisDragger.d.ts +0 -8
  70. package/lib/Viewer/Draggers/OdCuttingPlaneYAxisDragger.d.ts +0 -8
  71. package/lib/Viewer/Draggers/OdCuttingPlaneZAxisDragger.d.ts +0 -8
  72. package/lib/Viewer/Draggers/OdOrbitDragger.d.ts +0 -15
  73. package/lib/Viewer/Draggers/OdPanDragger.d.ts +0 -12
  74. package/lib/Viewer/Draggers/OdZoomDragger.d.ts +0 -12
  75. package/lib/Viewer/Draggers/OdZoomWheelDragger.d.ts +0 -11
  76. package/lib/Viewer/Draggers/OdZoomWindowDragger/OdSelectionFrame.d.ts +0 -19
  77. package/lib/Viewer/Draggers/OdZoomWindowDragger/index.d.ts +0 -14
  78. package/lib/Viewer/Draggers/OdaLineDragger.d.ts +0 -15
  79. package/lib/Viewer/Draggers/OdaTextDragger.d.ts +0 -16
  80. package/lib/Viewer/Draggers/OdaWalkDragger.d.ts +0 -30
  81. package/lib/Viewer/Draggers/OrbitAroundBuildingDragger.d.ts +0 -19
  82. package/lib/Viewer/EventEmitter2.d.ts +0 -54
  83. package/lib/Viewer/ICommands.d.ts +0 -25
  84. package/lib/Viewer/IEventEmitter2.d.ts +0 -13
  85. package/lib/Viewer/IViewer.d.ts +0 -30
  86. package/lib/Viewer/Loaders/BaseLoader.d.ts +0 -11
  87. package/lib/Viewer/Loaders/LoaderFactory.d.ts +0 -11
  88. package/lib/Viewer/Loaders/TCSLoader.d.ts +0 -5
  89. package/lib/Viewer/Loaders/UpdaterController.d.ts +0 -15
  90. package/lib/Viewer/Loaders/VsfXLoader.d.ts +0 -5
  91. package/lib/Viewer/Loaders/VsfXPartialLoader.d.ts +0 -5
  92. package/lib/Viewer/Loaders/VsfXStreamingLoader.d.ts +0 -5
  93. package/lib/Viewer/Markup/Api/IMarkupArrow.d.ts +0 -22
  94. package/lib/Viewer/Markup/Api/IMarkupCloud.d.ts +0 -15
  95. package/lib/Viewer/Markup/Api/IMarkupColorable.d.ts +0 -5
  96. package/lib/Viewer/Markup/Api/IMarkupEllipse.d.ts +0 -15
  97. package/lib/Viewer/Markup/Api/IMarkupImage.d.ts +0 -15
  98. package/lib/Viewer/Markup/Api/IMarkupLine.d.ts +0 -13
  99. package/lib/Viewer/Markup/Api/IMarkupObject.d.ts +0 -12
  100. package/lib/Viewer/Markup/Api/IMarkupRectangle.d.ts +0 -15
  101. package/lib/Viewer/Markup/Api/IMarkupText.d.ts +0 -13
  102. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaArrow.d.ts +0 -47
  103. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaCloud.d.ts +0 -36
  104. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.d.ts +0 -41
  105. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaImage.d.ts +0 -37
  106. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaLine.d.ts +0 -37
  107. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.d.ts +0 -39
  108. package/lib/Viewer/Markup/Api/Impl/Konva/KonvaText.d.ts +0 -38
  109. package/lib/Viewer/Markup/IMarkup.d.ts +0 -40
  110. package/lib/Viewer/Markup/IViewpoint.d.ts +0 -129
  111. package/lib/Viewer/Markup/Impl/Konva/KonvaMarkup.d.ts +0 -72
  112. package/lib/Viewer/Markup/Impl/Konva/MarkupColor.d.ts +0 -19
  113. package/lib/Viewer/Markup/Impl/Visualize/VisualizeMarkup.d.ts +0 -34
  114. package/lib/Viewer/Markup/MarkupFactory.d.ts +0 -7
  115. package/lib/Viewer/Options.d.ts +0 -239
  116. package/lib/Viewer/OptionsEvents.d.ts +0 -26
  117. package/lib/Viewer/Viewer.d.ts +0 -354
  118. package/lib/Viewer/ViewerCommands.d.ts +0 -23
  119. package/lib/Viewer/ViewerEvents.d.ts +0 -602
  120. package/lib/Viewer/utils.d.ts +0 -4
  121. package/src/Viewer/CanvasEvents.ts +0 -41
  122. package/src/Viewer/Commands/ApplyModelTransform.ts +0 -70
  123. package/src/Viewer/Commands/ClearMarkup.ts +0 -28
  124. package/src/Viewer/Commands/ClearSlices.ts +0 -27
  125. package/src/Viewer/Commands/CreatePreview.ts +0 -33
  126. package/src/Viewer/Commands/Explode.ts +0 -38
  127. package/src/Viewer/Commands/GetDefaultViewPositions.ts +0 -36
  128. package/src/Viewer/Commands/GetModels.ts +0 -43
  129. package/src/Viewer/Commands/GetSelected.ts +0 -58
  130. package/src/Viewer/Commands/HideSelected.ts +0 -37
  131. package/src/Viewer/Commands/IsolateSelected.ts +0 -37
  132. package/src/Viewer/Commands/RegenerateAll.ts +0 -37
  133. package/src/Viewer/Commands/ResetView.ts +0 -43
  134. package/src/Viewer/Commands/SelectModel.ts +0 -52
  135. package/src/Viewer/Commands/SetActiveDragger.ts +0 -29
  136. package/src/Viewer/Commands/SetDefaultViewPosition.ts +0 -50
  137. package/src/Viewer/Commands/SetMarkupColor.ts +0 -29
  138. package/src/Viewer/Commands/SetSelected.ts +0 -47
  139. package/src/Viewer/Commands/ShowAll.ts +0 -37
  140. package/src/Viewer/Commands/Unselect.ts +0 -37
  141. package/src/Viewer/Commands/ZoomToExtents.ts +0 -43
  142. package/src/Viewer/Commands/ZoomToObjects.ts +0 -47
  143. package/src/Viewer/Commands/ZoomToSelected.ts +0 -39
  144. package/src/Viewer/Commands.ts +0 -81
  145. package/src/Viewer/Draggers/Actions/OrbitAction.ts +0 -250
  146. package/src/Viewer/Draggers/Actions/PanAction.ts +0 -102
  147. package/src/Viewer/Draggers/Actions/ZoomAction.ts +0 -45
  148. package/src/Viewer/Draggers/Common/Geometry.ts +0 -152
  149. package/src/Viewer/Draggers/Common/GestureManager.ts +0 -263
  150. package/src/Viewer/Draggers/Common/OdBaseDragger.ts +0 -270
  151. package/src/Viewer/Draggers/Common/OdaGeAction.ts +0 -146
  152. package/src/Viewer/Draggers/MeasureLineDragger/MeasureLineItem.ts +0 -248
  153. package/src/Viewer/Draggers/MeasureLineDragger/MeasureUtils.ts +0 -182
  154. package/src/Viewer/Draggers/MeasureLineDragger/index.ts +0 -166
  155. package/src/Viewer/Draggers/OdBaseCuttingPlaneDragger.ts +0 -182
  156. package/src/Viewer/Draggers/OdCuttingPlaneXAxisDragger.ts +0 -53
  157. package/src/Viewer/Draggers/OdCuttingPlaneYAxisDragger.ts +0 -53
  158. package/src/Viewer/Draggers/OdCuttingPlaneZAxisDragger.ts +0 -53
  159. package/src/Viewer/Draggers/OdOrbitDragger.ts +0 -70
  160. package/src/Viewer/Draggers/OdPanDragger.ts +0 -62
  161. package/src/Viewer/Draggers/OdZoomDragger.ts +0 -59
  162. package/src/Viewer/Draggers/OdZoomWheelDragger.ts +0 -103
  163. package/src/Viewer/Draggers/OdZoomWindowDragger/OdSelectionFrame.ts +0 -123
  164. package/src/Viewer/Draggers/OdZoomWindowDragger/index.ts +0 -75
  165. package/src/Viewer/Draggers/OdaLineDragger.ts +0 -80
  166. package/src/Viewer/Draggers/OdaTextDragger.ts +0 -118
  167. package/src/Viewer/Draggers/OdaWalkDragger.ts +0 -278
  168. package/src/Viewer/Draggers/OrbitAroundBuildingDragger.ts +0 -184
  169. package/src/Viewer/EventEmitter2.ts +0 -116
  170. package/src/Viewer/ICommands.ts +0 -53
  171. package/src/Viewer/IEventEmitter2.ts +0 -36
  172. package/src/Viewer/IViewer.ts +0 -59
  173. package/src/Viewer/Loaders/BaseLoader.ts +0 -40
  174. package/src/Viewer/Loaders/LoaderFactory.ts +0 -47
  175. package/src/Viewer/Loaders/TCSLoader.ts +0 -82
  176. package/src/Viewer/Loaders/UpdaterController.ts +0 -36
  177. package/src/Viewer/Loaders/VsfXLoader.ts +0 -65
  178. package/src/Viewer/Loaders/VsfXPartialLoader.ts +0 -208
  179. package/src/Viewer/Loaders/VsfXStreamingLoader.ts +0 -87
  180. package/src/Viewer/Markup/Api/IMarkupArrow.ts +0 -12
  181. package/src/Viewer/Markup/Api/IMarkupCloud.ts +0 -15
  182. package/src/Viewer/Markup/Api/IMarkupColorable.ts +0 -4
  183. package/src/Viewer/Markup/Api/IMarkupEllipse.ts +0 -15
  184. package/src/Viewer/Markup/Api/IMarkupImage.ts +0 -15
  185. package/src/Viewer/Markup/Api/IMarkupLine.ts +0 -13
  186. package/src/Viewer/Markup/Api/IMarkupObject.ts +0 -15
  187. package/src/Viewer/Markup/Api/IMarkupRectangle.ts +0 -15
  188. package/src/Viewer/Markup/Api/IMarkupText.ts +0 -12
  189. package/src/Viewer/Markup/Api/Impl/Konva/KonvaArrow.ts +0 -117
  190. package/src/Viewer/Markup/Api/Impl/Konva/KonvaCloud.ts +0 -208
  191. package/src/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.ts +0 -118
  192. package/src/Viewer/Markup/Api/Impl/Konva/KonvaImage.ts +0 -123
  193. package/src/Viewer/Markup/Api/Impl/Konva/KonvaLine.ts +0 -131
  194. package/src/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.ts +0 -119
  195. package/src/Viewer/Markup/Api/Impl/Konva/KonvaText.ts +0 -110
  196. package/src/Viewer/Markup/IMarkup.ts +0 -41
  197. package/src/Viewer/Markup/IViewpoint.ts +0 -146
  198. package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +0 -1144
  199. package/src/Viewer/Markup/Impl/Konva/MarkupColor.ts +0 -39
  200. package/src/Viewer/Markup/Impl/Visualize/VisualizeMarkup.ts +0 -228
  201. package/src/Viewer/Markup/MarkupFactory.ts +0 -32
  202. package/src/Viewer/Options.ts +0 -527
  203. package/src/Viewer/OptionsEvents.ts +0 -28
  204. package/src/Viewer/Viewer.ts +0 -1182
  205. package/src/Viewer/ViewerCommands.ts +0 -45
  206. package/src/Viewer/ViewerEvents.ts +0 -705
  207. package/src/Viewer/utils.ts +0 -74
@@ -1,53 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
23
- import { Point3d } from "./Common/Geometry";
24
- import { OdBaseCuttingPlaneDragger } from "./OdBaseCuttingPlaneDragger";
25
-
26
- export class OdCuttingPlaneZAxisDragger extends OdBaseCuttingPlaneDragger {
27
- override createNormal(): number[] {
28
- return [0, 0, 1];
29
- }
30
-
31
- override handleDelta(delta: Point3d): Point3d {
32
- delta.x = 0.0;
33
- delta.y = 0.0;
34
- return delta;
35
- }
36
-
37
- override getPlanePreviewCoordinate(): number[] {
38
- return [
39
- this.m_center.x - this.m_size_x,
40
- this.m_center.y - this.m_size_y,
41
- this.m_center.z,
42
- this.m_center.x + this.m_size_x,
43
- this.m_center.y - this.m_size_y,
44
- this.m_center.z,
45
- this.m_center.x + this.m_size_x,
46
- this.m_center.y + this.m_size_y,
47
- this.m_center.z,
48
- this.m_center.x - this.m_size_x,
49
- this.m_center.y + this.m_size_y,
50
- this.m_center.z,
51
- ];
52
- }
53
- }
@@ -1,70 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
23
- /* eslint-disable no-unused-vars */
24
- import { Viewer } from "../Viewer";
25
- import { OrbitAction } from "./Actions/OrbitAction";
26
- import { Point2d } from "./Common/Geometry";
27
- import { OdBaseDragger } from "./Common/OdBaseDragger";
28
-
29
- export class OdOrbitDragger extends OdBaseDragger {
30
- private _orbitAction: OrbitAction;
31
- protected m_viewCenter: any;
32
- protected m_startPoint: Point2d;
33
- protected startCameraParams: any;
34
-
35
- constructor(subject: Viewer) {
36
- super(subject);
37
- this.autoSelect = true;
38
- this.press = false;
39
- this._orbitAction = new OrbitAction(this.m_module, this.subject, this.beginInteractivity, this.endInteractivity);
40
- }
41
-
42
- override start(x: number, y: number): void {
43
- this.press = true;
44
- this._orbitAction.beginAction(x, y);
45
- }
46
-
47
- setDefaultViewParams(): void {
48
- const extView = this.getViewer().getActiveTvExtendedView();
49
- extView.setView(
50
- this.startCameraParams.position,
51
- this.startCameraParams.target,
52
- this.startCameraParams.upVector,
53
- this.startCameraParams.viewFieldWidth,
54
- this.startCameraParams.viewFieldHeight,
55
- this.startCameraParams.perspective
56
- );
57
- extView.delete();
58
- }
59
-
60
- override drag(x: number, y: number, dltX: number, dltY: number): void {
61
- if (this.press) {
62
- this._orbitAction.action(x, y);
63
- }
64
- }
65
-
66
- override end(): void {
67
- this.press = false;
68
- this._orbitAction.endAction();
69
- }
70
- }
@@ -1,62 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
23
- /* eslint-disable no-unused-vars */
24
- import { Viewer } from "../Viewer";
25
- import { PanAction } from "./Actions/PanAction";
26
- import { Point3d } from "./Common/Geometry";
27
- import { OdBaseDragger } from "./Common/OdBaseDragger";
28
-
29
- export class OdPanDragger extends OdBaseDragger {
30
- private _panAction: PanAction;
31
- protected m_start: Point3d;
32
-
33
- constructor(subject: Viewer) {
34
- super(subject);
35
- this.autoSelect = true;
36
- this.press = false;
37
- this._panAction = new PanAction(
38
- this.m_module,
39
- this.subject,
40
- this.beginInteractivity,
41
- this.endInteractivity,
42
- this.getViewParams,
43
- this.setViewParams
44
- );
45
- }
46
-
47
- override start(x: number, y: number): void {
48
- this.press = true;
49
- this._panAction.beginAction(x, y);
50
- }
51
-
52
- override drag(x: number, y: number, dltX: number, dltY: number): void {
53
- if (this.press) {
54
- this._panAction.action(x, y);
55
- }
56
- }
57
-
58
- override end(x: number, y: number): void {
59
- this.press = false;
60
- this._panAction.endAction();
61
- }
62
- }
@@ -1,59 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
23
- /* eslint-disable no-unused-vars */
24
- import { Viewer } from "../Viewer";
25
- import { ZoomAction } from "./Actions/ZoomAction";
26
- import { OdBaseDragger } from "./Common/OdBaseDragger";
27
-
28
- export class OdZoomDragger extends OdBaseDragger {
29
- private _zoomAction: ZoomAction;
30
- protected pressX: number;
31
- protected pressY: number;
32
-
33
- constructor(subject: Viewer) {
34
- super(subject);
35
- this.autoSelect = true;
36
- this.press = false;
37
- this._zoomAction = new ZoomAction(this.m_module, this.subject);
38
- }
39
-
40
- override start(x: number, y: number): void {
41
- this.press = true;
42
- this.pressX = x;
43
- this.pressY = y;
44
- this.beginInteractivity();
45
- }
46
-
47
- override drag(x: number, y: number, dltX: number, dltY: number): void {
48
- if (this.press) {
49
- const ZOOM_SPEED = 0.025;
50
- const zoomFactor = dltY > 0 ? 1 + ZOOM_SPEED : 1 - ZOOM_SPEED;
51
- this._zoomAction.action(this.pressX, this.pressY, zoomFactor);
52
- }
53
- }
54
-
55
- override end(): void {
56
- this.press = false;
57
- this.endInteractivity();
58
- }
59
- }
@@ -1,103 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
23
-
24
- import { Viewer } from "../Viewer";
25
- import { OdBaseDragger } from "./Common/OdBaseDragger";
26
- import { ZoomAction } from "./Actions/ZoomAction";
27
-
28
- const INTERACTIVITY_TIME_OUT = 100;
29
-
30
- export class OdZoomWheelDragger extends OdBaseDragger {
31
- private _zoomAction: ZoomAction;
32
-
33
- private _endInteractivityTimeOutId;
34
-
35
- private _isEnableInteractivityMode: boolean;
36
-
37
- constructor(subject: Viewer) {
38
- super(subject);
39
-
40
- // ignore all events except "wheel" so as not to interfere with other handlers
41
- this.canvasEvents = ["wheel"];
42
- this._zoomAction = new ZoomAction(this.m_module, this.subject);
43
- this._endInteractivityTimeOutId = undefined;
44
- this._isEnableInteractivityMode = false;
45
- }
46
-
47
- wheel(event) {
48
- if (!this.subject.options.enableZoomWheel) {
49
- return;
50
- }
51
-
52
- event = event || window.event;
53
- event.preventDefault();
54
-
55
- const zoomReverse = this.subject.options.reverseZoomWheel ? -1 : 1;
56
- const zoomSpeed = 0.075 * zoomReverse;
57
-
58
- const viewer = this.getViewer();
59
- if (viewer) {
60
- const zoomFactor = event.deltaY > 0 ? 1 + zoomSpeed : 1 - zoomSpeed;
61
-
62
- this._zoomAction.action(
63
- event.offsetX * window.devicePixelRatio,
64
- event.offsetY * window.devicePixelRatio,
65
- zoomFactor
66
- );
67
-
68
- if (!this._isEnableInteractivityMode) {
69
- this._isEnableInteractivityMode = true;
70
- this.beginInteractivity();
71
- }
72
-
73
- if (this._endInteractivityTimeOutId) {
74
- clearTimeout(this._endInteractivityTimeOutId);
75
- }
76
-
77
- if (!this._isEnableInteractivityMode) {
78
- this._isEnableInteractivityMode = true;
79
- this.beginInteractivity();
80
- }
81
-
82
- if (this._endInteractivityTimeOutId) {
83
- clearTimeout(this._endInteractivityTimeOutId);
84
- }
85
-
86
- this.subject.update(true);
87
-
88
- this._endInteractivityTimeOutId = setTimeout(() => {
89
- this._endInteractivityTimeOutId = undefined;
90
- this.endInteractivity();
91
- this._isEnableInteractivityMode = false;
92
- }, INTERACTIVITY_TIME_OUT);
93
- }
94
- }
95
-
96
- override dispose(): void {
97
- if (this._endInteractivityTimeOutId) {
98
- clearTimeout(this._endInteractivityTimeOutId);
99
- this.endInteractivity();
100
- this._isEnableInteractivityMode = false;
101
- }
102
- }
103
- }
@@ -1,123 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
23
- import { Point3d } from "../Common/Geometry";
24
-
25
- export class OdSelectionFrame {
26
- protected m_start: number[];
27
- protected m_end: number[];
28
- protected m_model: any;
29
- protected m_module: any;
30
- protected m_entity: any;
31
- protected m_frame: any;
32
-
33
- constructor() {
34
- this.m_start = [0, 0, 0]; // 0
35
- this.m_end = [0, 0, 0]; // 2
36
-
37
- this.m_model = null;
38
- }
39
-
40
- createPoint3d(): Point3d {
41
- return new this.m_module.Point3d();
42
- }
43
-
44
- init(instance: any, model: any): void {
45
- this.m_module = instance;
46
- this.m_model = model;
47
- }
48
-
49
- getViewer() {
50
- return this.m_module.getViewer();
51
- }
52
-
53
- setValue(value: number[]): void {
54
- this.m_end = value;
55
- this.draw();
56
- }
57
-
58
- setStartPoint(point: number[]): void {
59
- this.m_start = point;
60
- this.m_end = point;
61
- this.draw();
62
- }
63
-
64
- toDoubleArray(points: Point3d[]): number[] {
65
- const p: number[] = [];
66
- for (let i = 0; i < points.length; i++) {
67
- p.push(points[i].x);
68
- p.push(points[i].y);
69
- p.push(points[i].z);
70
- }
71
- return p;
72
- }
73
-
74
- draw(): void {
75
- const view = this.getViewer().activeView;
76
- const viewM = view.viewingMatrix;
77
-
78
- const points = [];
79
- points.push(this.m_start);
80
- points.push(this.createPoint3d());
81
- points.push(this.m_end);
82
- points.push(this.createPoint3d());
83
-
84
- const p0 = this.createPoint3d();
85
- p0.set(this.m_start[0], this.m_start[1], this.m_start[2]);
86
-
87
- const p2 = this.createPoint3d();
88
- p2.set(this.m_end[0], this.m_end[1], this.m_end[2]);
89
-
90
- p0.transformBy(viewM);
91
- p2.transformBy(viewM);
92
-
93
- points[1].x = p0.x;
94
- points[3].x = p2.x;
95
- points[1].y = p2.y;
96
- points[3].y = p0.y;
97
- points[1].z = points[3].z = p2.z;
98
-
99
- const eyeM = view.eyeToWorldMatrix;
100
- points[1].transformBy(eyeM);
101
- points[3].transformBy(eyeM);
102
-
103
- if (!this.m_entity) {
104
- this.m_entity = this.m_model.appendEntity("");
105
- const entityPtr = this.m_entity.openObject();
106
-
107
- entityPtr.setColor(112, 112, 112);
108
- entityPtr.setLineWeight(2);
109
-
110
- this.m_frame = entityPtr.appendPolygon(this.toDoubleArray(points));
111
- entityPtr.delete();
112
- } else {
113
- this.m_frame.openAsPolygon().setPoints(this.toDoubleArray(points));
114
- }
115
- }
116
-
117
- clear(): void {
118
- if (this.m_entity) {
119
- this.m_model.removeEntity(this.m_entity);
120
- this.m_entity = null;
121
- }
122
- }
123
- }
@@ -1,75 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
23
- /* eslint-disable no-unused-vars */
24
-
25
- import { Viewer } from "../../Viewer";
26
- import { OdBaseDragger } from "../Common/OdBaseDragger";
27
- import { OdSelectionFrame } from "./OdSelectionFrame";
28
-
29
- export class OdZoomWindowDragger extends OdBaseDragger {
30
- protected m_frame: any;
31
- protected m_minX: number;
32
- protected m_minY: number;
33
- protected m_maxX: number;
34
- protected m_maxY: number;
35
-
36
- constructor(subject: Viewer) {
37
- super(subject);
38
- this.autoSelect = true;
39
- this.press = false;
40
- this.needInputText = false;
41
-
42
- this.m_frame = new OdSelectionFrame();
43
- this.m_frame.init(this.m_module, this.getModel());
44
- }
45
-
46
- override start(x: number, y: number): void {
47
- this.press = true;
48
- this.m_minX = x;
49
- this.m_minY = y;
50
-
51
- const startPoint = this.screenToWorld(x, y);
52
- this.m_frame.setStartPoint(startPoint);
53
- }
54
-
55
- override drag(x: number, y: number, dltX: number, dltY: number): void {
56
- if (this.press) {
57
- this.m_maxX = x;
58
- this.m_maxY = y;
59
-
60
- const point = this.screenToWorld(x, y);
61
- this.m_frame.setValue(point);
62
- }
63
- }
64
-
65
- override end(x: number, y: number): void {
66
- this.press = false;
67
- this.m_maxX = x;
68
- this.m_maxY = y;
69
-
70
- if (this.m_minX !== this.m_maxX && this.m_minY !== this.m_maxY) {
71
- this.m_frame.clear();
72
- this.getViewer().zoomWindow(this.m_minX, this.m_minY, this.m_maxX, this.m_maxY);
73
- }
74
- }
75
- }
@@ -1,80 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
23
- import { Viewer } from "../Viewer";
24
- import { OdBaseDragger } from "./Common/OdBaseDragger";
25
-
26
- export const MARKUP_ENTITY_LINE = "$MarkupTempEntity_Line";
27
-
28
- export class OdaLineDragger extends OdBaseDragger {
29
- protected entity: any;
30
- protected points: any[];
31
- protected drawPoints: any[];
32
-
33
- constructor(subject: Viewer) {
34
- super(subject);
35
- this.press = false;
36
- }
37
-
38
- override dispose(): void {
39
- super.dispose();
40
- this.end();
41
- this.points = null;
42
- this.drawPoints = null;
43
- }
44
-
45
- override start(x: number, y: number): void {
46
- const point = this.getViewer().screenToWorld(x, y);
47
- this.drawPoints = [point[0], point[1], point[2]];
48
- }
49
-
50
- override drag(x: number, y: number): void {
51
- if (this.isDragging) {
52
- const point = this.getViewer().screenToWorld(x, y);
53
- this.drawPoints.push(point[0], point[1], point[2]);
54
- this._updateFrame();
55
- }
56
- }
57
-
58
- override end(): void {
59
- if (this.entity) {
60
- this.entity.delete();
61
- this.drawPoints = null;
62
- this.entity = null;
63
- }
64
- }
65
-
66
- private _updateFrame(): void {
67
- if (this.entity) {
68
- const model = this.getViewer().getMarkupModel();
69
- model.removeEntity(this.entity);
70
- model.delete();
71
- this.entity.delete();
72
- }
73
-
74
- this.entity = this.getActiveMarkupEntity(MARKUP_ENTITY_LINE);
75
-
76
- const entityPtr = this.entity.openObject();
77
- entityPtr.appendPolyline(this.drawPoints).delete();
78
- entityPtr.delete();
79
- }
80
- }