@cognite/reveal 2.2.2 → 2.3.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/core/cad.d.ts +4 -4
- package/core/index.d.ts +7 -7
- package/core/src/datamodels/base/SupportedModelTypes.d.ts +4 -4
- package/core/src/datamodels/base/index.d.ts +6 -6
- package/core/src/datamodels/base/types.d.ts +14 -14
- package/core/src/datamodels/cad/CadManager.d.ts +45 -45
- package/core/src/datamodels/cad/CadModelFactory.d.ts +7 -7
- package/core/src/datamodels/cad/CadModelSectorLoadStatistics.d.ts +38 -38
- package/core/src/datamodels/cad/createCadManager.d.ts +9 -9
- package/core/src/datamodels/cad/picking.d.ts +28 -28
- package/core/src/datamodels/cad/rendering/RenderAlreadyLoadedGeometryProvider.d.ts +10 -10
- package/core/src/datamodels/cad/sector/CadModelClipper.d.ts +10 -10
- package/core/src/datamodels/cad/styling/AssetNodeCollection.d.ts +38 -38
- package/core/src/datamodels/cad/styling/InvertedNodeCollection.d.ts +24 -24
- package/core/src/datamodels/cad/styling/NodeCollectionDeserializer.d.ts +26 -26
- package/core/src/datamodels/cad/styling/PopulateIndexSetFromPagedResponseHelper.d.ts +24 -24
- package/core/src/datamodels/cad/styling/PropertyFilterNodeCollection.d.ts +54 -54
- package/core/src/datamodels/cad/styling/SinglePropertyFilterNodeCollection.d.ts +50 -50
- package/core/src/datamodels/cad/styling/index.d.ts +8 -8
- package/core/src/datamodels/pointcloud/PointCloudFactory.d.ts +9 -9
- package/core/src/datamodels/pointcloud/PointCloudManager.d.ts +26 -26
- package/core/src/datamodels/pointcloud/PointCloudMetadata.d.ts +11 -11
- package/core/src/datamodels/pointcloud/PointCloudMetadataRepository.d.ts +13 -13
- package/core/src/datamodels/pointcloud/PointCloudNode.d.ts +62 -62
- package/core/src/datamodels/pointcloud/PotreeGroupWrapper.d.ts +39 -39
- package/core/src/datamodels/pointcloud/PotreeNodeWrapper.d.ts +38 -38
- package/core/src/datamodels/pointcloud/createPointCloudManager.d.ts +6 -6
- package/core/src/datamodels/pointcloud/index.d.ts +5 -5
- package/core/src/datamodels/pointcloud/picking.d.ts +29 -29
- package/core/src/datamodels/pointcloud/types.d.ts +114 -114
- package/core/src/index.d.ts +19 -19
- package/core/src/internals.d.ts +15 -15
- package/core/src/migration.d.ts +8 -8
- package/core/src/public/RevealManager.d.ts +64 -64
- package/core/src/public/createRevealManager.d.ts +23 -23
- package/core/src/public/migration/Cognite3DModel.d.ts +339 -339
- package/core/src/public/migration/Cognite3DViewer.d.ts +566 -611
- package/core/src/public/migration/CogniteModelBase.d.ts +17 -17
- package/core/src/public/migration/CognitePointCloudModel.d.ts +121 -121
- package/core/src/public/migration/NodeIdAndTreeIndexMaps.d.ts +4 -4
- package/core/src/public/migration/NotSupportedInMigrationWrapperError.d.ts +11 -11
- package/core/src/public/migration/RenderController.d.ts +4 -4
- package/core/src/public/migration/types.d.ts +290 -290
- package/core/src/public/types.d.ts +46 -46
- package/core/src/storage/RevealManagerHelper.d.ts +58 -58
- package/core/src/utilities/BoundingBoxClipper.d.ts +23 -23
- package/core/src/utilities/Spinner.d.ts +27 -27
- package/core/src/utilities/ViewStateHelper.d.ts +37 -33
- package/core/src/utilities/callActionWithIndicesAsync.d.ts +4 -4
- package/core/src/utilities/index.d.ts +8 -8
- package/core/src/utilities/reflection.d.ts +7 -7
- package/core/src/utilities/worldToViewport.d.ts +30 -30
- package/core/utilities.d.ts +4 -4
- package/extensions/datasource.d.ts +9 -9
- package/extensions/datasource.js +6 -6
- package/extensions/datasource.map +1 -1
- package/index.d.ts +9 -8
- package/index.js +101 -91
- package/index.map +1 -1
- package/package.json +2 -2
- package/packages/cad-geometry-loaders/index.d.ts +14 -14
- package/packages/cad-geometry-loaders/src/CadLoadingHints.d.ts +11 -11
- package/packages/cad-geometry-loaders/src/CadModelSectorBudget.d.ts +26 -26
- package/packages/cad-geometry-loaders/src/CadModelUpdateHandler.d.ts +44 -44
- package/packages/cad-geometry-loaders/src/sector/CachedRepository.d.ts +25 -25
- package/packages/cad-geometry-loaders/src/sector/ModelStateHandler.d.ts +12 -12
- package/packages/cad-geometry-loaders/src/sector/Repository.d.ts +9 -9
- package/packages/cad-geometry-loaders/src/sector/SectorLoader.d.ts +28 -28
- package/packages/cad-geometry-loaders/src/sector/SimpleAndDetailedToSector3D.d.ts +20 -20
- package/packages/cad-geometry-loaders/src/sector/culling/ByVisibilityGpuSectorCuller.d.ts +53 -53
- package/packages/cad-geometry-loaders/src/sector/culling/OccludingGeometryProvider.d.ts +6 -6
- package/packages/cad-geometry-loaders/src/sector/culling/OrderSectorsByVisibilityCoverage.d.ts +107 -107
- package/packages/cad-geometry-loaders/src/sector/culling/SectorCuller.d.ts +33 -33
- package/packages/cad-geometry-loaders/src/sector/culling/TakenSectorTree.d.ts +24 -24
- package/packages/cad-geometry-loaders/src/sector/culling/types.d.ts +71 -71
- package/packages/cad-geometry-loaders/src/sector/rxSectorUtilities.d.ts +12 -12
- package/packages/cad-geometry-loaders/src/sector/sectorUtilities.d.ts +20 -20
- package/packages/cad-geometry-loaders/src/utilities/PromiseUtils.d.ts +18 -18
- package/packages/cad-geometry-loaders/src/utilities/arrays.d.ts +5 -5
- package/packages/cad-geometry-loaders/src/utilities/groupMeshesByNumber.d.ts +8 -8
- package/packages/cad-geometry-loaders/src/utilities/rxOperations.d.ts +6 -6
- package/packages/cad-geometry-loaders/src/utilities/types.d.ts +25 -25
- package/packages/cad-parsers/index.d.ts +21 -21
- package/packages/cad-parsers/src/cad/CadSectorParser.d.ts +15 -15
- package/packages/cad-parsers/src/cad/LevelOfDetail.d.ts +8 -8
- package/packages/cad-parsers/src/cad/filterInstanceMesh.d.ts +6 -6
- package/packages/cad-parsers/src/cad/filterPrimitives.d.ts +9 -9
- package/packages/cad-parsers/src/cad/primitiveGeometries.d.ts +31 -31
- package/packages/cad-parsers/src/cad/triangleMeshes.d.ts +6 -6
- package/packages/cad-parsers/src/cad/types.d.ts +56 -56
- package/packages/cad-parsers/src/metadata/CadMetadataParser.d.ts +7 -7
- package/packages/cad-parsers/src/metadata/CadModelMetadata.d.ts +44 -44
- package/packages/cad-parsers/src/metadata/CadModelMetadataRepository.d.ts +16 -16
- package/packages/cad-parsers/src/metadata/MetadataRepository.d.ts +7 -7
- package/packages/cad-parsers/src/metadata/parsers/CadMetadataParserV8.d.ts +51 -51
- package/packages/cad-parsers/src/metadata/types.d.ts +41 -41
- package/packages/cad-parsers/src/sector/RootSectorNode.d.ts +12 -12
- package/packages/cad-parsers/src/sector/SectorNode.d.ts +21 -21
- package/packages/cad-parsers/src/utilities/SectorScene.d.ts +21 -21
- package/packages/cad-parsers/src/utilities/SectorSceneFactory.d.ts +9 -9
- package/packages/cad-parsers/src/utilities/computeBoundingBoxFromAttributes.d.ts +9 -9
- package/packages/cad-parsers/src/utilities/float32BufferToMatrix.d.ts +12 -12
- package/packages/cad-parsers/src/utilities/types.d.ts +48 -48
- package/packages/cad-styling/index.d.ts +9 -9
- package/packages/cad-styling/src/CombineNodeCollectionBase.d.ts +31 -31
- package/packages/cad-styling/src/IntersectionNodeCollection.d.ts +15 -15
- package/packages/cad-styling/src/NodeAppearance.d.ts +62 -62
- package/packages/cad-styling/src/NodeAppearanceProvider.d.ts +33 -33
- package/packages/cad-styling/src/NodeCollectionBase.d.ts +47 -47
- package/packages/cad-styling/src/TreeIndexNodeCollection.d.ts +23 -23
- package/packages/cad-styling/src/UnionNodeCollection.d.ts +15 -15
- package/packages/camera-manager/index.d.ts +6 -4
- package/packages/camera-manager/src/CameraManager.d.ts +85 -0
- package/packages/camera-manager/src/ComboControls.d.ts +102 -100
- package/packages/camera-manager/src/Keyboard.d.ts +17 -17
- package/packages/camera-manager/src/types.d.ts +64 -0
- package/packages/data-source/index.d.ts +6 -6
- package/packages/data-source/src/CdfDataSource.d.ts +19 -19
- package/packages/data-source/src/DataSource.d.ts +26 -26
- package/packages/data-source/src/LocalDataSource.d.ts +15 -15
- package/packages/logger/index.d.ts +5 -5
- package/packages/logger/src/Log.d.ts +5 -5
- package/packages/metrics/index.d.ts +5 -5
- package/packages/metrics/src/MetricsLogger.d.ts +21 -21
- package/packages/metrics/src/types.d.ts +7 -7
- package/packages/modeldata-api/index.d.ts +13 -13
- package/packages/modeldata-api/src/CdfModelDataProvider.d.ts +17 -15
- package/packages/modeldata-api/src/CdfModelIdentifier.d.ts +17 -17
- package/packages/modeldata-api/src/CdfModelMetadataProvider.d.ts +19 -19
- package/packages/modeldata-api/src/CdfModelOutputsProvider.d.ts +15 -15
- package/packages/modeldata-api/src/LocalModelDataProvider.d.ts +10 -10
- package/packages/modeldata-api/src/LocalModelIdentifier.d.ts +14 -14
- package/packages/modeldata-api/src/LocalModelMetadataProvider.d.ts +14 -14
- package/packages/modeldata-api/src/Model3DOutputList.d.ts +17 -17
- package/packages/modeldata-api/src/ModelIdentifier.d.ts +12 -12
- package/packages/modeldata-api/src/ModelMetadataProvider.d.ts +17 -17
- package/packages/modeldata-api/src/applyDefaultModelTransformation.d.ts +6 -6
- package/packages/modeldata-api/src/types.d.ts +41 -41
- package/packages/modeldata-api/src/utilities.d.ts +7 -7
- package/packages/nodes-api/index.d.ts +6 -6
- package/packages/nodes-api/src/NodesApiClient.d.ts +52 -52
- package/packages/nodes-api/src/NodesCdfClient.d.ts +24 -24
- package/packages/nodes-api/src/NodesLocalClient.d.ts +30 -30
- package/packages/nodes-api/src/types.d.ts +10 -10
- package/packages/rendering/index.d.ts +17 -17
- package/packages/rendering/src/CadMaterialManager.d.ts +37 -37
- package/packages/rendering/src/InstancedMeshManager.d.ts +20 -20
- package/packages/rendering/src/cameraconfig.d.ts +12 -12
- package/packages/rendering/src/rendering/EffectRenderManager.d.ts +99 -99
- package/packages/rendering/src/rendering/NodeAppearanceTextureBuilder.d.ts +51 -51
- package/packages/rendering/src/rendering/RenderMode.d.ts +15 -15
- package/packages/rendering/src/rendering/createSimpleGeometryMesh.d.ts +6 -6
- package/packages/rendering/src/rendering/matCapTextureData.d.ts +5 -5
- package/packages/rendering/src/rendering/materials.d.ts +23 -23
- package/packages/rendering/src/rendering/primitives.d.ts +12 -12
- package/packages/rendering/src/rendering/shaders.d.ts +101 -101
- package/packages/rendering/src/rendering/types.d.ts +76 -76
- package/packages/rendering/src/sector/CadNode.d.ts +54 -54
- package/packages/rendering/src/transform/NodeTransformProvider.d.ts +13 -13
- package/packages/rendering/src/transform/NodeTransformTextureBuilder.d.ts +23 -23
- package/packages/rendering/src/transform/TransformOverrideBuffer.d.ts +21 -21
- package/packages/rendering/src/utilities/types.d.ts +26 -26
- package/packages/tools/index.d.ts +15 -15
- package/packages/tools/src/AxisView/AxisViewTool.d.ts +32 -32
- package/packages/tools/src/AxisView/types.d.ts +98 -98
- package/packages/tools/src/Cognite3DViewerToolBase.d.ts +25 -25
- package/packages/tools/src/DebugCameraTool.d.ts +20 -20
- package/packages/tools/src/DebugLoadedSectorsTool.d.ts +23 -23
- package/packages/tools/src/ExplodedViewTool.d.ts +12 -12
- package/packages/tools/src/Geomap/Geomap.d.ts +17 -17
- package/packages/tools/src/Geomap/GeomapTool.d.ts +24 -24
- package/packages/tools/src/Geomap/MapConfig.d.ts +195 -195
- package/packages/tools/src/HtmlOverlay/BucketGrid2D.d.ts +28 -28
- package/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +159 -159
- package/packages/tools/src/Timeline/Keyframe.d.ts +38 -38
- package/packages/tools/src/Timeline/TimelineTool.d.ts +79 -79
- package/packages/tools/src/Timeline/types.d.ts +13 -13
- package/packages/tools/src/types.d.ts +4 -4
- package/packages/utilities/index.d.ts +24 -24
- package/packages/utilities/src/CameraConfiguration.d.ts +10 -10
- package/packages/utilities/src/IndexSet.d.ts +1 -1
- package/packages/utilities/src/NumericRange.d.ts +22 -22
- package/packages/utilities/src/RandomColors.d.ts +34 -34
- package/packages/utilities/src/WebGLRendererStateHelper.d.ts +15 -15
- package/packages/utilities/src/assertNever.d.ts +7 -7
- package/packages/utilities/src/cache/MemoryRequestCache.d.ts +22 -22
- package/packages/utilities/src/cache/MostFrequentlyUsedCache.d.ts +19 -19
- package/packages/utilities/src/cache/RequestCache.d.ts +13 -13
- package/packages/utilities/src/datastructures/DynamicDefragmentedBuffer.d.ts +22 -22
- package/packages/utilities/src/determinePowerOfTwoDimensions.d.ts +11 -11
- package/packages/utilities/src/disposeAttributeArrayOnUpload.d.ts +17 -17
- package/packages/utilities/src/events/EventTrigger.d.ts +13 -13
- package/packages/utilities/src/events/InputHandler.d.ts +34 -0
- package/packages/utilities/src/events/clickOrTouchEventOffset.d.ts +13 -13
- package/packages/utilities/src/events/index.d.ts +6 -5
- package/packages/utilities/src/indexset/IndexSet.d.ts +26 -26
- package/packages/utilities/src/indexset/IntermediateIndexNode.d.ts +26 -26
- package/packages/utilities/src/indexset/LeafIndexNode.d.ts +16 -16
- package/packages/utilities/src/isMobileOrTablet.d.ts +4 -4
- package/packages/utilities/src/networking/isTheSameDomain.d.ts +11 -11
- package/packages/utilities/src/objectTraversal.d.ts +8 -8
- package/packages/utilities/src/packFloat.d.ts +6 -6
- package/packages/utilities/src/revealEnv.d.ts +10 -10
- package/packages/utilities/src/three/AutoDisposeGroup.d.ts +17 -17
- package/packages/utilities/src/three/BoundingBoxLOD.d.ts +27 -27
- package/packages/utilities/src/three/getBox3CornerPoints.d.ts +5 -5
- package/packages/utilities/src/transformCameraConfiguration.d.ts +6 -6
- package/packages/utilities/src/types.d.ts +10 -10
- package/packages/utilities/src/workers/WorkerPool.d.ts +14 -14
- package/tools.d.ts +7 -7
- package/tools.js +62 -58
- package/tools.map +1 -1
package/packages/cad-geometry-loaders/src/sector/culling/OrderSectorsByVisibilityCoverage.d.ts
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
import { CadModelMetadata, WantedSector } from '../../../../cad-parsers';
|
|
6
|
-
import { OccludingGeometryProvider } from './OccludingGeometryProvider';
|
|
7
|
-
/**
|
|
8
|
-
* Options for OrderSectorsByVisibleCoverage.
|
|
9
|
-
*/
|
|
10
|
-
export interface OrderSectorsByVisibleCoverageOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Renderer used to render coverage.
|
|
13
|
-
*/
|
|
14
|
-
renderer: THREE.WebGLRenderer;
|
|
15
|
-
/**
|
|
16
|
-
* Initializes a render target with already loaded geometry for pre-load
|
|
17
|
-
* occlusion.
|
|
18
|
-
*/
|
|
19
|
-
occludingGeometryProvider: OccludingGeometryProvider;
|
|
20
|
-
}
|
|
21
|
-
export declare type PrioritizedSectorIdentifier = {
|
|
22
|
-
/**
|
|
23
|
-
* The CAD model that holds the sector.
|
|
24
|
-
*/
|
|
25
|
-
model: CadModelMetadata;
|
|
26
|
-
/**
|
|
27
|
-
* Sector ID contained in the model provided.
|
|
28
|
-
*/
|
|
29
|
-
sectorId: number;
|
|
30
|
-
/**
|
|
31
|
-
* A number between 0 and 1 indicating how 'important' the sector is.
|
|
32
|
-
*/
|
|
33
|
-
priority: number;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Interface for classes that estimates how visible a sector will be on screen.
|
|
37
|
-
*/
|
|
38
|
-
export interface OrderSectorsByVisibilityCoverage {
|
|
39
|
-
/**
|
|
40
|
-
* Dispose any resources that cannot be garbage collected.
|
|
41
|
-
*/
|
|
42
|
-
dispose(): void;
|
|
43
|
-
/**
|
|
44
|
-
* Specifies what CAD models to estimate sector visibility for.
|
|
45
|
-
* @param models Models to estimate sector visibility for.
|
|
46
|
-
*/
|
|
47
|
-
setModels(models: CadModelMetadata[]): void;
|
|
48
|
-
/**
|
|
49
|
-
* Specify clipping planes.
|
|
50
|
-
* @param planes A list of clip planes or null to disable clipping.
|
|
51
|
-
*/
|
|
52
|
-
setClipping(planes: THREE.Plane[] | null): void;
|
|
53
|
-
/**
|
|
54
|
-
* Cull a set of sectors potentially being loaded towards already loaded geometry to determine if
|
|
55
|
-
* the sector is visible or occluded.
|
|
56
|
-
*/
|
|
57
|
-
cullOccludedSectors(camera: THREE.PerspectiveCamera, sectors: WantedSector[]): WantedSector[];
|
|
58
|
-
/**
|
|
59
|
-
* Estimates how visible the different sectors for the models added are and returns
|
|
60
|
-
* a prioritized list.
|
|
61
|
-
* @param camera The current viewpoint.
|
|
62
|
-
*/
|
|
63
|
-
orderSectorsByVisibility(camera: THREE.Camera): PrioritizedSectorIdentifier[];
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Estimates sector visibility by rendering their bounds with a pattern confirming to how
|
|
67
|
-
* much of the geometry covers of the bounding box.
|
|
68
|
-
*/
|
|
69
|
-
export declare class GpuOrderSectorsByVisibilityCoverage implements OrderSectorsByVisibilityCoverage {
|
|
70
|
-
/**
|
|
71
|
-
* Factor of how big render target we use for determining visibility of sectors
|
|
72
|
-
* compared to the full render size.
|
|
73
|
-
*/
|
|
74
|
-
private static readonly CoverageRenderTargetScalingFactor;
|
|
75
|
-
private sectorIdOffset;
|
|
76
|
-
private readonly scene;
|
|
77
|
-
private readonly _renderer;
|
|
78
|
-
private readonly _alreadyLoadedProvider;
|
|
79
|
-
private _debugImageElement?;
|
|
80
|
-
private readonly renderTarget;
|
|
81
|
-
private readonly containers;
|
|
82
|
-
private readonly buffers;
|
|
83
|
-
private readonly coverageMaterial;
|
|
84
|
-
constructor(options: OrderSectorsByVisibleCoverageOptions);
|
|
85
|
-
dispose(): void;
|
|
86
|
-
get renderer(): THREE.WebGLRenderer;
|
|
87
|
-
createDebugCanvas(options?: {
|
|
88
|
-
width: number;
|
|
89
|
-
height: number;
|
|
90
|
-
}): HTMLElement;
|
|
91
|
-
setModels(models: CadModelMetadata[]): void;
|
|
92
|
-
setClipping(planes: THREE.Plane[] | null): void;
|
|
93
|
-
cullOccludedSectors(camera: THREE.PerspectiveCamera, sectors: WantedSector[]): WantedSector[];
|
|
94
|
-
orderSectorsByVisibility(camera: THREE.PerspectiveCamera): PrioritizedSectorIdentifier[];
|
|
95
|
-
private readonly _ensureBuffersCorrectSizeVars;
|
|
96
|
-
private ensureBuffersCorrectSize;
|
|
97
|
-
private renderSectors;
|
|
98
|
-
private setAllSectorsVisible;
|
|
99
|
-
private setSectorsVisibility;
|
|
100
|
-
private removeModel;
|
|
101
|
-
private deleteSectorsFromBuffers;
|
|
102
|
-
private addModel;
|
|
103
|
-
private updateModel;
|
|
104
|
-
private findSectorContainer;
|
|
105
|
-
private unpackSectorVisibility;
|
|
106
|
-
private createSectorTreeGeometry;
|
|
107
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { CadModelMetadata, WantedSector } from '../../../../cad-parsers';
|
|
6
|
+
import { OccludingGeometryProvider } from './OccludingGeometryProvider';
|
|
7
|
+
/**
|
|
8
|
+
* Options for OrderSectorsByVisibleCoverage.
|
|
9
|
+
*/
|
|
10
|
+
export interface OrderSectorsByVisibleCoverageOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Renderer used to render coverage.
|
|
13
|
+
*/
|
|
14
|
+
renderer: THREE.WebGLRenderer;
|
|
15
|
+
/**
|
|
16
|
+
* Initializes a render target with already loaded geometry for pre-load
|
|
17
|
+
* occlusion.
|
|
18
|
+
*/
|
|
19
|
+
occludingGeometryProvider: OccludingGeometryProvider;
|
|
20
|
+
}
|
|
21
|
+
export declare type PrioritizedSectorIdentifier = {
|
|
22
|
+
/**
|
|
23
|
+
* The CAD model that holds the sector.
|
|
24
|
+
*/
|
|
25
|
+
model: CadModelMetadata;
|
|
26
|
+
/**
|
|
27
|
+
* Sector ID contained in the model provided.
|
|
28
|
+
*/
|
|
29
|
+
sectorId: number;
|
|
30
|
+
/**
|
|
31
|
+
* A number between 0 and 1 indicating how 'important' the sector is.
|
|
32
|
+
*/
|
|
33
|
+
priority: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Interface for classes that estimates how visible a sector will be on screen.
|
|
37
|
+
*/
|
|
38
|
+
export interface OrderSectorsByVisibilityCoverage {
|
|
39
|
+
/**
|
|
40
|
+
* Dispose any resources that cannot be garbage collected.
|
|
41
|
+
*/
|
|
42
|
+
dispose(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Specifies what CAD models to estimate sector visibility for.
|
|
45
|
+
* @param models Models to estimate sector visibility for.
|
|
46
|
+
*/
|
|
47
|
+
setModels(models: CadModelMetadata[]): void;
|
|
48
|
+
/**
|
|
49
|
+
* Specify clipping planes.
|
|
50
|
+
* @param planes A list of clip planes or null to disable clipping.
|
|
51
|
+
*/
|
|
52
|
+
setClipping(planes: THREE.Plane[] | null): void;
|
|
53
|
+
/**
|
|
54
|
+
* Cull a set of sectors potentially being loaded towards already loaded geometry to determine if
|
|
55
|
+
* the sector is visible or occluded.
|
|
56
|
+
*/
|
|
57
|
+
cullOccludedSectors(camera: THREE.PerspectiveCamera, sectors: WantedSector[]): WantedSector[];
|
|
58
|
+
/**
|
|
59
|
+
* Estimates how visible the different sectors for the models added are and returns
|
|
60
|
+
* a prioritized list.
|
|
61
|
+
* @param camera The current viewpoint.
|
|
62
|
+
*/
|
|
63
|
+
orderSectorsByVisibility(camera: THREE.Camera): PrioritizedSectorIdentifier[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Estimates sector visibility by rendering their bounds with a pattern confirming to how
|
|
67
|
+
* much of the geometry covers of the bounding box.
|
|
68
|
+
*/
|
|
69
|
+
export declare class GpuOrderSectorsByVisibilityCoverage implements OrderSectorsByVisibilityCoverage {
|
|
70
|
+
/**
|
|
71
|
+
* Factor of how big render target we use for determining visibility of sectors
|
|
72
|
+
* compared to the full render size.
|
|
73
|
+
*/
|
|
74
|
+
private static readonly CoverageRenderTargetScalingFactor;
|
|
75
|
+
private sectorIdOffset;
|
|
76
|
+
private readonly scene;
|
|
77
|
+
private readonly _renderer;
|
|
78
|
+
private readonly _alreadyLoadedProvider;
|
|
79
|
+
private _debugImageElement?;
|
|
80
|
+
private readonly renderTarget;
|
|
81
|
+
private readonly containers;
|
|
82
|
+
private readonly buffers;
|
|
83
|
+
private readonly coverageMaterial;
|
|
84
|
+
constructor(options: OrderSectorsByVisibleCoverageOptions);
|
|
85
|
+
dispose(): void;
|
|
86
|
+
get renderer(): THREE.WebGLRenderer;
|
|
87
|
+
createDebugCanvas(options?: {
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
}): HTMLElement;
|
|
91
|
+
setModels(models: CadModelMetadata[]): void;
|
|
92
|
+
setClipping(planes: THREE.Plane[] | null): void;
|
|
93
|
+
cullOccludedSectors(camera: THREE.PerspectiveCamera, sectors: WantedSector[]): WantedSector[];
|
|
94
|
+
orderSectorsByVisibility(camera: THREE.PerspectiveCamera): PrioritizedSectorIdentifier[];
|
|
95
|
+
private readonly _ensureBuffersCorrectSizeVars;
|
|
96
|
+
private ensureBuffersCorrectSize;
|
|
97
|
+
private renderSectors;
|
|
98
|
+
private setAllSectorsVisible;
|
|
99
|
+
private setSectorsVisibility;
|
|
100
|
+
private removeModel;
|
|
101
|
+
private deleteSectorsFromBuffers;
|
|
102
|
+
private addModel;
|
|
103
|
+
private updateModel;
|
|
104
|
+
private findSectorContainer;
|
|
105
|
+
private unpackSectorVisibility;
|
|
106
|
+
private createSectorTreeGeometry;
|
|
107
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import { WantedSector } from '../../../../cad-parsers';
|
|
5
|
-
import { DetermineSectorsInput, SectorLoadingSpent } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* Interface for implementations that are responsible for determining
|
|
8
|
-
* what sectors should be loaded (i.e. "culls" sectors).
|
|
9
|
-
*/
|
|
10
|
-
export interface SectorCuller {
|
|
11
|
-
/**
|
|
12
|
-
* Determine initial sector prioritization about what we think to load. This provides an initial guesstimate of
|
|
13
|
-
* what sectors we should load. Use {@link filterSectorsToLoad} to improve this estimate as new data is loaded.
|
|
14
|
-
* @param input
|
|
15
|
-
*/
|
|
16
|
-
determineSectors(input: DetermineSectorsInput): {
|
|
17
|
-
wantedSectors: WantedSector[];
|
|
18
|
-
spentBudget: SectorLoadingSpent;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Evaluates if sectors provided should be loaded or not, e.g. based on geometry we have now loaded
|
|
22
|
-
* since {@link determineSectors} was called. This can be used to e.g. implement pre-load occlusion culling
|
|
23
|
-
* of sectors based on geometry that has been loaded.
|
|
24
|
-
*
|
|
25
|
-
* @param input Same input as used in {@link determineSectors}.
|
|
26
|
-
* @param wantedSectorsBatch A set of sectors from {@link determineSectors}, e.g. in batches of 5-10.
|
|
27
|
-
*/
|
|
28
|
-
filterSectorsToLoad(input: DetermineSectorsInput, wantedSectorsBatch: WantedSector[]): Promise<WantedSector[]>;
|
|
29
|
-
/**
|
|
30
|
-
* Dispose all non-GCed resoures held.
|
|
31
|
-
*/
|
|
32
|
-
dispose(): void;
|
|
33
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { WantedSector } from '../../../../cad-parsers';
|
|
5
|
+
import { DetermineSectorsInput, SectorLoadingSpent } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Interface for implementations that are responsible for determining
|
|
8
|
+
* what sectors should be loaded (i.e. "culls" sectors).
|
|
9
|
+
*/
|
|
10
|
+
export interface SectorCuller {
|
|
11
|
+
/**
|
|
12
|
+
* Determine initial sector prioritization about what we think to load. This provides an initial guesstimate of
|
|
13
|
+
* what sectors we should load. Use {@link filterSectorsToLoad} to improve this estimate as new data is loaded.
|
|
14
|
+
* @param input
|
|
15
|
+
*/
|
|
16
|
+
determineSectors(input: DetermineSectorsInput): {
|
|
17
|
+
wantedSectors: WantedSector[];
|
|
18
|
+
spentBudget: SectorLoadingSpent;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Evaluates if sectors provided should be loaded or not, e.g. based on geometry we have now loaded
|
|
22
|
+
* since {@link determineSectors} was called. This can be used to e.g. implement pre-load occlusion culling
|
|
23
|
+
* of sectors based on geometry that has been loaded.
|
|
24
|
+
*
|
|
25
|
+
* @param input Same input as used in {@link determineSectors}.
|
|
26
|
+
* @param wantedSectorsBatch A set of sectors from {@link determineSectors}, e.g. in batches of 5-10.
|
|
27
|
+
*/
|
|
28
|
+
filterSectorsToLoad(input: DetermineSectorsInput, wantedSectorsBatch: WantedSector[]): Promise<WantedSector[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Dispose all non-GCed resoures held.
|
|
31
|
+
*/
|
|
32
|
+
dispose(): void;
|
|
33
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import { SectorMetadata } from '../../../../cad-parsers';
|
|
5
|
-
import { PrioritizedWantedSector, DetermineSectorCostDelegate, SectorCost } from './types';
|
|
6
|
-
export declare class TakenSectorTree {
|
|
7
|
-
get totalCost(): SectorCost;
|
|
8
|
-
private readonly sectors;
|
|
9
|
-
private readonly determineSectorCost;
|
|
10
|
-
private readonly _totalCost;
|
|
11
|
-
constructor(sectorRoot: SectorMetadata, determineSectorCost: DetermineSectorCostDelegate);
|
|
12
|
-
determineWantedSectorCount(): number;
|
|
13
|
-
toWantedSectors(modelIdentifier: string, modelBaseUrl: string, geometryClipBox: THREE.Box3 | null): PrioritizedWantedSector[];
|
|
14
|
-
markSectorDetailed(sectorId: number, priority: number): void;
|
|
15
|
-
/**
|
|
16
|
-
* Replaces a Simple sector by marking all its non-detailed children as Simple and
|
|
17
|
-
* marking the sector itself Detailed.
|
|
18
|
-
*/
|
|
19
|
-
private replaceSimpleWithDetailed;
|
|
20
|
-
private markAllDiscardedChildrenAsSimple;
|
|
21
|
-
private setSectorLod;
|
|
22
|
-
private setSectorPriority;
|
|
23
|
-
private getSectorLod;
|
|
24
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { SectorMetadata } from '../../../../cad-parsers';
|
|
5
|
+
import { PrioritizedWantedSector, DetermineSectorCostDelegate, SectorCost } from './types';
|
|
6
|
+
export declare class TakenSectorTree {
|
|
7
|
+
get totalCost(): SectorCost;
|
|
8
|
+
private readonly sectors;
|
|
9
|
+
private readonly determineSectorCost;
|
|
10
|
+
private readonly _totalCost;
|
|
11
|
+
constructor(sectorRoot: SectorMetadata, determineSectorCost: DetermineSectorCostDelegate);
|
|
12
|
+
determineWantedSectorCount(): number;
|
|
13
|
+
toWantedSectors(modelIdentifier: string, modelBaseUrl: string, geometryClipBox: THREE.Box3 | null): PrioritizedWantedSector[];
|
|
14
|
+
markSectorDetailed(sectorId: number, priority: number): void;
|
|
15
|
+
/**
|
|
16
|
+
* Replaces a Simple sector by marking all its non-detailed children as Simple and
|
|
17
|
+
* marking the sector itself Detailed.
|
|
18
|
+
*/
|
|
19
|
+
private replaceSimpleWithDetailed;
|
|
20
|
+
private markAllDiscardedChildrenAsSimple;
|
|
21
|
+
private setSectorLod;
|
|
22
|
+
private setSectorPriority;
|
|
23
|
+
private getSectorLod;
|
|
24
|
+
}
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
import { SectorMetadata, CadModelMetadata, LevelOfDetail, WantedSector } from '../../../../cad-parsers';
|
|
6
|
-
import { CadLoadingHints } from '../../CadLoadingHints';
|
|
7
|
-
import { CadModelSectorBudget } from '../../CadModelSectorBudget';
|
|
8
|
-
export interface DetermineSectorsInput {
|
|
9
|
-
camera: THREE.PerspectiveCamera;
|
|
10
|
-
clippingPlanes: THREE.Plane[];
|
|
11
|
-
cadModelsMetadata: CadModelMetadata[];
|
|
12
|
-
loadingHints: CadLoadingHints;
|
|
13
|
-
cameraInMotion: boolean;
|
|
14
|
-
budget: CadModelSectorBudget;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Statistics for how much data is required to load set of sectors.
|
|
18
|
-
*/
|
|
19
|
-
export declare type SectorLoadingSpent = {
|
|
20
|
-
/**
|
|
21
|
-
* Estimated number of bytes to download sectors.
|
|
22
|
-
*/
|
|
23
|
-
readonly downloadSize: number;
|
|
24
|
-
/**
|
|
25
|
-
* Estimated number of draw calls required to draw the sectors.
|
|
26
|
-
*/
|
|
27
|
-
readonly drawCalls: number;
|
|
28
|
-
/**
|
|
29
|
-
* Estimated "render cost" which can be compared to triangle count (but
|
|
30
|
-
* due to how Reveal renders primitives doesn't map directly to triangles).
|
|
31
|
-
*/
|
|
32
|
-
readonly renderCost: number;
|
|
33
|
-
/**
|
|
34
|
-
* Total number of sectors to load.
|
|
35
|
-
*/
|
|
36
|
-
readonly loadedSectorCount: number;
|
|
37
|
-
/**
|
|
38
|
-
* Number of 'simple' sectors to load.
|
|
39
|
-
*/
|
|
40
|
-
readonly simpleSectorCount: number;
|
|
41
|
-
/**
|
|
42
|
-
* Number of 'detailed' sectors to load.
|
|
43
|
-
*/
|
|
44
|
-
readonly detailedSectorCount: number;
|
|
45
|
-
/**
|
|
46
|
-
* How many sectors that was "forced prioritized".
|
|
47
|
-
*/
|
|
48
|
-
readonly forcedDetailedSectorCount: number;
|
|
49
|
-
/**
|
|
50
|
-
* The total number of sectors in models we are loading.
|
|
51
|
-
*/
|
|
52
|
-
readonly totalSectorCount: number;
|
|
53
|
-
/**
|
|
54
|
-
* How much of the prioritized nodes that are loaded (between 0 and 1).
|
|
55
|
-
*/
|
|
56
|
-
readonly accumulatedPriority: number;
|
|
57
|
-
};
|
|
58
|
-
export declare type SectorCost = {
|
|
59
|
-
downloadSize: number;
|
|
60
|
-
drawCalls: number;
|
|
61
|
-
renderCost: number;
|
|
62
|
-
};
|
|
63
|
-
export declare function addSectorCost(sum: SectorCost, cost: SectorCost): void;
|
|
64
|
-
export declare function reduceSectorCost(sum: SectorCost, cost: SectorCost): void;
|
|
65
|
-
export declare type PrioritizedWantedSector = WantedSector & {
|
|
66
|
-
priority: number;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Delegates that computes 'cost' of loading/visualizing a given sector.
|
|
70
|
-
*/
|
|
71
|
-
export declare type DetermineSectorCostDelegate = (sector: SectorMetadata, levelOfDetail: LevelOfDetail) => SectorCost;
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { SectorMetadata, CadModelMetadata, LevelOfDetail, WantedSector } from '../../../../cad-parsers';
|
|
6
|
+
import { CadLoadingHints } from '../../CadLoadingHints';
|
|
7
|
+
import { CadModelSectorBudget } from '../../CadModelSectorBudget';
|
|
8
|
+
export interface DetermineSectorsInput {
|
|
9
|
+
camera: THREE.PerspectiveCamera;
|
|
10
|
+
clippingPlanes: THREE.Plane[];
|
|
11
|
+
cadModelsMetadata: CadModelMetadata[];
|
|
12
|
+
loadingHints: CadLoadingHints;
|
|
13
|
+
cameraInMotion: boolean;
|
|
14
|
+
budget: CadModelSectorBudget;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Statistics for how much data is required to load set of sectors.
|
|
18
|
+
*/
|
|
19
|
+
export declare type SectorLoadingSpent = {
|
|
20
|
+
/**
|
|
21
|
+
* Estimated number of bytes to download sectors.
|
|
22
|
+
*/
|
|
23
|
+
readonly downloadSize: number;
|
|
24
|
+
/**
|
|
25
|
+
* Estimated number of draw calls required to draw the sectors.
|
|
26
|
+
*/
|
|
27
|
+
readonly drawCalls: number;
|
|
28
|
+
/**
|
|
29
|
+
* Estimated "render cost" which can be compared to triangle count (but
|
|
30
|
+
* due to how Reveal renders primitives doesn't map directly to triangles).
|
|
31
|
+
*/
|
|
32
|
+
readonly renderCost: number;
|
|
33
|
+
/**
|
|
34
|
+
* Total number of sectors to load.
|
|
35
|
+
*/
|
|
36
|
+
readonly loadedSectorCount: number;
|
|
37
|
+
/**
|
|
38
|
+
* Number of 'simple' sectors to load.
|
|
39
|
+
*/
|
|
40
|
+
readonly simpleSectorCount: number;
|
|
41
|
+
/**
|
|
42
|
+
* Number of 'detailed' sectors to load.
|
|
43
|
+
*/
|
|
44
|
+
readonly detailedSectorCount: number;
|
|
45
|
+
/**
|
|
46
|
+
* How many sectors that was "forced prioritized".
|
|
47
|
+
*/
|
|
48
|
+
readonly forcedDetailedSectorCount: number;
|
|
49
|
+
/**
|
|
50
|
+
* The total number of sectors in models we are loading.
|
|
51
|
+
*/
|
|
52
|
+
readonly totalSectorCount: number;
|
|
53
|
+
/**
|
|
54
|
+
* How much of the prioritized nodes that are loaded (between 0 and 1).
|
|
55
|
+
*/
|
|
56
|
+
readonly accumulatedPriority: number;
|
|
57
|
+
};
|
|
58
|
+
export declare type SectorCost = {
|
|
59
|
+
downloadSize: number;
|
|
60
|
+
drawCalls: number;
|
|
61
|
+
renderCost: number;
|
|
62
|
+
};
|
|
63
|
+
export declare function addSectorCost(sum: SectorCost, cost: SectorCost): void;
|
|
64
|
+
export declare function reduceSectorCost(sum: SectorCost, cost: SectorCost): void;
|
|
65
|
+
export declare type PrioritizedWantedSector = WantedSector & {
|
|
66
|
+
priority: number;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Delegates that computes 'cost' of loading/visualizing a given sector.
|
|
70
|
+
*/
|
|
71
|
+
export declare type DetermineSectorCostDelegate = (sector: SectorMetadata, levelOfDetail: LevelOfDetail) => SectorCost;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import { LevelOfDetail } from '../../../cad-parsers';
|
|
5
|
-
import { DetermineSectorsInput } from './culling/types';
|
|
6
|
-
export declare function loadingEnabled({ cadModelsMetadata, loadingHints }: DetermineSectorsInput): boolean;
|
|
7
|
-
export interface ModelState {
|
|
8
|
-
[id: number]: LevelOfDetail;
|
|
9
|
-
}
|
|
10
|
-
export interface SceneModelState {
|
|
11
|
-
[modelIdentifier: string]: ModelState;
|
|
12
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { LevelOfDetail } from '../../../cad-parsers';
|
|
5
|
+
import { DetermineSectorsInput } from './culling/types';
|
|
6
|
+
export declare function loadingEnabled({ cadModelsMetadata, loadingHints }: DetermineSectorsInput): boolean;
|
|
7
|
+
export interface ModelState {
|
|
8
|
+
[id: number]: LevelOfDetail;
|
|
9
|
+
}
|
|
10
|
+
export interface SceneModelState {
|
|
11
|
+
[modelIdentifier: string]: ModelState;
|
|
12
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
import { SectorQuads } from '@cognite/reveal-parser-worker';
|
|
6
|
-
import { AutoDisposeGroup } from '../../../utilities';
|
|
7
|
-
import { SectorMetadata, SectorGeometry, WantedSector, ConsumedSector, InstancedMeshFile } from '../../../cad-parsers';
|
|
8
|
-
import { Observable, OperatorFunction, MonoTypeOperatorFunction } from 'rxjs';
|
|
9
|
-
import { Materials } from '../../../rendering';
|
|
10
|
-
export declare function consumeSectorSimple(sector: SectorQuads, sectorBounds: THREE.Box3, materials: Materials, geometryClipBox: THREE.Box3 | null): {
|
|
11
|
-
sectorMeshes: AutoDisposeGroup;
|
|
12
|
-
instancedMeshes: InstancedMeshFile[];
|
|
13
|
-
};
|
|
14
|
-
export declare function consumeSectorDetailed(sector: SectorGeometry, metadata: SectorMetadata, materials: Materials, geometryClipBox: THREE.Box3 | null): {
|
|
15
|
-
sectorMeshes: AutoDisposeGroup;
|
|
16
|
-
instancedMeshes: InstancedMeshFile[];
|
|
17
|
-
};
|
|
18
|
-
export declare function distinctUntilLevelOfDetailChanged(): MonoTypeOperatorFunction<ConsumedSector>;
|
|
19
|
-
export declare function filterCurrentWantedSectors(wantedObservable: Observable<WantedSector[]>): OperatorFunction<ConsumedSector, ConsumedSector>;
|
|
20
|
-
export declare function findSectorMetadata(root: SectorMetadata, sectorId: number): SectorMetadata;
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { SectorQuads } from '@cognite/reveal-parser-worker';
|
|
6
|
+
import { AutoDisposeGroup } from '../../../utilities';
|
|
7
|
+
import { SectorMetadata, SectorGeometry, WantedSector, ConsumedSector, InstancedMeshFile } from '../../../cad-parsers';
|
|
8
|
+
import { Observable, OperatorFunction, MonoTypeOperatorFunction } from 'rxjs';
|
|
9
|
+
import { Materials } from '../../../rendering';
|
|
10
|
+
export declare function consumeSectorSimple(sector: SectorQuads, sectorBounds: THREE.Box3, materials: Materials, geometryClipBox: THREE.Box3 | null): {
|
|
11
|
+
sectorMeshes: AutoDisposeGroup;
|
|
12
|
+
instancedMeshes: InstancedMeshFile[];
|
|
13
|
+
};
|
|
14
|
+
export declare function consumeSectorDetailed(sector: SectorGeometry, metadata: SectorMetadata, materials: Materials, geometryClipBox: THREE.Box3 | null): {
|
|
15
|
+
sectorMeshes: AutoDisposeGroup;
|
|
16
|
+
instancedMeshes: InstancedMeshFile[];
|
|
17
|
+
};
|
|
18
|
+
export declare function distinctUntilLevelOfDetailChanged(): MonoTypeOperatorFunction<ConsumedSector>;
|
|
19
|
+
export declare function filterCurrentWantedSectors(wantedObservable: Observable<WantedSector[]>): OperatorFunction<ConsumedSector, ConsumedSector>;
|
|
20
|
+
export declare function findSectorMetadata(root: SectorMetadata, sectorId: number): SectorMetadata;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Extension utilities for Promise.
|
|
6
|
-
*/
|
|
7
|
-
export declare class PromiseUtils {
|
|
8
|
-
/**
|
|
9
|
-
* Awaits all promises in the list of promises available, returning them in an async iterator
|
|
10
|
-
* as they finish. The function completes when all promises has completed and the results have
|
|
11
|
-
* been yielded, or one of the promises provided rejects. This function is similar to
|
|
12
|
-
* Promise.all(), except that it returns results as they are ready and doesn't wait for all
|
|
13
|
-
* operations to finish.
|
|
14
|
-
*
|
|
15
|
-
* @param promises A list of promises to complete.
|
|
16
|
-
*/
|
|
17
|
-
static raceUntilAllCompleted<T>(promises: Promise<T>[]): AsyncIterable<T>;
|
|
18
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Extension utilities for Promise.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PromiseUtils {
|
|
8
|
+
/**
|
|
9
|
+
* Awaits all promises in the list of promises available, returning them in an async iterator
|
|
10
|
+
* as they finish. The function completes when all promises has completed and the results have
|
|
11
|
+
* been yielded, or one of the promises provided rejects. This function is similar to
|
|
12
|
+
* Promise.all(), except that it returns results as they are ready and doesn't wait for all
|
|
13
|
+
* operations to finish.
|
|
14
|
+
*
|
|
15
|
+
* @param promises A list of promises to complete.
|
|
16
|
+
*/
|
|
17
|
+
static raceUntilAllCompleted<T>(promises: Promise<T>[]): AsyncIterable<T>;
|
|
18
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
export declare function createOffsets(array: Float64Array): Float64Array;
|
|
5
|
-
export declare function createOffsetsArray(array: number[]): number[];
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
export declare function createOffsets(array: Float64Array): Float64Array;
|
|
5
|
+
export declare function createOffsetsArray(array: number[]): number[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
export declare function groupMeshesByNumber(id: Float64Array): Generator<{
|
|
5
|
-
id: number;
|
|
6
|
-
meshIndices: number[];
|
|
7
|
-
}>;
|
|
8
|
-
export declare function lastIndexOf<T>(sortedArray: T[], value: number, firstSearchIndex: number, elementValueOf: (element: T) => number): number;
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
export declare function groupMeshesByNumber(id: Float64Array): Generator<{
|
|
5
|
+
id: number;
|
|
6
|
+
meshIndices: number[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare function lastIndexOf<T>(sortedArray: T[], value: number, firstSearchIndex: number, elementValueOf: (element: T) => number): number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import { Observable, OperatorFunction } from 'rxjs';
|
|
5
|
-
export declare function emissionLastMillis(millis: number): OperatorFunction<unknown, boolean>;
|
|
6
|
-
export declare function delayedSwitch(millis: number): Observable<boolean>;
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { Observable, OperatorFunction } from 'rxjs';
|
|
5
|
+
export declare function emissionLastMillis(millis: number): OperatorFunction<unknown, boolean>;
|
|
6
|
+
export declare function delayedSwitch(millis: number): Observable<boolean>;
|