@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.
Files changed (212) hide show
  1. package/core/cad.d.ts +4 -4
  2. package/core/index.d.ts +7 -7
  3. package/core/src/datamodels/base/SupportedModelTypes.d.ts +4 -4
  4. package/core/src/datamodels/base/index.d.ts +6 -6
  5. package/core/src/datamodels/base/types.d.ts +14 -14
  6. package/core/src/datamodels/cad/CadManager.d.ts +45 -45
  7. package/core/src/datamodels/cad/CadModelFactory.d.ts +7 -7
  8. package/core/src/datamodels/cad/CadModelSectorLoadStatistics.d.ts +38 -38
  9. package/core/src/datamodels/cad/createCadManager.d.ts +9 -9
  10. package/core/src/datamodels/cad/picking.d.ts +28 -28
  11. package/core/src/datamodels/cad/rendering/RenderAlreadyLoadedGeometryProvider.d.ts +10 -10
  12. package/core/src/datamodels/cad/sector/CadModelClipper.d.ts +10 -10
  13. package/core/src/datamodels/cad/styling/AssetNodeCollection.d.ts +38 -38
  14. package/core/src/datamodels/cad/styling/InvertedNodeCollection.d.ts +24 -24
  15. package/core/src/datamodels/cad/styling/NodeCollectionDeserializer.d.ts +26 -26
  16. package/core/src/datamodels/cad/styling/PopulateIndexSetFromPagedResponseHelper.d.ts +24 -24
  17. package/core/src/datamodels/cad/styling/PropertyFilterNodeCollection.d.ts +54 -54
  18. package/core/src/datamodels/cad/styling/SinglePropertyFilterNodeCollection.d.ts +50 -50
  19. package/core/src/datamodels/cad/styling/index.d.ts +8 -8
  20. package/core/src/datamodels/pointcloud/PointCloudFactory.d.ts +9 -9
  21. package/core/src/datamodels/pointcloud/PointCloudManager.d.ts +26 -26
  22. package/core/src/datamodels/pointcloud/PointCloudMetadata.d.ts +11 -11
  23. package/core/src/datamodels/pointcloud/PointCloudMetadataRepository.d.ts +13 -13
  24. package/core/src/datamodels/pointcloud/PointCloudNode.d.ts +62 -62
  25. package/core/src/datamodels/pointcloud/PotreeGroupWrapper.d.ts +39 -39
  26. package/core/src/datamodels/pointcloud/PotreeNodeWrapper.d.ts +38 -38
  27. package/core/src/datamodels/pointcloud/createPointCloudManager.d.ts +6 -6
  28. package/core/src/datamodels/pointcloud/index.d.ts +5 -5
  29. package/core/src/datamodels/pointcloud/picking.d.ts +29 -29
  30. package/core/src/datamodels/pointcloud/types.d.ts +114 -114
  31. package/core/src/index.d.ts +19 -19
  32. package/core/src/internals.d.ts +15 -15
  33. package/core/src/migration.d.ts +8 -8
  34. package/core/src/public/RevealManager.d.ts +64 -64
  35. package/core/src/public/createRevealManager.d.ts +23 -23
  36. package/core/src/public/migration/Cognite3DModel.d.ts +339 -339
  37. package/core/src/public/migration/Cognite3DViewer.d.ts +566 -611
  38. package/core/src/public/migration/CogniteModelBase.d.ts +17 -17
  39. package/core/src/public/migration/CognitePointCloudModel.d.ts +121 -121
  40. package/core/src/public/migration/NodeIdAndTreeIndexMaps.d.ts +4 -4
  41. package/core/src/public/migration/NotSupportedInMigrationWrapperError.d.ts +11 -11
  42. package/core/src/public/migration/RenderController.d.ts +4 -4
  43. package/core/src/public/migration/types.d.ts +290 -290
  44. package/core/src/public/types.d.ts +46 -46
  45. package/core/src/storage/RevealManagerHelper.d.ts +58 -58
  46. package/core/src/utilities/BoundingBoxClipper.d.ts +23 -23
  47. package/core/src/utilities/Spinner.d.ts +27 -27
  48. package/core/src/utilities/ViewStateHelper.d.ts +37 -33
  49. package/core/src/utilities/callActionWithIndicesAsync.d.ts +4 -4
  50. package/core/src/utilities/index.d.ts +8 -8
  51. package/core/src/utilities/reflection.d.ts +7 -7
  52. package/core/src/utilities/worldToViewport.d.ts +30 -30
  53. package/core/utilities.d.ts +4 -4
  54. package/extensions/datasource.d.ts +9 -9
  55. package/extensions/datasource.js +6 -6
  56. package/extensions/datasource.map +1 -1
  57. package/index.d.ts +9 -8
  58. package/index.js +101 -91
  59. package/index.map +1 -1
  60. package/package.json +2 -2
  61. package/packages/cad-geometry-loaders/index.d.ts +14 -14
  62. package/packages/cad-geometry-loaders/src/CadLoadingHints.d.ts +11 -11
  63. package/packages/cad-geometry-loaders/src/CadModelSectorBudget.d.ts +26 -26
  64. package/packages/cad-geometry-loaders/src/CadModelUpdateHandler.d.ts +44 -44
  65. package/packages/cad-geometry-loaders/src/sector/CachedRepository.d.ts +25 -25
  66. package/packages/cad-geometry-loaders/src/sector/ModelStateHandler.d.ts +12 -12
  67. package/packages/cad-geometry-loaders/src/sector/Repository.d.ts +9 -9
  68. package/packages/cad-geometry-loaders/src/sector/SectorLoader.d.ts +28 -28
  69. package/packages/cad-geometry-loaders/src/sector/SimpleAndDetailedToSector3D.d.ts +20 -20
  70. package/packages/cad-geometry-loaders/src/sector/culling/ByVisibilityGpuSectorCuller.d.ts +53 -53
  71. package/packages/cad-geometry-loaders/src/sector/culling/OccludingGeometryProvider.d.ts +6 -6
  72. package/packages/cad-geometry-loaders/src/sector/culling/OrderSectorsByVisibilityCoverage.d.ts +107 -107
  73. package/packages/cad-geometry-loaders/src/sector/culling/SectorCuller.d.ts +33 -33
  74. package/packages/cad-geometry-loaders/src/sector/culling/TakenSectorTree.d.ts +24 -24
  75. package/packages/cad-geometry-loaders/src/sector/culling/types.d.ts +71 -71
  76. package/packages/cad-geometry-loaders/src/sector/rxSectorUtilities.d.ts +12 -12
  77. package/packages/cad-geometry-loaders/src/sector/sectorUtilities.d.ts +20 -20
  78. package/packages/cad-geometry-loaders/src/utilities/PromiseUtils.d.ts +18 -18
  79. package/packages/cad-geometry-loaders/src/utilities/arrays.d.ts +5 -5
  80. package/packages/cad-geometry-loaders/src/utilities/groupMeshesByNumber.d.ts +8 -8
  81. package/packages/cad-geometry-loaders/src/utilities/rxOperations.d.ts +6 -6
  82. package/packages/cad-geometry-loaders/src/utilities/types.d.ts +25 -25
  83. package/packages/cad-parsers/index.d.ts +21 -21
  84. package/packages/cad-parsers/src/cad/CadSectorParser.d.ts +15 -15
  85. package/packages/cad-parsers/src/cad/LevelOfDetail.d.ts +8 -8
  86. package/packages/cad-parsers/src/cad/filterInstanceMesh.d.ts +6 -6
  87. package/packages/cad-parsers/src/cad/filterPrimitives.d.ts +9 -9
  88. package/packages/cad-parsers/src/cad/primitiveGeometries.d.ts +31 -31
  89. package/packages/cad-parsers/src/cad/triangleMeshes.d.ts +6 -6
  90. package/packages/cad-parsers/src/cad/types.d.ts +56 -56
  91. package/packages/cad-parsers/src/metadata/CadMetadataParser.d.ts +7 -7
  92. package/packages/cad-parsers/src/metadata/CadModelMetadata.d.ts +44 -44
  93. package/packages/cad-parsers/src/metadata/CadModelMetadataRepository.d.ts +16 -16
  94. package/packages/cad-parsers/src/metadata/MetadataRepository.d.ts +7 -7
  95. package/packages/cad-parsers/src/metadata/parsers/CadMetadataParserV8.d.ts +51 -51
  96. package/packages/cad-parsers/src/metadata/types.d.ts +41 -41
  97. package/packages/cad-parsers/src/sector/RootSectorNode.d.ts +12 -12
  98. package/packages/cad-parsers/src/sector/SectorNode.d.ts +21 -21
  99. package/packages/cad-parsers/src/utilities/SectorScene.d.ts +21 -21
  100. package/packages/cad-parsers/src/utilities/SectorSceneFactory.d.ts +9 -9
  101. package/packages/cad-parsers/src/utilities/computeBoundingBoxFromAttributes.d.ts +9 -9
  102. package/packages/cad-parsers/src/utilities/float32BufferToMatrix.d.ts +12 -12
  103. package/packages/cad-parsers/src/utilities/types.d.ts +48 -48
  104. package/packages/cad-styling/index.d.ts +9 -9
  105. package/packages/cad-styling/src/CombineNodeCollectionBase.d.ts +31 -31
  106. package/packages/cad-styling/src/IntersectionNodeCollection.d.ts +15 -15
  107. package/packages/cad-styling/src/NodeAppearance.d.ts +62 -62
  108. package/packages/cad-styling/src/NodeAppearanceProvider.d.ts +33 -33
  109. package/packages/cad-styling/src/NodeCollectionBase.d.ts +47 -47
  110. package/packages/cad-styling/src/TreeIndexNodeCollection.d.ts +23 -23
  111. package/packages/cad-styling/src/UnionNodeCollection.d.ts +15 -15
  112. package/packages/camera-manager/index.d.ts +6 -4
  113. package/packages/camera-manager/src/CameraManager.d.ts +85 -0
  114. package/packages/camera-manager/src/ComboControls.d.ts +102 -100
  115. package/packages/camera-manager/src/Keyboard.d.ts +17 -17
  116. package/packages/camera-manager/src/types.d.ts +64 -0
  117. package/packages/data-source/index.d.ts +6 -6
  118. package/packages/data-source/src/CdfDataSource.d.ts +19 -19
  119. package/packages/data-source/src/DataSource.d.ts +26 -26
  120. package/packages/data-source/src/LocalDataSource.d.ts +15 -15
  121. package/packages/logger/index.d.ts +5 -5
  122. package/packages/logger/src/Log.d.ts +5 -5
  123. package/packages/metrics/index.d.ts +5 -5
  124. package/packages/metrics/src/MetricsLogger.d.ts +21 -21
  125. package/packages/metrics/src/types.d.ts +7 -7
  126. package/packages/modeldata-api/index.d.ts +13 -13
  127. package/packages/modeldata-api/src/CdfModelDataProvider.d.ts +17 -15
  128. package/packages/modeldata-api/src/CdfModelIdentifier.d.ts +17 -17
  129. package/packages/modeldata-api/src/CdfModelMetadataProvider.d.ts +19 -19
  130. package/packages/modeldata-api/src/CdfModelOutputsProvider.d.ts +15 -15
  131. package/packages/modeldata-api/src/LocalModelDataProvider.d.ts +10 -10
  132. package/packages/modeldata-api/src/LocalModelIdentifier.d.ts +14 -14
  133. package/packages/modeldata-api/src/LocalModelMetadataProvider.d.ts +14 -14
  134. package/packages/modeldata-api/src/Model3DOutputList.d.ts +17 -17
  135. package/packages/modeldata-api/src/ModelIdentifier.d.ts +12 -12
  136. package/packages/modeldata-api/src/ModelMetadataProvider.d.ts +17 -17
  137. package/packages/modeldata-api/src/applyDefaultModelTransformation.d.ts +6 -6
  138. package/packages/modeldata-api/src/types.d.ts +41 -41
  139. package/packages/modeldata-api/src/utilities.d.ts +7 -7
  140. package/packages/nodes-api/index.d.ts +6 -6
  141. package/packages/nodes-api/src/NodesApiClient.d.ts +52 -52
  142. package/packages/nodes-api/src/NodesCdfClient.d.ts +24 -24
  143. package/packages/nodes-api/src/NodesLocalClient.d.ts +30 -30
  144. package/packages/nodes-api/src/types.d.ts +10 -10
  145. package/packages/rendering/index.d.ts +17 -17
  146. package/packages/rendering/src/CadMaterialManager.d.ts +37 -37
  147. package/packages/rendering/src/InstancedMeshManager.d.ts +20 -20
  148. package/packages/rendering/src/cameraconfig.d.ts +12 -12
  149. package/packages/rendering/src/rendering/EffectRenderManager.d.ts +99 -99
  150. package/packages/rendering/src/rendering/NodeAppearanceTextureBuilder.d.ts +51 -51
  151. package/packages/rendering/src/rendering/RenderMode.d.ts +15 -15
  152. package/packages/rendering/src/rendering/createSimpleGeometryMesh.d.ts +6 -6
  153. package/packages/rendering/src/rendering/matCapTextureData.d.ts +5 -5
  154. package/packages/rendering/src/rendering/materials.d.ts +23 -23
  155. package/packages/rendering/src/rendering/primitives.d.ts +12 -12
  156. package/packages/rendering/src/rendering/shaders.d.ts +101 -101
  157. package/packages/rendering/src/rendering/types.d.ts +76 -76
  158. package/packages/rendering/src/sector/CadNode.d.ts +54 -54
  159. package/packages/rendering/src/transform/NodeTransformProvider.d.ts +13 -13
  160. package/packages/rendering/src/transform/NodeTransformTextureBuilder.d.ts +23 -23
  161. package/packages/rendering/src/transform/TransformOverrideBuffer.d.ts +21 -21
  162. package/packages/rendering/src/utilities/types.d.ts +26 -26
  163. package/packages/tools/index.d.ts +15 -15
  164. package/packages/tools/src/AxisView/AxisViewTool.d.ts +32 -32
  165. package/packages/tools/src/AxisView/types.d.ts +98 -98
  166. package/packages/tools/src/Cognite3DViewerToolBase.d.ts +25 -25
  167. package/packages/tools/src/DebugCameraTool.d.ts +20 -20
  168. package/packages/tools/src/DebugLoadedSectorsTool.d.ts +23 -23
  169. package/packages/tools/src/ExplodedViewTool.d.ts +12 -12
  170. package/packages/tools/src/Geomap/Geomap.d.ts +17 -17
  171. package/packages/tools/src/Geomap/GeomapTool.d.ts +24 -24
  172. package/packages/tools/src/Geomap/MapConfig.d.ts +195 -195
  173. package/packages/tools/src/HtmlOverlay/BucketGrid2D.d.ts +28 -28
  174. package/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +159 -159
  175. package/packages/tools/src/Timeline/Keyframe.d.ts +38 -38
  176. package/packages/tools/src/Timeline/TimelineTool.d.ts +79 -79
  177. package/packages/tools/src/Timeline/types.d.ts +13 -13
  178. package/packages/tools/src/types.d.ts +4 -4
  179. package/packages/utilities/index.d.ts +24 -24
  180. package/packages/utilities/src/CameraConfiguration.d.ts +10 -10
  181. package/packages/utilities/src/IndexSet.d.ts +1 -1
  182. package/packages/utilities/src/NumericRange.d.ts +22 -22
  183. package/packages/utilities/src/RandomColors.d.ts +34 -34
  184. package/packages/utilities/src/WebGLRendererStateHelper.d.ts +15 -15
  185. package/packages/utilities/src/assertNever.d.ts +7 -7
  186. package/packages/utilities/src/cache/MemoryRequestCache.d.ts +22 -22
  187. package/packages/utilities/src/cache/MostFrequentlyUsedCache.d.ts +19 -19
  188. package/packages/utilities/src/cache/RequestCache.d.ts +13 -13
  189. package/packages/utilities/src/datastructures/DynamicDefragmentedBuffer.d.ts +22 -22
  190. package/packages/utilities/src/determinePowerOfTwoDimensions.d.ts +11 -11
  191. package/packages/utilities/src/disposeAttributeArrayOnUpload.d.ts +17 -17
  192. package/packages/utilities/src/events/EventTrigger.d.ts +13 -13
  193. package/packages/utilities/src/events/InputHandler.d.ts +34 -0
  194. package/packages/utilities/src/events/clickOrTouchEventOffset.d.ts +13 -13
  195. package/packages/utilities/src/events/index.d.ts +6 -5
  196. package/packages/utilities/src/indexset/IndexSet.d.ts +26 -26
  197. package/packages/utilities/src/indexset/IntermediateIndexNode.d.ts +26 -26
  198. package/packages/utilities/src/indexset/LeafIndexNode.d.ts +16 -16
  199. package/packages/utilities/src/isMobileOrTablet.d.ts +4 -4
  200. package/packages/utilities/src/networking/isTheSameDomain.d.ts +11 -11
  201. package/packages/utilities/src/objectTraversal.d.ts +8 -8
  202. package/packages/utilities/src/packFloat.d.ts +6 -6
  203. package/packages/utilities/src/revealEnv.d.ts +10 -10
  204. package/packages/utilities/src/three/AutoDisposeGroup.d.ts +17 -17
  205. package/packages/utilities/src/three/BoundingBoxLOD.d.ts +27 -27
  206. package/packages/utilities/src/three/getBox3CornerPoints.d.ts +5 -5
  207. package/packages/utilities/src/transformCameraConfiguration.d.ts +6 -6
  208. package/packages/utilities/src/types.d.ts +10 -10
  209. package/packages/utilities/src/workers/WorkerPool.d.ts +14 -14
  210. package/tools.d.ts +7 -7
  211. package/tools.js +62 -58
  212. package/tools.map +1 -1
@@ -1,290 +1,290 @@
1
- /*!
2
- * Copyright 2021 Cognite AS
3
- */
4
- import { CogniteClient } from '@cognite/sdk';
5
- import { Cognite3DModel } from './Cognite3DModel';
6
- import { CognitePointCloudModel } from './CognitePointCloudModel';
7
- /**
8
- * @module @cognite/reveal
9
- */
10
- export declare type Color = {
11
- r: number;
12
- g: number;
13
- b: number;
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';
19
- /**
20
- * Callback to monitor loaded requests and progress.
21
- * Use OnLoadingCallback instead of onProgress/onComplete.
22
- * @module @cognite/reveal
23
- *
24
- * @param itemsLoaded Number of items loaded so far in this batch.
25
- * @param itemsRequested Total number of items to load in this batch.
26
- * @param itemsCulled Number of items deemed unnecessary to load in this batch.
27
- */
28
- export declare type OnLoadingCallback = (itemsLoaded: number, itemsRequested: number, itemsCulled: number) => void;
29
- /**
30
- * @module @cognite/reveal
31
- */
32
- export interface Cognite3DViewerOptions {
33
- /** Initialized connection to CDF used to load data. */
34
- sdk: CogniteClient;
35
- /** An existing DOM element that we will render canvas into. */
36
- domElement?: HTMLElement;
37
- /** Send anonymous usage statistics. */
38
- logMetrics?: boolean;
39
- /**
40
- * Render to offscreen buffer instead of canvas.
41
- */
42
- renderTargetOptions?: {
43
- target: THREE.WebGLRenderTarget;
44
- autoSetSize?: boolean;
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
- };
60
- /**
61
- * When false, camera near and far planes will not be updated automatically (defaults to true).
62
- * This can be useful when you have custom content in the 3D view and need to better
63
- * control the view frustum.
64
- *
65
- * When automatic camera near/far planes are disabled, you are responsible for setting
66
- * this on your own.
67
- * @example
68
- * ```
69
- * viewer.camera.near = 0.1;
70
- * viewer.camera.far = 1000.0;
71
- * viewer.camera.updateProjectionMatrix();
72
- * ```
73
- */
74
- automaticCameraNearFar?: boolean;
75
- /**
76
- * When false, the sensitivity of the camera controls will not be updated automatically.
77
- * This can be useful to better control the sensitivity of the 3D navigation.
78
- *
79
- * When not set, control the sensitivity of the camera using `viewer.cameraControls.minDistance`
80
- * and `viewer.cameraControls.maxDistance`.
81
- */
82
- automaticControlsSensitivity?: boolean;
83
- /** Renderer used to visualize model (optional). */
84
- renderer?: THREE.WebGLRenderer;
85
- /**
86
- * Hints Reveal to use a given anti-aliasing technique.
87
- *
88
- * Fast approximate anti-aliasing (FXAA) is a fast technique that will remove some, but not all aliasing effects. See
89
- * https://en.wikipedia.org/wiki/Fast_approximate_anti-aliasing.
90
- *
91
- * Multi-sampling anti-aliasinbg (MSAA) is a technique for taking multiple samples per pixel to avoid aliasing effects.
92
- * This mode requires WebGL 2. See https://www.khronos.org/opengl/wiki/Multisampling.
93
- *
94
- * The combined modes will apply both MSAA and FXAA anti-aliasing and yields the best visual result.
95
- *
96
- * When using the MSAA modes combined with FXAA Reveal will fall back to FXAA on WebGL 1. There is no fallback for the
97
- * "plain" MSAA modes on WebGL 1.
98
- *
99
- * Currently the default mode is FXAA, but this is subject to change.
100
- */
101
- antiAliasingHint?: 'disabled' | 'fxaa' | 'msaa2+fxaa' | 'msaa4+fxaa' | 'msaa8+fxaa' | 'msaa16+fxaa' | 'msaa2' | 'msaa4' | 'msaa8' | 'msaa16';
102
- /**
103
- * Hints the renderer of the quality it should aim for for screen space ambient occlusion,
104
- * an effect creating shadows and that gives the rendered image more depth.
105
- */
106
- ssaoQualityHint?: 'medium' | 'high' | 'veryhigh' | 'disabled';
107
- /**
108
- * Enables / disables visualizing the edges of geometry. Defaults to true.
109
- */
110
- enableEdges?: boolean;
111
- /** Callback to download stream progress. */
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;
124
- }
125
- import { GeometryFilter } from '../../public/types';
126
- import { DataSource } from '../../../../packages/data-source';
127
- export { GeometryFilter };
128
- /**
129
- * @module @cognite/reveal
130
- */
131
- export interface AddModelOptions {
132
- modelId: number;
133
- revisionId: number;
134
- localPath?: string;
135
- geometryFilter?: GeometryFilter;
136
- }
137
- export declare type CameraControlsOptions = {
138
- /**
139
- * Sets mouse wheel initiated action.
140
- *
141
- * Modes:
142
- *
143
- * 'zoomToTarget' - zooms just to the current target (center of the screen) of the camera.
144
- *
145
- * 'zoomPastCursor' - zooms in the direction of the ray coming from camera through cursor screen position, allows going through objects.
146
- *
147
- * 'zoomToCursor' - mouse wheel scroll zooms towards the point on the model where cursor is hovering over, doesn't allow going through objects.
148
- *
149
- * Default is 'zoomPastCursor'.
150
- *
151
- */
152
- mouseWheelAction?: 'zoomToTarget' | 'zoomPastCursor' | 'zoomToCursor';
153
- /**
154
- * Enables or disables change of camera target on mouse click. New target is then set to the point of the model under current cursor position.
155
- *
156
- * Default is false.
157
- *
158
- */
159
- onClickTargetChange?: boolean;
160
- };
161
- export declare type CadIntersection = {
162
- /**
163
- * The intersection type.
164
- */
165
- type: 'cad';
166
- /**
167
- * The model that was intersected.
168
- */
169
- model: Cognite3DModel;
170
- /**
171
- * Coordinate of the intersection.
172
- */
173
- point: THREE.Vector3;
174
- /**
175
- * Tree index of the intersected 3D node.
176
- */
177
- treeIndex: number;
178
- /**
179
- * Distance from the camera to the intersection.
180
- */
181
- distanceToCamera: number;
182
- };
183
- export declare type PointCloudIntersection = {
184
- /**
185
- * The intersection type.
186
- */
187
- type: 'pointcloud';
188
- /**
189
- * The model that was intersected.
190
- */
191
- model: CognitePointCloudModel;
192
- /**
193
- * Tree index of the intersected 3D node.
194
- */
195
- point: THREE.Vector3;
196
- /**
197
- * The index of the point that was intersected.
198
- */
199
- pointIndex: number;
200
- /**
201
- * Distance from the camera to the intersection.
202
- */
203
- distanceToCamera: number;
204
- };
205
- /**
206
- * Represents the result from {@link Cognite3DViewer.getIntersectionFromPixel}.
207
- * @module @cognite/reveal
208
- */
209
- export declare type Intersection = CadIntersection | PointCloudIntersection;
210
- /**
211
- * @module @cognite/reveal
212
- */
213
- export { CameraConfiguration } from '../../../../packages/utilities';
214
- /**
215
- * Delegate for pointer events.
216
- * @module @cognite/reveal
217
- * @see {@link Cognite3DViewer.on}.
218
- */
219
- export declare type PointerEventDelegate = (event: {
220
- offsetX: number;
221
- offsetY: number;
222
- }) => void;
223
- /**
224
- * Delegate for camera update events.
225
- * @module @cognite/reveal
226
- * @see {@link Cognite3DViewer.on}.
227
- */
228
- export declare type CameraChangeDelegate = (position: THREE.Vector3, target: THREE.Vector3) => void;
229
- /**
230
- * Delegate for disposal events.
231
- */
232
- export declare type DisposedDelegate = () => void;
233
- /**
234
- * Delegate for rendering events.
235
- * @module @cognite/reveal
236
- * @see {@link Cognite3DViewer.on}.
237
- */
238
- export declare type SceneRenderedDelegate = (event: {
239
- frameNumber: number;
240
- renderTime: number;
241
- renderer: THREE.WebGLRenderer;
242
- camera: THREE.PerspectiveCamera;
243
- }) => void;
244
- export * from './NotSupportedInMigrationWrapperError';
245
- export { CogniteModelBase } from './CogniteModelBase';
246
- /**
247
- * Represents a measurement of how much geometry can be loaded.
248
- */
249
- export declare type CadModelBudget = {
250
- /**
251
- * Sectors within this distance from the camera will always be loaded in high details.
252
- */
253
- readonly highDetailProximityThreshold: number;
254
- /**
255
- * Number of bytes of the geometry that must be downloaded.
256
- */
257
- readonly geometryDownloadSizeBytes: number;
258
- /**
259
- * Estimated maximum number of WebGL draw calls to download geometry for. Draw calls
260
- * are very important for the framerate.
261
- */
262
- readonly maximumNumberOfDrawCalls: number;
263
- /**
264
- * Maximum render cost. This number can be thought of as triangle count, although the number
265
- * doesn't match this directly.
266
- */
267
- readonly maximumRenderCost: number;
268
- };
269
- /**
270
- * Represents a budget of how many point from point clouds can be
271
- * loaded at the same time.
272
- */
273
- export declare type PointCloudBudget = {
274
- /**
275
- * Total number of points that can be loaded for all point clouds models
276
- * accumulated.
277
- */
278
- readonly numberOfPoints: number;
279
- };
280
- /**
281
- * Options to control how {@link Cognite3DViewer.getIntersectionFromPixel} behaves.
282
- */
283
- export interface IntersectionFromPixelOptions {
284
- /**
285
- * Threshold (in meters) for how close a point must be an intersection
286
- * ray for it to be considered an intersection for point clouds. Defaults
287
- * to 0.05.
288
- */
289
- pointIntersectionThreshold?: number;
290
- }
1
+ /*!
2
+ * Copyright 2021 Cognite AS
3
+ */
4
+ import { CogniteClient } from '@cognite/sdk';
5
+ import { Cognite3DModel } from './Cognite3DModel';
6
+ import { CognitePointCloudModel } from './CognitePointCloudModel';
7
+ /**
8
+ * @module @cognite/reveal
9
+ */
10
+ export declare type Color = {
11
+ r: number;
12
+ g: number;
13
+ b: number;
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';
19
+ /**
20
+ * Callback to monitor loaded requests and progress.
21
+ * Use OnLoadingCallback instead of onProgress/onComplete.
22
+ * @module @cognite/reveal
23
+ *
24
+ * @param itemsLoaded Number of items loaded so far in this batch.
25
+ * @param itemsRequested Total number of items to load in this batch.
26
+ * @param itemsCulled Number of items deemed unnecessary to load in this batch.
27
+ */
28
+ export declare type OnLoadingCallback = (itemsLoaded: number, itemsRequested: number, itemsCulled: number) => void;
29
+ /**
30
+ * @module @cognite/reveal
31
+ */
32
+ export interface Cognite3DViewerOptions {
33
+ /** Initialized connection to CDF used to load data. */
34
+ sdk: CogniteClient;
35
+ /** An existing DOM element that we will render canvas into. */
36
+ domElement?: HTMLElement;
37
+ /** Send anonymous usage statistics. */
38
+ logMetrics?: boolean;
39
+ /**
40
+ * Render to offscreen buffer instead of canvas.
41
+ */
42
+ renderTargetOptions?: {
43
+ target: THREE.WebGLRenderTarget;
44
+ autoSetSize?: boolean;
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
+ };
60
+ /**
61
+ * When false, camera near and far planes will not be updated automatically (defaults to true).
62
+ * This can be useful when you have custom content in the 3D view and need to better
63
+ * control the view frustum.
64
+ *
65
+ * When automatic camera near/far planes are disabled, you are responsible for setting
66
+ * this on your own.
67
+ * @example
68
+ * ```
69
+ * viewer.camera.near = 0.1;
70
+ * viewer.camera.far = 1000.0;
71
+ * viewer.camera.updateProjectionMatrix();
72
+ * ```
73
+ */
74
+ automaticCameraNearFar?: boolean;
75
+ /**
76
+ * When false, the sensitivity of the camera controls will not be updated automatically.
77
+ * This can be useful to better control the sensitivity of the 3D navigation.
78
+ *
79
+ * When not set, control the sensitivity of the camera using `viewer.cameraControls.minDistance`
80
+ * and `viewer.cameraControls.maxDistance`.
81
+ */
82
+ automaticControlsSensitivity?: boolean;
83
+ /** Renderer used to visualize model (optional). */
84
+ renderer?: THREE.WebGLRenderer;
85
+ /**
86
+ * Hints Reveal to use a given anti-aliasing technique.
87
+ *
88
+ * Fast approximate anti-aliasing (FXAA) is a fast technique that will remove some, but not all aliasing effects. See
89
+ * https://en.wikipedia.org/wiki/Fast_approximate_anti-aliasing.
90
+ *
91
+ * Multi-sampling anti-aliasinbg (MSAA) is a technique for taking multiple samples per pixel to avoid aliasing effects.
92
+ * This mode requires WebGL 2. See https://www.khronos.org/opengl/wiki/Multisampling.
93
+ *
94
+ * The combined modes will apply both MSAA and FXAA anti-aliasing and yields the best visual result.
95
+ *
96
+ * When using the MSAA modes combined with FXAA Reveal will fall back to FXAA on WebGL 1. There is no fallback for the
97
+ * "plain" MSAA modes on WebGL 1.
98
+ *
99
+ * Currently the default mode is FXAA, but this is subject to change.
100
+ */
101
+ antiAliasingHint?: 'disabled' | 'fxaa' | 'msaa2+fxaa' | 'msaa4+fxaa' | 'msaa8+fxaa' | 'msaa16+fxaa' | 'msaa2' | 'msaa4' | 'msaa8' | 'msaa16';
102
+ /**
103
+ * Hints the renderer of the quality it should aim for for screen space ambient occlusion,
104
+ * an effect creating shadows and that gives the rendered image more depth.
105
+ */
106
+ ssaoQualityHint?: 'medium' | 'high' | 'veryhigh' | 'disabled';
107
+ /**
108
+ * Enables / disables visualizing the edges of geometry. Defaults to true.
109
+ */
110
+ enableEdges?: boolean;
111
+ /** Callback to download stream progress. */
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;
124
+ }
125
+ import { GeometryFilter } from '../../public/types';
126
+ import { DataSource } from '../../../../packages/data-source';
127
+ export { GeometryFilter };
128
+ /**
129
+ * @module @cognite/reveal
130
+ */
131
+ export interface AddModelOptions {
132
+ modelId: number;
133
+ revisionId: number;
134
+ localPath?: string;
135
+ geometryFilter?: GeometryFilter;
136
+ }
137
+ export declare type CameraControlsOptions = {
138
+ /**
139
+ * Sets mouse wheel initiated action.
140
+ *
141
+ * Modes:
142
+ *
143
+ * 'zoomToTarget' - zooms just to the current target (center of the screen) of the camera.
144
+ *
145
+ * 'zoomPastCursor' - zooms in the direction of the ray coming from camera through cursor screen position, allows going through objects.
146
+ *
147
+ * 'zoomToCursor' - mouse wheel scroll zooms towards the point on the model where cursor is hovering over, doesn't allow going through objects.
148
+ *
149
+ * Default is 'zoomPastCursor'.
150
+ *
151
+ */
152
+ mouseWheelAction?: 'zoomToTarget' | 'zoomPastCursor' | 'zoomToCursor';
153
+ /**
154
+ * Enables or disables change of camera target on mouse click. New target is then set to the point of the model under current cursor position.
155
+ *
156
+ * Default is false.
157
+ *
158
+ */
159
+ onClickTargetChange?: boolean;
160
+ };
161
+ export declare type CadIntersection = {
162
+ /**
163
+ * The intersection type.
164
+ */
165
+ type: 'cad';
166
+ /**
167
+ * The model that was intersected.
168
+ */
169
+ model: Cognite3DModel;
170
+ /**
171
+ * Coordinate of the intersection.
172
+ */
173
+ point: THREE.Vector3;
174
+ /**
175
+ * Tree index of the intersected 3D node.
176
+ */
177
+ treeIndex: number;
178
+ /**
179
+ * Distance from the camera to the intersection.
180
+ */
181
+ distanceToCamera: number;
182
+ };
183
+ export declare type PointCloudIntersection = {
184
+ /**
185
+ * The intersection type.
186
+ */
187
+ type: 'pointcloud';
188
+ /**
189
+ * The model that was intersected.
190
+ */
191
+ model: CognitePointCloudModel;
192
+ /**
193
+ * Tree index of the intersected 3D node.
194
+ */
195
+ point: THREE.Vector3;
196
+ /**
197
+ * The index of the point that was intersected.
198
+ */
199
+ pointIndex: number;
200
+ /**
201
+ * Distance from the camera to the intersection.
202
+ */
203
+ distanceToCamera: number;
204
+ };
205
+ /**
206
+ * Represents the result from {@link Cognite3DViewer.getIntersectionFromPixel}.
207
+ * @module @cognite/reveal
208
+ */
209
+ export declare type Intersection = CadIntersection | PointCloudIntersection;
210
+ /**
211
+ * @module @cognite/reveal
212
+ */
213
+ export { CameraConfiguration } from '../../../../packages/utilities';
214
+ /**
215
+ * Delegate for pointer events.
216
+ * @module @cognite/reveal
217
+ * @see {@link Cognite3DViewer.on}.
218
+ */
219
+ export declare type PointerEventDelegate = (event: {
220
+ offsetX: number;
221
+ offsetY: number;
222
+ }) => void;
223
+ /**
224
+ * Delegate for camera update events.
225
+ * @module @cognite/reveal
226
+ * @see {@link Cognite3DViewer.on}.
227
+ */
228
+ export declare type CameraChangeDelegate = (position: THREE.Vector3, target: THREE.Vector3) => void;
229
+ /**
230
+ * Delegate for disposal events.
231
+ */
232
+ export declare type DisposedDelegate = () => void;
233
+ /**
234
+ * Delegate for rendering events.
235
+ * @module @cognite/reveal
236
+ * @see {@link Cognite3DViewer.on}.
237
+ */
238
+ export declare type SceneRenderedDelegate = (event: {
239
+ frameNumber: number;
240
+ renderTime: number;
241
+ renderer: THREE.WebGLRenderer;
242
+ camera: THREE.PerspectiveCamera;
243
+ }) => void;
244
+ export * from './NotSupportedInMigrationWrapperError';
245
+ export { CogniteModelBase } from './CogniteModelBase';
246
+ /**
247
+ * Represents a measurement of how much geometry can be loaded.
248
+ */
249
+ export declare type CadModelBudget = {
250
+ /**
251
+ * Sectors within this distance from the camera will always be loaded in high details.
252
+ */
253
+ readonly highDetailProximityThreshold: number;
254
+ /**
255
+ * Number of bytes of the geometry that must be downloaded.
256
+ */
257
+ readonly geometryDownloadSizeBytes: number;
258
+ /**
259
+ * Estimated maximum number of WebGL draw calls to download geometry for. Draw calls
260
+ * are very important for the framerate.
261
+ */
262
+ readonly maximumNumberOfDrawCalls: number;
263
+ /**
264
+ * Maximum render cost. This number can be thought of as triangle count, although the number
265
+ * doesn't match this directly.
266
+ */
267
+ readonly maximumRenderCost: number;
268
+ };
269
+ /**
270
+ * Represents a budget of how many point from point clouds can be
271
+ * loaded at the same time.
272
+ */
273
+ export declare type PointCloudBudget = {
274
+ /**
275
+ * Total number of points that can be loaded for all point clouds models
276
+ * accumulated.
277
+ */
278
+ readonly numberOfPoints: number;
279
+ };
280
+ /**
281
+ * Options to control how {@link Cognite3DViewer.getIntersectionFromPixel} behaves.
282
+ */
283
+ export interface IntersectionFromPixelOptions {
284
+ /**
285
+ * Threshold (in meters) for how close a point must be an intersection
286
+ * ray for it to be considered an intersection for point clouds. Defaults
287
+ * to 0.05.
288
+ */
289
+ pointIntersectionThreshold?: number;
290
+ }