@procore/bim-webviewer-sdk 16.1.0 → 16.2.0-BIM-4799.0

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 (51) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/Procore.Bim.Webviewer.d.ts +131 -104
  3. package/dist/Procore.Bim.Webviewer.js +1 -1
  4. package/dist/types/src/Webviewer.d.ts +12 -0
  5. package/dist/types/src/api/types/BimObject.d.ts +3 -0
  6. package/dist/types/src/components/CoachmarkManagerComponent/CoachmarkComponent.d.ts +2 -0
  7. package/dist/types/src/components/CoachmarkManagerComponent/CoachmarkManagerComponent.d.ts +9 -0
  8. package/dist/types/src/components/CoachmarkManagerComponent/Coachmarks.d.ts +2 -0
  9. package/dist/types/src/components/Markup/SvgRenderer.d.ts +5 -2
  10. package/dist/types/src/components/Markup/__tests__/fixtures.d.ts +1 -1
  11. package/dist/types/src/components/ShortestDistanceComponent.d.ts +1 -0
  12. package/dist/types/src/components/Tooltip/Tooltip.d.ts +22 -0
  13. package/dist/types/src/components/Tooltip/index.d.ts +1 -0
  14. package/dist/types/src/components/WindowViewPropertiesComponent/WindowViewPropertiesComponent.d.ts +3 -2
  15. package/dist/types/src/components/WindowViewPropertiesComponent/__tests__/formatUoms.test.d.ts +1 -0
  16. package/dist/types/src/components/WindowViewPropertiesComponent/formatUoms.d.ts +3 -0
  17. package/dist/types/src/controllers/RenderController.d.ts +3 -20
  18. package/dist/types/src/controllers/RenderControllerProxy.d.ts +3 -19
  19. package/dist/types/src/controllers/SettingsController.d.ts +2 -0
  20. package/dist/types/src/controllers/ShortestDistanceController.d.ts +2 -2
  21. package/dist/types/src/measuring/MeasureToolUtils.d.ts +11 -3
  22. package/dist/types/src/measuring/PointToPointController.d.ts +7 -6
  23. package/dist/types/src/measuring/PointToPointManager.d.ts +26 -5
  24. package/dist/types/src/measuring/__tests__/PointToPointFixtures.d.ts +165 -6
  25. package/dist/types/src/measuring/createPointToPointManagerDebugGui.d.ts +7 -0
  26. package/dist/types/src/navigation/DefaultControl.d.ts +7 -0
  27. package/dist/types/src/procoregl/MeshTopology/HalfEdge.d.ts +8 -0
  28. package/dist/types/src/procoregl/MeshTopology/MeshTopology.d.ts +6 -3
  29. package/dist/types/src/procoregl/MeshTopology/Position.d.ts +6 -7
  30. package/dist/types/src/procoregl/Models/Models.d.ts +11 -10
  31. package/dist/types/src/pwfreader/PWF.d.ts +2 -2
  32. package/dist/types/src/pwfreader/pwf/{PWFMeshObject.d.ts → MeshObject.d.ts} +4 -3
  33. package/dist/types/src/pwfreader/pwf/MeshnodeObject.d.ts +12 -0
  34. package/dist/types/src/pwfreader/pwf/NodeObject.d.ts +17 -0
  35. package/dist/types/src/pwfreader/shared/Mesh.d.ts +2 -1
  36. package/dist/types/src/pwfreader/shared/MeshServices.d.ts +4 -8
  37. package/dist/types/src/pwfreader/shared/Meshnode.d.ts +2 -12
  38. package/dist/types/src/pwfreader/shared/Node.d.ts +3 -20
  39. package/dist/types/src/pwfreader/streaming/StreamedMeshServices.d.ts +3 -2
  40. package/dist/types/src/pwfreader/streaming/StreamedMeshnode.d.ts +3 -2
  41. package/dist/types/src/sdk.d.ts +3 -1
  42. package/dist/types/src/types/PublicNode.d.ts +2 -2
  43. package/dist/types/src/unit_util.d.ts +46 -0
  44. package/dist/types/src/utils/MathHelper/MathHelper.d.ts +19 -0
  45. package/dist/types/src/utils/MathHelper/__tests__/MathHelper.test.d.ts +1 -0
  46. package/dist/types/src/utils/MathHelper/index.d.ts +1 -0
  47. package/package.json +1 -1
  48. package/dist/types/src/pwfreader/pwf/PWFMeshnodeObject.d.ts +0 -11
  49. package/dist/types/src/pwfreader/pwf/PWFModelObject.d.ts +0 -14
  50. package/dist/types/src/pwfreader/pwf/PWFNodeObject.d.ts +0 -10
  51. /package/dist/types/src/{procoregl/MeshTopology/__tests__/Position.test.d.ts → components/Tooltip/__tests__/Tooltip.test.d.ts} +0 -0
@@ -10,6 +10,7 @@ import type { Viewpoint, Visibility } from './api/types/Viewpoint';
10
10
  import type { CssColor } from './components/Markup/SvgRenderer';
11
11
  import { RenderMode } from './utils/constants';
12
12
  import { PointToPointManager } from './measuring/PointToPointManager';
13
+ import { Uom, DisplayUnit } from './unit_util';
13
14
  export type ResourceDiscriminator = {
14
15
  fileExtractionId: number;
15
16
  } | {
@@ -252,11 +253,22 @@ export declare class Webviewer {
252
253
  removeContextMenuItems: ({ contextMenuItemIds, }: {
253
254
  contextMenuItemIds: string[];
254
255
  }) => void;
256
+ showCoachmark: (params: {
257
+ id: string;
258
+ label: string;
259
+ buttonLabel: string;
260
+ buttonOnClick: () => void;
261
+ tooltipMessage?: string;
262
+ }) => void;
263
+ hideCoachmark: (coachmarkId: string) => void;
255
264
  getSettings: () => {
256
265
  displayUnits: string;
257
266
  };
258
267
  setToolbarHidden: (hidden: boolean) => void;
259
268
  setHotkeysEnabled: (enabled: boolean) => void;
269
+ getEquivalentUnitForDisplayUnit: (unit: Uom, displayUnit: DisplayUnit) => Uom;
270
+ convertUnit: (value: number, from: Uom, to: Uom) => number;
271
+ formatUnit: (value: number, unit: Uom) => string;
260
272
  };
261
273
  constructor(options: Options);
262
274
  /**
@@ -1,3 +1,4 @@
1
+ import type { Uom } from '../../unit_util';
1
2
  export type BimObject = {
2
3
  id: number;
3
4
  value: string;
@@ -7,4 +8,6 @@ export type BimProperty = {
7
8
  category: string;
8
9
  name: string;
9
10
  value: string;
11
+ typed_value?: string | number;
12
+ uom?: Uom | null;
10
13
  };
@@ -1,9 +1,11 @@
1
+ import { MenuOptionTooltip } from '../DropdownComponent/MenuOptions/MenuOptionTooltip';
1
2
  import { CoachmarkProps } from './Coachmarks';
2
3
  export declare class CoachmarkComponent {
3
4
  element: HTMLElement;
4
5
  buttonLabel: HTMLElement;
5
6
  button: HTMLElement;
6
7
  label: HTMLElement;
8
+ tooltip?: MenuOptionTooltip;
7
9
  private id;
8
10
  constructor(props: CoachmarkProps);
9
11
  setVisible(visible: boolean): void;
@@ -2,5 +2,14 @@ import { CoachmarkManagerProps } from './Coachmarks';
2
2
  import './styles.css';
3
3
  export declare class CoachmarkManagerComponent {
4
4
  element: HTMLElement;
5
+ private customCoachmarks;
5
6
  constructor(props: CoachmarkManagerProps);
7
+ showCustomCoachmark(params: {
8
+ id: string;
9
+ label: string;
10
+ buttonLabel: string;
11
+ buttonOnClick?: () => void;
12
+ tooltipMessage?: string;
13
+ }): void;
14
+ hideCustomCoachmark(id: string): void;
6
15
  }
@@ -4,6 +4,8 @@ import type { RenderController } from '../../controllers/RenderController';
4
4
  export type CoachmarkProps = {
5
5
  label: string;
6
6
  buttonLabel: string;
7
+ buttonOnClick?: () => void;
8
+ tooltipMessage?: string;
7
9
  id: string;
8
10
  };
9
11
  export type CoachmarkExtendedProps = {
@@ -34,6 +34,8 @@ export type Line = {
34
34
  end: Vector2;
35
35
  stroke: CssColor;
36
36
  strokeWidth: number;
37
+ strokeDasharray?: string;
38
+ opacity?: number;
37
39
  zIndex?: number;
38
40
  };
39
41
  export type Arrow = {
@@ -69,8 +71,8 @@ export type SvgData = {
69
71
  rects?: Rect[];
70
72
  };
71
73
  type AnchoredBoxEllipse = BoxEllipse & Anchorable;
72
- type AnchoredRadiusEllipse = Omit<RadiusEllipse, 'center'> & Anchorable;
73
- type AnchoredLine = Omit<Line, 'start' | 'end'> & AnchorableLine;
74
+ export type AnchoredRadiusEllipse = Omit<RadiusEllipse, 'center'> & Anchorable;
75
+ export type AnchoredLine = Omit<Line, 'start' | 'end'> & AnchorableLine;
74
76
  type AnchoredArrow = Omit<Arrow, 'start' | 'end'> & AnchorableLine;
75
77
  type AnchoredText = Omit<Text, 'origin'> & Anchorable;
76
78
  type AnchoredRect = Omit<Rect, 'x' | 'y'> & Anchorable;
@@ -109,6 +111,7 @@ export declare class SvgRenderer {
109
111
  drawArrow(arrow: Arrow): void;
110
112
  drawText(text: Text): void;
111
113
  drawRect(rect: Rect): void;
114
+ private clipLine;
112
115
  private _clear;
113
116
  clear(): void;
114
117
  hasContent(): boolean;
@@ -2,7 +2,7 @@ import type { RedlinesData } from '../../../viewpoint/types';
2
2
  import type { SvgData, AnchoredSvgData } from '../SvgRenderer';
3
3
  export declare const MARKUP_DRAW_SNAPSHOT = "\n<defs>\n <marker id=\"arrowhead-0\" viewBox=\"0 0 10 10\" refX=\"7\" refY=\"5\" markerWidth=\"6\" markerHeight=\"3\" orient=\" auto-start-reverse\" fill=\"rgb(0, 0, 255)\">\n <path d=\"M 0 0 L 10 5 L 0 10 z\"></path>\n </marker>\n</defs>\n<ellipse stroke=\"rgb(255, 0, 0)\" stroke-width=\"3\" fill=\"none\" cx=\"288.7389312236744\" cy=\"271.2610687763 256\" rx=\"31.26106877632563\" ry=\"31.26106877632563\"></ellipse>\n<ellipse stroke=\"rgb(255, 255, 127.5)\" stroke-width=\"3\" fill=\"none\" cx=\"194.95572489469748\" cy=\"396.3053438816281\" rx=\"62.522137552651245\" ry=\"93.78320632897683\"></ellipse>\n<line stroke=\"rgb(0, 255, 0)\" stroke-width=\"3\" x1=\"320\" y1=\"240\" x2=\"632.6106877632562\" y2=\"302.52213755265126\"></line>\n<line stroke=\"rgb(0, 0, 255)\" stroke-width=\"3\" x1=\"320\" y1=\"240\" x2=\"632.6106877632562\" y2=\"177.47786244734877\" marker-end=\"url(#arrowhead-0)\"></line>\n<text fill=\"rgb(255, 255, 0)\" x=\"632.6106877632562\" y=\"240\" style=\"font: 21px tahoma;\">text</text>\n";
4
4
  export declare const MARKUP_DATA: RedlinesData;
5
- export declare const SVG_DRAW_SNAPSHOT = "\n<defs>\n <marker id=\"arrowhead-0\" viewBox=\"0 0 10 10\" refX=\"7\" refY=\"5\" markerWidth=\"6\" markerHeight=\"3\" orient=\"auto-start-reverse\" fill=\"rgba(0, 0, 255, 0.5)\">\n <path d=\"M 0 0 L 10 5 L 0 10 z\"></path>\n </marker>\n</defs>\n<ellipse stroke=\"rgba(255, 0, 0, 0.5)\" stroke-width=\"3\" fill=\"none\" cx=\"288.7389312236744\" cy=\"261.2610687763256\" rx=\"31.26106877632563\" ry=\"41.26106877632563\"></ellipse>\n<ellipse stroke=\"rgba(255, 0, 255, 1)\" stroke-width=\"3\" fill=\"rgba(0, 255, 255, 0.5)\" cx=\"288.7389312236744\" cy=\"331.2610687763256\" rx=\"31.26106877632563\" ry=\"31.26106877632563\"></ellipse>\n<ellipse stroke=\"chartreuse\" stroke-width=\"5\" fill=\"dodgerblue\" cx=\"50\" cy=\"50\" rx=\"50\" ry=\"50\"></ellipse>\n<line stroke=\"rgba(0, 255, 0, 0.5)\" stroke-width=\"3\" x1=\"320\" y1=\"240\" x2=\"632.6106877632562\" y2=\"302.52213755265126\"></line>\n<line stroke=\"rgba(0, 0, 255, 0.5)\" stroke-width=\"3\" x1=\"320\" y1=\"240\" x2=\"632.6106877632562\" y2=\"177.47786244734877\" marker-end=\"url(#arrowhead-0)\"></line>\n<text fill=\"rgba(255, 255, 0, 0.5)\" x=\"632.6106877632562\" y=\"240\" style=\"font: 9px verdana;\">text</text>\n<rect width=\"50\" height=\"100\" x=\"250\" y=\"300\" rx=\"10\" ry=\"10\" fill=\"rgba(255, 0, 0, 0.5)\" stroke=\"rgba(0, 255, 0, 0.5)\" stroke-width=\"1\"></rect>\n";
5
+ export declare const SVG_DRAW_SNAPSHOT = "\n<defs>\n <marker id=\"arrowhead-0\" viewBox=\"0 0 10 10\" refX=\"7\" refY=\"5\" markerWidth=\"6\" markerHeight=\"3\" orient=\"auto-start-reverse\" fill=\"rgba(0, 0, 255, 0.5)\">\n <path d=\"M 0 0 L 10 5 L 0 10 z\"></path>\n </marker>\n</defs>\n<ellipse stroke=\"rgba(255, 0, 0, 0.5)\" stroke-width=\"3\" fill=\"none\" cx=\"288.7389312236744\" cy=\"261.2610687763256\" rx=\"31.26106877632563\" ry=\"41.26106877632563\"></ellipse>\n<ellipse stroke=\"rgba(255, 0, 255, 1)\" stroke-width=\"3\" fill=\"rgba(0, 255, 255, 0.5)\" cx=\"288.7389312236744\" cy=\"331.2610687763256\" rx=\"31.26106877632563\" ry=\"31.26106877632563\"></ellipse>\n<ellipse stroke=\"chartreuse\" stroke-width=\"5\" fill=\"dodgerblue\" cx=\"50\" cy=\"50\" rx=\"50\" ry=\"50\"></ellipse>\n<line stroke=\"rgba(0, 255, 0, 0.5)\" stroke-width=\"3\" x1=\"320\" y1=\"240\" x2=\"632.6106877632562\" y2=\"302.52213755265126\"></line>\n<line stroke=\"olive\" stroke-width=\"3\" x1=\"220\" y1=\"140\" x2=\"532\" y2=\"202\" stroke-dasharray=\"5 5\"></line>\n<line stroke=\"peru\" stroke-width=\"3\" x1=\"120\" y1=\"40\" x2=\"432\" y2=\"102\" opacity=\"0.5\"></line>\n<line stroke=\"rgba(0, 0, 255, 0.5)\" stroke-width=\"3\" x1=\"320\" y1=\"240\" x2=\"632.6106877632562\" y2=\"177.47786244734877\" marker-end=\"url(#arrowhead-0)\"></line>\n<text fill=\"rgba(255, 255, 0, 0.5)\" x=\"632.6106877632562\" y=\"240\" style=\"font: 9px verdana;\">text</text>\n<rect width=\"50\" height=\"100\" x=\"250\" y=\"300\" rx=\"10\" ry=\"10\" fill=\"rgba(255, 0, 0, 0.5)\" stroke=\"rgba(0, 255, 0, 0.5)\" stroke-width=\"1\"></rect>\n";
6
6
  export declare const SVG_DATA: SvgData;
7
7
  export declare const ANCHORED_SVG_DRAW_SNAPSHOT = "\n<defs>\n <marker id=\"arrowhead-0\" viewBox=\"0 0 10 10\" refX=\"7\" refY=\"5\" markerWidth=\"6\" markerHeight=\"3\" orient=\"auto-start-reverse\" fill=\"rgba(0, 0, 255, 0.5)\">\n <path d=\"M 0 0 L 10 5 L 0 10 z\"></path>\n </marker>\n</defs>\n<ellipse stroke=\"rgba(255, 0, 0, 0.5)\" stroke-width=\"3\" fill=\"none\" cx=\"373.4940062926364\" cy=\"137.2646118814776\" rx=\"25\" ry=\"25\"></ellipse>\n<ellipse stroke=\"rgba(255, 0, 255, 1)\" stroke-width=\"3\" fill=\"rgba(0, 255, 255, 0.5)\" cx=\"377.4935131017527\" cy=\"113.49240793561125\" rx=\"25\" ry=\"25\"></ellipse>\n<ellipse stroke=\"chartreuse\" stroke-width=\"5\" fill=\"dodgerblue\" cx=\"382.13939697834473\" cy=\"85.87827842058752\" rx=\"25\" ry=\"25\"></ellipse>\n<line stroke=\"rgba(0, 255, 0, 0.5)\" stroke-width=\"3\" x1=\"330.83673841037177\" y1=\"97.63705324816502\" x2=\"429.20274232219333\" y2=\"75.09117116380412\"></line>\n<line stroke=\"rgba(0, 0, 255, 0.5)\" stroke-width=\"3\" x1=\"348.3202682243527\" y1=\"68.77844857614542\" x2=\"421.05630132055813\" y2=\"105.55567600126108\" marker-end=\"url(#arrowhead-0)\"></line>\n<text fill=\"rgba(255, 255, 0, 0.5)\" x=\"397.6021287367146\" y=\"63.40898166491502\" style=\"font: 9px verdana;\">text</text>\n<rect width=\"40\" height=\"25\" x=\"374.1179019239718\" y=\"2.180634279826336\" rx=\"10\" ry=\"10\" fill=\"rgba(255, 0, 0, 0.5)\" stroke=\"rgba(0, 255, 0, 0.5)\" stroke-width=\"1\"></rect>\n<ellipse stroke=\"yellow\" stroke-width=\"5\" fill=\"red\" cx=\"392.02368438075905\" cy=\"-42.30962774098606\" rx=\"25\" ry=\"25\"></ellipse>\n<rect width=\"40\" height=\"25\" x=\"382.02368438075905\" y=\"-44.80962774098606\" rx=\"10\" ry=\"10\" fill=\"green\" stroke=\"cyan\" stroke-width=\"5\"></rect>\n<ellipse stroke=\"magenta\" stroke-width=\"5\" fill=\"blue\" cx=\"412.02368438075905\" cy=\"-22.30962774098606\" rx=\"25\" ry=\"25\"></ellipse>\n";
8
8
  export declare const ANCHORED_SVG_CAMERA_PARAMS: {
@@ -25,6 +25,7 @@ export class ShortestDistanceComponent {
25
25
  displayUnit: "ftin";
26
26
  pivot: import("three").Vector3;
27
27
  mouseMove: (event: any) => void;
28
+ onNavigationChanged(data: any): Promise<void>;
28
29
  DrawLine(start: any, end: any): void;
29
30
  DrawDashedLine(start: any, end: any): void;
30
31
  DrawEndpoint(endpoint: any): void;
@@ -0,0 +1,22 @@
1
+ import './styles.css';
2
+ type Position = 'top' | 'right' | 'bottom' | 'left';
3
+ export declare class Tooltip {
4
+ element: HTMLElement;
5
+ private arrowElement;
6
+ private target;
7
+ private bimMain;
8
+ private positionHorizontal;
9
+ private positionVertical;
10
+ private offsetFromTarget;
11
+ constructor(props: {
12
+ target: HTMLElement;
13
+ label: string;
14
+ position: Position;
15
+ maxWidth?: number;
16
+ offset?: number;
17
+ });
18
+ private onTargetMouseOver;
19
+ private onTargetMouseOut;
20
+ private positionAt;
21
+ }
22
+ export {};
@@ -0,0 +1 @@
1
+ export { Tooltip } from './Tooltip';
@@ -1,8 +1,9 @@
1
- export function WindowViewPropertiesComponent(options: any, render: any): void;
1
+ export function WindowViewPropertiesComponent(options: any, render: any, settings: any): void;
2
2
  export class WindowViewPropertiesComponent {
3
- constructor(options: any, render: any);
3
+ constructor(options: any, render: any, settings: any);
4
4
  toolId: 12;
5
5
  render: any;
6
+ settings: any;
6
7
  viewPropertiesId: string;
7
8
  searchTerm: string;
8
9
  searchComponent: SearchInput | null;
@@ -0,0 +1,3 @@
1
+ import { DisplayUnit } from '../../unit_util';
2
+ import type { BimProperty } from '../../api/types/BimObject';
3
+ export declare const formatUoms: (properties: BimProperty[], displayUnit: DisplayUnit, locale: string) => BimProperty[];
@@ -186,7 +186,7 @@ export class RenderController {
186
186
  } | null;
187
187
  getMeshnodeFromNodeId(nodeId: any): import("../pwfreader/shared/Meshnode").Meshnode | import("../pwfreader/shared/Node").Node | null;
188
188
  getMeshnodeFromIndex(id: any): import("../pwfreader/shared/Meshnode").Meshnode | null;
189
- getMeasureObjectMeshes(): import("../pwfreader/shared/Meshnode").MeshnodeObject[];
189
+ getMeasureObjectMeshes(): import("../pwfreader/pwf/MeshnodeObject").MeshnodeObject[];
190
190
  getCamera(): import("three").PerspectiveCamera;
191
191
  getRenderer(): import("../procoregl/ViewerRenderer").ViewerRenderer | undefined;
192
192
  resizeScene(params: any): void;
@@ -242,15 +242,7 @@ export class RenderController {
242
242
  y: number;
243
243
  z: number;
244
244
  };
245
- ToScreenPosition(params: any): {
246
- x: any;
247
- y: any;
248
- z: any;
249
- } | {
250
- x: any;
251
- y: any;
252
- z: any;
253
- }[];
245
+ ToScreenPosition(params: any): import("../sdk").Vector3 | import("../sdk").Vector3[];
254
246
  ConvertScreenPosition(vector: any): {
255
247
  x: any;
256
248
  y: any;
@@ -326,7 +318,6 @@ export class RenderController {
326
318
  unit: string;
327
319
  };
328
320
  };
329
- applyGlobalOffset(vector: any): any;
330
321
  refreshScene(): void;
331
322
  setHiddenSet(params: any): void;
332
323
  refreshLighting(): void;
@@ -345,15 +336,7 @@ export class RenderController {
345
336
  onUndo(): void;
346
337
  onRedo(): void;
347
338
  getOrbitTranslate(event: any): {
348
- translate: {
349
- x: any;
350
- y: any;
351
- z: any;
352
- } | {
353
- x: any;
354
- y: any;
355
- z: any;
356
- }[];
339
+ translate: import("../sdk").Vector3 | import("../sdk").Vector3[];
357
340
  orbitPoint: import("../sdk").Vector3;
358
341
  };
359
342
  setMeasureEnabled(enabled: any): void;
@@ -124,7 +124,7 @@ export class RenderControllerProxy {
124
124
  hideNodesFromNodeIds(...params: any[]): boolean | Promise<any>;
125
125
  onResize(...params: any[]): void;
126
126
  getMeshnodeFromIndex(...params: any[]): Promise<any> | import("../pwfreader/shared/Meshnode").Meshnode | null;
127
- getMeasureObjectMeshes(...params: any[]): Promise<any> | import("../pwfreader/shared/Meshnode").MeshnodeObject[];
127
+ getMeasureObjectMeshes(...params: any[]): Promise<any> | import("../pwfreader/pwf/MeshnodeObject").MeshnodeObject[];
128
128
  onContextMenu(...params: any[]): void | Promise<any>;
129
129
  getContextMenuData(...params: any[]): Promise<any> | {
130
130
  meshnodeIndex: number;
@@ -147,26 +147,10 @@ export class RenderControllerProxy {
147
147
  setVisibility(...params: any[]): void | Promise<any>;
148
148
  getVisibility(...params: any[]): Promise<any> | import("../sdk").Visibility;
149
149
  getOrbitTranslate(...params: any[]): Promise<any> | {
150
- translate: {
151
- x: any;
152
- y: any;
153
- z: any;
154
- } | {
155
- x: any;
156
- y: any;
157
- z: any;
158
- }[];
150
+ translate: import("../sdk").Vector3 | import("../sdk").Vector3[];
159
151
  orbitPoint: import("../sdk").Vector3;
160
152
  };
161
- ToScreenPosition(...params: any[]): Promise<any> | {
162
- x: any;
163
- y: any;
164
- z: any;
165
- } | {
166
- x: any;
167
- y: any;
168
- z: any;
169
- }[];
153
+ ToScreenPosition(...params: any[]): Promise<any> | import("../sdk").Vector3 | import("../sdk").Vector3[];
170
154
  ModelToMapSpace(...params: any[]): Promise<any> | {
171
155
  x?: undefined;
172
156
  y?: undefined;
@@ -5,7 +5,9 @@ export declare class SettingsController {
5
5
  private projectId;
6
6
  private projectSettings;
7
7
  private db?;
8
+ private locale;
8
9
  constructor(params: {
10
+ locale?: string | undefined;
9
11
  projectId: number;
10
12
  });
11
13
  private onDatabaseOpened;
@@ -1,5 +1,5 @@
1
- import { MeshnodeObject } from '../pwfreader/shared/Meshnode';
2
- import { Models } from '../procoregl/Models/Models';
1
+ import { MeshnodeObject } from '../pwfreader/pwf/MeshnodeObject';
2
+ import { Models } from '../procoregl/Models';
3
3
  export declare class ShortestDistanceController {
4
4
  private measureSet;
5
5
  private models;
@@ -1,4 +1,5 @@
1
- import type { MeshTopology } from '../procoregl/MeshTopology/MeshTopology';
1
+ import { Vector3 } from '../types/Math';
2
+ import { MeshTopology } from '../procoregl/MeshTopology';
2
3
  export declare const SNAP_TYPE: {
3
4
  readonly surface: "surface";
4
5
  readonly midpoint: "midpoint";
@@ -11,7 +12,9 @@ export declare function getIntersectionSnapAndOutline(params: {
11
12
  matrixWorld: THREE.Matrix4;
12
13
  meshTopology: MeshTopology;
13
14
  intersectionFaceNormal: THREE.Vector3;
14
- cameraDirection: THREE.Vector3;
15
+ camera: THREE.PerspectiveCamera;
16
+ canvasWidth: number;
17
+ canvasHeight: number;
15
18
  outlineOptions: {
16
19
  hideDifferentFaceNormal: boolean;
17
20
  hideNonCoplanar: boolean;
@@ -27,8 +30,10 @@ export declare function getIntersectionSnapAndOutline(params: {
27
30
  start: THREE.Vector3;
28
31
  end: THREE.Vector3;
29
32
  }[];
33
+ cursorRotation: Vector3;
34
+ snapScreenPosition: Vector3 | null;
30
35
  };
31
- export declare function detectSnapFeature(intersectPoint: THREE.Vector3, line: THREE.Line3): {
36
+ export declare function detectSnapFeature(intersectPoint: THREE.Vector3, line: THREE.Line3, cameraPosition: THREE.Vector3): {
32
37
  detectedSnapType: SnapType;
33
38
  detectedSnapPosition: THREE.Vector3;
34
39
  };
@@ -36,3 +41,6 @@ export declare function getNormalFromPoints(point1: THREE.Vector3, point2: THREE
36
41
  export declare function isNormalFacingCamera(normal: THREE.Vector3, cameraDirection: THREE.Vector3): boolean;
37
42
  export declare function arePlanesCoplanar(normal1: THREE.Vector3, point1: THREE.Vector3, normal2: THREE.Vector3, point2: THREE.Vector3): boolean;
38
43
  export declare function areNormalsSimilar(normal1: THREE.Vector3, normal2: THREE.Vector3): boolean;
44
+ export declare function getSurfaceCursorAngle(camera: THREE.PerspectiveCamera, faceNormal: THREE.Vector3, intersection: THREE.Vector3, canvasWidth: number, canvasHeight: number): Vector3;
45
+ export declare function getEdgeCursorAngle(start: Vector3, end: Vector3, camera: THREE.PerspectiveCamera, canvasWidth: number, canvasHeight: number): number;
46
+ export declare function arePointsCollinear(p1: THREE.Vector3, p2: THREE.Vector3, p3: THREE.Vector3): boolean;
@@ -2,46 +2,47 @@ import type { PickingController } from '../picking/PickingController';
2
2
  import type { Models } from '../procoregl/Models';
3
3
  import { Vector3 } from '../types/Math';
4
4
  import type { SnapType } from './MeasureToolUtils';
5
+ import type { ViewerRenderer } from '../procoregl/ViewerRenderer';
5
6
  export type WorldIntersectionSnapResult = {
6
7
  intersection: Vector3;
7
- viewProjectionMatrix: number[];
8
8
  snapType: SnapType;
9
9
  snapPosition: Vector3;
10
10
  snapEdge: {
11
11
  start: Vector3;
12
12
  end: Vector3;
13
13
  } | null;
14
- faceNormal: Vector3;
15
14
  boundaryEdges: {
16
15
  start: Vector3;
17
16
  end: Vector3;
18
17
  }[];
19
18
  meshnodeIndex: number;
19
+ cursorRotation: Vector3;
20
+ snapScreenPosition: Vector3 | null;
20
21
  };
21
22
  export declare class PointToPointController {
22
23
  private pickingController;
23
24
  private models;
24
- private camera;
25
+ private readonly camera;
25
26
  private currentHoverMeshnodeIndex;
26
27
  private meshTopologyCache;
27
28
  private _enabled;
28
- private globalOffset;
29
+ private readonly globalOffset;
29
30
  private prevLastWorldIntersectionSnapResult;
30
31
  private lastWorldIntersectionSnapResult;
31
32
  private debugGui;
33
+ private viewerRenderer;
32
34
  constructor(params: {
33
35
  pickingController: PickingController;
34
36
  models: Models;
35
37
  camera: THREE.PerspectiveCamera;
36
38
  globalOffset: THREE.Vector3;
39
+ viewerRenderer: ViewerRenderer;
37
40
  });
38
41
  get enabled(): boolean;
39
42
  set enabled(value: boolean);
40
43
  handleMouseClick(): void;
41
44
  handleMouseMove(event: MouseEvent): void;
42
45
  private getWorldIntersectionSnapResult;
43
- private calculateViewProjectionMatrix;
44
- private applyGlobalOffset;
45
46
  private publishIntersectionSnapResult;
46
47
  private getMeshTopology;
47
48
  private meshnodeTooComplex;
@@ -1,21 +1,42 @@
1
1
  import { SvgRenderer } from '../components/Markup/SvgRenderer';
2
- import { Vector3 } from '../types/Math';
3
- import type { WorldIntersectionSnapResult } from './PointToPointController';
4
2
  import type { RenderControllerProxy } from '../controllers/RenderControllerProxy';
5
3
  export declare class PointToPointManager {
6
4
  private svgRenderer;
7
5
  private renderControllerProxy;
8
6
  private static pointToPointEnabled;
7
+ private firstMeasurePoint;
8
+ private secondMeasurePoint;
9
+ private outlines;
10
+ private intersection;
11
+ private pivot;
12
+ private dist;
13
+ private xDist;
14
+ private yDist;
15
+ private zDist;
16
+ private gui;
17
+ private globalOffset;
9
18
  constructor(params: {
10
19
  renderControllerProxy: RenderControllerProxy;
11
20
  svgRenderer: SvgRenderer;
21
+ globalOffset: {
22
+ offsetX: number;
23
+ offsetY: number;
24
+ offsetZ: number;
25
+ };
12
26
  });
13
- onMeasurementObjectMove(payload: WorldIntersectionSnapResult): void;
14
- onMeasurementObjectLeave(): void;
15
- onMeasurementObjectClick(payload: Vector3): void;
27
+ private onSelectTool;
28
+ private onNavigationChanged;
29
+ private onMeasurementObjectMove;
30
+ private onMeasurementObjectLeave;
31
+ private onMeasurementObjectClick;
32
+ private resetMeasurement;
33
+ private calculateDistances;
16
34
  static isEnabled(): boolean;
17
35
  togglePointToPoint(params: {
18
36
  enable: boolean;
19
37
  }): void;
38
+ private setCameraAndNavigationControls;
39
+ private updateSvg;
20
40
  private createLine;
41
+ private createEllipse;
21
42
  }
@@ -1,12 +1,8 @@
1
- import { WorldIntersectionSnapResult } from '../PointToPointController';
2
- export declare const projectionMatrix: import("three").Matrix4;
3
- export declare const matrixWorldInverse: import("three").Matrix4;
1
+ import type { WorldIntersectionSnapResult } from '../PointToPointController';
4
2
  export declare const matrixWorld: import("three").Matrix4;
5
- export declare const quaternion: import("three").Quaternion;
6
3
  export declare const measurementObjectEnterObject1Payload: WorldIntersectionSnapResult;
7
4
  export declare const measurementObjectEnterTooComplexPayload: WorldIntersectionSnapResult;
8
5
  export declare const measurementObjectEnterObject2Payload: WorldIntersectionSnapResult;
9
- export declare const measurementObjectMoveObjectPayload: WorldIntersectionSnapResult;
10
6
  export declare const measurementObjectMoveMidpointPayload: WorldIntersectionSnapResult;
11
7
  export declare const measurementObjectLeaveMoveIntoObject2: {
12
8
  meshnodeIndex: number;
@@ -16,10 +12,173 @@ export declare const measurementObjectLeaveMoveIntoEmptySpace: {
16
12
  meshnodeIndex: number;
17
13
  relatedMeshnodeIndex: null;
18
14
  };
19
- export declare const measurementObjectClickPayload: {
15
+ export declare const measurementObjectClickPayloadFirstAnchor: {
20
16
  snapPosition: {
21
17
  x: number;
22
18
  y: number;
23
19
  z: number;
24
20
  };
25
21
  };
22
+ export declare const measurementObjectClickPayloadSecondAnchor: {
23
+ snapPosition: {
24
+ x: number;
25
+ y: number;
26
+ z: number;
27
+ };
28
+ };
29
+ export declare const measurementObjectMovePartialPayload: {
30
+ boundaryEdges: {
31
+ start: {
32
+ x: number;
33
+ y: number;
34
+ z: number;
35
+ };
36
+ end: {
37
+ x: number;
38
+ y: number;
39
+ z: number;
40
+ };
41
+ }[];
42
+ intersection: {
43
+ x: number;
44
+ y: number;
45
+ z: number;
46
+ };
47
+ };
48
+ export declare const svgDataObjectOutline: {
49
+ lines: {
50
+ stroke: string;
51
+ anchorStart: {
52
+ x: number;
53
+ y: number;
54
+ z: number;
55
+ };
56
+ anchorEnd: {
57
+ x: number;
58
+ y: number;
59
+ z: number;
60
+ };
61
+ strokeWidth: number;
62
+ opacity: number;
63
+ }[];
64
+ ellipses: never[];
65
+ };
66
+ export declare const svgDataFirstAnchorOutlineTempMeasurement: {
67
+ lines: ({
68
+ stroke: string;
69
+ anchorStart: {
70
+ x: number;
71
+ y: number;
72
+ z: number;
73
+ };
74
+ anchorEnd: {
75
+ x: number;
76
+ y: number;
77
+ z: number;
78
+ };
79
+ strokeWidth: number;
80
+ opacity: number;
81
+ strokeDasharray?: undefined;
82
+ } | {
83
+ stroke: string;
84
+ anchorStart: {
85
+ x: number;
86
+ y: number;
87
+ z: number;
88
+ };
89
+ anchorEnd: {
90
+ x: number;
91
+ y: number;
92
+ z: number;
93
+ };
94
+ strokeWidth: number;
95
+ opacity: number;
96
+ strokeDasharray: string;
97
+ })[];
98
+ ellipses: {
99
+ stroke: string;
100
+ strokeWidth: number;
101
+ anchor: {
102
+ x: number;
103
+ y: number;
104
+ z: number;
105
+ };
106
+ zIndex: number;
107
+ radius: {
108
+ x: number;
109
+ y: number;
110
+ };
111
+ fill: string;
112
+ }[];
113
+ };
114
+ export declare const svgDataFinalMeasurement: {
115
+ lines: ({
116
+ stroke: string;
117
+ anchorStart: {
118
+ x: number;
119
+ y: number;
120
+ z: number;
121
+ };
122
+ anchorEnd: {
123
+ x: number;
124
+ y: number;
125
+ z: number;
126
+ };
127
+ strokeWidth: number;
128
+ opacity: number;
129
+ strokeDasharray?: undefined;
130
+ } | {
131
+ stroke: string;
132
+ anchorStart: {
133
+ x: number;
134
+ y: number;
135
+ z: number;
136
+ };
137
+ anchorEnd: {
138
+ x: number;
139
+ y: number;
140
+ z: number;
141
+ };
142
+ strokeWidth: number;
143
+ opacity: number;
144
+ strokeDasharray: string;
145
+ })[];
146
+ ellipses: {
147
+ stroke: string;
148
+ strokeWidth: number;
149
+ anchor: {
150
+ x: number;
151
+ y: number;
152
+ z: number;
153
+ };
154
+ zIndex: number;
155
+ radius: {
156
+ x: number;
157
+ y: number;
158
+ };
159
+ fill: string;
160
+ }[];
161
+ };
162
+ export declare const svgDataEmpty: {
163
+ lines: never[];
164
+ ellipses: never[];
165
+ };
166
+ export declare const svgDataFirstAnchorPointOnly: {
167
+ lines: never[];
168
+ ellipses: {
169
+ stroke: string;
170
+ strokeWidth: number;
171
+ anchor: {
172
+ x: number;
173
+ y: number;
174
+ z: number;
175
+ };
176
+ zIndex: number;
177
+ radius: {
178
+ x: number;
179
+ y: number;
180
+ };
181
+ fill: string;
182
+ }[];
183
+ };
184
+ export declare function createCamera(canvasWidth: number, canvasHeight: number): THREE.PerspectiveCamera;
@@ -0,0 +1,7 @@
1
+ import { DebugGui } from '../utils/DebugGui';
2
+ export declare const pointToPointCursorSize: {
3
+ surfaceCursorSize: number;
4
+ edgeCursorSize: number;
5
+ endpointCursorSize: number;
6
+ };
7
+ export declare const createPointToPointManagerDebugGui: () => ReturnType<typeof DebugGui.add>;
@@ -7,6 +7,10 @@ export declare class DefaultControl implements MouseControl {
7
7
  private isRotating;
8
8
  private startMouseDown?;
9
9
  private lockRotation;
10
+ private surfaceCursor;
11
+ private edgeCursor;
12
+ private midPointCursor;
13
+ private endPointCursor;
10
14
  private static COUNTS_AS_CLICK_THRESHOLD;
11
15
  constructor(params: {
12
16
  dom: HTMLElement;
@@ -24,4 +28,7 @@ export declare class DefaultControl implements MouseControl {
24
28
  private onMeasurementObjectEnter;
25
29
  private updatePointToPointCursor;
26
30
  private resetCursor;
31
+ private updateCursorPosition;
32
+ private updatePointToPointCursorSize;
33
+ private addPointToPointCursorToDom;
27
34
  }