@cognite/reveal 2.0.0-beta.4 → 2.2.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/README.md +81 -6
- package/core/cad.d.ts +4 -0
- package/core/index.d.ts +7 -0
- package/{datamodels → core/src/datamodels}/base/SupportedModelTypes.d.ts +0 -0
- package/{datamodels → core/src/datamodels}/base/index.d.ts +1 -1
- package/{datamodels → core/src/datamodels}/base/types.d.ts +1 -0
- package/{datamodels → core/src/datamodels}/cad/CadManager.d.ts +8 -13
- package/{datamodels → core/src/datamodels}/cad/CadModelFactory.d.ts +2 -6
- package/{datamodels → core/src/datamodels}/cad/CadModelSectorLoadStatistics.d.ts +0 -0
- package/core/src/datamodels/cad/createCadManager.d.ts +9 -0
- package/{datamodels → core/src/datamodels}/cad/picking.d.ts +1 -1
- package/{datamodels → core/src/datamodels}/cad/rendering/RenderAlreadyLoadedGeometryProvider.d.ts +2 -2
- package/{datamodels → core/src/datamodels}/cad/sector/CadModelClipper.d.ts +1 -1
- package/{datamodels → core/src/datamodels}/cad/styling/AssetNodeCollection.d.ts +3 -3
- package/{datamodels → core/src/datamodels}/cad/styling/InvertedNodeCollection.d.ts +2 -2
- package/{datamodels → core/src/datamodels}/cad/styling/NodeCollectionDeserializer.d.ts +1 -1
- package/{datamodels → core/src/datamodels}/cad/styling/PopulateIndexSetFromPagedResponseHelper.d.ts +1 -2
- package/{datamodels → core/src/datamodels}/cad/styling/PropertyFilterNodeCollection.d.ts +2 -2
- package/{datamodels → core/src/datamodels}/cad/styling/SinglePropertyFilterNodeCollection.d.ts +3 -6
- package/{datamodels → core/src/datamodels}/cad/styling/index.d.ts +2 -7
- package/{datamodels → core/src/datamodels}/pointcloud/PointCloudFactory.d.ts +1 -1
- package/{datamodels → core/src/datamodels}/pointcloud/PointCloudManager.d.ts +9 -5
- package/{datamodels → core/src/datamodels}/pointcloud/PointCloudMetadata.d.ts +1 -1
- package/core/src/datamodels/pointcloud/PointCloudMetadataRepository.d.ts +13 -0
- package/{datamodels → core/src/datamodels}/pointcloud/PointCloudNode.d.ts +2 -1
- package/{datamodels → core/src/datamodels}/pointcloud/PotreeGroupWrapper.d.ts +7 -1
- package/{datamodels → core/src/datamodels}/pointcloud/PotreeNodeWrapper.d.ts +0 -0
- package/core/src/datamodels/pointcloud/createPointCloudManager.d.ts +6 -0
- package/{datamodels → core/src/datamodels}/pointcloud/index.d.ts +0 -0
- package/{datamodels → core/src/datamodels}/pointcloud/picking.d.ts +0 -0
- package/{datamodels → core/src/datamodels}/pointcloud/types.d.ts +0 -0
- package/core/src/index.d.ts +19 -0
- package/core/src/internals.d.ts +15 -0
- package/{migration.d.ts → core/src/migration.d.ts} +0 -0
- package/{public → core/src/public}/RevealManager.d.ts +16 -14
- package/{public → core/src/public}/createRevealManager.d.ts +3 -4
- package/{public → core/src/public}/migration/Cognite3DModel.d.ts +38 -9
- package/{public → core/src/public}/migration/Cognite3DViewer.d.ts +48 -28
- package/{public → core/src/public}/migration/CogniteModelBase.d.ts +0 -0
- package/{public → core/src/public}/migration/CognitePointCloudModel.d.ts +2 -8
- package/{public → core/src/public}/migration/NodeIdAndTreeIndexMaps.d.ts +0 -0
- package/{public → core/src/public}/migration/NotSupportedInMigrationWrapperError.d.ts +0 -0
- package/{public → core/src/public}/migration/RenderController.d.ts +0 -0
- package/{public → core/src/public}/migration/types.d.ts +47 -3
- package/core/src/public/types.d.ts +46 -0
- package/core/src/storage/RevealManagerHelper.d.ts +58 -0
- package/{utilities → core/src/utilities}/BoundingBoxClipper.d.ts +1 -4
- package/{utilities → core/src/utilities}/Spinner.d.ts +4 -5
- package/{utilities → core/src/utilities}/ViewStateHelper.d.ts +5 -5
- package/{utilities → core/src/utilities}/callActionWithIndicesAsync.d.ts +0 -0
- package/core/src/utilities/index.d.ts +8 -0
- package/{utilities → core/src/utilities}/reflection.d.ts +0 -6
- package/core/src/utilities/worldToViewport.d.ts +30 -0
- package/{utilities/events/clickOrTouchEventOffset.d.ts → core/utilities.d.ts} +1 -1
- package/extensions/datasource.d.ts +9 -0
- package/extensions/datasource.js +33 -0
- package/extensions/datasource.map +1 -0
- package/index.d.ts +2 -14
- package/index.js +185 -121
- package/index.map +1 -1
- package/package.json +47 -120
- package/packages/cad-geometry-loaders/index.d.ts +14 -0
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/CadLoadingHints.d.ts +0 -0
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/CadModelSectorBudget.d.ts +6 -1
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/CadModelUpdateHandler.d.ts +3 -5
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/CachedRepository.d.ts +3 -4
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/ModelStateHandler.d.ts +1 -1
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/Repository.d.ts +1 -1
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/SectorLoader.d.ts +1 -1
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/SimpleAndDetailedToSector3D.d.ts +4 -4
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/culling/ByVisibilityGpuSectorCuller.d.ts +1 -1
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/culling/OccludingGeometryProvider.d.ts +0 -0
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/culling/OrderSectorsByVisibilityCoverage.d.ts +3 -5
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/culling/SectorCuller.d.ts +1 -1
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/culling/TakenSectorTree.d.ts +2 -2
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/culling/types.d.ts +7 -4
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/rxSectorUtilities.d.ts +1 -1
- package/{datamodels/cad → packages/cad-geometry-loaders/src}/sector/sectorUtilities.d.ts +4 -4
- package/{utilities → packages/cad-geometry-loaders/src/utilities}/PromiseUtils.d.ts +0 -0
- package/{utilities → packages/cad-geometry-loaders/src/utilities}/arrays.d.ts +0 -0
- package/{datamodels/cad/sector → packages/cad-geometry-loaders/src/utilities}/groupMeshesByNumber.d.ts +0 -0
- package/{utilities → packages/cad-geometry-loaders/src/utilities}/rxOperations.d.ts +0 -2
- package/packages/cad-geometry-loaders/src/utilities/types.d.ts +25 -0
- package/packages/cad-parsers/index.d.ts +21 -0
- package/{datamodels/cad/sector → packages/cad-parsers/src/cad}/CadSectorParser.d.ts +2 -3
- package/{datamodels/cad/sector → packages/cad-parsers/src/cad}/LevelOfDetail.d.ts +0 -0
- package/{datamodels/cad/rendering → packages/cad-parsers/src/cad}/filterInstanceMesh.d.ts +0 -0
- package/{datamodels/cad/rendering → packages/cad-parsers/src/cad}/filterPrimitives.d.ts +0 -0
- package/{datamodels/cad/rendering → packages/cad-parsers/src/cad}/primitiveGeometries.d.ts +2 -2
- package/{datamodels/cad/rendering → packages/cad-parsers/src/cad}/triangleMeshes.d.ts +1 -1
- package/packages/cad-parsers/src/cad/types.d.ts +56 -0
- package/{datamodels/cad/parsers → packages/cad-parsers/src/metadata}/CadMetadataParser.d.ts +1 -1
- package/{datamodels/cad → packages/cad-parsers/src/metadata}/CadModelMetadata.d.ts +6 -2
- package/packages/cad-parsers/src/metadata/CadModelMetadataRepository.d.ts +16 -0
- package/packages/cad-parsers/src/metadata/MetadataRepository.d.ts +7 -0
- package/{datamodels/cad → packages/cad-parsers/src/metadata}/parsers/CadMetadataParserV8.d.ts +2 -1
- package/packages/cad-parsers/src/metadata/types.d.ts +41 -0
- package/{datamodels/cad → packages/cad-parsers/src}/sector/RootSectorNode.d.ts +1 -1
- package/{datamodels/cad → packages/cad-parsers/src}/sector/SectorNode.d.ts +3 -2
- package/{datamodels/cad/sector → packages/cad-parsers/src/utilities}/SectorScene.d.ts +2 -2
- package/packages/cad-parsers/src/utilities/SectorSceneFactory.d.ts +12 -0
- package/{datamodels/cad/rendering → packages/cad-parsers/src/utilities}/computeBoundingBoxFromAttributes.d.ts +0 -0
- package/{datamodels/cad/rendering → packages/cad-parsers/src/utilities}/float32BufferToMatrix.d.ts +0 -0
- package/packages/cad-parsers/src/utilities/types.d.ts +48 -0
- package/packages/cad-styling/index.d.ts +9 -0
- package/{datamodels/cad/styling → packages/cad-styling/src}/CombineNodeCollectionBase.d.ts +2 -2
- package/{datamodels/cad/styling → packages/cad-styling/src}/IntersectionNodeCollection.d.ts +1 -1
- package/{datamodels/cad → packages/cad-styling/src}/NodeAppearance.d.ts +3 -7
- package/{datamodels/cad/styling → packages/cad-styling/src}/NodeAppearanceProvider.d.ts +2 -2
- package/{datamodels/cad/styling → packages/cad-styling/src}/NodeCollectionBase.d.ts +1 -1
- package/{datamodels/cad/styling → packages/cad-styling/src}/TreeIndexNodeCollection.d.ts +1 -2
- package/{datamodels/cad/styling → packages/cad-styling/src}/UnionNodeCollection.d.ts +1 -1
- package/packages/camera-manager/index.d.ts +4 -0
- package/{combo-camera-controls → packages/camera-manager/src}/ComboControls.d.ts +35 -34
- package/{combo-camera-controls → packages/camera-manager/src}/Keyboard.d.ts +5 -5
- package/packages/data-source/index.d.ts +6 -0
- package/packages/data-source/src/CdfDataSource.d.ts +19 -0
- package/packages/data-source/src/DataSource.d.ts +26 -0
- package/packages/data-source/src/LocalDataSource.d.ts +15 -0
- package/packages/logger/index.d.ts +5 -0
- package/packages/logger/src/Log.d.ts +5 -0
- package/packages/metrics/index.d.ts +5 -0
- package/packages/metrics/src/MetricsLogger.d.ts +21 -0
- package/packages/metrics/src/types.d.ts +7 -0
- package/packages/modeldata-api/index.d.ts +13 -0
- package/packages/modeldata-api/src/CdfModelDataProvider.d.ts +15 -0
- package/packages/modeldata-api/src/CdfModelIdentifier.d.ts +17 -0
- package/packages/modeldata-api/src/CdfModelMetadataProvider.d.ts +19 -0
- package/packages/modeldata-api/src/CdfModelOutputsProvider.d.ts +15 -0
- package/packages/modeldata-api/src/LocalModelDataProvider.d.ts +9 -0
- package/packages/modeldata-api/src/LocalModelIdentifier.d.ts +14 -0
- package/packages/modeldata-api/src/LocalModelMetadataProvider.d.ts +14 -0
- package/{utilities/networking → packages/modeldata-api/src}/Model3DOutputList.d.ts +1 -2
- package/packages/modeldata-api/src/ModelIdentifier.d.ts +12 -0
- package/packages/modeldata-api/src/ModelMetadataProvider.d.ts +17 -0
- package/{utilities/networking → packages/modeldata-api/src}/applyDefaultModelTransformation.d.ts +1 -1
- package/packages/modeldata-api/src/types.d.ts +41 -0
- package/packages/modeldata-api/src/utilities.d.ts +7 -0
- package/packages/nodes-api/index.d.ts +6 -0
- package/packages/nodes-api/src/NodesApiClient.d.ts +52 -0
- package/packages/nodes-api/src/NodesCdfClient.d.ts +24 -0
- package/packages/nodes-api/src/NodesLocalClient.d.ts +30 -0
- package/packages/nodes-api/src/types.d.ts +10 -0
- package/packages/rendering/index.d.ts +17 -0
- package/{datamodels/cad → packages/rendering/src}/CadMaterialManager.d.ts +5 -7
- package/{datamodels/cad → packages/rendering/src}/InstancedMeshManager.d.ts +1 -1
- package/{datamodels/cad → packages/rendering/src}/cameraconfig.d.ts +1 -1
- package/{datamodels/cad → packages/rendering/src}/rendering/EffectRenderManager.d.ts +29 -13
- package/{datamodels/cad/styling → packages/rendering/src/rendering}/NodeAppearanceTextureBuilder.d.ts +8 -8
- package/{datamodels/cad → packages/rendering/src}/rendering/RenderMode.d.ts +0 -0
- package/{datamodels/cad → packages/rendering/src}/rendering/createSimpleGeometryMesh.d.ts +0 -0
- package/{datamodels/cad → packages/rendering/src}/rendering/matCapTextureData.d.ts +0 -0
- package/{datamodels/cad → packages/rendering/src}/rendering/materials.d.ts +0 -0
- package/packages/rendering/src/rendering/primitives.d.ts +12 -0
- package/{datamodels/cad → packages/rendering/src}/rendering/shaders.d.ts +1 -1
- package/packages/rendering/src/rendering/types.d.ts +76 -0
- package/{datamodels/cad → packages/rendering/src/sector}/CadNode.d.ts +7 -12
- package/{datamodels/cad/styling → packages/rendering/src/transform}/NodeTransformProvider.d.ts +0 -0
- package/{datamodels/cad/styling → packages/rendering/src/transform}/NodeTransformTextureBuilder.d.ts +1 -1
- package/{datamodels/cad/styling → packages/rendering/src/transform}/TransformOverrideBuffer.d.ts +3 -3
- package/packages/rendering/src/utilities/types.d.ts +26 -0
- package/packages/tools/index.d.ts +15 -0
- package/{tools → packages/tools/src}/AxisView/AxisViewTool.d.ts +2 -2
- package/{tools → packages/tools/src}/AxisView/types.d.ts +0 -0
- package/{tools → packages/tools/src}/Cognite3DViewerToolBase.d.ts +0 -0
- package/{tools → packages/tools/src}/DebugCameraTool.d.ts +1 -1
- package/{tools → packages/tools/src}/DebugLoadedSectorsTool.d.ts +4 -3
- package/{tools → packages/tools/src}/ExplodedViewTool.d.ts +1 -1
- package/packages/tools/src/Geomap/Geomap.d.ts +14 -0
- package/packages/tools/src/Geomap/GeomapTool.d.ts +21 -0
- package/packages/tools/src/Geomap/MapConfig.d.ts +195 -0
- package/packages/tools/src/HtmlOverlay/BucketGrid2D.d.ts +28 -0
- package/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +159 -0
- package/packages/tools/src/Timeline/Keyframe.d.ts +38 -0
- package/packages/tools/src/Timeline/TimelineTool.d.ts +79 -0
- package/packages/tools/src/Timeline/types.d.ts +13 -0
- package/packages/tools/src/types.d.ts +4 -0
- package/packages/utilities/index.d.ts +24 -0
- package/packages/utilities/src/CameraConfiguration.d.ts +10 -0
- package/{utilities → packages/utilities/src}/IndexSet.d.ts +0 -0
- package/{utilities → packages/utilities/src}/NumericRange.d.ts +0 -0
- package/packages/utilities/src/RandomColors.d.ts +34 -0
- package/{utilities → packages/utilities/src}/WebGLRendererStateHelper.d.ts +0 -0
- package/{utilities → packages/utilities/src}/assertNever.d.ts +0 -0
- package/{utilities → packages/utilities/src}/cache/MemoryRequestCache.d.ts +0 -0
- package/{utilities → packages/utilities/src/cache}/MostFrequentlyUsedCache.d.ts +0 -0
- package/{utilities → packages/utilities/src}/cache/RequestCache.d.ts +0 -0
- package/{utilities → packages/utilities/src}/datastructures/DynamicDefragmentedBuffer.d.ts +2 -2
- package/{utilities → packages/utilities/src}/determinePowerOfTwoDimensions.d.ts +0 -0
- package/{utilities → packages/utilities/src}/disposeAttributeArrayOnUpload.d.ts +0 -0
- package/{utilities → packages/utilities/src}/events/EventTrigger.d.ts +0 -0
- package/packages/utilities/src/events/clickOrTouchEventOffset.d.ts +13 -0
- package/{utilities → packages/utilities/src}/events/index.d.ts +0 -0
- package/{utilities → packages/utilities/src}/indexset/IndexSet.d.ts +0 -0
- package/{utilities → packages/utilities/src}/indexset/IntermediateIndexNode.d.ts +0 -0
- package/{utilities → packages/utilities/src}/indexset/LeafIndexNode.d.ts +0 -0
- package/{utilities → packages/utilities/src}/isMobileOrTablet.d.ts +0 -0
- package/{utilities → packages/utilities/src}/networking/isTheSameDomain.d.ts +0 -0
- package/{utilities → packages/utilities/src}/objectTraversal.d.ts +0 -0
- package/{utilities → packages/utilities/src}/packFloat.d.ts +0 -0
- package/{revealEnv.d.ts → packages/utilities/src/revealEnv.d.ts} +0 -0
- package/{utilities → packages/utilities/src}/three/AutoDisposeGroup.d.ts +0 -0
- package/packages/utilities/src/three/BoundingBoxLOD.d.ts +27 -0
- package/{utilities → packages/utilities/src}/three/getBox3CornerPoints.d.ts +0 -0
- package/{utilities → packages/utilities/src}/transformCameraConfiguration.d.ts +1 -1
- package/packages/utilities/src/types.d.ts +10 -0
- package/{utilities → packages/utilities/src}/workers/WorkerPool.d.ts +0 -0
- package/tools.d.ts +1 -7
- package/tools.js +199 -12
- package/tools.map +1 -1
- package/combo-camera-controls/index.d.ts +0 -4
- package/datamodels/base/MetadataRepository.d.ts +0 -6
- package/datamodels/cad/CadModelMetadataRepository.d.ts +0 -15
- package/datamodels/cad/createCadManager.d.ts +0 -13
- package/datamodels/cad/index.d.ts +0 -8
- package/datamodels/cad/rendering/primitives.d.ts +0 -7
- package/datamodels/cad/rendering/types.d.ts +0 -25
- package/datamodels/cad/sector/types.d.ts +0 -114
- package/datamodels/pointcloud/PointCloudMetadataRepository.d.ts +0 -12
- package/datamodels/pointcloud/createPointCloudManager.d.ts +0 -10
- package/internals.d.ts +0 -27
- package/public/types.d.ts +0 -121
- package/tools/HtmlOverlayTool.d.ts +0 -88
- package/utilities/index.d.ts +0 -13
- package/utilities/metrics.d.ts +0 -15
- package/utilities/networking/CdfModelDataClient.d.ts +0 -45
- package/utilities/networking/CogniteClientNodeIdAndTreeIndexMapper.d.ts +0 -14
- package/utilities/networking/HttpHeadersProvider.d.ts +0 -7
- package/utilities/networking/LocalModelDataClient.d.ts +0 -23
- package/utilities/networking/types.d.ts +0 -37
- package/utilities/networking/utilities.d.ts +0 -13
- package/utilities/three/dumpRendererToImage.d.ts +0 -5
- package/utilities/three/index.d.ts +0 -6
- package/utilities/types.d.ts +0 -67
- package/utilities/worldToViewport.d.ts +0 -11
|
@@ -5,10 +5,10 @@ import * as THREE from 'three';
|
|
|
5
5
|
import { CogniteInternalId } from '@cognite/sdk';
|
|
6
6
|
import { CameraConfiguration } from './types';
|
|
7
7
|
import { CogniteModelBase } from './CogniteModelBase';
|
|
8
|
-
import { NumericRange } from '../../utilities';
|
|
9
8
|
import { SupportedModelTypes } from '../types';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { WellKnownUnit } from './types';
|
|
10
|
+
import { NumericRange } from '../../../../packages/utilities';
|
|
11
|
+
import { NodeCollectionBase, NodeAppearance } from '../../../../packages/cad-styling';
|
|
12
12
|
/**
|
|
13
13
|
* Represents a single 3D CAD model loaded from CDF.
|
|
14
14
|
* @noInheritDoc
|
|
@@ -16,6 +16,19 @@ import { NodeAppearance } from '../../datamodels/cad';
|
|
|
16
16
|
*/
|
|
17
17
|
export declare class Cognite3DModel extends THREE.Object3D implements CogniteModelBase {
|
|
18
18
|
readonly type: SupportedModelTypes;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the unit the coordinates for the model is stored. Returns an empty string
|
|
21
|
+
* if no unit has been stored.
|
|
22
|
+
* Note that coordinates in Reveal always are converted to meters using {@see modelUnitToMetersFactor}.
|
|
23
|
+
* @version New since 2.1
|
|
24
|
+
*/
|
|
25
|
+
get modelUnit(): WellKnownUnit | '';
|
|
26
|
+
/**
|
|
27
|
+
* Returns the conversion factor that converts from model coordinates to meters. Note that this can
|
|
28
|
+
* return undefined if the model has been stored in an unsupported unit.
|
|
29
|
+
* @version New since 2.1
|
|
30
|
+
*/
|
|
31
|
+
get modelUnitToMetersFactor(): number | undefined;
|
|
19
32
|
/**
|
|
20
33
|
* The CDF model ID of the model.
|
|
21
34
|
*/
|
|
@@ -25,7 +38,7 @@ export declare class Cognite3DModel extends THREE.Object3D implements CogniteMod
|
|
|
25
38
|
*/
|
|
26
39
|
readonly revisionId: number;
|
|
27
40
|
private readonly cadModel;
|
|
28
|
-
private readonly
|
|
41
|
+
private readonly nodesApiClient;
|
|
29
42
|
private readonly nodeIdAndTreeIndexMaps;
|
|
30
43
|
private readonly _styledNodeCollections;
|
|
31
44
|
/**
|
|
@@ -41,6 +54,13 @@ export declare class Cognite3DModel extends THREE.Object3D implements CogniteMod
|
|
|
41
54
|
* {@link assignStyledNodeCollection}.
|
|
42
55
|
*/
|
|
43
56
|
getDefaultNodeAppearance(): NodeAppearance;
|
|
57
|
+
/**
|
|
58
|
+
* Returns all currently registered node collections and associated appearance.
|
|
59
|
+
*/
|
|
60
|
+
get styledNodeCollections(): {
|
|
61
|
+
nodeCollection: NodeCollectionBase;
|
|
62
|
+
appearance: NodeAppearance;
|
|
63
|
+
}[];
|
|
44
64
|
/**
|
|
45
65
|
* Customizes rendering style for a set of nodes, e.g. to highlight, hide
|
|
46
66
|
* or color code a set of 3D objects. This allows for custom look and feel
|
|
@@ -67,12 +87,21 @@ export declare class Cognite3DModel extends THREE.Object3D implements CogniteMod
|
|
|
67
87
|
* const visibleNodes = new TreeIndexNodeCollection(someTreeIndices);
|
|
68
88
|
* model.assignStyledNodeCollection(visibleSet, { rendererGhosted: false });
|
|
69
89
|
* ```
|
|
90
|
+
* @throws Error if node collection already has been assigned to the model.
|
|
70
91
|
*/
|
|
71
92
|
assignStyledNodeCollection(nodeCollection: NodeCollectionBase, appearance: NodeAppearance): void;
|
|
93
|
+
/**
|
|
94
|
+
* Updates styled node collections with a new appearance.
|
|
95
|
+
* @param nodeCollection A node collection previously assigned using {@link assignStyledNodeCollection}.
|
|
96
|
+
* @param newAppearance New appearance for the nodes in the collection.
|
|
97
|
+
* @throws Error if node collection hasn't previously been assigned using {@link assignStyledNodeCollection}.
|
|
98
|
+
*/
|
|
99
|
+
updateStyledNodeCollection(nodeCollection: NodeCollectionBase, newAppearance: NodeAppearance): void;
|
|
72
100
|
/**
|
|
73
101
|
* Removes styling for previously added styled collection, resetting the style to the default (or
|
|
74
102
|
* the style imposed by other styled collections).
|
|
75
103
|
* @param nodeCollection Node collection previously added using {@link assignStyledNodeCollection}.
|
|
104
|
+
* @throws Error if node collection isn't assigned to the model.
|
|
76
105
|
*/
|
|
77
106
|
unassignStyledNodeCollection(nodeCollection: NodeCollectionBase): void;
|
|
78
107
|
/**
|
|
@@ -139,11 +168,11 @@ export declare class Cognite3DModel extends THREE.Object3D implements CogniteMod
|
|
|
139
168
|
*
|
|
140
169
|
* @param treeIndex Tree index of node to find ancestor tree index range for.
|
|
141
170
|
* @param generation What "generation" to find. 0 is the node itself,
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* @returns
|
|
146
|
-
*
|
|
171
|
+
* 1 means parent, 2 means grandparent etc. If the node doesn't have as many
|
|
172
|
+
* ancestors, the root of the model is returned. This can be determined by checking
|
|
173
|
+
* that the range returned includes 0.
|
|
174
|
+
* @returns Tree index range of the subtree spanned by the ancestor at the
|
|
175
|
+
* "generation" specified, or the root.
|
|
147
176
|
*/
|
|
148
177
|
getAncestorTreeIndices(treeIndex: number, generation: number): Promise<NumericRange>;
|
|
149
178
|
/**
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import { AddModelOptions, Cognite3DViewerOptions, Intersection, CameraChangeDelegate, PointerEventDelegate, CadModelBudget } from './types';
|
|
5
|
+
import { AddModelOptions, Cognite3DViewerOptions, Intersection, CameraChangeDelegate, PointerEventDelegate, CadModelBudget, PointCloudBudget } from './types';
|
|
6
6
|
import { CogniteModelBase } from './CogniteModelBase';
|
|
7
7
|
import { Cognite3DModel } from './Cognite3DModel';
|
|
8
8
|
import { CognitePointCloudModel } from './CognitePointCloudModel';
|
|
9
9
|
import { DisposedDelegate, SceneRenderedDelegate } from '../types';
|
|
10
10
|
import { SupportedModelTypes } from '../../datamodels/base';
|
|
11
11
|
import { IntersectionFromPixelOptions } from '../..';
|
|
12
|
-
import ComboControls from '../../combo-camera-controls';
|
|
13
12
|
import { ViewerState } from '../../utilities/ViewStateHelper';
|
|
13
|
+
import ComboControls from '../../../../packages/camera-manager';
|
|
14
14
|
/**
|
|
15
15
|
* @example
|
|
16
16
|
* ```js
|
|
@@ -22,7 +22,6 @@ import { ViewerState } from '../../utilities/ViewStateHelper';
|
|
|
22
22
|
* @module @cognite/reveal
|
|
23
23
|
*/
|
|
24
24
|
export declare class Cognite3DViewer {
|
|
25
|
-
private readonly _viewStateHelper;
|
|
26
25
|
private get canvas();
|
|
27
26
|
/**
|
|
28
27
|
* For now it just always returns true.
|
|
@@ -40,12 +39,13 @@ export declare class Cognite3DViewer {
|
|
|
40
39
|
* Returns the renderer used to produce images from 3D geometry.
|
|
41
40
|
*/
|
|
42
41
|
get renderer(): THREE.WebGLRenderer;
|
|
42
|
+
private readonly _cdfSdkClient;
|
|
43
|
+
private readonly _dataSource;
|
|
43
44
|
private readonly camera;
|
|
44
45
|
private readonly scene;
|
|
45
46
|
private readonly controls;
|
|
46
|
-
private readonly sdkClient;
|
|
47
47
|
private readonly _subscription;
|
|
48
|
-
private readonly
|
|
48
|
+
private readonly _revealManagerHelper;
|
|
49
49
|
private readonly _domElement;
|
|
50
50
|
private readonly _renderer;
|
|
51
51
|
private readonly _boundAnimate;
|
|
@@ -58,9 +58,9 @@ export declare class Cognite3DViewer {
|
|
|
58
58
|
private readonly renderController;
|
|
59
59
|
private latestRequestId;
|
|
60
60
|
private readonly clock;
|
|
61
|
-
private
|
|
62
|
-
private _geometryFilters;
|
|
61
|
+
private _clippingNeedsUpdate;
|
|
63
62
|
private readonly spinner;
|
|
63
|
+
private get revealManager();
|
|
64
64
|
/**
|
|
65
65
|
* Reusable buffers used by functions in Cognite3dViewer to avoid allocations.
|
|
66
66
|
*/
|
|
@@ -75,6 +75,16 @@ export declare class Cognite3DViewer {
|
|
|
75
75
|
* budget is shared between all added CAD models and not a per-model budget.
|
|
76
76
|
*/
|
|
77
77
|
set cadBudget(budget: CadModelBudget);
|
|
78
|
+
/**
|
|
79
|
+
* Returns the point cloud budget. The budget is shared between all loaded
|
|
80
|
+
* point cloud models.
|
|
81
|
+
*/
|
|
82
|
+
get pointCloudBudget(): PointCloudBudget;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the point cloud budget. The budget is shared between all loaded
|
|
85
|
+
* point cloud models.
|
|
86
|
+
*/
|
|
87
|
+
set pointCloudBudget(budget: PointCloudBudget);
|
|
78
88
|
/**
|
|
79
89
|
* Gets a list of models currently added to the viewer.
|
|
80
90
|
*/
|
|
@@ -84,6 +94,12 @@ export declare class Cognite3DViewer {
|
|
|
84
94
|
* Returns reveal version installed.
|
|
85
95
|
*/
|
|
86
96
|
getVersion(): string;
|
|
97
|
+
/**
|
|
98
|
+
* Sets the log level. Used for debugging.
|
|
99
|
+
* Defaults to 'none' (which is identical to 'silent').
|
|
100
|
+
* @param level
|
|
101
|
+
*/
|
|
102
|
+
setLogLevel(level: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' | 'none'): void;
|
|
87
103
|
/**
|
|
88
104
|
* Dispose of WebGL resources. Can be used to free up memory when the viewer is no longer in use.
|
|
89
105
|
* @see {@link https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects}
|
|
@@ -141,7 +157,7 @@ export declare class Cognite3DViewer {
|
|
|
141
157
|
* node collections and applies the `state` object.
|
|
142
158
|
* @param state Viewer state retrieved from {@link Cognite3DViewer.getViewState}.
|
|
143
159
|
*/
|
|
144
|
-
setViewState(state: ViewerState): void
|
|
160
|
+
setViewState(state: ViewerState): Promise<void>;
|
|
145
161
|
/**
|
|
146
162
|
* Add a new model to the viewer.
|
|
147
163
|
* Call {@link Cognite3DViewer.fitCameraToModel} to see the model after the model has loaded.
|
|
@@ -264,36 +280,46 @@ export declare class Cognite3DViewer {
|
|
|
264
280
|
*/
|
|
265
281
|
setBackgroundColor(color: THREE.Color): void;
|
|
266
282
|
/**
|
|
267
|
-
* Sets per-pixel
|
|
268
|
-
* @param
|
|
283
|
+
* Sets per-pixel clipping planes. Pixels behind any of the planes will be sliced away.
|
|
284
|
+
* @param clippingPlanes The planes to use for clipping.
|
|
269
285
|
* @example
|
|
270
286
|
* ```js
|
|
271
287
|
* // Hide pixels with values less than 0 in the x direction
|
|
272
288
|
* const plane = new THREE.Plane(new THREE.Vector3(1, 0, 0), 0);
|
|
273
|
-
* viewer.
|
|
289
|
+
* viewer.setClippingPlanes([plane]);
|
|
274
290
|
* ```
|
|
275
291
|
* ```js
|
|
276
292
|
* // Hide pixels with values greater than 20 in the x direction
|
|
277
293
|
* const plane = new THREE.Plane(new THREE.Vector3(-1, 0, 0), 20);
|
|
278
|
-
* viewer.
|
|
294
|
+
* viewer.setClippingPlanes([plane]);
|
|
279
295
|
* ```
|
|
280
296
|
* ```js
|
|
281
297
|
* // Hide pixels with values less than 0 in the x direction or greater than 0 in the y direction
|
|
282
298
|
* const xPlane = new THREE.Plane(new THREE.Vector3(1, 0, 0), 0);
|
|
283
299
|
* const yPlane = new THREE.Plane(new THREE.Vector3(0, -1, 0), 0);
|
|
284
|
-
* viewer.
|
|
300
|
+
* viewer.setClippingPlanes([xPlane, yPlane]);
|
|
285
301
|
* ```
|
|
286
302
|
* ```js
|
|
287
303
|
* // Hide pixels behind an arbitrary, non axis-aligned plane
|
|
288
304
|
* const plane = new THREE.Plane(new THREE.Vector3(1.5, 20, -19), 20);
|
|
289
|
-
* viewer.
|
|
305
|
+
* viewer.setClippingPlanes([plane]);
|
|
290
306
|
* ```
|
|
291
307
|
* ```js
|
|
292
|
-
* // Disable
|
|
293
|
-
* viewer.
|
|
308
|
+
* // Disable clipping planes
|
|
309
|
+
* viewer.setClippingPlanes([]);
|
|
294
310
|
* ```
|
|
295
311
|
*/
|
|
312
|
+
setClippingPlanes(clippingPlanes: THREE.Plane[]): void;
|
|
313
|
+
/**
|
|
314
|
+
* @param slicingPlanes
|
|
315
|
+
* @deprecated Since version 2.1, will be removed in version 3.0. Use {@link setClippingPlanes}.
|
|
316
|
+
*/
|
|
296
317
|
setSlicingPlanes(slicingPlanes: THREE.Plane[]): void;
|
|
318
|
+
/**
|
|
319
|
+
* Returns the current active clipping planes.
|
|
320
|
+
* @version New in 2.1
|
|
321
|
+
*/
|
|
322
|
+
getClippingPlanes(): THREE.Plane[];
|
|
297
323
|
/**
|
|
298
324
|
* @obvious
|
|
299
325
|
* @returns The THREE.Camera used for rendering.
|
|
@@ -412,9 +438,8 @@ export declare class Cognite3DViewer {
|
|
|
412
438
|
fitCameraToBoundingBox(box: THREE.Box3, duration?: number, radiusFactor?: number): void;
|
|
413
439
|
/**
|
|
414
440
|
* Typically used when you perform some changes and can't see them unless you move camera.
|
|
415
|
-
* To fix this forceRerender might be used.
|
|
416
441
|
*/
|
|
417
|
-
|
|
442
|
+
requestRedraw(): void;
|
|
418
443
|
/**
|
|
419
444
|
* Allows to move camera with WASM or arrows keys.
|
|
420
445
|
*/
|
|
@@ -516,20 +541,15 @@ export declare class Cognite3DViewer {
|
|
|
516
541
|
private getModels;
|
|
517
542
|
/** @private */
|
|
518
543
|
private moveCameraTo;
|
|
544
|
+
/**
|
|
545
|
+
* Creates a helper for managing viewer state.
|
|
546
|
+
*/
|
|
547
|
+
private createViewStateHelper;
|
|
519
548
|
/** @private */
|
|
520
549
|
private animate;
|
|
521
550
|
/** @private */
|
|
522
551
|
private updateCameraNearAndFar;
|
|
523
552
|
/** @private */
|
|
524
553
|
private resizeIfNecessary;
|
|
525
|
-
private startPointerEventListeners;
|
|
526
|
-
/**
|
|
527
|
-
* Removes a geometry filter for the model provided.
|
|
528
|
-
* @param model
|
|
529
|
-
*/
|
|
530
|
-
private removeGeometryFilterForModel;
|
|
531
|
-
/**
|
|
532
|
-
* Updates slicing planes. Must be called after manipulating geometry filters.
|
|
533
|
-
*/
|
|
534
|
-
private updateSlicingPlanes;
|
|
554
|
+
private readonly startPointerEventListeners;
|
|
535
555
|
}
|
|
File without changes
|
|
@@ -82,15 +82,9 @@ export declare class CognitePointCloudModel extends THREE.Object3D implements Co
|
|
|
82
82
|
*/
|
|
83
83
|
getClasses(): Array<number | WellKnownAsprsPointClassCodes>;
|
|
84
84
|
/**
|
|
85
|
-
* Returns the current
|
|
85
|
+
* Returns the current number of visible/loaded points.
|
|
86
86
|
*/
|
|
87
|
-
get
|
|
88
|
-
/**
|
|
89
|
-
* The point budget limits the number of points loaded and rendered at any given time,
|
|
90
|
-
* which helps to adapt performance requirements to the capabilities of different hardware.
|
|
91
|
-
* Recommended values are between 500.000 and 10.000.000.
|
|
92
|
-
*/
|
|
93
|
-
set pointBudget(count: number);
|
|
87
|
+
get visiblePointCount(): number;
|
|
94
88
|
/**
|
|
95
89
|
* Determines how points currently are colored.
|
|
96
90
|
*/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -12,6 +12,10 @@ export declare type Color = {
|
|
|
12
12
|
g: number;
|
|
13
13
|
b: number;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Units supported by {@link Cognite3DModel}.
|
|
17
|
+
*/
|
|
18
|
+
export declare type WellKnownUnit = 'Meters' | 'Centimeters' | 'Millimeters' | 'Micrometers' | 'Kilometers' | 'Feet' | 'Inches' | 'Yards' | 'Miles' | 'Mils' | 'Microinches';
|
|
15
19
|
/**
|
|
16
20
|
* Callback to monitor loaded requests and progress.
|
|
17
21
|
* Use OnLoadingCallback instead of onProgress/onComplete.
|
|
@@ -39,6 +43,20 @@ export interface Cognite3DViewerOptions {
|
|
|
39
43
|
target: THREE.WebGLRenderTarget;
|
|
40
44
|
autoSetSize?: boolean;
|
|
41
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Style the loading indicator.
|
|
48
|
+
*/
|
|
49
|
+
loadingIndicatorStyle?: {
|
|
50
|
+
/**
|
|
51
|
+
* What corner the spinner should be placed in. Defaults top topLeft.
|
|
52
|
+
*/
|
|
53
|
+
placement: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
|
54
|
+
/**
|
|
55
|
+
* Opacity of the spinner in fractions. Valid values are between
|
|
56
|
+
* 0.2 and 1.0. Defaults to 1.0.
|
|
57
|
+
*/
|
|
58
|
+
opacity: number;
|
|
59
|
+
};
|
|
42
60
|
/**
|
|
43
61
|
* When false, camera near and far planes will not be updated automatically (defaults to true).
|
|
44
62
|
* This can be useful when you have custom content in the 3D view and need to better
|
|
@@ -92,8 +110,20 @@ export interface Cognite3DViewerOptions {
|
|
|
92
110
|
enableEdges?: boolean;
|
|
93
111
|
/** Callback to download stream progress. */
|
|
94
112
|
onLoading?: OnLoadingCallback;
|
|
113
|
+
/**
|
|
114
|
+
* Allows providing a custom data source that Reveal will
|
|
115
|
+
* use to load model data. Note that some features might not
|
|
116
|
+
* work when implementing a custom data source. Please refer
|
|
117
|
+
* to the Reveal documentation for details.
|
|
118
|
+
*
|
|
119
|
+
* Note that the data source must support {@link CdfModelIdentifier}.
|
|
120
|
+
*
|
|
121
|
+
* This cannot be used together with {@link _localModels}.
|
|
122
|
+
*/
|
|
123
|
+
customDataSource?: DataSource;
|
|
95
124
|
}
|
|
96
125
|
import { GeometryFilter } from '../../public/types';
|
|
126
|
+
import { DataSource } from '../../../../packages/data-source';
|
|
97
127
|
export { GeometryFilter };
|
|
98
128
|
/**
|
|
99
129
|
* @module @cognite/reveal
|
|
@@ -103,8 +133,6 @@ export interface AddModelOptions {
|
|
|
103
133
|
revisionId: number;
|
|
104
134
|
localPath?: string;
|
|
105
135
|
geometryFilter?: GeometryFilter;
|
|
106
|
-
orthographicCamera?: boolean;
|
|
107
|
-
onComplete?: () => void;
|
|
108
136
|
}
|
|
109
137
|
export declare type CadIntersection = {
|
|
110
138
|
/**
|
|
@@ -158,7 +186,7 @@ export declare type Intersection = CadIntersection | PointCloudIntersection;
|
|
|
158
186
|
/**
|
|
159
187
|
* @module @cognite/reveal
|
|
160
188
|
*/
|
|
161
|
-
export { CameraConfiguration } from '
|
|
189
|
+
export { CameraConfiguration } from '../../../../packages/utilities';
|
|
162
190
|
/**
|
|
163
191
|
* Delegate for pointer events.
|
|
164
192
|
* @module @cognite/reveal
|
|
@@ -208,6 +236,22 @@ export declare type CadModelBudget = {
|
|
|
208
236
|
* are very important for the framerate.
|
|
209
237
|
*/
|
|
210
238
|
readonly maximumNumberOfDrawCalls: number;
|
|
239
|
+
/**
|
|
240
|
+
* Maximum render cost. This number can be thought of as triangle count, although the number
|
|
241
|
+
* doesn't match this directly.
|
|
242
|
+
*/
|
|
243
|
+
readonly maximumRenderCost: number;
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* Represents a budget of how many point from point clouds can be
|
|
247
|
+
* loaded at the same time.
|
|
248
|
+
*/
|
|
249
|
+
export declare type PointCloudBudget = {
|
|
250
|
+
/**
|
|
251
|
+
* Total number of points that can be loaded for all point clouds models
|
|
252
|
+
* accumulated.
|
|
253
|
+
*/
|
|
254
|
+
readonly numberOfPoints: number;
|
|
211
255
|
};
|
|
212
256
|
/**
|
|
213
257
|
* Options to control how {@link Cognite3DViewer.getIntersectionFromPixel} behaves.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { LoadingState, SectorCuller } from '../../../packages/cad-geometry-loaders';
|
|
5
|
+
import { SectorQuads, RenderOptions } from '../../../packages/rendering';
|
|
6
|
+
import { SectorGeometry } from '../../../packages/cad-parsers';
|
|
7
|
+
/**
|
|
8
|
+
* @property logMetrics Might be used to disable usage statistics.
|
|
9
|
+
* @property nodeAppearanceProvider Style node by tree-index.
|
|
10
|
+
* @property internal Internals are for internal usage only (like unit-testing).
|
|
11
|
+
*/
|
|
12
|
+
export declare type RevealOptions = {
|
|
13
|
+
logMetrics?: boolean;
|
|
14
|
+
renderOptions?: RenderOptions;
|
|
15
|
+
internal?: {
|
|
16
|
+
parseCallback?: (parsed: {
|
|
17
|
+
lod: string;
|
|
18
|
+
data: SectorGeometry | SectorQuads;
|
|
19
|
+
}) => void;
|
|
20
|
+
sectorCuller?: SectorCuller;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export interface GeometryFilter {
|
|
24
|
+
/**
|
|
25
|
+
* The bounds to load geometry within. By default this box is in CDF coordinate space which
|
|
26
|
+
* will be transformed into coordinates relative to the model using the the model transformation
|
|
27
|
+
* which can be specified using {@link https://docs.cognite.com/api/v1/#operation/update3DRevisions |the CDF API},
|
|
28
|
+
* or set in {@link https://fusion.cognite.com/ |Cognite Fusion}.
|
|
29
|
+
* @see {@link isBoundingBoxInModelCoordinates}.
|
|
30
|
+
*/
|
|
31
|
+
boundingBox?: THREE.Box3;
|
|
32
|
+
/**
|
|
33
|
+
* When set, the geometry filter {@link boundingBox} will be considered to be in "Reveal/ThreeJS space".
|
|
34
|
+
* Rather than CDF space which is the default. When using Reveal space, the model transformation
|
|
35
|
+
* which can be specified using {@link https://docs.cognite.com/api/v1/#operation/update3DRevisions |the CDF API},
|
|
36
|
+
* or set in {@link https://fusion.cognite.com/ |Cognite Fusion}.
|
|
37
|
+
*/
|
|
38
|
+
isBoundingBoxInModelCoordinates?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Handler for events about data being loaded.
|
|
42
|
+
*/
|
|
43
|
+
export declare type LoadingStateChangeListener = (loadingState: LoadingState) => any;
|
|
44
|
+
export * from '../datamodels/pointcloud/types';
|
|
45
|
+
export * from './migration/types';
|
|
46
|
+
export { SupportedModelTypes } from '../datamodels/base';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { AddModelOptions } from '../public/migration/types';
|
|
6
|
+
import { RevealOptions } from '../public/types';
|
|
7
|
+
import { PointCloudNode, RevealManager } from '../internals';
|
|
8
|
+
import { DataSource } from '../../../packages/data-source';
|
|
9
|
+
import { CadNode } from '../../../packages/rendering';
|
|
10
|
+
import { CogniteClient } from '@cognite/sdk';
|
|
11
|
+
/**
|
|
12
|
+
* Helper for {@link RevealManager} for creating a uniform interface for
|
|
13
|
+
* working with instances that fetch models from CDF or instances that fetch
|
|
14
|
+
* models from local storage (i.e. in development/debugging).
|
|
15
|
+
*/
|
|
16
|
+
export declare class RevealManagerHelper {
|
|
17
|
+
private readonly _revealManager;
|
|
18
|
+
addCadModel: (model: AddModelOptions) => Promise<CadNode>;
|
|
19
|
+
addPointCloudModel: (model: AddModelOptions) => Promise<PointCloudNode>;
|
|
20
|
+
private constructor();
|
|
21
|
+
private constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Create helper for RevealManager that loads models from local storage. This is only
|
|
24
|
+
* meant for use in debugging and development.
|
|
25
|
+
* @param renderer
|
|
26
|
+
* @param scene
|
|
27
|
+
* @param revealOptions
|
|
28
|
+
*/
|
|
29
|
+
static createLocalHelper(renderer: THREE.WebGLRenderer, scene: THREE.Scene, revealOptions: RevealOptions): RevealManagerHelper;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a helper for RevealManager that loads models from CDF.
|
|
32
|
+
* @param renderer
|
|
33
|
+
* @param scene
|
|
34
|
+
* @param revealOptions
|
|
35
|
+
* @param sdkClient
|
|
36
|
+
*/
|
|
37
|
+
static createCdfHelper(renderer: THREE.WebGLRenderer, scene: THREE.Scene, revealOptions: RevealOptions, sdkClient: CogniteClient): RevealManagerHelper;
|
|
38
|
+
static createCustomDataSourceHelper(renderer: THREE.WebGLRenderer, scene: THREE.Scene, revealOptions: RevealOptions, dataSource: DataSource): RevealManagerHelper;
|
|
39
|
+
get revealManager(): RevealManager;
|
|
40
|
+
/**
|
|
41
|
+
* Adds a local CAD model.
|
|
42
|
+
* @param model
|
|
43
|
+
* @param revealManager
|
|
44
|
+
*/
|
|
45
|
+
private static addLocalCadModel;
|
|
46
|
+
/**
|
|
47
|
+
* Adds a CDF hosted CAD model.
|
|
48
|
+
* @param model
|
|
49
|
+
* @param revealManager
|
|
50
|
+
*/
|
|
51
|
+
private static addCdfCadModel;
|
|
52
|
+
/**
|
|
53
|
+
* Add a CDF hosted point cloud model.
|
|
54
|
+
* @param model
|
|
55
|
+
* @param revealManager
|
|
56
|
+
*/
|
|
57
|
+
private static addCdfPointCloudModel;
|
|
58
|
+
}
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
export declare class BoundingBoxClipper {
|
|
6
|
-
private _intersection;
|
|
7
6
|
private readonly _box;
|
|
8
7
|
private readonly _clippingPlanes;
|
|
9
|
-
constructor(box?: THREE.Box3
|
|
8
|
+
constructor(box?: THREE.Box3);
|
|
10
9
|
set minX(x: number);
|
|
11
10
|
get minX(): number;
|
|
12
11
|
set minY(y: number);
|
|
@@ -19,8 +18,6 @@ export declare class BoundingBoxClipper {
|
|
|
19
18
|
get maxY(): number;
|
|
20
19
|
set maxZ(z: number);
|
|
21
20
|
get maxZ(): number;
|
|
22
|
-
set intersection(value: boolean);
|
|
23
|
-
get intersection(): boolean;
|
|
24
21
|
private updatePlanes;
|
|
25
22
|
get clippingPlanes(): THREE.Plane[];
|
|
26
23
|
}
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
+
export declare type Corner = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
|
5
6
|
export declare class Spinner {
|
|
6
7
|
private static readonly stylesId;
|
|
7
|
-
static classnames
|
|
8
|
-
base: string;
|
|
9
|
-
loading: string;
|
|
10
|
-
dark: string;
|
|
11
|
-
};
|
|
8
|
+
private static readonly classnames;
|
|
12
9
|
private static readonly titles;
|
|
13
10
|
private _loading;
|
|
14
11
|
private static loadStyles;
|
|
15
12
|
private readonly el;
|
|
16
13
|
constructor(parent: HTMLElement);
|
|
14
|
+
set placement(placement: Corner);
|
|
15
|
+
set opacity(fractionOpacity: number);
|
|
17
16
|
get loading(): boolean;
|
|
18
17
|
set loading(loadingState: boolean);
|
|
19
18
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright 2021 Cognite AS
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as THREE from 'three';
|
|
5
5
|
import { Cognite3DViewer } from '../public/migration/Cognite3DViewer';
|
|
6
|
+
import { NodeAppearance } from '../../../packages/cad-styling';
|
|
6
7
|
import { CogniteClient } from '@cognite/sdk';
|
|
7
|
-
import * as THREE from 'three';
|
|
8
8
|
export declare type ViewerState = {
|
|
9
9
|
camera: {
|
|
10
10
|
position: THREE.Vector3;
|
|
@@ -26,8 +26,8 @@ export declare type ModelState = {
|
|
|
26
26
|
export declare class ViewStateHelper {
|
|
27
27
|
private readonly _cameraControls;
|
|
28
28
|
private readonly _viewer;
|
|
29
|
-
private
|
|
30
|
-
constructor(viewer: Cognite3DViewer,
|
|
29
|
+
private readonly _cdfClient;
|
|
30
|
+
constructor(viewer: Cognite3DViewer, cdfClient: CogniteClient);
|
|
31
31
|
getCurrentState(): ViewerState;
|
|
32
|
-
setState(viewerState: ViewerState): void
|
|
32
|
+
setState(viewerState: ViewerState): Promise<void>;
|
|
33
33
|
}
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
export { worldToViewportCoordinates, worldToNormalizedViewportCoordinates } from './worldToViewport';
|
|
5
|
+
export { BoundingBoxClipper } from './BoundingBoxClipper';
|
|
6
|
+
export { assertNever, EventTrigger } from '../../../packages/utilities';
|
|
7
|
+
export { LoadingState } from '../../../packages/cad-geometry-loaders';
|
|
8
|
+
export { LocalModelIdentifier, CdfModelIdentifier } from '../../../packages/modeldata-api';
|
|
@@ -5,9 +5,3 @@
|
|
|
5
5
|
* Retrieves the property type of a single property of a type.
|
|
6
6
|
*/
|
|
7
7
|
export declare type PropType<TObj, TProp extends keyof TObj> = TObj[TProp];
|
|
8
|
-
/**
|
|
9
|
-
* Removes the readonly modifier for a property.
|
|
10
|
-
*/
|
|
11
|
-
export declare type Mutable<T> = {
|
|
12
|
-
-readonly [P in keyof T]: T[P];
|
|
13
|
-
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
/**
|
|
6
|
+
* Maps from 3D world coordinates to normalized screen coordinates
|
|
7
|
+
* relative to the canvas being rendered to. X and Y will
|
|
8
|
+
* be in range [0, 1]. Z is in range [-1, 1] if the coordinate
|
|
9
|
+
* is inside the camera near and far planes.
|
|
10
|
+
* @param camera Camera used to project point from 3D to NDC coordinates
|
|
11
|
+
* @param position3D World position in 3D
|
|
12
|
+
* @param out Optionally pre-allocated THREE.Vector3
|
|
13
|
+
* @returns Relative screen coordinates in X, Y and Z in range [-1, 1] if point
|
|
14
|
+
* is within near/far of camera.
|
|
15
|
+
*/
|
|
16
|
+
export declare function worldToNormalizedViewportCoordinates(camera: THREE.PerspectiveCamera, position3D: THREE.Vector3, out?: THREE.Vector3): THREE.Vector3;
|
|
17
|
+
/**
|
|
18
|
+
* Maps from 3D world coordinates to screen coordinates
|
|
19
|
+
* relative to the canvas. X and Y will be in absolute
|
|
20
|
+
* coordinates (0,0 being the top left of the canvas). Z is
|
|
21
|
+
* in range [-1, 1] if the coordinate
|
|
22
|
+
* is inside the camera near and far planes.
|
|
23
|
+
* @param renderer Renderer used to render the "world"
|
|
24
|
+
* @param camera Camera used to project point from 3D to NDC coordinates
|
|
25
|
+
* @param position3D World position in 3D
|
|
26
|
+
* @param out Optionally pre-allocated THREE.Vector3
|
|
27
|
+
* @returns Relative screen coordinates in X, Y and Z in range [-1, 1] if point
|
|
28
|
+
* is within near/far of camera.
|
|
29
|
+
*/
|
|
30
|
+
export declare function worldToViewportCoordinates(renderer: THREE.WebGLRenderer, camera: THREE.PerspectiveCamera, position3D: THREE.Vector3, out?: THREE.Vector3): THREE.Vector3;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @module @cognite/reveal/extensions/datasource
|
|
6
|
+
*/
|
|
7
|
+
export { DataSource } from '../packages/data-source';
|
|
8
|
+
export { NodesApiClient } from '../packages/nodes-api';
|
|
9
|
+
export { ModelIdentifier, CdfModelIdentifier, ModelMetadataProvider, ModelDataProvider } from '../packages/modeldata-api';
|