@cognite/reveal 4.34.0 → 4.34.1
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/README.md +13 -13
- package/dist/api-entry-points/core.d.ts +1 -1
- package/dist/assets/eptBinaryDecoder.worker-XgCyWWQG.js.map +1 -0
- package/dist/index.js +3508 -3502
- package/dist/index.js.map +1 -1
- package/dist/packages/360-images/src/entity/Image360VisualizationBox.d.ts +6 -9
- package/dist/packages/api/src/public/RevealManager.d.ts +6 -9
- package/dist/packages/api/src/public/RevealOptions.d.ts +2 -5
- package/dist/packages/api/src/public/createRevealManager.d.ts +3 -6
- package/dist/packages/api/src/public/migration/Cognite3DViewer.d.ts +36 -39
- package/dist/packages/api/src/storage/RevealManagerHelper.d.ts +4 -7
- package/dist/packages/api/src/utilities/Spinner.d.ts +2 -5
- package/dist/packages/cad-geometry-loaders/src/CadManager.d.ts +4 -7
- package/dist/packages/cad-geometry-loaders/src/CadModelUpdateHandler.d.ts +3 -6
- package/dist/packages/cad-geometry-loaders/src/sector/culling/WeightFunctionsHelper.d.ts +9 -12
- package/dist/packages/cad-geometry-loaders/src/sector/culling/computeNdcAreaOfBox.d.ts +2 -5
- package/dist/packages/cad-geometry-loaders/src/sector/culling/transformBoxToNDC.d.ts +2 -5
- package/dist/packages/cad-geometry-loaders/src/sector/culling/types.d.ts +5 -8
- package/dist/packages/cad-model/src/picking/PickingHandler.d.ts +4 -7
- package/dist/packages/cad-model/src/utilities/BoundingBoxClipper.d.ts +3 -6
- package/dist/packages/cad-model/src/utilities/CustomSectorBounds.d.ts +3 -6
- package/dist/packages/cad-model/src/wrappers/CogniteCadModel.d.ts +19 -22
- package/dist/packages/cad-model/visual-tests/DebugLoadedSectorsTool.d.ts +2 -5
- package/dist/packages/cad-model/visual-tests/SectorBoundingBoxes.VisualTest.d.ts +2 -5
- package/dist/packages/cad-parsers/src/cad/filterPrimitivesCommon.d.ts +2 -5
- package/dist/packages/cad-parsers/src/cad/filterPrimitivesV9.d.ts +2 -2
- package/dist/packages/cad-parsers/src/cad/types.d.ts +3 -6
- package/dist/packages/cad-parsers/src/metadata/CadModelClipper.d.ts +2 -5
- package/dist/packages/cad-parsers/src/metadata/CadModelMetadata.d.ts +4 -7
- package/dist/packages/cad-parsers/src/metadata/parsers/CadMetadataParserGltf.d.ts +2 -5
- package/dist/packages/cad-parsers/src/metadata/types.d.ts +3 -6
- package/dist/packages/cad-parsers/src/sector/RootSectorNode.d.ts +3 -6
- package/dist/packages/cad-parsers/src/sector/SectorNode.d.ts +6 -9
- package/dist/packages/cad-parsers/src/utilities/SectorScene.d.ts +5 -8
- package/dist/packages/cad-parsers/src/utilities/computeBoundingBoxFromAttributes.d.ts +6 -9
- package/dist/packages/cad-parsers/src/utilities/types.d.ts +6 -9
- package/dist/packages/cad-styling/index.d.ts +1 -1
- package/dist/packages/cad-styling/src/AssetNodeCollection.d.ts +3 -6
- package/dist/packages/cad-styling/src/CdfModelNodeCollectionDataProvider.d.ts +3 -6
- package/dist/packages/cad-styling/src/NodeAppearance.d.ts +6 -12
- package/dist/packages/cad-styling/src/NodeAppearanceTextureBuilder.d.ts +2 -5
- package/dist/packages/cad-styling/src/PopulateIndexSetFromPagedResponseHelper.d.ts +2 -5
- package/dist/packages/cad-styling/src/TreeIndexNodeCollection.d.ts +3 -6
- package/dist/packages/cad-styling/src/transform/NodeTransformTextureBuilder.d.ts +3 -6
- package/dist/packages/cad-styling/src/transform/TransformOverrideBuffer.d.ts +4 -7
- package/dist/packages/camera-manager/src/DefaultCameraManager.d.ts +5 -8
- package/dist/packages/data-providers/src/ModelMetadataProvider.d.ts +4 -7
- package/dist/packages/data-providers/src/metadata-providers/CdfModelMetadataProvider.d.ts +4 -7
- package/dist/packages/data-providers/src/metadata-providers/LocalModelMetadataProvider.d.ts +4 -7
- package/dist/packages/data-providers/src/types.d.ts +3 -3
- package/dist/packages/data-providers/src/utilities/applyDefaultModelTransformation.d.ts +2 -5
- package/dist/packages/metrics/src/MetricsLogger.d.ts +3 -6
- package/dist/packages/model-base/src/types.d.ts +5 -8
- package/dist/packages/nodes-api/src/NodesApiClient.d.ts +2 -5
- package/dist/packages/nodes-api/src/NodesCdfClient.d.ts +2 -5
- package/dist/packages/nodes-api/src/NodesLocalClient.d.ts +2 -5
- package/dist/packages/pointclouds/src/CognitePointCloudModel.d.ts +17 -20
- package/dist/packages/pointclouds/src/PointCloudManager.d.ts +5 -9
- package/dist/packages/pointclouds/src/PointCloudMetadata.d.ts +2 -5
- package/dist/packages/pointclouds/src/PointCloudPickingHandler.d.ts +2 -5
- package/dist/packages/pointclouds/src/createPointCloudManager.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/geometry/IPointCloudTreeGeometry.d.ts +4 -4
- package/dist/packages/pointclouds/src/potree-three-loader/geometry/IPointCloudTreeGeometryNode.d.ts +3 -3
- package/dist/packages/pointclouds/src/potree-three-loader/geometry/PointCloudEptGeometry.d.ts +8 -8
- package/dist/packages/pointclouds/src/potree-three-loader/geometry/PointCloudEptGeometryNode.d.ts +8 -8
- package/dist/packages/pointclouds/src/potree-three-loader/geometry/translationUtils.d.ts +4 -7
- package/dist/packages/pointclouds/src/potree-three-loader/tree/IPointCloudTreeNode.d.ts +2 -2
- package/dist/packages/pointclouds/src/potree-three-loader/tree/IPointCloudTreeNodeBase.d.ts +3 -3
- package/dist/packages/pointclouds/src/potree-three-loader/tree/PointAttributes.d.ts +4 -2
- package/dist/packages/pointclouds/src/potree-three-loader/utils/WorkerPool.d.ts +3 -0
- package/dist/packages/pointclouds/visual-tests/EdlPointCloud.VisualTest.d.ts +2 -2
- package/dist/packages/pointclouds/visual-tests/PointCloudColorStyling.VisualTest.d.ts +2 -2
- package/dist/packages/rendering/src/CadMaterialManager.d.ts +6 -9
- package/dist/packages/rendering/src/RenderPass.d.ts +2 -5
- package/dist/packages/rendering/src/RenderPipelineExecutor.d.ts +2 -5
- package/dist/packages/rendering/src/pipeline-executors/BasicPipelineExecutor.d.ts +3 -6
- package/dist/packages/rendering/src/pipeline-executors/StepPipelineExecutor.d.ts +3 -6
- package/dist/packages/rendering/src/pointcloud-rendering/PointCloudMaterial.d.ts +6 -6
- package/dist/packages/rendering/src/pointcloud-rendering/PointCloudObjectAppearanceTexture.d.ts +2 -5
- package/dist/packages/rendering/src/render-passes/GeometryPass.d.ts +3 -6
- package/dist/packages/rendering/src/render-passes/PointCloudEffectsPass.d.ts +3 -3
- package/dist/packages/rendering/src/render-passes/PostProcessingPass.d.ts +3 -6
- package/dist/packages/rendering/src/render-passes/SSAOPass.d.ts +3 -6
- package/dist/packages/rendering/src/render-passes/types.d.ts +19 -19
- package/dist/packages/rendering/src/render-pipeline-providers/CadGeometryRenderModePipelineProvider.d.ts +4 -7
- package/dist/packages/rendering/src/render-pipeline-providers/CadGeometryRenderPipelineProvider.d.ts +2 -2
- package/dist/packages/rendering/src/render-pipeline-providers/DefaultRenderPipelineProvider.d.ts +4 -7
- package/dist/packages/rendering/src/render-pipeline-providers/PointCloudRenderPipelineProvider.d.ts +2 -5
- package/dist/packages/rendering/src/render-pipeline-providers/types.d.ts +11 -14
- package/dist/packages/rendering/src/rendering/materials.d.ts +18 -21
- package/dist/packages/rendering/src/rendering/shaders.d.ts +27 -74
- package/dist/packages/rendering/src/utilities/renderUtilities.d.ts +8 -11
- package/dist/packages/rendering/src/utilities/types.d.ts +13 -13
- package/dist/packages/sector-parser/src/reveal-glb-parser/primitiveGeometries.d.ts +8 -11
- package/dist/packages/sector-parser/visual-tests/testMaterials.d.ts +2 -5
- package/dist/packages/tools/src/AxisGizmo/AxisGizmoOptions.d.ts +2 -2
- package/dist/packages/tools/src/AxisView/types.d.ts +7 -10
- package/dist/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +6 -9
- package/dist/packages/tools/src/Measurement/MeasurementLine.d.ts +7 -10
- package/dist/packages/tools/src/Measurement/MeasurementManager.d.ts +5 -8
- package/dist/packages/tools/src/Measurement/MeasurementTool.d.ts +3 -3
- package/dist/packages/tools/src/Overlay3D/Overlay3DTool.d.ts +5 -5
- package/dist/packages/utilities/src/RandomColors.d.ts +4 -7
- package/dist/packages/utilities/src/SceneHandler.d.ts +10 -13
- package/dist/packages/utilities/src/WebGLRendererStateHelper.d.ts +4 -7
- package/dist/packages/utilities/src/three/createDistinctColors.d.ts +2 -5
- package/dist/packages/utilities/src/three/createFullScreenTriangleGeometry.d.ts +2 -5
- package/dist/packages/utilities/src/three/fitCameraToBoundingBox.d.ts +4 -7
- package/dist/packages/utilities/src/three/fromThreeVector3.d.ts +2 -5
- package/dist/packages/utilities/src/three/isBox3OnPositiveSideOfPlane.d.ts +2 -5
- package/dist/packages/utilities/src/three/toThreeBox3.d.ts +2 -5
- package/dist/packages/utilities/src/three/unionBoxes.d.ts +2 -5
- package/dist/packages/utilities/src/three/visitBox3CornerPoints.d.ts +3 -6
- package/dist/packages/utilities/src/transformCameraConfiguration.d.ts +2 -5
- package/dist/packages/utilities/src/worldToViewport.d.ts +7 -10
- package/package.json +21 -21
- package/dist/assets/eptBinaryDecoder.worker-DXT9usP2.js.map +0 -1
package/README.md
CHANGED
|
@@ -61,9 +61,9 @@ See [our documentation](https://cognitedata.github.io/reveal-docs/docs/examples/
|
|
|
61
61
|
|
|
62
62
|
## Prerequisites
|
|
63
63
|
|
|
64
|
-
For development, you will need to install [Node](https://nodejs.org/en/download/), [
|
|
64
|
+
For development, you will need to install [Node](https://nodejs.org/en/download/), [pnpm](https://pnpm.io/installation) and [Rust+Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html).
|
|
65
65
|
|
|
66
|
-
Run `
|
|
66
|
+
Run `pnpm install` in the viewer
|
|
67
67
|
|
|
68
68
|
## Local Packages
|
|
69
69
|
The Reveal viewer is structured using local packages.
|
|
@@ -99,14 +99,14 @@ If your package depends on another local package, it must be explicitly declared
|
|
|
99
99
|
}
|
|
100
100
|
```
|
|
101
101
|
The `workspace` keyword declares that the dependency is a local package and should never be fetched from NPM.
|
|
102
|
-
And the `':*'` syntax means that it should just grab any version available. See [this](https://
|
|
102
|
+
And the `':*'` syntax means that it should just grab any version available. See [this](https://pnpm.io/workspaces) for more documentation on pnpm workspaces.
|
|
103
103
|
|
|
104
104
|
If you want to add Rust/Webassembly code to a package, you can add the following script in `package.json`:
|
|
105
105
|
|
|
106
106
|
```json
|
|
107
107
|
{
|
|
108
108
|
"scripts": {
|
|
109
|
-
"run-wasm-pack": "
|
|
109
|
+
"run-wasm-pack": "pnpm -w run ws:update-cargo-index && wasm-pack"
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
```
|
|
@@ -115,7 +115,7 @@ Then the crate will automatically be built and tested by the `build` and `test`
|
|
|
115
115
|
The `ws:update-cargo-index` step ensures that the local `crates.io` index has been updated before running build.
|
|
116
116
|
Otherwise, the index update will be executed in a quiet manner, and the command may appear to hang for several minutes.
|
|
117
117
|
|
|
118
|
-
When writing tests in Rust, the tests must be annotated with the `#[wasm_bindgen_test]` attribute, instead of the conventional `#[test]`, and `wasm-bindgen-test` must be added as a (dev-)dependency. All tests are run as part of the normal `
|
|
118
|
+
When writing tests in Rust, the tests must be annotated with the `#[wasm_bindgen_test]` attribute, instead of the conventional `#[test]`, and `wasm-bindgen-test` must be added as a (dev-)dependency. All tests are run as part of the normal `pnpm run test` script in the root folder, but can also be run manually with e.g. `wasm-pack test --chrome --headless` in the relevant `wasm` folder.
|
|
119
119
|
|
|
120
120
|
It is also possible to run and test a local package in isolation from the rest of Reveal.
|
|
121
121
|
Convenience functionality has been created to make this easy.
|
|
@@ -123,44 +123,44 @@ Add the following script to your package's `package.json`:
|
|
|
123
123
|
```json
|
|
124
124
|
{
|
|
125
125
|
"scripts": {
|
|
126
|
-
"test": "
|
|
126
|
+
"test": "test": "vitest run --config ./../../vitest.config.ts",
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
```
|
|
130
|
-
Running `
|
|
130
|
+
Running `pnpm run test` will run all tests in your package that resolves the `*.test.*` regex pattern.
|
|
131
131
|
|
|
132
132
|
To run a test app that includes your package (and any dependencies), create a `/app/` subfolder in your package that includes an `index.ts` file.
|
|
133
133
|
Add the following script to your package's `package.json`:
|
|
134
134
|
```json
|
|
135
135
|
{
|
|
136
136
|
"scripts": {
|
|
137
|
-
"start": "
|
|
137
|
+
"start": "pnpm -w run ws:serve"
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
Running the command `
|
|
142
|
+
Running the command `pnpm start` will host a localhost site with a template HTML that includes the `/app/index.ts` script that has been transpiled to javascript.
|
|
143
143
|
To see an example of this check out the `packages/camera-manager` package.
|
|
144
144
|
|
|
145
145
|
## API Extractor
|
|
146
146
|
|
|
147
147
|
The `viewer/reveal.api.md` file contains a description of the public API of Reveal. In the CI pipeline, the `reveal.api.md` file is checked to be up-to-date by API extractor.
|
|
148
148
|
|
|
149
|
-
In order to update this file locally, run `
|
|
149
|
+
In order to update this file locally, run `pnpm run update-api` *after* having run the build script. This will update the API file with any changes, which should be added and committed in the same PR.
|
|
150
150
|
|
|
151
151
|
## Debugging
|
|
152
152
|
|
|
153
153
|
### Worker source maps
|
|
154
154
|
|
|
155
|
-
When bundling source maps with inlined web workers, the bundle size grows huge. Therefore source maps for workers are disabled by default. In order to add source maps to workers, pass `--env workerSourceMaps=true` to the `
|
|
155
|
+
When bundling source maps with inlined web workers, the bundle size grows huge. Therefore source maps for workers are disabled by default. In order to add source maps to workers, pass `--env workerSourceMaps=true` to the `pnpm run build` script.
|
|
156
156
|
|
|
157
157
|
## Creating and running visual tests
|
|
158
158
|
|
|
159
159
|
Visual test files must be on the format `visual-tests/SomeTest.VisualTest.ts`. See one of the existing tests
|
|
160
160
|
for example on how to create a test.
|
|
161
161
|
|
|
162
|
-
Visual tests can be run from `viewer/` using `
|
|
163
|
-
run a single test by using `
|
|
162
|
+
Visual tests can be run from `viewer/` using `pnpm run test:visual`. This will run all visual tests. You can also
|
|
163
|
+
run a single test by using `pnpm run test:visual -- -t="SomeTest"` (will run all tests with "SomeTest" in the name). Note that arguments only will be passed to the client, to pass arguments to the server you will need to manually start the server and client separately.
|
|
164
164
|
|
|
165
165
|
For more information about visual tests, see [visual-tests/README.md](visual-tests/README.md).
|
|
166
166
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export * from '../packages/api/';
|
|
8
8
|
export type { CameraControlsOptions, CameraManagerEventType, CameraManager, CameraState, ComboControlsOptions, ComboControlsEventType, CameraEventDelegate, CameraChangeDelegate, CameraStopDelegate, IFlexibleCameraManager, FlexibleControlsTypeChangeDelegate } from '../packages/camera-manager';
|
|
9
9
|
export { CAMERA_MANAGER_EVENT_TYPE_LIST, DebouncedCameraStopEventTrigger, DefaultCameraManager, isDefaultCameraManager, CameraManagerHelper, ComboControls, FlexibleControlsOptions, FlexibleWheelZoomType, FlexibleControlsType, FlexibleMouseActionType, isFlexibleCameraManager } from '../packages/camera-manager';
|
|
10
|
-
export type { AreaCollection, NodeAppearance, SerializableNodeAppearance, SerializedNodeCollection, PropertyFilterNodeCollectionOptions, NodeCollectionSerializationContext, CdfModelNodeCollectionDataProvider } from '../packages/cad-styling';
|
|
10
|
+
export type { AreaCollection, NodeAppearance, DefaultNodeAppearanceInstances, SerializableNodeAppearance, SerializedNodeCollection, PropertyFilterNodeCollectionOptions, NodeCollectionSerializationContext, CdfModelNodeCollectionDataProvider } from '../packages/cad-styling';
|
|
11
11
|
export { ClusteredAreaCollection, NodeOutlineColor, DefaultNodeAppearance, NodeCollection, CdfNodeCollectionBase, CombineNodeCollectionBase, TreeIndexNodeCollection, NodeIdNodeCollection, IntersectionNodeCollection, UnionNodeCollection, PropertyFilterNodeCollection, SinglePropertyFilterNodeCollection, AssetNodeCollection, InvertedNodeCollection, registerNodeCollectionType } from '../packages/cad-styling';
|
|
12
12
|
export type { SupportedModelTypes } from '../packages/model-base';
|
|
13
13
|
export type { BeforeSceneRenderedDelegate, SceneRenderedDelegate, PointerEventDelegate, PointerEventData, DisposedDelegate, DMInstanceRef, ICustomObject, CustomObjectIntersection } from '../packages/utilities';
|