@cognite/reveal-components 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/poi-markers/poi-create-cursor.js +4 -0
  3. package/dist/common/i18n/en/reveal-components.js +183 -178
  4. package/dist/data-providers/Fdm3dDataProvider.d.ts +3 -3
  5. package/dist/data-providers/FdmSDK.d.ts +8 -0
  6. package/dist/data-providers/FdmSDK.js +34 -21
  7. package/dist/data-providers/assets/createClassicAssetsCache.d.ts +7 -0
  8. package/dist/data-providers/assets/createClassicAssetsCache.js +18 -0
  9. package/dist/data-providers/assets/createDmsDescribableNodesCache.d.ts +23 -0
  10. package/dist/data-providers/assets/createDmsDescribableNodesCache.js +19 -0
  11. package/dist/data-providers/cache/PointCloudAnnotationCache.js +10 -10
  12. package/dist/data-providers/cache/RevisionFdmNodeCache.d.ts +3 -2
  13. package/dist/data-providers/cache/RevisionFdmNodeCache.js +65 -39
  14. package/dist/data-providers/cache/annotationModelUtils.js +8 -6
  15. package/dist/data-providers/cache/cad/CadInstanceMappingsCache.d.ts +5 -2
  16. package/dist/data-providers/cache/cad/CadInstanceMappingsCacheImpl.js +9 -6
  17. package/dist/data-providers/cache/cad/FdmCadNodeCache.d.ts +3 -1
  18. package/dist/data-providers/cache/cad/FdmCadNodeCacheImpl.d.ts +5 -0
  19. package/dist/data-providers/cache/cad/FdmCadNodeCacheImpl.js +8 -3
  20. package/dist/data-providers/core-dm-provider/CoreDm3dDataProvider.d.ts +3 -3
  21. package/dist/data-providers/core-dm-provider/CoreDm3dDataProvider.js +11 -11
  22. package/dist/data-providers/core-dm-provider/filterNodesByMappedTo3d.js +13 -13
  23. package/dist/data-providers/core-dm-provider/getCadConnectionsForInstances.js +18 -18
  24. package/dist/data-providers/core-dm-provider/getCadConnectionsForRevisions.js +11 -11
  25. package/dist/data-providers/core-dm-provider/getCadModelsForInstance.js +3 -3
  26. package/dist/data-providers/core-dm-provider/getDMSModels.js +6 -6
  27. package/dist/data-providers/core-dm-provider/getEdgeConnected3dInstances.js +8 -8
  28. package/dist/data-providers/core-dm-provider/getFdmConnectionsForNodes.d.ts +2 -3
  29. package/dist/data-providers/core-dm-provider/getFdmConnectionsForNodes.js +19 -19
  30. package/dist/data-providers/core-dm-provider/listMappedFdmNodes.js +14 -14
  31. package/dist/data-providers/index.d.ts +2 -1
  32. package/dist/data-providers/index.js +2 -0
  33. package/dist/data-providers/legacy-fdm-provider/LegacyFdm3dDataProvider.d.ts +3 -3
  34. package/dist/data-providers/legacy-fdm-provider/fdmEdgesToCadConnections.js +3 -3
  35. package/dist/data-providers/legacy-fdm-provider/getFdmConnectionsForNodeIds.d.ts +3 -3
  36. package/dist/data-providers/legacy-fdm-provider/getFdmConnectionsForNodeIds.js +1 -1
  37. package/dist/data-providers/network/cad/searchClassicAssetsForCadModels.js +5 -5
  38. package/dist/data-providers/network/cad/searchHybridDmAssetsForCadModels.js +3 -3
  39. package/dist/data-providers/network/common/getDMAssetsForAnnotationReference.js +3 -3
  40. package/dist/data-providers/utils/getDMSModelRevisionRefs.js +3 -3
  41. package/dist/domains/annotation360/image360SceneCollectionTransform.d.ts +18 -0
  42. package/dist/domains/annotation360/image360SceneCollectionTransform.js +37 -0
  43. package/dist/domains/index.d.ts +4 -2
  44. package/dist/domains/index.js +3 -1
  45. package/dist/domains/pointsOfInterest/PointsOfInterestTool.d.ts +5 -0
  46. package/dist/domains/pointsOfInterest/PointsOfInterestTool.js +36 -17
  47. package/dist/domains/reveal/RevealDomainObjectUtils.d.ts +1 -0
  48. package/dist/domains/reveal/RevealDomainObjectUtils.js +1 -1
  49. package/dist/domains/reveal/cad/CadDomainObject.d.ts +18 -1
  50. package/dist/domains/reveal/cad/CadDomainObject.js +31 -15
  51. package/dist/foundation/renderTarget/CdfCaches.d.ts +9 -1
  52. package/dist/foundation/renderTarget/CdfCaches.js +24 -14
  53. package/dist/foundation/treeNodes/cad-tree-node/cad-lazy-loader.d.ts +3 -1
  54. package/dist/foundation/treeNodes/cad-tree-node/cad-lazy-loader.js +33 -22
  55. package/dist/foundation/treeNodes/cad-tree-node/cad-node-update-styling.js +6 -6
  56. package/dist/foundation/treeNodes/cad-tree-node/cad-tree-node.d.ts +1 -0
  57. package/dist/foundation/treeNodes/cad-tree-node/cad-tree-node.js +4 -1
  58. package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/classic-instance-mappings-sdk.js +2 -5
  59. package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/core-dm-instance-mappings-sdk.d.ts +14 -0
  60. package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/core-dm-instance-mappings-sdk.js +23 -0
  61. package/dist/ui/components/InstanceLabel/InstanceLabel.js +18 -30
  62. package/dist/ui/components/Reveal3DResources/Reveal3DResources.js +20 -20
  63. package/dist/ui/components/RevealCanvas/SDKProvider.js +6 -6
  64. package/dist/ui/components/RevealCanvas/UsageMetricsTrackerContext.d.ts +3 -0
  65. package/dist/ui/components/RevealCanvas/UsageMetricsTrackerContext.js +6 -0
  66. package/dist/ui/components/RevealCanvas/ViewerContext.d.ts +2 -0
  67. package/dist/ui/components/RevealCanvas/ViewerContext.js +5 -5
  68. package/dist/ui/components/RevealContext/RevealContext.js +6 -6
  69. package/dist/ui/components/RevealToolbar/AssetContextualizedButton.js +1 -1
  70. package/dist/ui/components/RuleBasedOutputs/hooks/useGetDMConnectionWithNodeFromHybridMappingsQuery.js +11 -11
  71. package/dist/ui/components/Widget/RevealWidget.context.d.ts +2 -1
  72. package/dist/ui/components/Widget/RevealWidget.context.js +1 -1
  73. package/dist/ui/components/Widget/RevealWidget.d.ts +11 -2
  74. package/dist/ui/components/Widget/RevealWidget.js +35 -20
  75. package/dist/ui/components/Widget/RevealWidgetCameraController.d.ts +3 -1
  76. package/dist/ui/components/Widget/RevealWidgetCameraController.js +12 -10
  77. package/dist/ui/components/Widget/RevealWidgetController.d.ts +3 -1
  78. package/dist/ui/components/Widget/RevealWidgetController.js +40 -33
  79. package/dist/ui/components/Widget/index.d.ts +1 -1
  80. package/dist/ui/components/Widget/styling/applyPointCloudInstanceStyling.js +5 -5
  81. package/dist/ui/components/Widget/useRevealWidgetMetricsTracking.d.ts +21 -0
  82. package/dist/ui/components/Widget/useRevealWidgetMetricsTracking.js +33 -0
  83. package/dist/ui/components/commandBased/Factories/DefaultIcons.js +31 -31
  84. package/dist/ui/components/commandBased/buttons/DropdownButton.d.ts +2 -0
  85. package/dist/ui/components/commandBased/buttons/DropdownButton.js +67 -48
  86. package/dist/ui/components/commandBased/pointsOfInterest/PoiCommentSection.js +6 -6
  87. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.context.d.ts +16 -0
  88. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.context.js +6 -0
  89. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.d.ts +15 -0
  90. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.function.d.ts +5 -0
  91. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.function.js +14 -0
  92. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.js +105 -0
  93. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.function.d.ts +13 -2
  94. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.function.js +17 -9
  95. package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.js +27 -13
  96. package/dist/ui/components/commandBased/treeView/TreeView/components/tree-view-info.js +2 -2
  97. package/dist/ui/components/commandBased/treeView/TreeView/extraComponents/CadTreeAssetMappingDropdown.js +34 -33
  98. package/dist/ui/components/commandBased/treeView/TreeView/tree-view-node.js +1 -0
  99. package/dist/ui/components/commandBased/treeView/TreeView/tree-view-props.d.ts +1 -0
  100. package/dist/ui/components/commandBased/treeView/TreeView/tree-view.js +27 -25
  101. package/dist/ui/components/i18n/I18n.js +3 -3
  102. package/dist/ui/components/index.d.ts +1 -1
  103. package/dist/ui/hooks/network/fetchLinkFromRelationshipsByTimeseries.js +4 -4
  104. package/dist/ui/hooks/network/getImage360CollectionsForDmInstance.js +7 -7
  105. package/dist/ui/hooks/network/getTimeseriesLatestDatapoints.js +3 -3
  106. package/dist/ui/hooks/pointClouds/fetchAnnotationsForModel.js +4 -4
  107. package/dist/ui/hooks/pointClouds/usePointCloudAnnotationMappingForIntersection.js +11 -11
  108. package/dist/ui/hooks/pointClouds/usePointCloudAnnotationMappingsForAssetInstances.js +4 -4
  109. package/dist/ui/hooks/scenes/use3dScenes.js +4 -4
  110. package/dist/ui/query/core-dm/usePointCloudDMVolumeMappingForIntersection.js +9 -9
  111. package/dist/ui/query/core-dm/usePointCloudDMVolumes.js +10 -10
  112. package/dist/ui/query/index.d.ts +1 -0
  113. package/dist/ui/query/index.js +17 -16
  114. package/dist/ui/query/useAll3dDirectConnectionsWithProperties.js +6 -6
  115. package/dist/ui/query/useAssetsAndTimeseriesLinkageDataQuery.js +24 -24
  116. package/dist/ui/query/useAssetsAndTimeseriesLinkages.context.d.ts +3 -2
  117. package/dist/ui/query/useAssetsAndTimeseriesLinkages.context.js +4 -4
  118. package/dist/ui/query/useAssetsAndTimeseriesLinkages.js +13 -13
  119. package/dist/ui/query/useAssetsByIdsQuery.js +10 -11
  120. package/dist/ui/query/useCadNode3DInfo.d.ts +8 -0
  121. package/dist/ui/query/useCadNode3DInfo.js +24 -0
  122. package/dist/ui/query/useFetchClassicAssetsByIds.js +5 -5
  123. package/dist/ui/query/useFilterOnClassicAssetsInScene.js +6 -6
  124. package/dist/ui/query/useHybridMappingsForAssetInstances.js +9 -9
  125. package/dist/ui/query/useInstanceNames.d.ts +11 -0
  126. package/dist/ui/query/useInstanceNames.js +17 -0
  127. package/dist/ui/query/useInstancesByIdsQuery.context.d.ts +3 -5
  128. package/dist/ui/query/useInstancesByIdsQuery.context.js +4 -8
  129. package/dist/ui/query/useInstancesByIdsQuery.d.ts +9 -6
  130. package/dist/ui/query/useInstancesByIdsQuery.js +14 -23
  131. package/dist/ui/query/useNamedDmInstancesByIds.d.ts +12 -0
  132. package/dist/utilities/cache/ReadonlyEntityCache.d.ts +4 -0
  133. package/dist/utilities/cache/ReadonlyEntityCache.js +27 -0
  134. package/dist/utilities/createMixpanelUsageMetricsTracker.d.ts +23 -0
  135. package/dist/utilities/createMixpanelUsageMetricsTracker.js +23 -0
  136. package/dist/utilities/externalIndex.d.ts +2 -0
  137. package/dist/utilities/externalIndex.js +3 -1
  138. package/dist/utilities/getInstancesFromClick.js +9 -9
  139. package/dist/utilities/index.d.ts +2 -1
  140. package/dist/utilities/index.js +12 -9
  141. package/dist/utilities/queryKeys.d.ts +2 -0
  142. package/dist/utilities/queryKeys.js +7 -0
  143. package/dist/utilities/signal/useCombinedUpdateSignal.d.ts +9 -0
  144. package/dist/utilities/signal/useCombinedUpdateSignal.js +14 -0
  145. package/dist/utilities/signal/useMemoWithUpdateSignal.d.ts +3 -0
  146. package/dist/utilities/signal/useMemoWithUpdateSignal.js +13 -0
  147. package/dist/utilities/usageMetricsTracker.d.ts +4 -0
  148. package/dist/utilities/usageMetricsTracker.js +4 -0
  149. package/package.json +7 -3
  150. package/dist/ui/hooks/network/getAssetsByIds.d.ts +0 -2
  151. package/dist/ui/hooks/network/getAssetsByIds.js +0 -4
  152. package/dist/ui/query/useDmsInstanceByIdsQuery.d.ts +0 -3
  153. package/dist/ui/query/useDmsInstanceByIdsQuery.js +0 -18
@@ -1,36 +1,36 @@
1
1
  import { createFdmKey as e } from "../cache/idAndKeyTranslation.js";
2
2
  import { restrictToDmsId as t } from "../../utilities/restrictToDmsId.js";
3
3
  import { isDefined as n } from "../../utilities/isDefined.js";
4
- import { createDmsQueryDataAccumulator as r } from "../../utilities/dms-cursoring/dmsAccumulator.js";
5
- import { COGNITE_CAD_NODE_SOURCE as i, COGNITE_CAD_NODE_VIEW_VERSION_KEY as a, COGNITE_VISUALIZABLE_SOURCE as o, CORE_DM_3D_CONTAINER_SPACE as s, CORE_DM_SPACE as c } from "./dataModels.js";
4
+ import { COGNITE_CAD_NODE_SOURCE as r, COGNITE_CAD_NODE_VIEW_VERSION_KEY as i, COGNITE_VISUALIZABLE_SOURCE as a, CORE_DM_3D_CONTAINER_SPACE as o, CORE_DM_SPACE as s } from "./dataModels.js";
5
+ import { createDmsQueryDataAccumulator as c } from "../../utilities/dms-cursoring/dmsAccumulator.js";
6
6
  import { hasIdFilter as l } from "./utils/filters.js";
7
7
  import { createObject3dToAssetMap as u, filterCadNodesWithObject3D as d, getModelRevisionAndTreeIndex as f } from "../utils/cadConnectionMapping.js";
8
8
  import { cogniteCadNodeSourceWithProperties as p } from "./cogniteCadNodeSourceWithProperties.js";
9
9
  import { cogniteVisualizableSourceWithProperties as m } from "./cogniteVisualizable.js";
10
10
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/getCadConnectionsForInstances.ts
11
11
  var h = "cad_connections_for_instances_query", g = 5e3;
12
- async function _(r, i, o) {
13
- if (r.length === 0 || i.length === 0) return [];
14
- let s = await v(r, i, o), l = d(s.items.cad_nodes), p = u(s.items.assets);
12
+ async function _(r, a, o) {
13
+ if (r.length === 0 || a.length === 0) return [];
14
+ let c = await v(r, a, o), l = d(c.items.cad_nodes), p = u(c.items.assets);
15
15
  return l.map((n) => {
16
- let r = n.properties[c][a], o = p.get(e(r.object3D));
16
+ let r = n.properties[s][i], o = p.get(e(r.object3D));
17
17
  if (o === void 0) return;
18
- let s = f(i, r);
19
- if (s !== void 0) return {
20
- ...s,
18
+ let c = f(a, r);
19
+ if (c !== void 0) return {
20
+ ...c,
21
21
  instance: t(o)
22
22
  };
23
23
  }).filter(n);
24
24
  }
25
- async function v(e, n, i) {
26
- let a = {
25
+ async function v(e, n, r) {
26
+ let i = {
27
27
  ...y(e),
28
28
  parameters: {
29
29
  modelRefs: n.map(([e]) => t(e)),
30
30
  revisionRefs: n.map(([, e]) => t(e))
31
31
  }
32
32
  };
33
- return r(i, a, { serial: ["assets", "cad_nodes"] }, { metricsFeatureName: h }).accumulateAllData();
33
+ return c(r, i, { serial: ["assets", "cad_nodes"] }, { metricsFeatureName: h }).accumulateAllData();
34
34
  }
35
35
  function y(e) {
36
36
  return {
@@ -43,7 +43,7 @@ function y(e) {
43
43
  nodes: {
44
44
  from: "assets",
45
45
  through: {
46
- view: o,
46
+ view: a,
47
47
  identifier: "object3D"
48
48
  },
49
49
  direction: "outwards"
@@ -54,20 +54,20 @@ function y(e) {
54
54
  nodes: {
55
55
  from: "object_3ds",
56
56
  through: {
57
- view: i,
57
+ view: r,
58
58
  identifier: "object3D"
59
59
  },
60
60
  filter: { and: [{ in: {
61
61
  property: [
62
- s,
63
- i.externalId,
62
+ o,
63
+ r.externalId,
64
64
  "model3D"
65
65
  ],
66
66
  values: { parameter: "modelRefs" }
67
67
  } }, { containsAny: {
68
68
  property: [
69
- s,
70
- i.externalId,
69
+ o,
70
+ r.externalId,
71
71
  "revisions"
72
72
  ],
73
73
  values: { parameter: "revisionRefs" }
@@ -1,19 +1,19 @@
1
1
  import { createFdmKey as e } from "../cache/idAndKeyTranslation.js";
2
2
  import { restrictToDmsId as t } from "../../utilities/restrictToDmsId.js";
3
3
  import { isDefined as n } from "../../utilities/isDefined.js";
4
- import { createDmsQueryDataAccumulator as r } from "../../utilities/dms-cursoring/dmsAccumulator.js";
5
- import { COGNITE_CAD_NODE_VIEW_VERSION_KEY as i, CORE_DM_SPACE as a } from "./dataModels.js";
4
+ import { COGNITE_CAD_NODE_VIEW_VERSION_KEY as r, CORE_DM_SPACE as i } from "./dataModels.js";
5
+ import { createDmsQueryDataAccumulator as a } from "../../utilities/dms-cursoring/dmsAccumulator.js";
6
6
  import { createObject3dToAssetMap as o, filterCadNodesWithObject3D as s, getModelRevisionAndTreeIndex as c } from "../utils/cadConnectionMapping.js";
7
7
  import { cadConnectionsQuery as l } from "./cadConnectionsQuery.js";
8
8
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/getCadConnectionsForRevisions.ts
9
9
  var u = "cad_connections_for_revisions_query";
10
- async function d(r, l) {
11
- if (r.length === 0) return [];
12
- let u = await f(r, l), d = s(u.items.cad_nodes), p = o(u.items.assets);
10
+ async function d(a, l) {
11
+ if (a.length === 0) return [];
12
+ let u = await f(a, l), d = s(u.items.cad_nodes), p = o(u.items.assets);
13
13
  return d.map((n) => {
14
- let o = n.properties[a][i], s = p.get(e(o.object3D));
14
+ let o = n.properties[i][r], s = p.get(e(o.object3D));
15
15
  if (s === void 0) return;
16
- let l = c(r, o);
16
+ let l = c(a, o);
17
17
  if (l !== void 0) return {
18
18
  ...l,
19
19
  instance: t(s)
@@ -21,14 +21,14 @@ async function d(r, l) {
21
21
  }).filter(n);
22
22
  }
23
23
  async function f(e, n) {
24
- let i = {
24
+ let r = {
25
25
  modelRefs: e.map(([e, n]) => t(e)),
26
26
  revisionRefs: e.map(([e, n]) => t(n))
27
- }, a = {
27
+ }, i = {
28
28
  ...l,
29
- parameters: i
29
+ parameters: r
30
30
  };
31
- return r(n, a, { serial: ["cad_nodes", "assets"] }, { metricsFeatureName: u }).accumulateAllData();
31
+ return a(n, i, { serial: ["cad_nodes", "assets"] }, { metricsFeatureName: u }).accumulateAllData();
32
32
  }
33
33
  //#endregion
34
34
  export { d as getCadConnectionsForRevisions };
@@ -1,5 +1,5 @@
1
- import { createDmsQueryDataAccumulator as e } from "../../utilities/dms-cursoring/dmsAccumulator.js";
2
- import { COGNITE_CAD_NODE_VIEW_VERSION_KEY as t } from "./dataModels.js";
1
+ import { COGNITE_CAD_NODE_VIEW_VERSION_KEY as e } from "./dataModels.js";
2
+ import { createDmsQueryDataAccumulator as t } from "../../utilities/dms-cursoring/dmsAccumulator.js";
3
3
  import { cadModelsForInstanceQuery as n } from "./cadModelsForInstanceQuery.js";
4
4
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/getCadModelsForInstance.ts
5
5
  async function r(r, i) {
@@ -10,7 +10,7 @@ async function r(r, i) {
10
10
  ...n,
11
11
  parameters: a
12
12
  };
13
- return (await e(i, o, "cad_nodes").accumulateAllData()).items.cad_nodes.flatMap((e) => e.properties.cdf_cdm[t].revisions?.map(({ externalId: e, space: t }) => ({
13
+ return (await t(i, o, "cad_nodes").accumulateAllData()).items.cad_nodes.flatMap((t) => t.properties.cdf_cdm[e].revisions?.map(({ externalId: e, space: t }) => ({
14
14
  type: "cad",
15
15
  sourceType: "cdm",
16
16
  externalId: e,
@@ -1,15 +1,15 @@
1
1
  import { restrictToDmsId as e } from "../../utilities/restrictToDmsId.js";
2
- import { createDmsQueryDataAccumulator as t } from "../../utilities/dms-cursoring/dmsAccumulator.js";
3
- import { COGNITE_3D_MODEL_SOURCE as n } from "./dataModels.js";
2
+ import { COGNITE_3D_MODEL_SOURCE as t } from "./dataModels.js";
3
+ import { createDmsQueryDataAccumulator as n } from "../../utilities/dms-cursoring/dmsAccumulator.js";
4
4
  import { hasData3DModelContainerFilter as r } from "./utils/filters.js";
5
5
  import { chunk as i } from "lodash-es";
6
6
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/getDMSModels.ts
7
- async function a(a, o, s = t) {
7
+ async function a(a, o, s = n) {
8
8
  let c = a.map((e) => `cog_3d_model_${e}`), l = i(c, 50), u = [];
9
- for (let t of l) {
9
+ for (let n of l) {
10
10
  let i = await s(o, {
11
11
  select: { models: { sources: [{
12
- source: n,
12
+ source: t,
13
13
  properties: [
14
14
  "name",
15
15
  "description",
@@ -21,7 +21,7 @@ async function a(a, o, s = t) {
21
21
  }] } },
22
22
  with: { models: { nodes: { filter: { and: [{ in: {
23
23
  property: ["node", "externalId"],
24
- values: t
24
+ values: n
25
25
  } }, r] } } } }
26
26
  }, "models").accumulateAllData();
27
27
  u.push(...i.items.models.map(e));
@@ -1,12 +1,12 @@
1
- import { createDmsQueryDataAccumulator as e } from "../../utilities/dms-cursoring/dmsAccumulator.js";
2
- import { COGNITE_VISUALIZABLE_SOURCE as t } from "./dataModels.js";
1
+ import { COGNITE_VISUALIZABLE_SOURCE as e } from "./dataModels.js";
2
+ import { createDmsQueryDataAccumulator as t } from "../../utilities/dms-cursoring/dmsAccumulator.js";
3
3
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/getEdgeConnected3dInstances.ts
4
- async function n(t, n, i = e) {
4
+ async function n(e, n, i = t) {
5
5
  return (await i(n, {
6
6
  ...r,
7
7
  parameters: {
8
- instanceExternalId: t.externalId,
9
- instanceSpace: t.space
8
+ instanceExternalId: e.externalId,
9
+ instanceSpace: e.space
10
10
  }
11
11
  }, { serial: [
12
12
  "start_instance",
@@ -39,8 +39,8 @@ var r = {
39
39
  from: "start_to_object_edges",
40
40
  chainTo: "destination",
41
41
  filter: { exists: { property: [
42
- t.space,
43
- t.externalId,
42
+ e.space,
43
+ e.externalId,
44
44
  "object3D"
45
45
  ] } }
46
46
  } },
@@ -48,7 +48,7 @@ var r = {
48
48
  nodes: {
49
49
  from: "objects_connected_with_3d",
50
50
  through: {
51
- view: t,
51
+ view: e,
52
52
  identifier: "object3D"
53
53
  }
54
54
  },
@@ -1,5 +1,4 @@
1
- import { Node3D } from '@cognite/sdk';
2
1
  import { createDmsQueryDataAccumulator } from '../../utilities/dms-cursoring/dmsAccumulator';
3
- import { FdmCadConnection } from '../cache/types';
2
+ import { CadNodeIdData, FdmCadConnection } from '../cache/types';
4
3
  import { DmsUniqueIdentifier, FdmSDK } from '../FdmSDK';
5
- export declare function getFdmConnectionsForNodes(model: DmsUniqueIdentifier, revisionRef: DmsUniqueIdentifier, revisionId: number, nodes: Node3D[], fdmSdk: FdmSDK, accumulate?: typeof createDmsQueryDataAccumulator): Promise<FdmCadConnection[]>;
4
+ export declare function getFdmConnectionsForNodes(model: DmsUniqueIdentifier, revisionRef: DmsUniqueIdentifier, revisionId: number, nodes: CadNodeIdData[], fdmSdk: FdmSDK, accumulate?: typeof createDmsQueryDataAccumulator): Promise<FdmCadConnection[]>;
@@ -3,39 +3,39 @@ import { isSameDmsId as t } from "../../utilities/instanceIds/equality.js";
3
3
  import { createFdmKey as n } from "../cache/idAndKeyTranslation.js";
4
4
  import "../../utilities/instanceIds/index.js";
5
5
  import { restrictToDmsId as r } from "../../utilities/restrictToDmsId.js";
6
- import { createDmsQueryDataAccumulator as i } from "../../utilities/dms-cursoring/dmsAccumulator.js";
7
- import { COGNITE_ASSET_SOURCE as a, COGNITE_CAD_NODE_SOURCE as o, COGNITE_CAD_NODE_VIEW_VERSION_KEY as s, COGNITE_VISUALIZABLE_SOURCE as c, COGNITE_VISUALIZABLE_VIEW_VERSION_KEY as l, CORE_DM_3D_CONTAINER_SPACE as u, CORE_DM_SPACE as d } from "./dataModels.js";
6
+ import { COGNITE_ASSET_SOURCE as i, COGNITE_CAD_NODE_SOURCE as a, COGNITE_CAD_NODE_VIEW_VERSION_KEY as o, COGNITE_VISUALIZABLE_SOURCE as s, COGNITE_VISUALIZABLE_VIEW_VERSION_KEY as c, CORE_DM_3D_CONTAINER_SPACE as l, CORE_DM_SPACE as u } from "./dataModels.js";
7
+ import { createDmsQueryDataAccumulator as d } from "../../utilities/dms-cursoring/dmsAccumulator.js";
8
8
  import { cadNodeHasObject3DFilter as f } from "./utils/filters.js";
9
9
  import { getCadConnectionFieldsForRevision as p } from "../utils/cadNodeConnectionFields.js";
10
10
  import { getModelIdFromExternalId as m } from "./getCdfIdFromExternalId.js";
11
11
  import { cogniteCadNodeSourceWithProperties as h } from "./cogniteCadNodeSourceWithProperties.js";
12
12
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/getFdmConnectionsForNodes.ts
13
- async function g(a, o, c, u, f, h = i) {
14
- let g = u.map((e) => e.treeIndex), v = new Set(g), y = /* @__PURE__ */ new Map(), b = {
13
+ async function g(i, a, s, l, f, h = d) {
14
+ let g = l.map((e) => e.treeIndex), v = new Set(g), y = /* @__PURE__ */ new Map(), b = {
15
15
  ..._,
16
16
  parameters: {
17
- modelReference: r(a),
17
+ modelReference: r(i),
18
18
  treeIndexes: g,
19
- revisionRefs: [r(o)]
19
+ revisionRefs: [r(a)]
20
20
  }
21
- }, x = m(a.externalId), S = await h(f, b, { serial: [
21
+ }, x = m(i.externalId), S = await h(f, b, { serial: [
22
22
  "cad_nodes",
23
23
  "objects_3d",
24
24
  "assets"
25
25
  ] }).accumulateAllData();
26
26
  S.items.cad_nodes.filter((t) => e(t.properties.cdf_cdm["CogniteCADNode/v1"].object3D)).forEach((e) => {
27
- let n = e.properties[d][s], r = n.revisions.findIndex((e) => t(e, o)), i = n.treeIndexes[r];
27
+ let n = e.properties[u][o], r = n.revisions.findIndex((e) => t(e, a)), i = n.treeIndexes[r];
28
28
  v.has(i) && y.set(i, {
29
29
  props: n,
30
30
  revisionIndex: r
31
31
  });
32
32
  });
33
- let C = new Map(S.items.assets.map((e) => [n(e.properties[d][l].object3D), e])), w = [];
33
+ let C = new Map(S.items.assets.map((e) => [n(e.properties[u][c].object3D), e])), w = [];
34
34
  return [...y.entries()].forEach(([e, { props: t, revisionIndex: r }]) => {
35
35
  let i = n(t.object3D), a = C.get(i);
36
36
  a !== void 0 && w.push({
37
37
  modelId: x,
38
- revisionId: c,
38
+ revisionId: s,
39
39
  treeIndex: e,
40
40
  instance: a,
41
41
  ...p(t, r)
@@ -47,24 +47,24 @@ var _ = {
47
47
  cad_nodes: { nodes: { filter: { and: [
48
48
  { equals: {
49
49
  property: [
50
- u,
51
- o.externalId,
50
+ l,
51
+ a.externalId,
52
52
  "model3D"
53
53
  ],
54
54
  value: { parameter: "modelReference" }
55
55
  } },
56
56
  { containsAny: {
57
57
  property: [
58
- u,
59
- o.externalId,
58
+ l,
59
+ a.externalId,
60
60
  "treeIndexes"
61
61
  ],
62
62
  values: { parameter: "treeIndexes" }
63
63
  } },
64
64
  { containsAny: {
65
65
  property: [
66
- u,
67
- o.externalId,
66
+ l,
67
+ a.externalId,
68
68
  "revisions"
69
69
  ],
70
70
  values: { parameter: "revisionRefs" }
@@ -74,7 +74,7 @@ var _ = {
74
74
  objects_3d: { nodes: {
75
75
  from: "cad_nodes",
76
76
  through: {
77
- view: o,
77
+ view: a,
78
78
  identifier: "object3D"
79
79
  },
80
80
  direction: "outwards"
@@ -82,7 +82,7 @@ var _ = {
82
82
  assets: { nodes: {
83
83
  from: "objects_3d",
84
84
  through: {
85
- view: a,
85
+ view: i,
86
86
  identifier: "object3D"
87
87
  },
88
88
  direction: "inwards"
@@ -91,7 +91,7 @@ var _ = {
91
91
  select: {
92
92
  cad_nodes: { sources: h },
93
93
  assets: { sources: [{
94
- source: c,
94
+ source: s,
95
95
  properties: ["object3D"]
96
96
  }] },
97
97
  objects_3d: {}
@@ -1,8 +1,8 @@
1
1
  import { isDmsInstance as e } from "../../utilities/instanceIds/typeGuards.js";
2
2
  import "../../utilities/instanceIds/index.js";
3
3
  import { makeSureNonEmptyFilterForRequest as t } from "../FdmSDK.js";
4
- import { createDmsQueryDataAccumulator as n } from "../../utilities/dms-cursoring/dmsAccumulator.js";
5
- import { COGNITE_CAD_NODE_SOURCE as r } from "./dataModels.js";
4
+ import { COGNITE_CAD_NODE_SOURCE as n } from "./dataModels.js";
5
+ import { createDmsQueryDataAccumulator as r } from "../../utilities/dms-cursoring/dmsAccumulator.js";
6
6
  import { cadVisualizableQueryPayload as i, image360VisualizableQueryPayload as a, pointCloudsVisualizablesQueryPayload as o } from "./cadAndPointCloudAndImage360VisualizableQuery.js";
7
7
  import { uniqBy as s } from "lodash-es";
8
8
  //#region libs/shared/reveal-components/src/data-providers/core-dm-provider/listMappedFdmNodes.ts
@@ -23,32 +23,32 @@ async function u(e, n, r, i, a) {
23
23
  let o = t(r), s = e.cad.length > 0 ? await d(n, e.cad, o, i, a) : [], c = e.pointCloud.length > 0 ? await f(n, e.pointCloud, o, i, a) : [], l = e.image360.length > 0 ? await p(n, e.image360, o, i, a) : [];
24
24
  return s.concat(c).concat(l);
25
25
  }
26
- async function d(e, t, r, a, o) {
26
+ async function d(e, t, n, a, o) {
27
27
  let s = {
28
- ...i(e, r, o.pageSize),
28
+ ...i(e, n, o.pageSize),
29
29
  parameters: { revisionRefs: t }
30
- }, c = n(a, s, { serial: ["cad_nodes", "cad_visualizables"] }), l = o.mode === "all" ? await c.accumulateAllData() : await c.accumulateNext();
30
+ }, c = r(a, s, { serial: ["cad_nodes", "cad_visualizables"] }), l = o.mode === "all" ? await c.accumulateAllData() : await c.accumulateNext();
31
31
  return m(e, l.items.cad_visualizables, l.items.cad_nodes);
32
32
  }
33
- async function f(e, t, r, i, a) {
33
+ async function f(e, t, n, i, a) {
34
34
  let s = {
35
- ...o(e, r, a.pageSize),
35
+ ...o(e, n, a.pageSize),
36
36
  parameters: { revisionRefs: t }
37
- }, c = n(i, s, { serial: ["pointcloud_volumes", "pointcloud_visualizables"] });
37
+ }, c = r(i, s, { serial: ["pointcloud_volumes", "pointcloud_visualizables"] });
38
38
  return (a.mode === "all" ? await c.accumulateAllData() : await c.accumulateNext()).items.pointcloud_visualizables;
39
39
  }
40
- async function p(e, t, r, i, o) {
40
+ async function p(e, t, n, i, o) {
41
41
  let s = {
42
- ...a(e, t, r, o.pageSize),
42
+ ...a(e, t, n, o.pageSize),
43
43
  parameters: { revisionRefs: t }
44
- }, c = n(i, s, { serial: ["image360_collections", "image360_visualizables"] });
44
+ }, c = r(i, s, { serial: ["image360_collections", "image360_visualizables"] });
45
45
  return (o.mode === "all" ? await c.accumulateAllData() : await c.accumulateNext()).items.image360_visualizables;
46
46
  }
47
- function m(t, n, i) {
47
+ function m(t, r, i) {
48
48
  let a = [];
49
49
  return i.forEach((i) => {
50
- let o = i.properties[r.space][`${r.externalId}/${r.version}`]?.object3D;
51
- e(o) && n.forEach((n) => {
50
+ let o = i.properties[n.space][`${n.externalId}/${n.version}`]?.object3D;
51
+ e(o) && r.forEach((n) => {
52
52
  t.forEach((t) => {
53
53
  let r = n.properties[t.space][`${t.externalId}/${t.version}`], i = e(r?.object3D) ? r?.object3D : void 0;
54
54
  i !== void 0 && o.externalId === i.externalId && o.space === i.space && a.push(n);
@@ -2,5 +2,6 @@ export type { AssetIdsAndTimeseriesData, ExtendedRelationship, AssetAndTimeserie
2
2
  export type { InstanceBounds } from './network/bounds/getBoundsForInstance';
3
3
  export type { AssetProperties } from './core-dm-provider/utils/filters';
4
4
  export type { FdmNode, Source, DmsUniqueIdentifier, ExternalId, SearchOperator, SimpleSource, Space, NodeItem, } from './FdmSDK';
5
- export type { CadNodeMapping } from './cache/cad/CadInstanceMappingsCache';
5
+ export type { CadNodeMapping, CadInstanceMappingsCache, } from './cache/cad/CadInstanceMappingsCache';
6
+ export { instanceIdToInstanceReference } from './cache/idAndKeyTranslation';
6
7
  export type { CadNodeIdData } from './cache/types';
@@ -0,0 +1,2 @@
1
+ import { instanceIdToInstanceReference as e } from "./cache/idAndKeyTranslation.js";
2
+ export { e as instanceIdToInstanceReference };
@@ -1,7 +1,7 @@
1
- import { ViewDefinition, CogniteClient, Node3D } from '@cognite/sdk';
1
+ import { ViewDefinition, CogniteClient } from '@cognite/sdk';
2
2
  import { TrackingDelegate } from '../../foundation/utilities/types';
3
3
  import { InstancesWithView, InstancesWithViewDefinition } from '../../ui/query/useSearchMappedEquipmentFDM';
4
- import { FdmCadConnection } from '../cache/types';
4
+ import { CadNodeIdData, FdmCadConnection } from '../cache/types';
5
5
  import { Fdm3dDataProvider } from '../Fdm3dDataProvider';
6
6
  import { DmsUniqueIdentifier, FdmSDK, InstanceFilter, NodeItem, Source } from '../FdmSDK';
7
7
  import { Classic3DResourceIdentifier, ThreeDResourceIdentifier } from '../types/resources';
@@ -15,7 +15,7 @@ export declare class LegacyFdm3dDataProvider implements Fdm3dDataProvider {
15
15
  is3dView(view: ViewDefinition): boolean;
16
16
  getDMSModels(modelId: number): Promise<DmsUniqueIdentifier[]>;
17
17
  getEdgeConnected3dInstances(instance: DmsUniqueIdentifier): Promise<DmsUniqueIdentifier[]>;
18
- getFdmConnectionsForNodes(models: DmsUniqueIdentifier[], revisionId: number, nodes: Node3D[]): Promise<FdmCadConnection[]>;
18
+ getFdmConnectionsForNodes(models: DmsUniqueIdentifier[], revisionId: number, nodes: CadNodeIdData[]): Promise<FdmCadConnection[]>;
19
19
  listMappedFdmNodes(models: ThreeDResourceIdentifier[], sourcesToSearch: ViewDefinition[], instanceFilter: InstanceFilter | undefined, limit: number): Promise<NodeItem[]>;
20
20
  listAllMappedFdmNodes(models: ThreeDResourceIdentifier[], sourcesToSearch: Source[]): Promise<NodeItem[]>;
21
21
  filterNodesByMappedTo3d(nodes: InstancesWithViewDefinition[], models: ThreeDResourceIdentifier[], includeIndirectRelations: boolean): Promise<InstancesWithView[]>;
@@ -1,13 +1,13 @@
1
1
  import { createModelRevisionKey as e, revisionKeyToIds as t } from "../cache/idAndKeyTranslation.js";
2
- import { executeParallel as n } from "../../utilities/executeParallel.js";
3
- import { isDefined as r } from "../../utilities/isDefined.js";
2
+ import { isDefined as n } from "../../utilities/isDefined.js";
3
+ import { executeParallel as r } from "../../utilities/executeParallel.js";
4
4
  import { nodeIdsToTreeIndices as i } from "../cache/requests.js";
5
5
  import { chunk as a } from "lodash-es";
6
6
  //#region libs/shared/reveal-components/src/data-providers/legacy-fdm-provider/fdmEdgesToCadConnections.ts
7
7
  var o = 2;
8
8
  async function s(e, t) {
9
9
  let i = c(e);
10
- return (await n([...i.entries()].map(([e, n]) => async () => await l(e, n, t)), o)).flat().filter(r);
10
+ return (await r([...i.entries()].map(([e, n]) => async () => await l(e, n, t)), o)).flat().filter(n);
11
11
  }
12
12
  function c(t) {
13
13
  return t.reduce((t, n) => {
@@ -1,4 +1,4 @@
1
- import { CogniteClient, Node3D } from '@cognite/sdk';
2
- import { FdmCadConnection } from '../cache/types';
1
+ import { CogniteClient } from '@cognite/sdk';
2
+ import { CadNodeIdData, FdmCadConnection } from '../cache/types';
3
3
  import { DmsUniqueIdentifier, FdmSDK } from '../FdmSDK';
4
- export declare function getFdmConnectionsForNodes(fdmClient: FdmSDK, cogniteClient: CogniteClient, models: DmsUniqueIdentifier[], revisionId: number, nodes: Node3D[]): Promise<FdmCadConnection[]>;
4
+ export declare function getFdmConnectionsForNodes(fdmClient: FdmSDK, cogniteClient: CogniteClient, models: DmsUniqueIdentifier[], revisionId: number, nodes: CadNodeIdData[]): Promise<FdmCadConnection[]>;
@@ -2,7 +2,7 @@ import { SYSTEM_3D_EDGE_SOURCE as e } from "./dataModels.js";
2
2
  import { fdmEdgesToCadConnections as t } from "./fdmEdgesToCadConnections.js";
3
3
  //#region libs/shared/reveal-components/src/data-providers/legacy-fdm-provider/getFdmConnectionsForNodeIds.ts
4
4
  async function n(n, r, i, a, o) {
5
- let s = o.map((e) => e.id), c = { and: [
5
+ let s = o.map((e) => e.nodeId), c = { and: [
6
6
  { in: {
7
7
  property: ["edge", "endNode"],
8
8
  values: i.map((e) => ({
@@ -1,6 +1,6 @@
1
1
  import { createModelRevisionKey as e } from "../../cache/idAndKeyTranslation.js";
2
- import { executeParallel as t } from "../../../utilities/executeParallel.js";
3
- import { isDefined as n } from "../../../utilities/isDefined.js";
2
+ import { isDefined as t } from "../../../utilities/isDefined.js";
3
+ import { executeParallel as n } from "../../../utilities/executeParallel.js";
4
4
  import { isClassicCadAssetMapping as r } from "../../cache/cad/assetMappingTypes.js";
5
5
  import { fetchAssetPage as i } from "./fetchAllAssetsForCadModels.js";
6
6
  //#region libs/shared/reveal-components/src/data-providers/network/cad/searchClassicAssetsForCadModels.ts
@@ -45,7 +45,7 @@ async function l(e, t, n, r, i, a, o, s = 10, c = 20) {
45
45
  };
46
46
  }
47
47
  async function u(i, o, s) {
48
- let c = (await t(i.map((t) => async () => {
48
+ let c = (await n(i.map((t) => async () => {
49
49
  let n = e(t.modelId, t.revisionId), r = s?.find((e) => e.modelRevisionKey === n);
50
50
  if (s !== void 0 && r === void 0) return;
51
51
  let { mappings: i, nextCursor: a } = await o.getAssetMappingsForModelPage(t.modelId, t.revisionId, r?.cursor);
@@ -56,7 +56,7 @@ async function u(i, o, s) {
56
56
  cursor: a
57
57
  }
58
58
  };
59
- }), a)).filter(n), l = c.map((e) => e.nextCursorEntry).filter(n);
59
+ }), a)).filter(t), l = c.map((e) => e.nextCursorEntry).filter(t);
60
60
  return {
61
61
  assetIds: c.flatMap((e) => e.mappings.filter(r).map((e) => e.assetId)),
62
62
  modelKeyWithCursors: l.length > 0 ? l : void 0
@@ -79,7 +79,7 @@ async function d(e, t, n, r) {
79
79
  }
80
80
  async function f(e, r, i) {
81
81
  let o = await p(i, r);
82
- return (await t(e.map((e) => async () => m(i, e.modelId, e.revisionId)), a)).filter(n).reduce((e, t) => e + t, 0) <= o ? "scanFromAssetMappings" : "scanFromAsset";
82
+ return (await n(e.map((e) => async () => m(i, e.modelId, e.revisionId)), a)).filter(t).reduce((e, t) => e + t, 0) <= o ? "scanFromAssetMappings" : "scanFromAsset";
83
83
  }
84
84
  async function p(e, t) {
85
85
  return (await e.post(`/api/v1/projects/${e.project}/assets/aggregate`, { data: {
@@ -9,11 +9,11 @@ async function a(e, t, n, r, a, s, c = i) {
9
9
  return (n.query === void 0 || n.query === "") && n.filter === void 0 ? await o(e, n.limit ?? 1e3, t, r) : await l(e, a, s);
10
10
  }
11
11
  async function o(r, i, a, o) {
12
- let s = await n("dm", r, i, void 0, o), c = new e(o), l = s.items.flatMap((e) => e.mappings.items.map((e) => e.instanceId));
13
- return (await c.getByExternalIds(l.map((e) => ({
12
+ let s = await n("dm", r, i, void 0, o), c = new e(o), l = s.items.flatMap((e) => e.mappings.items.map((e) => e.instanceId)), { items: u } = await c.getByExternalIds(l.map((e) => ({
14
13
  ...e,
15
14
  instanceType: "node"
16
- })), [t(a)])).items;
15
+ })), [t(a)]);
16
+ return u;
17
17
  }
18
18
  //#endregion
19
19
  export { a as searchHybridDmAssetsForCadModels };
@@ -4,12 +4,12 @@ import { uniqBy as i } from "lodash-es";
4
4
  //#region libs/shared/reveal-components/src/data-providers/network/common/getDMAssetsForAnnotationReference.ts
5
5
  async function a(a, o) {
6
6
  if (a.length === 0) return [];
7
- let s = i(a, e);
8
- return (await o.getByExternalIds(s.filter((e) => e.sources.some((e) => e.externalId === t.externalId && e.space === t.space && e.version === t.version)).map((e) => ({
7
+ let s = i(a, e), { items: c } = await o.getByExternalIds(s.filter((e) => e.sources.some((e) => e.externalId === t.externalId && e.space === t.space && e.version === t.version)).map((e) => ({
9
8
  externalId: e.externalId,
10
9
  space: e.space,
11
10
  instanceType: e.instanceType
12
- })), [t])).items.map((e) => ({
11
+ })), [t]);
12
+ return c.map((e) => ({
13
13
  ...e,
14
14
  properties: e.properties[r][n]
15
15
  }));
@@ -1,9 +1,9 @@
1
- import { executeParallel as e } from "../../utilities/executeParallel.js";
2
- import { isDefined as t } from "../../utilities/isDefined.js";
1
+ import { isDefined as e } from "../../utilities/isDefined.js";
2
+ import { executeParallel as t } from "../../utilities/executeParallel.js";
3
3
  import { getDMSModels as n } from "../core-dm-provider/getDMSModels.js";
4
4
  import { getDMSRevision as r } from "../core-dm-provider/getDMSRevision.js";
5
5
  async function i(n, i, a) {
6
- return (await e(i.map((e, t) => async () => n[t] === void 0 ? void 0 : await r(n[t], e, a)), 2)).filter(t);
6
+ return (await t(i.map((e, t) => async () => n[t] === void 0 ? void 0 : await r(n[t], e, a)), 2)).filter(e);
7
7
  }
8
8
  async function a(e, t) {
9
9
  return await n(e, t);
@@ -0,0 +1,18 @@
1
+ import { Matrix4, Vector3 } from 'three';
2
+ import { DataSourceType, Image360, Image360Collection } from '@cognite/reveal';
3
+ export declare function getPlausibleEntityAnchorViewer(entity: Image360<DataSourceType> | undefined, referenceCenterCdf: Vector3): Vector3 | undefined;
4
+ export declare function applySceneCollectionTransformToCdfPoint(point: Vector3, collectionTransform: Matrix4, target?: Vector3): Vector3;
5
+ type ApplySceneCollectionTransformToCdfAnnotationWorldPointParams = {
6
+ rawCenterCdf: Vector3;
7
+ unitDirectionFromCenterCdf: Vector3;
8
+ vectorLength: number;
9
+ collectionTransform: Matrix4;
10
+ sceneAlignedImageCenterViewer: Vector3;
11
+ target?: Vector3;
12
+ };
13
+ export declare function applySceneCollectionTransformToCdfAnnotationWorldPoint({ rawCenterCdf, unitDirectionFromCenterCdf, vectorLength, collectionTransform, sceneAlignedImageCenterViewer, target, }: ApplySceneCollectionTransformToCdfAnnotationWorldPointParams): Vector3;
14
+ export declare function convertSceneAlignedImage360AnnotationGeometryToRawCdf(center: Vector3, polygon: Vector3[], collection: Image360Collection<DataSourceType>, vectorLength: number, entity?: Image360<DataSourceType>): {
15
+ center: Vector3;
16
+ polygon: Vector3[];
17
+ };
18
+ export {};
@@ -0,0 +1,37 @@
1
+ import { VIEWER_TO_CDF_TRANSFORMATION as e, convertFromViewerCoordinates as t, convertToViewerCoordinates as n } from "../../foundation/renderTarget/convertCoordinates.js";
2
+ import { Matrix4 as r, Vector3 as i } from "three";
3
+ import { CDF_TO_VIEWER_TRANSFORMATION as a } from "@cognite/reveal";
4
+ //#region libs/shared/reveal-components/src/domains/annotation360/image360SceneCollectionTransform.ts
5
+ var o = .05;
6
+ function s(e, t) {
7
+ if (e === void 0) return;
8
+ let r = new i().setFromMatrixPosition(e.transform);
9
+ if (!(r.distanceTo(n(t)) > o)) return r;
10
+ }
11
+ function c(t, n, r = new i()) {
12
+ return r.copy(t).applyMatrix4(a).applyMatrix4(n).applyMatrix4(e);
13
+ }
14
+ new r(), new i(), new i();
15
+ function l(e, i, a, o, l) {
16
+ let d = a.getModelTransformation(), f = new r().copy(d).invert(), p = s(l, e);
17
+ if (p !== void 0) {
18
+ let e = p.clone().applyMatrix4(f), r = u(d).invert(), a = t(e);
19
+ return {
20
+ center: a,
21
+ polygon: i.map((i) => {
22
+ let s = n(i.clone().multiplyScalar(o)).applyMatrix4(r);
23
+ return t(e.clone().add(s)).sub(a).normalize();
24
+ })
25
+ };
26
+ }
27
+ let m = c(e, f);
28
+ return {
29
+ center: m,
30
+ polygon: i.map((t) => c(e.clone().addScaledVector(t, o), f).sub(m).normalize())
31
+ };
32
+ }
33
+ function u(e) {
34
+ return new r().copy(e).setPosition(0, 0, 0);
35
+ }
36
+ //#endregion
37
+ export { c as applySceneCollectionTransformToCdfPoint, l as convertSceneAlignedImage360AnnotationGeometryToRawCdf, s as getPlausibleEntityAnchorViewer };
@@ -94,6 +94,7 @@ export { Image360AnnotationFolder } from './annotation360/Image360AnnotationFold
94
94
  export { Image360AnnotationSelectTool } from './annotation360/Image360AnnotationSelectTool';
95
95
  export { Image360AnnotationCreateTool } from './annotation360/Image360AnnotationCreateTool';
96
96
  export { DeleteSelectedImage360AnnotationCommand } from './annotation360/DeleteSelectedImage360AnnotationCommand';
97
+ export { convertSceneAlignedImage360AnnotationGeometryToRawCdf } from './annotation360/image360SceneCollectionTransform';
97
98
  export { isPointsOfInterestIntersection, type PointOfInterest, PointsOfInterestDomainObject, PointsOfInterestView, } from './pointsOfInterest';
98
99
  export type { LegacyIdentifier } from './annotation360/types';
99
100
  export type { FdmIdentifier } from './annotation360/types';
@@ -101,13 +102,14 @@ export type { AnnotationIdentifier } from './annotation360/types';
101
102
  export type { AssetIdentifier } from './annotation360/types';
102
103
  export type { AnnotationStatus } from './annotation360/types';
103
104
  export type { ILazyLoader } from '../foundation/treeNodes/tree-node-type/i-lazy-loader';
104
- export type { INodesAndInstanceMappingsSdk } from '../foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/i-nodes-and-instance-mappings-sdk';
105
+ export type { INodesAndInstanceMappingsSdk, IInstanceMappingsSdk, } from '../foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/i-nodes-and-instance-mappings-sdk';
105
106
  export { NodesAndInstanceMappingsSdk } from '../foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/nodes-and-instance-mappings-sdk';
107
+ export { CoreDmInstanceMappingsSdk, type CoreDmInstanceMappingDeleteDelegate, } from '../foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/core-dm-instance-mappings-sdk';
106
108
  export { ClassicInstanceMappingsSdk } from '../foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/classic-instance-mappings-sdk';
107
109
  export { CadLazyLoader } from '../foundation/treeNodes/cad-tree-node/cad-lazy-loader';
108
110
  export type { CadLazyLoaderOptions } from '../foundation/treeNodes/cad-tree-node/cad-lazy-loader';
109
111
  export { CadTreeNode } from '../foundation/treeNodes/cad-tree-node/cad-tree-node';
110
112
  export { TreeNode } from '../foundation/treeNodes/tree-node/tree-node';
111
- export type { TreeNodeAction } from '../foundation/treeNodes/tree-node-type/tree-node-actions';
113
+ export type { TreeNodeAction, TreeNodeSelectAction, } from '../foundation/treeNodes/tree-node-type/tree-node-actions';
112
114
  export type { RevisionId } from '../foundation/treeNodes/cad-tree-node/cad-types';
113
115
  export { DEFAULT_POLYGON_OFFSET, updatePolygonOffset, } from '../foundation/utilities/misc/defaultPolygonOffset';