@vertexvis/viewer 0.10.2-canary.7 → 0.11.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.
- package/dist/cjs/{browser.esm-ae55f058.js → browser.esm-17419694.js} +25 -25
- package/dist/cjs/{bundle.esm-c457ad4d.js → bundle.esm-b79513ef.js} +231 -207
- package/dist/cjs/{constants-4277684a.js → constants-1d65ed39.js} +1 -1
- package/dist/cjs/{cursors-b93b43ef.js → cursors-8aaf500f.js} +1 -1
- package/dist/cjs/{dom-cdb50ebc.js → dom-40804039.js} +1 -1
- package/dist/cjs/index.cjs.js +8 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{markup-3dac4cef.js → markup-e84a143f.js} +11 -2
- package/dist/cjs/{measurement-b494bf55.js → measurement-4579193b.js} +2 -2
- package/dist/cjs/{orientation-42cc9e8d.js → orientation-09d0f3ef.js} +14 -7
- package/dist/cjs/{png-decoder-2add73dd.js → png-decoder-97ea96ba.js} +3 -3
- package/dist/cjs/{scene-23a0a330.js → scene-4397373a.js} +28524 -2446
- package/dist/cjs/{utils-6933381f.js → utils-414e6cfe.js} +2 -2
- package/dist/cjs/utils-440f0f7d.js +61 -0
- package/dist/cjs/vertex-scene-tree.cjs.entry.js +6 -5
- package/dist/cjs/vertex-viewer-dom-element_3.cjs.entry.js +4 -4
- package/dist/cjs/{vertex-viewer-markup-arrow_2.cjs.entry.js → vertex-viewer-markup-arrow_3.cjs.entry.js} +267 -4
- package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js +43 -9
- package/dist/cjs/vertex-viewer-markup.cjs.entry.js +25 -5
- package/dist/cjs/vertex-viewer-measurement-distance_2.cjs.entry.js +8 -8
- package/dist/cjs/vertex-viewer-measurement-tool.cjs.entry.js +5 -5
- package/dist/cjs/vertex-viewer-measurements.cjs.entry.js +5 -5
- package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer.cjs.entry.js +141 -48
- package/dist/cjs/viewer.cjs.js +1 -1
- package/dist/cjs/{viewport-e69f8223.js → viewport-fc405a48.js} +31 -7
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/scene-tree/scene-tree.js +3 -2
- package/dist/collection/components/viewer/viewer.js +28 -3
- package/dist/collection/components/viewer-markup/utils.js +65 -1
- package/dist/collection/components/viewer-markup/viewer-markup.js +72 -16
- package/dist/collection/components/viewer-markup-circle/utils.js +2 -55
- package/dist/collection/components/viewer-markup-circle/viewer-markup-circle.js +4 -4
- package/dist/collection/components/viewer-markup-freeform.tsx/utils.js +10 -0
- package/dist/collection/components/viewer-markup-freeform.tsx/viewer-markup-freeform.css +157 -0
- package/dist/collection/components/viewer-markup-freeform.tsx/viewer-markup-freeform.js +413 -0
- package/dist/collection/components/viewer-markup-tool/viewer-markup-tool.js +63 -9
- package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance-components.js +1 -1
- package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js +2 -2
- package/dist/collection/lib/cursors.js +1 -1
- package/dist/collection/lib/interactions/baseInteractionHandler.js +5 -4
- package/dist/collection/lib/interactions/flyToPartKeyInteraction.js +1 -1
- package/dist/collection/lib/interactions/interactionApi.js +101 -22
- package/dist/collection/lib/interactions/mouseInteractions.js +17 -15
- package/dist/collection/lib/interactions/multiTouchInteractionHandler.js +2 -2
- package/dist/collection/lib/mappers.js +4 -3
- package/dist/collection/lib/scenes/camera.js +8 -2
- package/dist/collection/lib/scenes/operations.js +1 -1
- package/dist/collection/lib/scenes/scene.js +5 -2
- package/dist/collection/lib/types/frame.js +8 -2
- package/dist/collection/lib/types/markup.js +9 -1
- package/dist/collection/lib/types/stencilBuffer.js +2 -2
- package/dist/collection/lib/types/viewport.js +32 -8
- package/dist/collection/testing/fixtures.js +2 -1
- package/dist/esm/{browser.esm-7dbdf78a.js → browser.esm-e4fb17dc.js} +25 -25
- package/dist/esm/{bundle.esm-590d2273.js → bundle.esm-d891316f.js} +232 -208
- package/dist/esm/{constants-083f6b2c.js → constants-037e417f.js} +1 -1
- package/dist/esm/{cursors-39294365.js → cursors-00835249.js} +1 -1
- package/dist/esm/{dom-43682375.js → dom-d0877f90.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/index.mjs +7 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loader.mjs +1 -1
- package/dist/esm/{markup-3ce3dccd.js → markup-9b29aa94.js} +11 -3
- package/dist/esm/{measurement-78bd27fc.js → measurement-8430d5d6.js} +2 -2
- package/dist/esm/{orientation-c3e2af18.js → orientation-bb34b652.js} +14 -7
- package/dist/esm/{png-decoder-dfb97536.js → png-decoder-c4745070.js} +3 -3
- package/dist/esm/{scene-30ac6229.js → scene-72760305.js} +28532 -2454
- package/dist/esm/utils-5fe43b8a.js +52 -0
- package/dist/esm/{utils-b857bd7c.js → utils-f8e0baf7.js} +2 -2
- package/dist/esm/vertex-scene-tree.entry.js +6 -5
- package/dist/esm/vertex-viewer-dom-element_3.entry.js +4 -4
- package/dist/esm/{vertex-viewer-markup-arrow_2.entry.js → vertex-viewer-markup-arrow_3.entry.js} +267 -5
- package/dist/esm/vertex-viewer-markup-tool.entry.js +43 -9
- package/dist/esm/vertex-viewer-markup.entry.js +25 -5
- package/dist/esm/vertex-viewer-measurement-distance_2.entry.js +8 -8
- package/dist/esm/vertex-viewer-measurement-tool.entry.js +5 -5
- package/dist/esm/vertex-viewer-measurements.entry.js +5 -5
- package/dist/esm/vertex-viewer-view-cube.entry.js +3 -3
- package/dist/esm/vertex-viewer.entry.js +141 -48
- package/dist/esm/viewer.js +1 -1
- package/dist/esm/{viewport-8fea0743.js → viewport-d6f5cd7b.js} +31 -7
- package/dist/types/components/viewer/viewer.d.ts +4 -0
- package/dist/types/components/viewer-markup/utils.d.ts +8 -0
- package/dist/types/components/viewer-markup/viewer-markup.d.ts +13 -6
- package/dist/types/components/viewer-markup-circle/utils.d.ts +1 -4
- package/dist/types/components/viewer-markup-freeform.tsx/utils.d.ts +3 -0
- package/dist/types/components/viewer-markup-freeform.tsx/viewer-markup-freeform.d.ts +116 -0
- package/dist/types/components/viewer-markup-tool/viewer-markup-tool.d.ts +13 -1
- package/dist/types/components.d.ts +107 -10
- package/dist/types/lib/interactions/interactionApi.d.ts +22 -6
- package/dist/types/lib/interactions/mouseInteractions.d.ts +7 -6
- package/dist/types/lib/scenes/camera.d.ts +5 -1
- package/dist/types/lib/scenes/scene.d.ts +1 -1
- package/dist/types/lib/types/frame.d.ts +4 -1
- package/dist/types/lib/types/markup.d.ts +12 -1
- package/dist/types/lib/types/viewport.d.ts +17 -0
- package/dist/viewer/index.esm.js +1 -1
- package/dist/viewer/p-012fb54f.js +4 -0
- package/dist/viewer/{p-3dc15d99.entry.js → p-117324c0.entry.js} +1 -1
- package/dist/viewer/{p-1ee75110.entry.js → p-1c772ec1.entry.js} +1 -1
- package/dist/viewer/p-1f8a238b.js +4 -0
- package/dist/viewer/p-21e8510d.js +4 -0
- package/dist/viewer/{p-e3105f9a.entry.js → p-3c2aff67.entry.js} +1 -1
- package/dist/viewer/p-5389e9d4.js +4 -0
- package/dist/viewer/p-59d075d4.js +17 -0
- package/dist/viewer/{p-5b078339.js → p-62c6f482.js} +1 -1
- package/dist/viewer/p-640cb5f8.js +18 -0
- package/dist/viewer/p-68aaf1f8.entry.js +4 -0
- package/dist/viewer/{p-05b2444e.js → p-75682963.js} +1 -1
- package/dist/viewer/{p-4183c421.entry.js → p-79c45c02.entry.js} +1 -1
- package/dist/viewer/p-835e158e.js +4 -0
- package/dist/viewer/p-8c255868.entry.js +4 -0
- package/dist/viewer/{p-f4a492e1.js → p-9faabd97.js} +1 -1
- package/dist/viewer/p-b122ee39.js +4 -0
- package/dist/viewer/p-b36b3d1a.js +4 -0
- package/dist/viewer/{p-7c71db57.entry.js → p-bc9e6919.entry.js} +1 -1
- package/dist/viewer/{p-f090a3f3.entry.js → p-c818c80e.entry.js} +1 -1
- package/dist/viewer/{p-e96bc9a2.js → p-d42a482c.js} +1 -1
- package/dist/viewer/p-f43e8cc2.entry.js +4 -0
- package/dist/viewer/p-f75436be.entry.js +4 -0
- package/dist/viewer/viewer.esm.js +1 -1
- package/package.json +18 -16
- package/readme.md +6 -6
- package/dist/cjs/utils-96f244e1.js +0 -104
- package/dist/esm/utils-a550c58f.js +0 -96
- package/dist/viewer/p-11bdd2c4.js +0 -4
- package/dist/viewer/p-14182324.entry.js +0 -4
- package/dist/viewer/p-2768474e.js +0 -4
- package/dist/viewer/p-2e11803d.js +0 -4
- package/dist/viewer/p-6d4ab5fc.js +0 -17
- package/dist/viewer/p-964642c6.js +0 -4
- package/dist/viewer/p-9e856d0a.entry.js +0 -4
- package/dist/viewer/p-a717d9ff.js +0 -4
- package/dist/viewer/p-a9434d8e.entry.js +0 -4
- package/dist/viewer/p-af806858.js +0 -4
- package/dist/viewer/p-b5c350a7.js +0 -4
- package/dist/viewer/p-d912dd24.js +0 -18
- package/dist/viewer/p-f6d75616.entry.js +0 -4
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { h, EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { Point, Rectangle } from '@vertexvis/geometry';
|
|
3
|
+
/**
|
|
4
|
+
* The supported markup modes.
|
|
5
|
+
*
|
|
6
|
+
* @see {@link ViewerMarkupFreeformMode.mode} - For more details about modes.
|
|
7
|
+
*/
|
|
8
|
+
export declare type ViewerMarkupFreeformMode = 'edit' | 'create' | '';
|
|
9
|
+
export declare class ViewerMarkupFreeform {
|
|
10
|
+
/**
|
|
11
|
+
* The positions of the various points of this freeform markup. Can either be an array of
|
|
12
|
+
* `Point`s or a JSON string representation in the format of `[[x1, y1], [x2, y2]]` or
|
|
13
|
+
* `[{"x": 0, "y": 0}, {"x": 0, "y": 0}]`.
|
|
14
|
+
*
|
|
15
|
+
* Points are expected to be relative coordinates from `[-0.5, 0.5]`,
|
|
16
|
+
* e.g. `[0, 0]` corresponds to a point in the center of the viewport.
|
|
17
|
+
*/
|
|
18
|
+
points?: Point.Point[];
|
|
19
|
+
/**
|
|
20
|
+
* The positions of the various points of this freeform markup. Can either be an array of
|
|
21
|
+
* `Point`s or a JSON string representation in the format of `[[x1, y1], [x2, y2]]` or
|
|
22
|
+
* `[{"x": 0, "y": 0}, {"x": 0, "y": 0}]`.
|
|
23
|
+
*
|
|
24
|
+
* Points are expected to be relative coordinates from `[-0.5, 0.5]`,
|
|
25
|
+
* e.g. `[0, 0]` corresponds to a point in the center of the viewport.
|
|
26
|
+
*/
|
|
27
|
+
pointsJson?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The bounds of the freeform. Can either be an instance of a `Rectangle` or
|
|
30
|
+
* a JSON string representation in the format of `[x, y, width, height]` or
|
|
31
|
+
* `{"x": 0, "y": 0, "width": 10, "height": 10}`.
|
|
32
|
+
*
|
|
33
|
+
* Bounds are expected to have relative coordinates, with `[x, y]` from `[-0.5, 0.5]`
|
|
34
|
+
* and `[width, height]` from `[0, 1]`, e.g. `[0, 0, 0.25, 0.25]`corresponds to a freeform
|
|
35
|
+
* with a diameter of one fourth the viewport's smallest size in the center of the viewport.
|
|
36
|
+
*/
|
|
37
|
+
bounds?: Rectangle.Rectangle;
|
|
38
|
+
/**
|
|
39
|
+
* The bounds of the freeform. Can either be an instance of a `Rectangle` or
|
|
40
|
+
* a JSON string representation in the format of `[x, y, width, height]` or
|
|
41
|
+
* `{"x": 0, "y": 0, "width": 0.1, "height": 0.1}`.
|
|
42
|
+
*
|
|
43
|
+
* Bounds are expected to have relative coordinates, with `[x, y]` from `[-0.5, 0.5]`
|
|
44
|
+
* and `[width, height]` from `[0, 1]`, e.g. `[0, 0, 0.25, 0.25]`corresponds to a freeform
|
|
45
|
+
* with a diameter of one fourth the viewport's smallest size in the center of the viewport.
|
|
46
|
+
*/
|
|
47
|
+
boundsJson?: string;
|
|
48
|
+
/**
|
|
49
|
+
* A mode that specifies how the markup component should behave. When
|
|
50
|
+
* unset, the component will not respond to interactions with the handles.
|
|
51
|
+
* When `edit`, the markup anchors are interactive and the user is able
|
|
52
|
+
* to reposition them. When `create`, anytime the user clicks on the canvas,
|
|
53
|
+
* a new markup will be performed.
|
|
54
|
+
*/
|
|
55
|
+
mode: ViewerMarkupFreeformMode;
|
|
56
|
+
/**
|
|
57
|
+
* The viewer to connect to markups.
|
|
58
|
+
*
|
|
59
|
+
* This property will automatically be set when a child of a
|
|
60
|
+
* `<vertex-viewer-markup>` or `<vertex-viewer>` element.
|
|
61
|
+
*/
|
|
62
|
+
viewer?: HTMLVertexViewerElement;
|
|
63
|
+
/**
|
|
64
|
+
* An event that is dispatched anytime the user begins editing the
|
|
65
|
+
* markup.
|
|
66
|
+
*/
|
|
67
|
+
editBegin: EventEmitter<void>;
|
|
68
|
+
/**
|
|
69
|
+
* An event that is dispatched when the user has finished editing the
|
|
70
|
+
* markup.
|
|
71
|
+
*/
|
|
72
|
+
editEnd: EventEmitter<void>;
|
|
73
|
+
/**
|
|
74
|
+
* An event that is dispatched when the user cancels editing of the
|
|
75
|
+
* markup.
|
|
76
|
+
*/
|
|
77
|
+
editCancel: EventEmitter<void>;
|
|
78
|
+
private hostEl;
|
|
79
|
+
private elementBounds?;
|
|
80
|
+
private resizeStartPosition?;
|
|
81
|
+
private editAnchor;
|
|
82
|
+
private resizeBounds?;
|
|
83
|
+
private resizePoints?;
|
|
84
|
+
private screenPoints;
|
|
85
|
+
private min?;
|
|
86
|
+
private max?;
|
|
87
|
+
/**
|
|
88
|
+
* @ignore
|
|
89
|
+
*/
|
|
90
|
+
protected componentWillLoad(): void;
|
|
91
|
+
protected componentDidLoad(): void;
|
|
92
|
+
dispose(): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* @ignore
|
|
95
|
+
*/
|
|
96
|
+
protected handleViewerChanged(newViewer?: HTMLVertexViewerElement, oldViewer?: HTMLVertexViewerElement): void;
|
|
97
|
+
protected handlePointsJsonChange(): void;
|
|
98
|
+
protected handleBoundsJsonChange(): void;
|
|
99
|
+
private updateViewport;
|
|
100
|
+
private updatePointsFromProps;
|
|
101
|
+
render(): h.JSX.IntrinsicElements;
|
|
102
|
+
private addInteractionListeners;
|
|
103
|
+
private addDrawingInteractionListeners;
|
|
104
|
+
private addEditingInteractionListeners;
|
|
105
|
+
private removeInteractionListeners;
|
|
106
|
+
private removeDrawingInteractionListeners;
|
|
107
|
+
private removeEditingInteractionListeners;
|
|
108
|
+
private updateEditAnchor;
|
|
109
|
+
private updateBounds;
|
|
110
|
+
private updatePoints;
|
|
111
|
+
private startMarkup;
|
|
112
|
+
private endMarkup;
|
|
113
|
+
private endEdit;
|
|
114
|
+
private updateMinAndMax;
|
|
115
|
+
private convertPointsToScreen;
|
|
116
|
+
}
|
|
@@ -3,7 +3,7 @@ import { Markup } from '../../lib/types/markup';
|
|
|
3
3
|
/**
|
|
4
4
|
* The types of markup that can be performed by this tool.
|
|
5
5
|
*/
|
|
6
|
-
export declare type ViewerMarkupToolType = 'arrow' | 'circle';
|
|
6
|
+
export declare type ViewerMarkupToolType = 'arrow' | 'circle' | 'freeform';
|
|
7
7
|
export declare class ViewerMarkupTool {
|
|
8
8
|
/**
|
|
9
9
|
* An HTML template that describes the HTML to use for new arrow
|
|
@@ -17,6 +17,12 @@ export declare class ViewerMarkupTool {
|
|
|
17
17
|
* `<vertex-viewer-markup-circle>`.
|
|
18
18
|
*/
|
|
19
19
|
circleTemplateId?: string;
|
|
20
|
+
/**
|
|
21
|
+
* An HTML template that describes the HTML to use for new freeform
|
|
22
|
+
* markup. It's expected that the template contains a
|
|
23
|
+
* `<vertex-viewer-markup-freeform>`.
|
|
24
|
+
*/
|
|
25
|
+
freeformTemplateId?: string;
|
|
20
26
|
/**
|
|
21
27
|
* The type of markup.
|
|
22
28
|
*
|
|
@@ -69,6 +75,10 @@ export declare class ViewerMarkupTool {
|
|
|
69
75
|
* @ignore
|
|
70
76
|
*/
|
|
71
77
|
protected handleCircleTemplateIdChanged(): void;
|
|
78
|
+
/**
|
|
79
|
+
* @ignore
|
|
80
|
+
*/
|
|
81
|
+
protected handleFreeformTemplateIdChanged(): void;
|
|
72
82
|
/**
|
|
73
83
|
* @ignore
|
|
74
84
|
*/
|
|
@@ -83,6 +93,8 @@ export declare class ViewerMarkupTool {
|
|
|
83
93
|
protected render(): h.JSX.IntrinsicElements;
|
|
84
94
|
private createArrowMarkupElement;
|
|
85
95
|
private createCircleMarkupElement;
|
|
96
|
+
private createFreeformMarkupElement;
|
|
97
|
+
private createNewMarkupElement;
|
|
86
98
|
private updateMarkupElement;
|
|
87
99
|
private handleMarkupEditBegin;
|
|
88
100
|
private handleMarkupEditEnd;
|
|
@@ -36,6 +36,7 @@ import { ViewerMarkupToolType } from "./components/viewer-markup-tool/viewer-mar
|
|
|
36
36
|
import { Markup } from "./lib/types/markup";
|
|
37
37
|
import { ViewerMarkupArrowMode } from "./components/viewer-markup-arrow/viewer-markup-arrow";
|
|
38
38
|
import { ViewerMarkupCircleMode } from "./components/viewer-markup-circle/viewer-markup-circle";
|
|
39
|
+
import { ViewerMarkupFreeformMode } from "./components/viewer-markup-freeform.tsx/viewer-markup-freeform";
|
|
39
40
|
import { ViewerMarkupToolType as ViewerMarkupToolType1 } from "./components/viewer-markup-tool/viewer-markup-tool";
|
|
40
41
|
import { ViewerMeasurementDistanceElementMetrics, ViewerMeasurementDistanceLabelFormatter, ViewerMeasurementDistanceMode } from "./components/viewer-measurement-distance/viewer-measurement-distance";
|
|
41
42
|
import { Anchor } from "./components/viewer-measurement-distance/utils";
|
|
@@ -310,8 +311,7 @@ export namespace Components {
|
|
|
310
311
|
/**
|
|
311
312
|
* The default hex color or material to use when selecting items.
|
|
312
313
|
*/
|
|
313
|
-
"selectionMaterial": |
|
|
314
|
-
| ColorMaterial;
|
|
314
|
+
"selectionMaterial": string | ColorMaterial;
|
|
315
315
|
/**
|
|
316
316
|
* Property used for internals or testing.
|
|
317
317
|
* @private
|
|
@@ -494,7 +494,7 @@ export namespace Components {
|
|
|
494
494
|
* @see {
|
|
495
495
|
* @link ViewerMarkups.circleTemplateId}
|
|
496
496
|
*/
|
|
497
|
-
"addMarkup": (markup: Markup) => Promise<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement>;
|
|
497
|
+
"addMarkup": (markup: Markup) => Promise<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement | HTMLVertexViewerMarkupFreeformElement>;
|
|
498
498
|
/**
|
|
499
499
|
* An HTML template that describes the HTML to use for new arrow markup. It's expected that the template contains a `<vertex-viewer-markup-arrow>`.
|
|
500
500
|
*/
|
|
@@ -507,6 +507,10 @@ export namespace Components {
|
|
|
507
507
|
* If `true`, disables adding or editing of markup through user interaction.
|
|
508
508
|
*/
|
|
509
509
|
"disabled": boolean;
|
|
510
|
+
/**
|
|
511
|
+
* An HTML template that describes the HTML to use for new freeform markup. It's expected that the template contains a `<vertex-viewer-markup-freeform>`.
|
|
512
|
+
*/
|
|
513
|
+
"freeformTemplateId"?: string;
|
|
510
514
|
/**
|
|
511
515
|
* Returns the markup element associated to the given ID.
|
|
512
516
|
* @param id The ID of the markup element to return.
|
|
@@ -514,20 +518,20 @@ export namespace Components {
|
|
|
514
518
|
* @see {
|
|
515
519
|
* @link ViewerMarkup.getMarkupElements}
|
|
516
520
|
*/
|
|
517
|
-
"getMarkupElement": (id: string) => Promise<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement | undefined>;
|
|
521
|
+
"getMarkupElement": (id: string) => Promise<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement | HTMLVertexViewerMarkupFreeformElement | undefined>;
|
|
518
522
|
/**
|
|
519
523
|
* Returns a list of markup elements that are children of this component.
|
|
520
524
|
* @returns A list of all markups.
|
|
521
525
|
* @see {
|
|
522
526
|
* @link ViewerMarkup.getMarkupElement}
|
|
523
527
|
*/
|
|
524
|
-
"getMarkupElements": () => Promise<Array<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement>>;
|
|
528
|
+
"getMarkupElements": () => Promise<Array<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement | HTMLVertexViewerMarkupFreeformElement>>;
|
|
525
529
|
/**
|
|
526
530
|
* Removes a markup with the given ID, and returns the HTML element associated to the markup. Returns `undefined` if no markup is found.
|
|
527
531
|
* @param id The ID of the markup to remove.
|
|
528
532
|
* @returns The markup element, or undefined.
|
|
529
533
|
*/
|
|
530
|
-
"removeMarkup": (id: string) => Promise<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement | undefined>;
|
|
534
|
+
"removeMarkup": (id: string) => Promise<HTMLVertexViewerMarkupArrowElement | HTMLVertexViewerMarkupCircleElement | HTMLVertexViewerMarkupFreeformElement | undefined>;
|
|
531
535
|
/**
|
|
532
536
|
* The ID of the markup that is selected.
|
|
533
537
|
*/
|
|
@@ -587,6 +591,33 @@ export namespace Components {
|
|
|
587
591
|
*/
|
|
588
592
|
"viewer"?: HTMLVertexViewerElement;
|
|
589
593
|
}
|
|
594
|
+
interface VertexViewerMarkupFreeform {
|
|
595
|
+
/**
|
|
596
|
+
* The bounds of the freeform. Can either be an instance of a `Rectangle` or a JSON string representation in the format of `[x, y, width, height]` or `{"x": 0, "y": 0, "width": 10, "height": 10}`. Bounds are expected to have relative coordinates, with `[x, y]` from `[-0.5, 0.5]` and `[width, height]` from `[0, 1]`, e.g. `[0, 0, 0.25, 0.25]`corresponds to a freeform with a diameter of one fourth the viewport's smallest size in the center of the viewport.
|
|
597
|
+
*/
|
|
598
|
+
"bounds"?: Rectangle.Rectangle;
|
|
599
|
+
/**
|
|
600
|
+
* The bounds of the freeform. Can either be an instance of a `Rectangle` or a JSON string representation in the format of `[x, y, width, height]` or `{"x": 0, "y": 0, "width": 0.1, "height": 0.1}`. Bounds are expected to have relative coordinates, with `[x, y]` from `[-0.5, 0.5]` and `[width, height]` from `[0, 1]`, e.g. `[0, 0, 0.25, 0.25]`corresponds to a freeform with a diameter of one fourth the viewport's smallest size in the center of the viewport.
|
|
601
|
+
*/
|
|
602
|
+
"boundsJson"?: string;
|
|
603
|
+
"dispose": () => Promise<void>;
|
|
604
|
+
/**
|
|
605
|
+
* A mode that specifies how the markup component should behave. When unset, the component will not respond to interactions with the handles. When `edit`, the markup anchors are interactive and the user is able to reposition them. When `create`, anytime the user clicks on the canvas, a new markup will be performed.
|
|
606
|
+
*/
|
|
607
|
+
"mode": ViewerMarkupFreeformMode;
|
|
608
|
+
/**
|
|
609
|
+
* The positions of the various points of this freeform markup. Can either be an array of `Point`s or a JSON string representation in the format of `[[x1, y1], [x2, y2]]` or `[{"x": 0, "y": 0}, {"x": 0, "y": 0}]`. Points are expected to be relative coordinates from `[-0.5, 0.5]`, e.g. `[0, 0]` corresponds to a point in the center of the viewport.
|
|
610
|
+
*/
|
|
611
|
+
"points"?: Point.Point[];
|
|
612
|
+
/**
|
|
613
|
+
* The positions of the various points of this freeform markup. Can either be an array of `Point`s or a JSON string representation in the format of `[[x1, y1], [x2, y2]]` or `[{"x": 0, "y": 0}, {"x": 0, "y": 0}]`. Points are expected to be relative coordinates from `[-0.5, 0.5]`, e.g. `[0, 0]` corresponds to a point in the center of the viewport.
|
|
614
|
+
*/
|
|
615
|
+
"pointsJson"?: string;
|
|
616
|
+
/**
|
|
617
|
+
* The viewer to connect to markups. This property will automatically be set when a child of a `<vertex-viewer-markup>` or `<vertex-viewer>` element.
|
|
618
|
+
*/
|
|
619
|
+
"viewer"?: HTMLVertexViewerElement;
|
|
620
|
+
}
|
|
590
621
|
interface VertexViewerMarkupTool {
|
|
591
622
|
/**
|
|
592
623
|
* An HTML template that describes the HTML to use for new arrow markup. It's expected that the template contains a `<vertex-viewer-markup-arrow>`.
|
|
@@ -600,6 +631,10 @@ export namespace Components {
|
|
|
600
631
|
* Disables markups. This property will automatically be set when a child of a `<vertex-viewer-markup>` element.
|
|
601
632
|
*/
|
|
602
633
|
"disabled": boolean;
|
|
634
|
+
/**
|
|
635
|
+
* An HTML template that describes the HTML to use for new freeform markup. It's expected that the template contains a `<vertex-viewer-markup-freeform>`.
|
|
636
|
+
*/
|
|
637
|
+
"freeformTemplateId"?: string;
|
|
603
638
|
/**
|
|
604
639
|
* The type of markup. This property will automatically be set when a child of a `<vertex-viewer-markup>` element.
|
|
605
640
|
*/
|
|
@@ -950,6 +985,12 @@ declare global {
|
|
|
950
985
|
prototype: HTMLVertexViewerMarkupCircleElement;
|
|
951
986
|
new (): HTMLVertexViewerMarkupCircleElement;
|
|
952
987
|
};
|
|
988
|
+
interface HTMLVertexViewerMarkupFreeformElement extends Components.VertexViewerMarkupFreeform, HTMLStencilElement {
|
|
989
|
+
}
|
|
990
|
+
var HTMLVertexViewerMarkupFreeformElement: {
|
|
991
|
+
prototype: HTMLVertexViewerMarkupFreeformElement;
|
|
992
|
+
new (): HTMLVertexViewerMarkupFreeformElement;
|
|
993
|
+
};
|
|
953
994
|
interface HTMLVertexViewerMarkupToolElement extends Components.VertexViewerMarkupTool, HTMLStencilElement {
|
|
954
995
|
}
|
|
955
996
|
var HTMLVertexViewerMarkupToolElement: {
|
|
@@ -1015,6 +1056,7 @@ declare global {
|
|
|
1015
1056
|
"vertex-viewer-markup": HTMLVertexViewerMarkupElement;
|
|
1016
1057
|
"vertex-viewer-markup-arrow": HTMLVertexViewerMarkupArrowElement;
|
|
1017
1058
|
"vertex-viewer-markup-circle": HTMLVertexViewerMarkupCircleElement;
|
|
1059
|
+
"vertex-viewer-markup-freeform": HTMLVertexViewerMarkupFreeformElement;
|
|
1018
1060
|
"vertex-viewer-markup-tool": HTMLVertexViewerMarkupToolElement;
|
|
1019
1061
|
"vertex-viewer-measurement-distance": HTMLVertexViewerMeasurementDistanceElement;
|
|
1020
1062
|
"vertex-viewer-measurement-line": HTMLVertexViewerMeasurementLineElement;
|
|
@@ -1183,6 +1225,10 @@ declare namespace LocalJSX {
|
|
|
1183
1225
|
* Emits an event whenever the user taps or clicks a location in the viewer and the configured amount of time passes without receiving a mouseup or touchend. The event includes the location of the tap or click.
|
|
1184
1226
|
*/
|
|
1185
1227
|
"onLongpress"?: (event: CustomEvent<TapEventDetails>) => void;
|
|
1228
|
+
/**
|
|
1229
|
+
* Emits an event when a frame is received with a different scene attribute.
|
|
1230
|
+
*/
|
|
1231
|
+
"onSceneChanged"?: (event: CustomEvent<void>) => void;
|
|
1186
1232
|
/**
|
|
1187
1233
|
* Emits an event when the scene is ready to be interacted with.
|
|
1188
1234
|
*/
|
|
@@ -1207,8 +1253,7 @@ declare namespace LocalJSX {
|
|
|
1207
1253
|
/**
|
|
1208
1254
|
* The default hex color or material to use when selecting items.
|
|
1209
1255
|
*/
|
|
1210
|
-
"selectionMaterial"?: |
|
|
1211
|
-
| ColorMaterial;
|
|
1256
|
+
"selectionMaterial"?: string | ColorMaterial;
|
|
1212
1257
|
/**
|
|
1213
1258
|
* Property used for internals or testing.
|
|
1214
1259
|
* @private
|
|
@@ -1388,14 +1433,22 @@ declare namespace LocalJSX {
|
|
|
1388
1433
|
* If `true`, disables adding or editing of markup through user interaction.
|
|
1389
1434
|
*/
|
|
1390
1435
|
"disabled"?: boolean;
|
|
1436
|
+
/**
|
|
1437
|
+
* An HTML template that describes the HTML to use for new freeform markup. It's expected that the template contains a `<vertex-viewer-markup-freeform>`.
|
|
1438
|
+
*/
|
|
1439
|
+
"freeformTemplateId"?: string;
|
|
1391
1440
|
/**
|
|
1392
1441
|
* Dispatched when a new markup is added, either through user interaction or programmatically.
|
|
1393
1442
|
*/
|
|
1394
|
-
"onMarkupAdded"?: (event: CustomEvent
|
|
1443
|
+
"onMarkupAdded"?: (event: CustomEvent<| HTMLVertexViewerMarkupArrowElement
|
|
1444
|
+
| HTMLVertexViewerMarkupCircleElement
|
|
1445
|
+
| HTMLVertexViewerMarkupFreeformElement>) => void;
|
|
1395
1446
|
/**
|
|
1396
1447
|
* Dispatched when a markup is removed, either through user interaction or programmatically.
|
|
1397
1448
|
*/
|
|
1398
|
-
"onMarkupRemoved"?: (event: CustomEvent
|
|
1449
|
+
"onMarkupRemoved"?: (event: CustomEvent<| HTMLVertexViewerMarkupArrowElement
|
|
1450
|
+
| HTMLVertexViewerMarkupCircleElement
|
|
1451
|
+
| HTMLVertexViewerMarkupFreeformElement>) => void;
|
|
1399
1452
|
/**
|
|
1400
1453
|
* The ID of the markup that is selected.
|
|
1401
1454
|
*/
|
|
@@ -1477,6 +1530,44 @@ declare namespace LocalJSX {
|
|
|
1477
1530
|
*/
|
|
1478
1531
|
"viewer"?: HTMLVertexViewerElement;
|
|
1479
1532
|
}
|
|
1533
|
+
interface VertexViewerMarkupFreeform {
|
|
1534
|
+
/**
|
|
1535
|
+
* The bounds of the freeform. Can either be an instance of a `Rectangle` or a JSON string representation in the format of `[x, y, width, height]` or `{"x": 0, "y": 0, "width": 10, "height": 10}`. Bounds are expected to have relative coordinates, with `[x, y]` from `[-0.5, 0.5]` and `[width, height]` from `[0, 1]`, e.g. `[0, 0, 0.25, 0.25]`corresponds to a freeform with a diameter of one fourth the viewport's smallest size in the center of the viewport.
|
|
1536
|
+
*/
|
|
1537
|
+
"bounds"?: Rectangle.Rectangle;
|
|
1538
|
+
/**
|
|
1539
|
+
* The bounds of the freeform. Can either be an instance of a `Rectangle` or a JSON string representation in the format of `[x, y, width, height]` or `{"x": 0, "y": 0, "width": 0.1, "height": 0.1}`. Bounds are expected to have relative coordinates, with `[x, y]` from `[-0.5, 0.5]` and `[width, height]` from `[0, 1]`, e.g. `[0, 0, 0.25, 0.25]`corresponds to a freeform with a diameter of one fourth the viewport's smallest size in the center of the viewport.
|
|
1540
|
+
*/
|
|
1541
|
+
"boundsJson"?: string;
|
|
1542
|
+
/**
|
|
1543
|
+
* A mode that specifies how the markup component should behave. When unset, the component will not respond to interactions with the handles. When `edit`, the markup anchors are interactive and the user is able to reposition them. When `create`, anytime the user clicks on the canvas, a new markup will be performed.
|
|
1544
|
+
*/
|
|
1545
|
+
"mode"?: ViewerMarkupFreeformMode;
|
|
1546
|
+
/**
|
|
1547
|
+
* An event that is dispatched anytime the user begins editing the markup.
|
|
1548
|
+
*/
|
|
1549
|
+
"onEditBegin"?: (event: CustomEvent<void>) => void;
|
|
1550
|
+
/**
|
|
1551
|
+
* An event that is dispatched when the user cancels editing of the markup.
|
|
1552
|
+
*/
|
|
1553
|
+
"onEditCancel"?: (event: CustomEvent<void>) => void;
|
|
1554
|
+
/**
|
|
1555
|
+
* An event that is dispatched when the user has finished editing the markup.
|
|
1556
|
+
*/
|
|
1557
|
+
"onEditEnd"?: (event: CustomEvent<void>) => void;
|
|
1558
|
+
/**
|
|
1559
|
+
* The positions of the various points of this freeform markup. Can either be an array of `Point`s or a JSON string representation in the format of `[[x1, y1], [x2, y2]]` or `[{"x": 0, "y": 0}, {"x": 0, "y": 0}]`. Points are expected to be relative coordinates from `[-0.5, 0.5]`, e.g. `[0, 0]` corresponds to a point in the center of the viewport.
|
|
1560
|
+
*/
|
|
1561
|
+
"points"?: Point.Point[];
|
|
1562
|
+
/**
|
|
1563
|
+
* The positions of the various points of this freeform markup. Can either be an array of `Point`s or a JSON string representation in the format of `[[x1, y1], [x2, y2]]` or `[{"x": 0, "y": 0}, {"x": 0, "y": 0}]`. Points are expected to be relative coordinates from `[-0.5, 0.5]`, e.g. `[0, 0]` corresponds to a point in the center of the viewport.
|
|
1564
|
+
*/
|
|
1565
|
+
"pointsJson"?: string;
|
|
1566
|
+
/**
|
|
1567
|
+
* The viewer to connect to markups. This property will automatically be set when a child of a `<vertex-viewer-markup>` or `<vertex-viewer>` element.
|
|
1568
|
+
*/
|
|
1569
|
+
"viewer"?: HTMLVertexViewerElement;
|
|
1570
|
+
}
|
|
1480
1571
|
interface VertexViewerMarkupTool {
|
|
1481
1572
|
/**
|
|
1482
1573
|
* An HTML template that describes the HTML to use for new arrow markup. It's expected that the template contains a `<vertex-viewer-markup-arrow>`.
|
|
@@ -1490,6 +1581,10 @@ declare namespace LocalJSX {
|
|
|
1490
1581
|
* Disables markups. This property will automatically be set when a child of a `<vertex-viewer-markup>` element.
|
|
1491
1582
|
*/
|
|
1492
1583
|
"disabled"?: boolean;
|
|
1584
|
+
/**
|
|
1585
|
+
* An HTML template that describes the HTML to use for new freeform markup. It's expected that the template contains a `<vertex-viewer-markup-freeform>`.
|
|
1586
|
+
*/
|
|
1587
|
+
"freeformTemplateId"?: string;
|
|
1493
1588
|
/**
|
|
1494
1589
|
* An event that is dispatched when a user begins a new markup.
|
|
1495
1590
|
*/
|
|
@@ -1760,6 +1855,7 @@ declare namespace LocalJSX {
|
|
|
1760
1855
|
"vertex-viewer-markup": VertexViewerMarkup;
|
|
1761
1856
|
"vertex-viewer-markup-arrow": VertexViewerMarkupArrow;
|
|
1762
1857
|
"vertex-viewer-markup-circle": VertexViewerMarkupCircle;
|
|
1858
|
+
"vertex-viewer-markup-freeform": VertexViewerMarkupFreeform;
|
|
1763
1859
|
"vertex-viewer-markup-tool": VertexViewerMarkupTool;
|
|
1764
1860
|
"vertex-viewer-measurement-distance": VertexViewerMeasurementDistance;
|
|
1765
1861
|
"vertex-viewer-measurement-line": VertexViewerMeasurementLine;
|
|
@@ -1790,6 +1886,7 @@ declare module "@stencil/core" {
|
|
|
1790
1886
|
"vertex-viewer-markup": LocalJSX.VertexViewerMarkup & JSXBase.HTMLAttributes<HTMLVertexViewerMarkupElement>;
|
|
1791
1887
|
"vertex-viewer-markup-arrow": LocalJSX.VertexViewerMarkupArrow & JSXBase.HTMLAttributes<HTMLVertexViewerMarkupArrowElement>;
|
|
1792
1888
|
"vertex-viewer-markup-circle": LocalJSX.VertexViewerMarkupCircle & JSXBase.HTMLAttributes<HTMLVertexViewerMarkupCircleElement>;
|
|
1889
|
+
"vertex-viewer-markup-freeform": LocalJSX.VertexViewerMarkupFreeform & JSXBase.HTMLAttributes<HTMLVertexViewerMarkupFreeformElement>;
|
|
1793
1890
|
"vertex-viewer-markup-tool": LocalJSX.VertexViewerMarkupTool & JSXBase.HTMLAttributes<HTMLVertexViewerMarkupToolElement>;
|
|
1794
1891
|
"vertex-viewer-measurement-distance": LocalJSX.VertexViewerMeasurementDistance & JSXBase.HTMLAttributes<HTMLVertexViewerMeasurementDistanceElement>;
|
|
1795
1892
|
"vertex-viewer-measurement-line": LocalJSX.VertexViewerMeasurementLine & JSXBase.HTMLAttributes<HTMLVertexViewerMeasurementLineElement>;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { BoundingBox,
|
|
1
|
+
import { BoundingBox, Point, Ray } from '@vertexvis/geometry';
|
|
2
2
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
3
3
|
import { TapEventDetails, TapEventKeys } from './tapEventDetails';
|
|
4
4
|
import { StreamApi } from '@vertexvis/stream-api';
|
|
5
5
|
import { Scene, Camera } from '../scenes';
|
|
6
|
-
import { Interactions, Viewport } from '../types';
|
|
6
|
+
import { DepthBuffer, Interactions, Viewport } from '../types';
|
|
7
7
|
import { ReceivedFrame } from '../..';
|
|
8
8
|
declare type SceneProvider = () => Scene;
|
|
9
9
|
declare type InteractionConfigProvider = () => Interactions.InteractionConfig;
|
|
10
10
|
declare type CameraTransform = (data: {
|
|
11
11
|
camera: Camera;
|
|
12
|
-
viewport:
|
|
12
|
+
viewport: Viewport;
|
|
13
13
|
scale: Point.Point;
|
|
14
14
|
boundingBox: BoundingBox.BoundingBox;
|
|
15
|
+
frame: ReceivedFrame;
|
|
16
|
+
depthBuffer?: DepthBuffer;
|
|
15
17
|
}) => Camera;
|
|
16
18
|
/**
|
|
17
19
|
* The `InteractionApi` provides methods that API developers can use to modify
|
|
@@ -31,6 +33,8 @@ export declare class InteractionApi {
|
|
|
31
33
|
private currentCamera?;
|
|
32
34
|
private lastAngle;
|
|
33
35
|
private worldRotationPoint?;
|
|
36
|
+
private panData?;
|
|
37
|
+
private zoomData?;
|
|
34
38
|
constructor(stream: StreamApi, getConfig: InteractionConfigProvider, getScene: SceneProvider, getFrame: () => ReceivedFrame | undefined, getViewport: () => Viewport, tapEmitter: EventEmitter<TapEventDetails>, doubleTapEmitter: EventEmitter<TapEventDetails>, longPressEmitter: EventEmitter<TapEventDetails>, interactionStartedEmitter: EventEmitter<void>, interactionFinishedEmitter: EventEmitter<void>);
|
|
35
39
|
/**
|
|
36
40
|
* Generates a ray from the given point, in viewport coordinates.
|
|
@@ -74,6 +78,17 @@ export declare class InteractionApi {
|
|
|
74
78
|
*/
|
|
75
79
|
twistCamera(delta: number): Promise<void>;
|
|
76
80
|
twistCamera(delta: Point.Point): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Moves the camera's position and look at to the given screen coordinate.
|
|
83
|
+
*
|
|
84
|
+
* If the screen coordinate intersects with an object, the camera will track
|
|
85
|
+
* the hit point so the mouse position is always under the mouse.
|
|
86
|
+
*
|
|
87
|
+
* If the screen coordinate doesn't intersect with an object, then ???.
|
|
88
|
+
*
|
|
89
|
+
* @param screenPt A point in screen coordinates.
|
|
90
|
+
*/
|
|
91
|
+
panCameraToScreenPoint(screenPt: Point.Point): Promise<void>;
|
|
77
92
|
/**
|
|
78
93
|
* Performs a pan operation of the scene's camera, and requests a new image
|
|
79
94
|
* for the updated scene.
|
|
@@ -81,7 +96,7 @@ export declare class InteractionApi {
|
|
|
81
96
|
* @param delta A position delta `{x, y}` in the 2D coordinate space of the
|
|
82
97
|
* viewer.
|
|
83
98
|
*/
|
|
84
|
-
|
|
99
|
+
panCameraByDelta(delta: Point.Point): Promise<void>;
|
|
85
100
|
/**
|
|
86
101
|
* Performs a rotate operation of the scene around the camera's look at point,
|
|
87
102
|
* and requests a new image for the updated scene.
|
|
@@ -98,7 +113,8 @@ export declare class InteractionApi {
|
|
|
98
113
|
* @param delta The distance to zoom. Positive values zoom in and negative
|
|
99
114
|
* values zoom out.
|
|
100
115
|
*/
|
|
101
|
-
zoomCamera(delta: number
|
|
116
|
+
zoomCamera(delta: number): Promise<void>;
|
|
117
|
+
zoomCameraToPoint(point: Point.Point, delta: number): Promise<void>;
|
|
102
118
|
/**
|
|
103
119
|
* Marks the end of an interaction.
|
|
104
120
|
*/
|
|
@@ -124,6 +140,6 @@ export declare class InteractionApi {
|
|
|
124
140
|
pixelThreshold(isTouch?: boolean): number;
|
|
125
141
|
private emitTapEvent;
|
|
126
142
|
private isCoarseInputDevice;
|
|
127
|
-
private
|
|
143
|
+
private getWorldPoint;
|
|
128
144
|
}
|
|
129
145
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InteractionApi } from './interactionApi';
|
|
2
|
-
import { Point
|
|
2
|
+
import { Point } from '@vertexvis/geometry';
|
|
3
3
|
import { InteractionType } from './baseInteractionHandler';
|
|
4
4
|
export declare abstract class MouseInteraction {
|
|
5
5
|
protected currentPosition: Point.Point | undefined;
|
|
@@ -7,7 +7,7 @@ export declare abstract class MouseInteraction {
|
|
|
7
7
|
setPosition(position?: Point.Point): void;
|
|
8
8
|
getPosition(): Point.Point | undefined;
|
|
9
9
|
getType(): InteractionType;
|
|
10
|
-
beginDrag(event: MouseEvent, canvasPosition: Point.Point, api: InteractionApi, element
|
|
10
|
+
beginDrag(event: MouseEvent, canvasPosition: Point.Point, api: InteractionApi, element: HTMLElement): void;
|
|
11
11
|
drag(event: MouseEvent, api: InteractionApi): void;
|
|
12
12
|
endDrag(event: MouseEvent, api: InteractionApi): void;
|
|
13
13
|
zoom(delta: number, api: InteractionApi): void;
|
|
@@ -30,13 +30,13 @@ export declare class ZoomInteraction extends MouseInteraction {
|
|
|
30
30
|
type: InteractionType;
|
|
31
31
|
private didTransformBegin;
|
|
32
32
|
private interactionTimer;
|
|
33
|
-
private
|
|
33
|
+
private startPt?;
|
|
34
34
|
constructor(interactionTimeout?: number);
|
|
35
|
-
beginDrag(event: MouseEvent, canvasPosition: Point.Point, api: InteractionApi, element
|
|
35
|
+
beginDrag(event: MouseEvent, canvasPosition: Point.Point, api: InteractionApi, element: HTMLElement): void;
|
|
36
36
|
drag(event: MouseEvent, api: InteractionApi): void;
|
|
37
37
|
endDrag(event: MouseEvent, api: InteractionApi): void;
|
|
38
38
|
zoom(delta: number, api: InteractionApi): void;
|
|
39
|
-
|
|
39
|
+
zoomToPoint(pt: Point.Point, delta: number, api: InteractionApi): void;
|
|
40
40
|
private beginInteraction;
|
|
41
41
|
private endInteraction;
|
|
42
42
|
private resetInteractionTimer;
|
|
@@ -46,7 +46,8 @@ export declare class ZoomInteraction extends MouseInteraction {
|
|
|
46
46
|
}
|
|
47
47
|
export declare class PanInteraction extends MouseInteraction {
|
|
48
48
|
type: InteractionType;
|
|
49
|
-
|
|
49
|
+
private canvasRect?;
|
|
50
|
+
beginDrag(event: MouseEvent, canvasPosition: Point.Point, api: InteractionApi, element: HTMLElement): void;
|
|
50
51
|
drag(event: MouseEvent, api: InteractionApi): void;
|
|
51
52
|
endDrag(event: MouseEvent, api: InteractionApi): void;
|
|
52
53
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Animation, FlyTo, FrameCamera, StandardView } from '../types';
|
|
1
|
+
import { Animation, FlyTo, FrameCamera, FramePerspectiveCamera, StandardView } from '../types';
|
|
2
2
|
import { Vector3, BoundingBox } from '@vertexvis/geometry';
|
|
3
3
|
import { StreamApi } from '@vertexvis/stream-api';
|
|
4
4
|
import { CameraRenderResult } from './cameraRenderResult';
|
|
@@ -108,6 +108,10 @@ export declare class Camera implements FrameCamera.FrameCamera {
|
|
|
108
108
|
* @param camera The values to update the camera to.
|
|
109
109
|
*/
|
|
110
110
|
update(camera: Partial<FrameCamera.FrameCamera>): Camera;
|
|
111
|
+
/**
|
|
112
|
+
* Returns a `FramePerspectiveCamera` representation.
|
|
113
|
+
*/
|
|
114
|
+
toFrameCamera(): FramePerspectiveCamera;
|
|
111
115
|
private buildFlyToType;
|
|
112
116
|
private computeClippingPlanes;
|
|
113
117
|
/**
|
|
@@ -62,7 +62,7 @@ export declare class Scene {
|
|
|
62
62
|
/**
|
|
63
63
|
* Applies the provided scene view state to the scene.
|
|
64
64
|
*/
|
|
65
|
-
applySceneViewState(sceneViewStateId: UUID.UUID): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined>;
|
|
65
|
+
applySceneViewState(sceneViewStateId: UUID.UUID, opts?: SceneExecutionOptions): Promise<vertexvis.protobuf.stream.ILoadSceneViewStateResult | undefined>;
|
|
66
66
|
/**
|
|
67
67
|
* Returns an executor that accepts a function as a parameter that contains one or many operations to apply
|
|
68
68
|
* to the scene view. The operations will be applied transactionally.
|
|
@@ -32,12 +32,14 @@ export declare class FrameScene {
|
|
|
32
32
|
readonly boundingBox: BoundingBox.BoundingBox;
|
|
33
33
|
readonly crossSection: CrossSectioning.CrossSectioning;
|
|
34
34
|
readonly worldOrientation: Orientation;
|
|
35
|
-
|
|
35
|
+
readonly hasChanged: boolean;
|
|
36
|
+
constructor(camera: FramePerspectiveCamera, boundingBox: BoundingBox.BoundingBox, crossSection: CrossSectioning.CrossSectioning, worldOrientation: Orientation, hasChanged: boolean);
|
|
36
37
|
}
|
|
37
38
|
interface FrameCameraMatrices {
|
|
38
39
|
readonly worldMatrix: Matrix4.Matrix4;
|
|
39
40
|
readonly viewMatrix: Matrix4.Matrix4;
|
|
40
41
|
readonly projectionMatrix: Matrix4.Matrix4;
|
|
42
|
+
readonly projectionMatrixInverse: Matrix4.Matrix4;
|
|
41
43
|
readonly projectionViewMatrix: Matrix4.Matrix4;
|
|
42
44
|
}
|
|
43
45
|
interface FramePerspectiveCameraLike {
|
|
@@ -65,6 +67,7 @@ export declare class FramePerspectiveCamera implements FrameCameraMatrices, Fram
|
|
|
65
67
|
get worldMatrix(): Matrix4.Matrix4;
|
|
66
68
|
get viewMatrix(): Matrix4.Matrix4;
|
|
67
69
|
get projectionMatrix(): Matrix4.Matrix4;
|
|
70
|
+
get projectionMatrixInverse(): Matrix4.Matrix4;
|
|
68
71
|
get projectionViewMatrix(): Matrix4.Matrix4;
|
|
69
72
|
}
|
|
70
73
|
export {};
|
|
@@ -19,4 +19,15 @@ export declare class CircleMarkup {
|
|
|
19
19
|
readonly id: string;
|
|
20
20
|
constructor(init: CircleMarkupInit);
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export interface FreeformMarkupInit {
|
|
23
|
+
bounds?: Rectangle.Rectangle;
|
|
24
|
+
points?: Point.Point[];
|
|
25
|
+
id?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare class FreeformMarkup {
|
|
28
|
+
readonly bounds: Rectangle.Rectangle;
|
|
29
|
+
readonly points: Point.Point[];
|
|
30
|
+
readonly id: string;
|
|
31
|
+
constructor(init: FreeformMarkupInit);
|
|
32
|
+
}
|
|
33
|
+
export declare type Markup = ArrowMarkup | CircleMarkup | FreeformMarkup;
|
|
@@ -88,6 +88,23 @@ export declare class Viewport implements Dimensions.Dimensions {
|
|
|
88
88
|
* @returns
|
|
89
89
|
*/
|
|
90
90
|
transformPointToRay(pt: Point.Point, image: FrameImageLike, camera: FramePerspectiveCamera): Ray.Ray;
|
|
91
|
+
/**
|
|
92
|
+
* Maps a screen point to normalized device coordinates (NDC). A screen point
|
|
93
|
+
* at 0,0 represents the top-left of the viewport.
|
|
94
|
+
*
|
|
95
|
+
* @param screenPt A screen point.
|
|
96
|
+
*/
|
|
97
|
+
transformScreenPointToNdc(screenPt: Point.Point, image: FrameImageLike): Point.Point;
|
|
98
|
+
/**
|
|
99
|
+
* Maps a point in screen space to a world point that is coplanar with the
|
|
100
|
+
* camera's near plane.
|
|
101
|
+
*
|
|
102
|
+
* @param screenPt The screen point to transform.
|
|
103
|
+
* @param image An image of frame.
|
|
104
|
+
* @param camera The camera used to map a 2D point to 3D point.
|
|
105
|
+
* @returns A point on the screen in world space.
|
|
106
|
+
*/
|
|
107
|
+
transformPointToScreenWorld(screenPt: Point.Point, image: FrameImageLike, camera: FramePerspectiveCamera): Vector3.Vector3 | undefined;
|
|
91
108
|
/**
|
|
92
109
|
* Computes a rectangle that is scaled correctly to be drawn within the
|
|
93
110
|
* viewport.
|
package/dist/viewer/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**!
|
|
2
2
|
* Copyright (c) 2021 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
export{c as ColorMaterial,l as LoadableResource,S as Scene,a as SynchronizedClock}from"./p-
|
|
4
|
+
export{c as ColorMaterial,l as LoadableResource,S as Scene,a as SynchronizedClock}from"./p-b122ee39.js";export{C as CursorManager,m as measurementCursor}from"./p-9faabd97.js";export{F as ReceivedFrame,a as ReceivedFrameImage,b as ReceivedFrameScene,c as ReceivedPerspectiveCamera}from"./p-21e8510d.js";export{A as ArrowMarkup,C as CircleMarkup,F as FreeformMarkup}from"./p-5389e9d4.js";export{V as Viewport}from"./p-b36b3d1a.js";import"./p-59d075d4.js";import"./p-640cb5f8.js";import"./p-112455b1.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* Copyright (c) 2021 Vertex Software LLC. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import{v as t}from"./p-640cb5f8.js";import{a as s}from"./p-59d075d4.js";class i{constructor(i){var r,o,e,l;this.start=null!==(r=i.start)&&void 0!==r?r:t.origin(),this.end=null!==(o=i.end)&&void 0!==o?o:t.origin(),this.invalid=null!==(e=i.invalid)&&void 0!==e&&e,this.id=null!==(l=i.id)&&void 0!==l?l:`measurement--${s.create()}`}getWorldDistance(){return t.distance(this.start,this.end)}getRealDistance(t){return t.translateRealValueToWorld(this.getWorldDistance())}}export{i as D}
|