@vertexvis/viewer 0.13.1 → 0.13.2-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{browser.esm-31b03292.js → browser.esm-c51162f8.js} +1 -1
- package/dist/cjs/{bundle.esm-dc0a8361.js → bundle.esm-1b8b1f36.js} +34 -0
- package/dist/cjs/{config-90ee43d5.js → config-91efd353.js} +2 -2
- package/dist/cjs/{cursors-ad2fd395.js → cursors-14827f58.js} +1 -1
- package/dist/cjs/{dom-dd265f48.js → dom-c697cf99.js} +1 -1
- package/dist/cjs/{entities-aa59890e.js → entities-0829b4a4.js} +3 -3
- package/dist/cjs/index.cjs.js +13 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{mapper-f6e6cafe.js → mapper-67af470b.js} +2 -2
- package/dist/cjs/{markup-fb1553b1.js → markup-835f2e83.js} +2 -2
- package/dist/cjs/{measurement-aba1e0e8.js → measurement-8e0ce89a.js} +2 -2
- package/dist/cjs/{model-4ec0c36e.js → model-78241d4f.js} +1 -1
- package/dist/cjs/{overlays-40c6cbc7.js → overlays-06786e52.js} +2 -2
- package/dist/cjs/{png-decoder-27d25eed.js → png-decoder-01b76242.js} +1 -1
- package/dist/cjs/{results-bc325974.js → results-7a694238.js} +1 -1
- package/dist/cjs/{scene-d420fd26.js → scene-23535fc0.js} +176 -85
- package/dist/cjs/{streamAttributes-d6236448.js → streamAttributes-f13c1a96.js} +1431 -41
- package/dist/cjs/{utils-f80be307.js → utils-4a02e54b.js} +1 -1
- package/dist/cjs/{utils-545b1865.js → utils-5cc32a26.js} +1 -1
- package/dist/cjs/vertex-scene-tree-search_3.cjs.entry.js +1 -1
- package/dist/cjs/vertex-scene-tree.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-dom-element_3.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-markup-arrow_3.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-markup.cjs.entry.js +4 -4
- package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +11 -11
- package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +6 -6
- package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +10 -10
- package/dist/cjs/vertex-viewer-measurement-tool.cjs.entry.js +5 -5
- package/dist/cjs/vertex-viewer-measurements.cjs.entry.js +8 -8
- package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer.cjs.entry.js +198 -79
- package/dist/cjs/viewer.cjs.js +1 -1
- package/dist/cjs/{viewport-8c39089f.js → viewport-052809c7.js} +1 -1
- package/dist/collection/components/viewer/viewer.js +68 -4
- package/dist/collection/components/viewer-dom-renderer/renderer2d.js +1 -1
- package/dist/collection/components/viewer-dom-renderer/renderer3d.js +1 -1
- package/dist/collection/components/viewer-dom-renderer/viewer-dom-renderer.js +3 -3
- package/dist/collection/components/viewer-measurement-distance/viewer-measurement-distance.js +3 -3
- package/dist/collection/components/viewer-measurement-overlays/viewer-measurement-overlays.js +3 -3
- package/dist/collection/index.js +2 -2
- package/dist/collection/lib/errors.js +8 -1
- package/dist/collection/lib/interactions/index.js +3 -1
- package/dist/collection/lib/interactions/interactionApi.js +4 -25
- package/dist/collection/lib/interactions/interactionApiOrthographic.js +50 -0
- package/dist/collection/lib/interactions/interactionApiPerspective.js +50 -0
- package/dist/collection/lib/mappers/frameStreaming.js +27 -5
- package/dist/collection/lib/rendering/matrices.js +13 -4
- package/dist/collection/lib/scenes/__mocks__/mocks.js +2 -2
- package/dist/collection/lib/scenes/camera.js +149 -77
- package/dist/collection/lib/scenes/mapper.js +3 -2
- package/dist/collection/lib/scenes/scene.js +23 -9
- package/dist/collection/lib/types/clippingPlanes.js +54 -17
- package/dist/collection/lib/types/depthBuffer.js +1 -1
- package/dist/collection/lib/types/frame.js +88 -23
- package/dist/collection/lib/types/frameCamera.js +81 -6
- package/dist/collection/lib/types/viewport.js +1 -1
- package/dist/collection/testing/fixtures.js +23 -10
- package/dist/collection/testing/viewer.js +5 -3
- package/dist/custom-elements/index.js +1821 -194
- package/dist/esm/{browser.esm-59e914f6.js → browser.esm-48f051a3.js} +1 -1
- package/dist/esm/{bundle.esm-d899b2d5.js → bundle.esm-df3a8a42.js} +35 -1
- package/dist/esm/{config-604c644e.js → config-3a5d3ea3.js} +2 -2
- package/dist/esm/{cursors-a7ec4adb.js → cursors-45f23dfe.js} +1 -1
- package/dist/esm/{dom-780d25be.js → dom-18d9ac79.js} +1 -1
- package/dist/esm/{entities-759d97cd.js → entities-60dfd79d.js} +3 -3
- package/dist/esm/index.js +12 -12
- package/dist/esm/index.mjs +12 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loader.mjs +1 -1
- package/dist/esm/{mapper-4b815e31.js → mapper-adf23dc4.js} +2 -2
- package/dist/esm/{markup-1d177b4a.js → markup-accb6b5c.js} +2 -2
- package/dist/esm/{measurement-12cdbf5c.js → measurement-6cd457a6.js} +2 -2
- package/dist/esm/{model-e5a4f00f.js → model-4982c15d.js} +1 -1
- package/dist/esm/{overlays-1919b192.js → overlays-1783a61a.js} +2 -2
- package/dist/esm/{png-decoder-3f1fa486.js → png-decoder-f35def4c.js} +1 -1
- package/dist/esm/{results-994bdb50.js → results-93d45acc.js} +1 -1
- package/dist/esm/{scene-2c2460d5.js → scene-2d8bdccc.js} +176 -85
- package/dist/esm/{streamAttributes-d623bb60.js → streamAttributes-87a3605c.js} +1426 -43
- package/dist/esm/{utils-5e57bf24.js → utils-9f4b25ec.js} +1 -1
- package/dist/esm/{utils-83a19677.js → utils-ed2346c0.js} +1 -1
- package/dist/esm/vertex-scene-tree-search_3.entry.js +1 -1
- package/dist/esm/vertex-scene-tree.entry.js +4 -4
- package/dist/esm/vertex-viewer-dom-element_3.entry.js +4 -4
- package/dist/esm/vertex-viewer-markup-arrow_3.entry.js +3 -3
- package/dist/esm/vertex-viewer-markup-tool.entry.js +4 -4
- package/dist/esm/vertex-viewer-markup.entry.js +4 -4
- package/dist/esm/vertex-viewer-measurement-details.entry.js +3 -3
- package/dist/esm/vertex-viewer-measurement-distance.entry.js +11 -11
- package/dist/esm/vertex-viewer-measurement-line_2.entry.js +6 -6
- package/dist/esm/vertex-viewer-measurement-precise.entry.js +10 -10
- package/dist/esm/vertex-viewer-measurement-tool.entry.js +5 -5
- package/dist/esm/vertex-viewer-measurements.entry.js +8 -8
- package/dist/esm/vertex-viewer-view-cube.entry.js +3 -3
- package/dist/esm/vertex-viewer.entry.js +198 -79
- package/dist/esm/viewer.js +1 -1
- package/dist/esm/{viewport-01c886ea.js → viewport-6d4c0af0.js} +1 -1
- package/dist/types/components/viewer/viewer.d.ts +8 -0
- package/dist/types/components/viewer-dom-renderer/renderer2d.d.ts +2 -2
- package/dist/types/components/viewer-dom-renderer/renderer3d.d.ts +3 -3
- package/dist/types/components/viewer-dom-renderer/viewer-dom-renderer.d.ts +2 -2
- package/dist/types/components/viewer-measurement-distance/utils.d.ts +2 -2
- package/dist/types/components/viewer-measurement-distance/viewer-measurement-distance.d.ts +2 -2
- package/dist/types/components/viewer-measurement-overlays/viewer-measurement-overlays-components.d.ts +2 -2
- package/dist/types/components/viewer-measurement-overlays/viewer-measurement-overlays.d.ts +2 -2
- package/dist/types/components.d.ts +15 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lib/errors.d.ts +3 -0
- package/dist/types/lib/interactions/index.d.ts +2 -0
- package/dist/types/lib/interactions/interactionApi.d.ts +20 -21
- package/dist/types/lib/interactions/interactionApiOrthographic.d.ts +21 -0
- package/dist/types/lib/interactions/interactionApiPerspective.d.ts +21 -0
- package/dist/types/lib/mappers/frameStreaming.d.ts +2 -0
- package/dist/types/lib/scenes/__mocks__/mocks.d.ts +2 -2
- package/dist/types/lib/scenes/camera.d.ts +100 -37
- package/dist/types/lib/scenes/scene.d.ts +1 -1
- package/dist/types/lib/types/clippingPlanes.d.ts +3 -1
- package/dist/types/lib/types/depthBuffer.d.ts +4 -4
- package/dist/types/lib/types/frame.d.ts +54 -11
- package/dist/types/lib/types/frameCamera.d.ts +21 -2
- package/dist/types/lib/types/viewport.d.ts +2 -3
- package/dist/types/testing/fixtures.d.ts +4 -2
- package/dist/viewer/index.esm.js +1 -1
- package/dist/viewer/{p-3f6ac74f.js → p-014561cd.js} +1 -1
- package/dist/viewer/p-121f2b40.js +18 -0
- package/dist/viewer/p-18ec4fed.js +4 -0
- package/dist/viewer/{p-e2297df2.entry.js → p-1acd0e56.entry.js} +1 -1
- package/dist/viewer/{p-da2f4a56.js → p-25dfee48.js} +1 -1
- package/dist/viewer/p-2e75198d.js +4 -0
- package/dist/viewer/p-38c06c25.js +4 -0
- package/dist/viewer/{p-67446e35.js → p-463151e0.js} +1 -1
- package/dist/viewer/{p-301660cf.js → p-546ae240.js} +1 -1
- package/dist/viewer/{p-d00e9203.js → p-6120a219.js} +1 -1
- package/dist/viewer/p-61db972b.js +4 -0
- package/dist/viewer/{p-a0df0e0c.js → p-6d9d3553.js} +1 -1
- package/dist/viewer/{p-f8d01b8a.entry.js → p-7c5bee8e.entry.js} +1 -1
- package/dist/viewer/{p-8decee06.entry.js → p-8de749a5.entry.js} +1 -1
- package/dist/viewer/{p-081e6873.js → p-8df35eee.js} +1 -1
- package/dist/viewer/{p-671c113c.entry.js → p-923b616f.entry.js} +1 -1
- package/dist/viewer/p-9b1ecc71.js +4 -0
- package/dist/viewer/{p-3810c24d.js → p-9fd5fc8e.js} +1 -1
- package/dist/viewer/p-b2d4c0cf.entry.js +4 -0
- package/dist/viewer/{p-364ce21c.js → p-b8bc15ec.js} +1 -1
- package/dist/viewer/{p-439220c6.js → p-b8f027eb.js} +1 -1
- package/dist/viewer/p-bc7f0ad6.entry.js +4 -0
- package/dist/viewer/{p-2cefb1b0.js → p-ce0fe8be.js} +1 -1
- package/dist/viewer/p-d939ecd3.entry.js +4 -0
- package/dist/viewer/{p-25eaab00.entry.js → p-de7eecce.entry.js} +1 -1
- package/dist/viewer/{p-4985fad5.js → p-e3fff448.js} +1 -1
- package/dist/viewer/{p-6e80f8b0.entry.js → p-e4934f47.entry.js} +1 -1
- package/dist/viewer/{p-df292b56.entry.js → p-e8f6cba6.entry.js} +1 -1
- package/dist/viewer/{p-353cfc7a.entry.js → p-ee86bed2.entry.js} +1 -1
- package/dist/viewer/{p-c62cb926.entry.js → p-f359a9ac.entry.js} +1 -1
- package/dist/viewer/{p-e07377fa.entry.js → p-fa7f2d0c.entry.js} +1 -1
- package/dist/viewer/{p-915d95ad.entry.js → p-ffde162f.entry.js} +1 -1
- package/dist/viewer/viewer.esm.js +1 -1
- package/package.json +8 -8
- package/dist/viewer/p-085e908a.js +0 -4
- package/dist/viewer/p-0aba71fd.js +0 -18
- package/dist/viewer/p-423410be.js +0 -4
- package/dist/viewer/p-432267bc.entry.js +0 -4
- package/dist/viewer/p-7cad9bf4.js +0 -4
- package/dist/viewer/p-d90f2f6d.entry.js +0 -4
- package/dist/viewer/p-f755af5a.entry.js +0 -4
- package/dist/viewer/p-f7cb7e59.js +0 -4
- package/dist/viewer/p-fe11d694.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BoundingBox, Vector3 } from '@vertexvis/geometry';
|
|
2
2
|
import { StreamApi } from '@vertexvis/stream-api';
|
|
3
3
|
import { FrameDecoder } from '../mappers';
|
|
4
|
-
import { Animation, FlyTo, FrameCamera, FramePerspectiveCamera, StandardView } from '../types';
|
|
4
|
+
import { Animation, ClippingPlanes, FlyTo, FrameCamera, FrameCameraBase, FrameOrthographicCamera, FramePerspectiveCamera, StandardView } from '../types';
|
|
5
5
|
import { CameraRenderResult } from './cameraRenderResult';
|
|
6
6
|
interface CameraRenderOptions {
|
|
7
7
|
animation?: Animation.Animation;
|
|
@@ -35,28 +35,22 @@ export interface FlyToParams {
|
|
|
35
35
|
* This class in intended to treated as an immutable type. Any mutations return
|
|
36
36
|
* a new instance of the class with the updated properties.
|
|
37
37
|
*/
|
|
38
|
-
export declare class Camera
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
export declare abstract class Camera {
|
|
39
|
+
protected stream: StreamApi;
|
|
40
|
+
protected aspect: number;
|
|
41
41
|
private data;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
constructor(stream: StreamApi, aspect: number, data: FrameCamera.FrameCamera, boundingBox: BoundingBox.BoundingBox, decodeFrame: FrameDecoder);
|
|
46
|
-
|
|
47
|
-
* Updates the position of the camera such that the given bounding box will
|
|
48
|
-
* be contained within the camera's view.
|
|
49
|
-
*
|
|
50
|
-
* @param boundingBox The bounding box to position to.
|
|
51
|
-
*/
|
|
52
|
-
fitToBoundingBox(boundingBox: BoundingBox.BoundingBox): Camera;
|
|
42
|
+
protected boundingBox: BoundingBox.BoundingBox;
|
|
43
|
+
protected decodeFrame: FrameDecoder;
|
|
44
|
+
protected flyToOptions?: FlyTo.FlyToOptions | undefined;
|
|
45
|
+
constructor(stream: StreamApi, aspect: number, data: FrameCamera.FrameCamera, boundingBox: BoundingBox.BoundingBox, decodeFrame: FrameDecoder, flyToOptions?: FlyTo.FlyToOptions | undefined);
|
|
46
|
+
protected fitCameraToBoundingBox(boundingBox: BoundingBox.BoundingBox, fovVertical: number, viewVector: Vector3.Vector3): Camera;
|
|
53
47
|
/**
|
|
54
48
|
* Returns the distance from the camera's position to the center
|
|
55
49
|
* of the provided bounding box (or the scene's visible bounding box if not provided).
|
|
56
50
|
*
|
|
57
51
|
* @param boundingBox - The bounding box to determine distance from.
|
|
58
52
|
*/
|
|
59
|
-
|
|
53
|
+
signedDistanceToBoundingBoxCenter(boundingBox?: BoundingBox.BoundingBox): number;
|
|
60
54
|
/**
|
|
61
55
|
* Specifies that the next render of the camera will be repositioned to one of
|
|
62
56
|
* the options specified in `options`.
|
|
@@ -65,13 +59,6 @@ export declare class Camera implements FrameCamera.FrameCamera {
|
|
|
65
59
|
* be positioned.
|
|
66
60
|
*/
|
|
67
61
|
flyTo(paramsOrQuery: FlyToParams | ((q: FlyToExecutor) => TerminalFlyToExecutor)): Camera;
|
|
68
|
-
/**
|
|
69
|
-
* Shifts the position of the camera by the given delta.
|
|
70
|
-
*
|
|
71
|
-
* @param delta The number of units to shift the camera on the X, Y, and Z
|
|
72
|
-
* axis.
|
|
73
|
-
*/
|
|
74
|
-
moveBy(delta: Vector3.Vector3): Camera;
|
|
75
62
|
viewAll(): Camera;
|
|
76
63
|
/**
|
|
77
64
|
* Queues the rendering for a new frame using this camera. The returned
|
|
@@ -85,6 +72,16 @@ export declare class Camera implements FrameCamera.FrameCamera {
|
|
|
85
72
|
* @param axis A normalized vector to rotate around.
|
|
86
73
|
*/
|
|
87
74
|
rotateAroundAxis(angleInRadians: number, axis: Vector3.Vector3): Camera;
|
|
75
|
+
/**
|
|
76
|
+
* Updates the `position` and `up` vectors of the camera to the given standard
|
|
77
|
+
* view.
|
|
78
|
+
*
|
|
79
|
+
* @param standardView The standard view to apply.
|
|
80
|
+
* @returns A new camera.
|
|
81
|
+
*/
|
|
82
|
+
standardView(standardView: StandardView): Camera;
|
|
83
|
+
private buildFlyToType;
|
|
84
|
+
protected computeClippingPlanes(camera: FrameCamera.FrameCamera): ClippingPlanes.ClippingPlanes;
|
|
88
85
|
/**
|
|
89
86
|
* Repositions the camera by rotating its current position around an axis
|
|
90
87
|
* defined at a specific world point.
|
|
@@ -93,32 +90,55 @@ export declare class Camera implements FrameCamera.FrameCamera {
|
|
|
93
90
|
* @param point The point in world space to place the axis at.
|
|
94
91
|
* @param axis A normalized vector to rotate around.
|
|
95
92
|
*/
|
|
96
|
-
rotateAroundAxisAtPoint(angleInRadians: number, point: Vector3.Vector3, axis: Vector3.Vector3): Camera;
|
|
93
|
+
abstract rotateAroundAxisAtPoint(angleInRadians: number, point: Vector3.Vector3, axis: Vector3.Vector3): Camera;
|
|
97
94
|
/**
|
|
98
|
-
* Updates the
|
|
99
|
-
* view.
|
|
95
|
+
* Updates the position of the camera such that the given bounding box will
|
|
96
|
+
* be contained within the camera's view.
|
|
100
97
|
*
|
|
101
|
-
* @param
|
|
102
|
-
* @returns A new camera.
|
|
98
|
+
* @param boundingBox The bounding box to position to.
|
|
103
99
|
*/
|
|
104
|
-
|
|
100
|
+
abstract fitToBoundingBox(boundingBox: BoundingBox.BoundingBox): Camera;
|
|
101
|
+
abstract get position(): Vector3.Vector3;
|
|
102
|
+
abstract get lookAt(): Vector3.Vector3;
|
|
103
|
+
abstract get up(): Vector3.Vector3;
|
|
104
|
+
abstract get near(): number;
|
|
105
|
+
abstract get far(): number;
|
|
106
|
+
abstract get aspectRatio(): number;
|
|
107
|
+
abstract get viewVector(): Vector3.Vector3;
|
|
108
|
+
/**
|
|
109
|
+
* Shifts the position of the camera by the given delta.
|
|
110
|
+
*
|
|
111
|
+
* @param delta The number of units to shift the camera on the X, Y, and Z
|
|
112
|
+
* axis.
|
|
113
|
+
*/
|
|
114
|
+
abstract moveBy(delta: Vector3.Vector3): Camera;
|
|
105
115
|
/**
|
|
106
116
|
* Updates the `position`, `lookAt` and/or `up` vectors of the camera.
|
|
107
117
|
*
|
|
108
118
|
* @param camera The values to update the camera to.
|
|
109
119
|
*/
|
|
110
|
-
update(camera: Partial<FrameCamera.FrameCamera>): Camera;
|
|
120
|
+
abstract update(camera: Partial<FrameCamera.FrameCamera>): Camera;
|
|
111
121
|
/**
|
|
112
|
-
* Returns a `
|
|
122
|
+
* Returns a `FrameCameraBase` representation.
|
|
113
123
|
*/
|
|
114
|
-
toFrameCamera():
|
|
115
|
-
|
|
116
|
-
|
|
124
|
+
abstract toFrameCamera(): FrameCameraBase;
|
|
125
|
+
protected abstract updateFlyToOptions(flyToOptions?: FlyTo.FlyToOptions): Camera;
|
|
126
|
+
}
|
|
127
|
+
export declare class PerspectiveCamera extends Camera implements FrameCamera.PerspectiveFrameCamera {
|
|
128
|
+
private perspectiveData;
|
|
129
|
+
constructor(stream: StreamApi, aspect: number, perspectiveData: FrameCamera.PerspectiveFrameCamera, boundingBox: BoundingBox.BoundingBox, decodeFrame: FrameDecoder, flyToOptions?: FlyTo.FlyToOptions);
|
|
117
130
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
131
|
+
* Shifts the position of the camera by the given delta.
|
|
132
|
+
*
|
|
133
|
+
* @param delta The number of units to shift the camera on the X, Y, and Z
|
|
134
|
+
* axis.
|
|
120
135
|
*/
|
|
121
|
-
|
|
136
|
+
moveBy(delta: Vector3.Vector3): Camera;
|
|
137
|
+
rotateAroundAxisAtPoint(angleInRadians: number, point: Vector3.Vector3, axis: Vector3.Vector3): Camera;
|
|
138
|
+
fitToBoundingBox(boundingBox: BoundingBox.BoundingBox): Camera;
|
|
139
|
+
update(camera: Partial<FrameCamera.FrameCamera>): Camera;
|
|
140
|
+
toFrameCamera(): FramePerspectiveCamera;
|
|
141
|
+
get viewVector(): Vector3.Vector3;
|
|
122
142
|
/**
|
|
123
143
|
* The position vector for the camera, in world space coordinates.
|
|
124
144
|
*/
|
|
@@ -147,5 +167,48 @@ export declare class Camera implements FrameCamera.FrameCamera {
|
|
|
147
167
|
* The camera's far clipping plane.
|
|
148
168
|
*/
|
|
149
169
|
get far(): number;
|
|
170
|
+
protected updateFlyToOptions(flyToOptions?: FlyTo.FlyToOptions): PerspectiveCamera;
|
|
171
|
+
}
|
|
172
|
+
export declare class OrthographicCamera extends Camera implements FrameCamera.OrthographicFrameCamera {
|
|
173
|
+
private orthographicData;
|
|
174
|
+
constructor(stream: StreamApi, aspect: number, orthographicData: FrameCamera.OrthographicFrameCamera, boundingBox: BoundingBox.BoundingBox, decodeFrame: FrameDecoder, flyToOptions?: FlyTo.FlyToOptions);
|
|
175
|
+
/**
|
|
176
|
+
* Shifts the position of the camera by the given delta.
|
|
177
|
+
*
|
|
178
|
+
* @param delta The number of units to shift the camera on the X, Y, and Z
|
|
179
|
+
* axis.
|
|
180
|
+
*/
|
|
181
|
+
moveBy(delta: Vector3.Vector3): Camera;
|
|
182
|
+
rotateAroundAxisAtPoint(angleInRadians: number, point: Vector3.Vector3, axis: Vector3.Vector3): Camera;
|
|
183
|
+
fitToBoundingBox(boundingBox: BoundingBox.BoundingBox): Camera;
|
|
184
|
+
update(camera: Partial<FrameCamera.FrameCamera>): Camera;
|
|
185
|
+
toFrameCamera(): FrameOrthographicCamera;
|
|
186
|
+
get viewVector(): Vector3.Vector3;
|
|
187
|
+
get position(): Vector3.Vector3;
|
|
188
|
+
/**
|
|
189
|
+
* A normalized vector representing the up direction.
|
|
190
|
+
*/
|
|
191
|
+
get up(): Vector3.Vector3;
|
|
192
|
+
/**
|
|
193
|
+
* A vector, in world space coordinates, of where the camera is pointed at.
|
|
194
|
+
*/
|
|
195
|
+
get lookAt(): Vector3.Vector3;
|
|
196
|
+
/**
|
|
197
|
+
* The camera's field of view.
|
|
198
|
+
*/
|
|
199
|
+
get fovHeight(): number;
|
|
200
|
+
/**
|
|
201
|
+
* The aspect ratio of the camera.
|
|
202
|
+
*/
|
|
203
|
+
get aspectRatio(): number;
|
|
204
|
+
/**
|
|
205
|
+
* The camera's near clipping plane.
|
|
206
|
+
*/
|
|
207
|
+
get near(): number;
|
|
208
|
+
/**
|
|
209
|
+
* The camera's far clipping plane.
|
|
210
|
+
*/
|
|
211
|
+
get far(): number;
|
|
212
|
+
protected updateFlyToOptions(flyToOptions?: FlyTo.FlyToOptions): OrthographicCamera;
|
|
150
213
|
}
|
|
151
214
|
export {};
|
|
@@ -4,7 +4,7 @@ import { StreamApi } from '@vertexvis/stream-api';
|
|
|
4
4
|
import { UUID } from '@vertexvis/utils';
|
|
5
5
|
import { FrameDecoder } from '../mappers';
|
|
6
6
|
import { Frame } from '../types/frame';
|
|
7
|
-
import { Camera } from '
|
|
7
|
+
import { Camera } from '.';
|
|
8
8
|
import { ColorMaterial } from './colorMaterial';
|
|
9
9
|
import { CrossSectioner } from './crossSectioner';
|
|
10
10
|
import { ItemOperation, SceneItemOperations, SceneOperationBuilder } from './operations';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BoundingBox } from '@vertexvis/geometry';
|
|
2
|
-
import { FrameCamera } from './frameCamera';
|
|
2
|
+
import { FrameCamera, OrthographicFrameCamera, PerspectiveFrameCamera } from './frameCamera';
|
|
3
3
|
export interface ClippingPlanes {
|
|
4
4
|
near: number;
|
|
5
5
|
far: number;
|
|
6
6
|
}
|
|
7
7
|
export declare function fromBoundingBoxAndLookAtCamera(boundingBox: BoundingBox.BoundingBox, camera: FrameCamera): ClippingPlanes;
|
|
8
|
+
export declare function fromBoundingBoxAndPerspectiveCamera(boundingBox: BoundingBox.BoundingBox, camera: PerspectiveFrameCamera): ClippingPlanes;
|
|
9
|
+
export declare function fromBoundingBoxAndOrthographicCamera(boundingBox: BoundingBox.BoundingBox, camera: OrthographicFrameCamera): ClippingPlanes;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Point, Ray } from '@vertexvis/geometry';
|
|
2
2
|
import { Vector3 } from '@vertexvis/geometry';
|
|
3
3
|
import type { DecodedPng } from 'fast-png';
|
|
4
|
-
import {
|
|
4
|
+
import { FrameCameraWithMatrices, FrameImageLike, ImageAttributesLike } from './frame';
|
|
5
5
|
import { Viewport } from './viewport';
|
|
6
6
|
/**
|
|
7
7
|
* A `DepthBuffer` represents the depth information for a rendered frame. This
|
|
@@ -13,7 +13,7 @@ import { Viewport } from './viewport';
|
|
|
13
13
|
* a relative distance between the camera's near and far planes.
|
|
14
14
|
*/
|
|
15
15
|
export declare class DepthBuffer implements FrameImageLike {
|
|
16
|
-
readonly camera:
|
|
16
|
+
readonly camera: FrameCameraWithMatrices;
|
|
17
17
|
readonly imageAttr: ImageAttributesLike;
|
|
18
18
|
readonly pixels: Uint16Array;
|
|
19
19
|
/**
|
|
@@ -28,7 +28,7 @@ export declare class DepthBuffer implements FrameImageLike {
|
|
|
28
28
|
* @param imageAttr The attributes of the depth buffer image.
|
|
29
29
|
* @param pixels A 16-bit typed array of depth values.
|
|
30
30
|
*/
|
|
31
|
-
constructor(camera:
|
|
31
|
+
constructor(camera: FrameCameraWithMatrices, imageAttr: ImageAttributesLike, pixels: Uint16Array);
|
|
32
32
|
/**
|
|
33
33
|
* Creates a `DepthBuffer` from a decoded PNG.
|
|
34
34
|
*
|
|
@@ -38,7 +38,7 @@ export declare class DepthBuffer implements FrameImageLike {
|
|
|
38
38
|
* @throws If the PNG is not a single channel, 16-bit image.
|
|
39
39
|
* @returns A depth buffer.
|
|
40
40
|
*/
|
|
41
|
-
static fromPng(png: Pick<DecodedPng, 'data'>, camera:
|
|
41
|
+
static fromPng(png: Pick<DecodedPng, 'data'>, camera: FrameCameraWithMatrices, imageAttr: ImageAttributesLike): DepthBuffer;
|
|
42
42
|
/**
|
|
43
43
|
* Computes the depth from a 2D point within the coordinate space of the depth
|
|
44
44
|
* buffer. The returned depth is a value that's between the near and far plane
|
|
@@ -34,40 +34,47 @@ export declare class FrameImage implements FrameImageLike {
|
|
|
34
34
|
constructor(imageAttr: ImageAttributesLike, imageBytes: Uint8Array);
|
|
35
35
|
}
|
|
36
36
|
export declare class FrameScene {
|
|
37
|
-
readonly camera:
|
|
37
|
+
readonly camera: FrameCameraBase;
|
|
38
38
|
readonly boundingBox: BoundingBox.BoundingBox;
|
|
39
39
|
readonly crossSection: CrossSectioning.CrossSectioning;
|
|
40
40
|
readonly worldOrientation: Orientation;
|
|
41
41
|
readonly hasChanged: boolean;
|
|
42
|
-
constructor(camera:
|
|
42
|
+
constructor(camera: FrameCameraBase, boundingBox: BoundingBox.BoundingBox, crossSection: CrossSectioning.CrossSectioning, worldOrientation: Orientation, hasChanged: boolean);
|
|
43
43
|
}
|
|
44
44
|
interface FrameCameraMatrices {
|
|
45
|
-
readonly worldMatrix: Matrix4.Matrix4;
|
|
46
|
-
readonly viewMatrix: Matrix4.Matrix4;
|
|
47
45
|
readonly projectionMatrix: Matrix4.Matrix4;
|
|
48
46
|
readonly projectionMatrixInverse: Matrix4.Matrix4;
|
|
47
|
+
readonly worldMatrix: Matrix4.Matrix4;
|
|
48
|
+
readonly viewMatrix: Matrix4.Matrix4;
|
|
49
49
|
readonly projectionViewMatrix: Matrix4.Matrix4;
|
|
50
50
|
}
|
|
51
|
-
interface
|
|
51
|
+
interface FrameCameraLike {
|
|
52
52
|
readonly position: Vector3.Vector3;
|
|
53
53
|
readonly lookAt: Vector3.Vector3;
|
|
54
54
|
readonly up: Vector3.Vector3;
|
|
55
55
|
readonly near: number;
|
|
56
56
|
readonly far: number;
|
|
57
57
|
readonly aspectRatio: number;
|
|
58
|
+
}
|
|
59
|
+
interface FramePerspectiveCameraLike {
|
|
58
60
|
readonly fovY: number;
|
|
59
61
|
}
|
|
60
|
-
|
|
62
|
+
interface FrameOrthographicCameraLike {
|
|
63
|
+
readonly fovHeight: number;
|
|
64
|
+
readonly top: number;
|
|
65
|
+
readonly bottom: number;
|
|
66
|
+
readonly right: number;
|
|
67
|
+
readonly left: number;
|
|
68
|
+
}
|
|
69
|
+
export declare class FrameCameraBase implements FrameCameraLike {
|
|
61
70
|
readonly position: Vector3.Vector3;
|
|
62
71
|
readonly lookAt: Vector3.Vector3;
|
|
63
72
|
readonly up: Vector3.Vector3;
|
|
64
73
|
readonly near: number;
|
|
65
74
|
readonly far: number;
|
|
66
75
|
readonly aspectRatio: number;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
constructor(position: Vector3.Vector3, lookAt: Vector3.Vector3, up: Vector3.Vector3, near: number, far: number, aspectRatio: number, fovY: number);
|
|
70
|
-
static fromBoundingBox(camera: FrameCamera.FrameCamera, boundingBox: BoundingBox.BoundingBox, aspectRatio: number): FramePerspectiveCamera;
|
|
76
|
+
protected cameraMatrices?: FrameCameraMatrices;
|
|
77
|
+
constructor(position: Vector3.Vector3, lookAt: Vector3.Vector3, up: Vector3.Vector3, near: number, far: number, aspectRatio: number);
|
|
71
78
|
get direction(): Vector3.Vector3;
|
|
72
79
|
get viewVector(): Vector3.Vector3;
|
|
73
80
|
get worldMatrix(): Matrix4.Matrix4;
|
|
@@ -75,7 +82,7 @@ export declare class FramePerspectiveCamera implements FrameCameraMatrices, Fram
|
|
|
75
82
|
get projectionMatrix(): Matrix4.Matrix4;
|
|
76
83
|
get projectionMatrixInverse(): Matrix4.Matrix4;
|
|
77
84
|
get projectionViewMatrix(): Matrix4.Matrix4;
|
|
78
|
-
|
|
85
|
+
static fromBoundingBox(camera: FrameCamera.FrameCamera, boundingBox: BoundingBox.BoundingBox, aspectRatio: number): FrameCameraBase;
|
|
79
86
|
/**
|
|
80
87
|
* Checks if the given point, in world space, is behind the near plane
|
|
81
88
|
* of the camera.
|
|
@@ -93,5 +100,41 @@ export declare class FramePerspectiveCamera implements FrameCameraMatrices, Fram
|
|
|
93
100
|
* intersect with the near plane.
|
|
94
101
|
*/
|
|
95
102
|
intersectLineWithNear(line: Line3.Line3): Vector3.Vector3 | undefined;
|
|
103
|
+
protected computeCameraMatrices(): FrameCameraMatrices;
|
|
104
|
+
protected updateCameraMatrices(cameraMatrices: FrameCameraMatrices): FrameCameraMatrices;
|
|
105
|
+
}
|
|
106
|
+
export interface FrameCameraWithMatrices extends FrameCameraBase {
|
|
107
|
+
readonly direction: Vector3.Vector3;
|
|
108
|
+
readonly viewVector: Vector3.Vector3;
|
|
109
|
+
readonly worldMatrix: Matrix4.Matrix4;
|
|
110
|
+
readonly viewMatrix: Matrix4.Matrix4;
|
|
111
|
+
readonly projectionMatrix: Matrix4.Matrix4;
|
|
112
|
+
readonly projectionMatrixInverse: Matrix4.Matrix4;
|
|
113
|
+
readonly projectionViewMatrix: Matrix4.Matrix4;
|
|
114
|
+
}
|
|
115
|
+
export declare class FramePerspectiveCamera extends FrameCameraBase implements FrameCameraWithMatrices, FramePerspectiveCameraLike {
|
|
116
|
+
readonly position: Vector3.Vector3;
|
|
117
|
+
readonly lookAt: Vector3.Vector3;
|
|
118
|
+
readonly up: Vector3.Vector3;
|
|
119
|
+
readonly near: number;
|
|
120
|
+
readonly far: number;
|
|
121
|
+
readonly aspectRatio: number;
|
|
122
|
+
readonly fovY: number;
|
|
123
|
+
constructor(position: Vector3.Vector3, lookAt: Vector3.Vector3, up: Vector3.Vector3, near: number, far: number, aspectRatio: number, fovY: number);
|
|
124
|
+
protected computeCameraMatrices(): FrameCameraMatrices;
|
|
125
|
+
}
|
|
126
|
+
export declare class FrameOrthographicCamera extends FrameCameraBase implements FrameCameraWithMatrices, FrameOrthographicCameraLike {
|
|
127
|
+
readonly lookAt: Vector3.Vector3;
|
|
128
|
+
readonly up: Vector3.Vector3;
|
|
129
|
+
readonly near: number;
|
|
130
|
+
readonly far: number;
|
|
131
|
+
readonly aspectRatio: number;
|
|
132
|
+
readonly fovHeight: number;
|
|
133
|
+
readonly top: number;
|
|
134
|
+
readonly bottom: number;
|
|
135
|
+
readonly right: number;
|
|
136
|
+
readonly left: number;
|
|
137
|
+
constructor(viewVector: Vector3.Vector3, lookAt: Vector3.Vector3, up: Vector3.Vector3, near: number, far: number, aspectRatio: number, fovHeight: number);
|
|
138
|
+
protected computeCameraMatrices(): FrameCameraMatrices;
|
|
96
139
|
}
|
|
97
140
|
export {};
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
+
import { vertexvis } from '@vertexvis/frame-streaming-protos';
|
|
1
2
|
import { Vector3 } from '@vertexvis/geometry';
|
|
2
|
-
export interface
|
|
3
|
+
export interface PerspectiveFrameCamera {
|
|
3
4
|
position: Vector3.Vector3;
|
|
4
5
|
lookAt: Vector3.Vector3;
|
|
5
6
|
up: Vector3.Vector3;
|
|
7
|
+
fovY: number;
|
|
6
8
|
}
|
|
7
|
-
export
|
|
9
|
+
export interface OrthographicFrameCamera {
|
|
10
|
+
viewVector: Vector3.Vector3;
|
|
11
|
+
lookAt: Vector3.Vector3;
|
|
12
|
+
up: Vector3.Vector3;
|
|
13
|
+
fovHeight: number;
|
|
14
|
+
}
|
|
15
|
+
export declare type FrameCamera = PerspectiveFrameCamera | OrthographicFrameCamera;
|
|
16
|
+
export declare function isPerspectiveFrameCamera(camera: Partial<FrameCamera>): camera is PerspectiveFrameCamera;
|
|
17
|
+
export declare function isOrthographicFrameCamera(camera: Partial<FrameCamera>): camera is OrthographicFrameCamera;
|
|
18
|
+
export declare function withPositionAndViewVector(camera: FrameCamera): FrameCamera & {
|
|
19
|
+
position: Vector3.Vector3;
|
|
20
|
+
viewVector: Vector3.Vector3;
|
|
21
|
+
};
|
|
22
|
+
export declare function createPerspective(data?: Partial<PerspectiveFrameCamera>): PerspectiveFrameCamera;
|
|
23
|
+
export declare function createOrthographic(data?: Partial<OrthographicFrameCamera>): OrthographicFrameCamera;
|
|
24
|
+
export declare function toOrthographic(data: PerspectiveFrameCamera): OrthographicFrameCamera;
|
|
25
|
+
export declare function toPerspective(data: OrthographicFrameCamera, fovY?: number): PerspectiveFrameCamera;
|
|
26
|
+
export declare function toProtobuf(camera: Partial<FrameCamera>): vertexvis.protobuf.stream.ICamera;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Dimensions, Matrix4, Point, Ray, Rectangle, Vector3 } from '@vertexvis/geometry';
|
|
2
2
|
import { DepthBuffer } from './depthBuffer';
|
|
3
|
-
import type { FrameImageLike } from './frame';
|
|
4
|
-
import { FramePerspectiveCamera } from './frame';
|
|
3
|
+
import type { FrameCameraWithMatrices, FrameImageLike } from './frame';
|
|
5
4
|
/**
|
|
6
5
|
* A `Viewport` represents the drawing area in the viewer.
|
|
7
6
|
*
|
|
@@ -88,7 +87,7 @@ export declare class Viewport implements Dimensions.Dimensions {
|
|
|
88
87
|
* @param camera A camera used to determine orientation of the scene.
|
|
89
88
|
* @returns
|
|
90
89
|
*/
|
|
91
|
-
transformPointToRay(pt: Point.Point, image: FrameImageLike, camera:
|
|
90
|
+
transformPointToRay(pt: Point.Point, image: FrameImageLike, camera: FrameCameraWithMatrices): Ray.Ray;
|
|
92
91
|
/**
|
|
93
92
|
* Maps a screen point to normalized device coordinates (NDC). A screen point
|
|
94
93
|
* at 0,0 represents the top-left of the viewport.
|
|
@@ -5,8 +5,10 @@ import { PointToPointHitTester } from '../components/viewer-measurement-distance
|
|
|
5
5
|
import { PointToPointHitProvider } from '../components/viewer-measurement-distance/interactions';
|
|
6
6
|
import { RaycasterLike } from '../lib/scenes/raycaster';
|
|
7
7
|
import { DepthBuffer, FeatureMap, Frame, ImageAttributesLike, StencilBuffer, Viewport } from '../lib/types';
|
|
8
|
-
export declare const
|
|
9
|
-
export declare
|
|
8
|
+
export declare const drawFramePayloadPerspective: DrawFramePayload;
|
|
9
|
+
export declare const drawFramePayloadOrthographic: DrawFramePayload;
|
|
10
|
+
export declare function makePerspectiveFrame(): Frame;
|
|
11
|
+
export declare function makeOrthographicFrame(): Frame;
|
|
10
12
|
export declare function makeImagePng(width: number, height: number): Uint8Array;
|
|
11
13
|
export declare function makeDepthImagePng(width: number, height: number, value?: number): Uint8Array;
|
|
12
14
|
export declare function makeDepthImageBytes(width: number, height: number, value?: number): Uint16Array;
|
package/dist/viewer/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**!
|
|
2
2
|
* Copyright (c) 2022 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-2e75198d.js";export{C as CursorManager,m as measurementCursor,a as measurementWithArrowCursor}from"./p-6120a219.js";export{M as MeasurementController,a as MeasurementEntity}from"./p-b8bc15ec.js";export{M as MeasurementModel}from"./p-25dfee48.js";export{M as MeasurementOverlayManager}from"./p-9fd5fc8e.js";export{m as makeMinimumDistanceResult}from"./p-463151e0.js";export{A as AngleUnits,e as AreaUnits,D as DistanceUnits,E as EntityType,F as ReceivedFrame,a as ReceivedFrameImage,b as ReceivedFrameScene,c as ReceivedOrthographicCamera,d as ReceivedPerspectiveCamera}from"./p-18ec4fed.js";export{A as ArrowMarkup,C as CircleMarkup,F as FreeformMarkup}from"./p-8df35eee.js";export{V as Viewport}from"./p-e3fff448.js";import"./p-546ae240.js";import"./p-121f2b40.js";import"./p-61db972b.js";import"./p-112455b1.js";import"./p-3a20a038.js";
|