@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.
- package/README.md +1 -1
- package/dist/assets/poi-markers/poi-create-cursor.js +4 -0
- package/dist/common/i18n/en/reveal-components.js +183 -178
- package/dist/data-providers/Fdm3dDataProvider.d.ts +3 -3
- package/dist/data-providers/FdmSDK.d.ts +8 -0
- package/dist/data-providers/FdmSDK.js +34 -21
- package/dist/data-providers/assets/createClassicAssetsCache.d.ts +7 -0
- package/dist/data-providers/assets/createClassicAssetsCache.js +18 -0
- package/dist/data-providers/assets/createDmsDescribableNodesCache.d.ts +23 -0
- package/dist/data-providers/assets/createDmsDescribableNodesCache.js +19 -0
- package/dist/data-providers/cache/PointCloudAnnotationCache.js +10 -10
- package/dist/data-providers/cache/RevisionFdmNodeCache.d.ts +3 -2
- package/dist/data-providers/cache/RevisionFdmNodeCache.js +65 -39
- package/dist/data-providers/cache/annotationModelUtils.js +8 -6
- package/dist/data-providers/cache/cad/CadInstanceMappingsCache.d.ts +5 -2
- package/dist/data-providers/cache/cad/CadInstanceMappingsCacheImpl.js +9 -6
- package/dist/data-providers/cache/cad/FdmCadNodeCache.d.ts +3 -1
- package/dist/data-providers/cache/cad/FdmCadNodeCacheImpl.d.ts +5 -0
- package/dist/data-providers/cache/cad/FdmCadNodeCacheImpl.js +8 -3
- package/dist/data-providers/core-dm-provider/CoreDm3dDataProvider.d.ts +3 -3
- package/dist/data-providers/core-dm-provider/CoreDm3dDataProvider.js +11 -11
- package/dist/data-providers/core-dm-provider/filterNodesByMappedTo3d.js +13 -13
- package/dist/data-providers/core-dm-provider/getCadConnectionsForInstances.js +18 -18
- package/dist/data-providers/core-dm-provider/getCadConnectionsForRevisions.js +11 -11
- package/dist/data-providers/core-dm-provider/getCadModelsForInstance.js +3 -3
- package/dist/data-providers/core-dm-provider/getDMSModels.js +6 -6
- package/dist/data-providers/core-dm-provider/getEdgeConnected3dInstances.js +8 -8
- package/dist/data-providers/core-dm-provider/getFdmConnectionsForNodes.d.ts +2 -3
- package/dist/data-providers/core-dm-provider/getFdmConnectionsForNodes.js +19 -19
- package/dist/data-providers/core-dm-provider/listMappedFdmNodes.js +14 -14
- package/dist/data-providers/index.d.ts +2 -1
- package/dist/data-providers/index.js +2 -0
- package/dist/data-providers/legacy-fdm-provider/LegacyFdm3dDataProvider.d.ts +3 -3
- package/dist/data-providers/legacy-fdm-provider/fdmEdgesToCadConnections.js +3 -3
- package/dist/data-providers/legacy-fdm-provider/getFdmConnectionsForNodeIds.d.ts +3 -3
- package/dist/data-providers/legacy-fdm-provider/getFdmConnectionsForNodeIds.js +1 -1
- package/dist/data-providers/network/cad/searchClassicAssetsForCadModels.js +5 -5
- package/dist/data-providers/network/cad/searchHybridDmAssetsForCadModels.js +3 -3
- package/dist/data-providers/network/common/getDMAssetsForAnnotationReference.js +3 -3
- package/dist/data-providers/utils/getDMSModelRevisionRefs.js +3 -3
- package/dist/domains/annotation360/image360SceneCollectionTransform.d.ts +18 -0
- package/dist/domains/annotation360/image360SceneCollectionTransform.js +37 -0
- package/dist/domains/index.d.ts +4 -2
- package/dist/domains/index.js +3 -1
- package/dist/domains/pointsOfInterest/PointsOfInterestTool.d.ts +5 -0
- package/dist/domains/pointsOfInterest/PointsOfInterestTool.js +36 -17
- package/dist/domains/reveal/RevealDomainObjectUtils.d.ts +1 -0
- package/dist/domains/reveal/RevealDomainObjectUtils.js +1 -1
- package/dist/domains/reveal/cad/CadDomainObject.d.ts +18 -1
- package/dist/domains/reveal/cad/CadDomainObject.js +31 -15
- package/dist/foundation/renderTarget/CdfCaches.d.ts +9 -1
- package/dist/foundation/renderTarget/CdfCaches.js +24 -14
- package/dist/foundation/treeNodes/cad-tree-node/cad-lazy-loader.d.ts +3 -1
- package/dist/foundation/treeNodes/cad-tree-node/cad-lazy-loader.js +33 -22
- package/dist/foundation/treeNodes/cad-tree-node/cad-node-update-styling.js +6 -6
- package/dist/foundation/treeNodes/cad-tree-node/cad-tree-node.d.ts +1 -0
- package/dist/foundation/treeNodes/cad-tree-node/cad-tree-node.js +4 -1
- package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/classic-instance-mappings-sdk.js +2 -5
- package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/core-dm-instance-mappings-sdk.d.ts +14 -0
- package/dist/foundation/treeNodes/cad-tree-node/nodes-and-instance-mappings-sdk/core-dm-instance-mappings-sdk.js +23 -0
- package/dist/ui/components/InstanceLabel/InstanceLabel.js +18 -30
- package/dist/ui/components/Reveal3DResources/Reveal3DResources.js +20 -20
- package/dist/ui/components/RevealCanvas/SDKProvider.js +6 -6
- package/dist/ui/components/RevealCanvas/UsageMetricsTrackerContext.d.ts +3 -0
- package/dist/ui/components/RevealCanvas/UsageMetricsTrackerContext.js +6 -0
- package/dist/ui/components/RevealCanvas/ViewerContext.d.ts +2 -0
- package/dist/ui/components/RevealCanvas/ViewerContext.js +5 -5
- package/dist/ui/components/RevealContext/RevealContext.js +6 -6
- package/dist/ui/components/RevealToolbar/AssetContextualizedButton.js +1 -1
- package/dist/ui/components/RuleBasedOutputs/hooks/useGetDMConnectionWithNodeFromHybridMappingsQuery.js +11 -11
- package/dist/ui/components/Widget/RevealWidget.context.d.ts +2 -1
- package/dist/ui/components/Widget/RevealWidget.context.js +1 -1
- package/dist/ui/components/Widget/RevealWidget.d.ts +11 -2
- package/dist/ui/components/Widget/RevealWidget.js +35 -20
- package/dist/ui/components/Widget/RevealWidgetCameraController.d.ts +3 -1
- package/dist/ui/components/Widget/RevealWidgetCameraController.js +12 -10
- package/dist/ui/components/Widget/RevealWidgetController.d.ts +3 -1
- package/dist/ui/components/Widget/RevealWidgetController.js +40 -33
- package/dist/ui/components/Widget/index.d.ts +1 -1
- package/dist/ui/components/Widget/styling/applyPointCloudInstanceStyling.js +5 -5
- package/dist/ui/components/Widget/useRevealWidgetMetricsTracking.d.ts +21 -0
- package/dist/ui/components/Widget/useRevealWidgetMetricsTracking.js +33 -0
- package/dist/ui/components/commandBased/Factories/DefaultIcons.js +31 -31
- package/dist/ui/components/commandBased/buttons/DropdownButton.d.ts +2 -0
- package/dist/ui/components/commandBased/buttons/DropdownButton.js +67 -48
- package/dist/ui/components/commandBased/pointsOfInterest/PoiCommentSection.js +6 -6
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.context.d.ts +16 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.context.js +6 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.d.ts +15 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.function.d.ts +5 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.function.js +14 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/CadNodeInfoDialog.js +105 -0
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.function.d.ts +13 -2
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.function.js +17 -9
- package/dist/ui/components/commandBased/treeView/DomainObjectTreeView/DomainObjectTreeView.js +27 -13
- package/dist/ui/components/commandBased/treeView/TreeView/components/tree-view-info.js +2 -2
- package/dist/ui/components/commandBased/treeView/TreeView/extraComponents/CadTreeAssetMappingDropdown.js +34 -33
- package/dist/ui/components/commandBased/treeView/TreeView/tree-view-node.js +1 -0
- package/dist/ui/components/commandBased/treeView/TreeView/tree-view-props.d.ts +1 -0
- package/dist/ui/components/commandBased/treeView/TreeView/tree-view.js +27 -25
- package/dist/ui/components/i18n/I18n.js +3 -3
- package/dist/ui/components/index.d.ts +1 -1
- package/dist/ui/hooks/network/fetchLinkFromRelationshipsByTimeseries.js +4 -4
- package/dist/ui/hooks/network/getImage360CollectionsForDmInstance.js +7 -7
- package/dist/ui/hooks/network/getTimeseriesLatestDatapoints.js +3 -3
- package/dist/ui/hooks/pointClouds/fetchAnnotationsForModel.js +4 -4
- package/dist/ui/hooks/pointClouds/usePointCloudAnnotationMappingForIntersection.js +11 -11
- package/dist/ui/hooks/pointClouds/usePointCloudAnnotationMappingsForAssetInstances.js +4 -4
- package/dist/ui/hooks/scenes/use3dScenes.js +4 -4
- package/dist/ui/query/core-dm/usePointCloudDMVolumeMappingForIntersection.js +9 -9
- package/dist/ui/query/core-dm/usePointCloudDMVolumes.js +10 -10
- package/dist/ui/query/index.d.ts +1 -0
- package/dist/ui/query/index.js +17 -16
- package/dist/ui/query/useAll3dDirectConnectionsWithProperties.js +6 -6
- package/dist/ui/query/useAssetsAndTimeseriesLinkageDataQuery.js +24 -24
- package/dist/ui/query/useAssetsAndTimeseriesLinkages.context.d.ts +3 -2
- package/dist/ui/query/useAssetsAndTimeseriesLinkages.context.js +4 -4
- package/dist/ui/query/useAssetsAndTimeseriesLinkages.js +13 -13
- package/dist/ui/query/useAssetsByIdsQuery.js +10 -11
- package/dist/ui/query/useCadNode3DInfo.d.ts +8 -0
- package/dist/ui/query/useCadNode3DInfo.js +24 -0
- package/dist/ui/query/useFetchClassicAssetsByIds.js +5 -5
- package/dist/ui/query/useFilterOnClassicAssetsInScene.js +6 -6
- package/dist/ui/query/useHybridMappingsForAssetInstances.js +9 -9
- package/dist/ui/query/useInstanceNames.d.ts +11 -0
- package/dist/ui/query/useInstanceNames.js +17 -0
- package/dist/ui/query/useInstancesByIdsQuery.context.d.ts +3 -5
- package/dist/ui/query/useInstancesByIdsQuery.context.js +4 -8
- package/dist/ui/query/useInstancesByIdsQuery.d.ts +9 -6
- package/dist/ui/query/useInstancesByIdsQuery.js +14 -23
- package/dist/ui/query/useNamedDmInstancesByIds.d.ts +12 -0
- package/dist/utilities/cache/ReadonlyEntityCache.d.ts +4 -0
- package/dist/utilities/cache/ReadonlyEntityCache.js +27 -0
- package/dist/utilities/createMixpanelUsageMetricsTracker.d.ts +23 -0
- package/dist/utilities/createMixpanelUsageMetricsTracker.js +23 -0
- package/dist/utilities/externalIndex.d.ts +2 -0
- package/dist/utilities/externalIndex.js +3 -1
- package/dist/utilities/getInstancesFromClick.js +9 -9
- package/dist/utilities/index.d.ts +2 -1
- package/dist/utilities/index.js +12 -9
- package/dist/utilities/queryKeys.d.ts +2 -0
- package/dist/utilities/queryKeys.js +7 -0
- package/dist/utilities/signal/useCombinedUpdateSignal.d.ts +9 -0
- package/dist/utilities/signal/useCombinedUpdateSignal.js +14 -0
- package/dist/utilities/signal/useMemoWithUpdateSignal.d.ts +3 -0
- package/dist/utilities/signal/useMemoWithUpdateSignal.js +13 -0
- package/dist/utilities/usageMetricsTracker.d.ts +4 -0
- package/dist/utilities/usageMetricsTracker.js +4 -0
- package/package.json +7 -3
- package/dist/ui/hooks/network/getAssetsByIds.d.ts +0 -2
- package/dist/ui/hooks/network/getAssetsByIds.js +0 -4
- package/dist/ui/query/useDmsInstanceByIdsQuery.d.ts +0 -3
- 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 {
|
|
5
|
-
import {
|
|
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,
|
|
13
|
-
if (r.length === 0 ||
|
|
14
|
-
let
|
|
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[
|
|
16
|
+
let r = n.properties[s][i], o = p.get(e(r.object3D));
|
|
17
17
|
if (o === void 0) return;
|
|
18
|
-
let
|
|
19
|
-
if (
|
|
20
|
-
...
|
|
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,
|
|
26
|
-
let
|
|
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
|
|
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:
|
|
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:
|
|
57
|
+
view: r,
|
|
58
58
|
identifier: "object3D"
|
|
59
59
|
},
|
|
60
60
|
filter: { and: [{ in: {
|
|
61
61
|
property: [
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
o,
|
|
63
|
+
r.externalId,
|
|
64
64
|
"model3D"
|
|
65
65
|
],
|
|
66
66
|
values: { parameter: "modelRefs" }
|
|
67
67
|
} }, { containsAny: {
|
|
68
68
|
property: [
|
|
69
|
-
|
|
70
|
-
|
|
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 {
|
|
5
|
-
import {
|
|
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(
|
|
11
|
-
if (
|
|
12
|
-
let u = await f(
|
|
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[
|
|
14
|
+
let o = n.properties[i][r], s = p.get(e(o.object3D));
|
|
15
15
|
if (s === void 0) return;
|
|
16
|
-
let l = c(
|
|
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
|
|
24
|
+
let r = {
|
|
25
25
|
modelRefs: e.map(([e, n]) => t(e)),
|
|
26
26
|
revisionRefs: e.map(([e, n]) => t(n))
|
|
27
|
-
},
|
|
27
|
+
}, i = {
|
|
28
28
|
...l,
|
|
29
|
-
parameters:
|
|
29
|
+
parameters: r
|
|
30
30
|
};
|
|
31
|
-
return
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
|
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 {
|
|
3
|
-
import {
|
|
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 =
|
|
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
|
|
9
|
+
for (let n of l) {
|
|
10
10
|
let i = await s(o, {
|
|
11
11
|
select: { models: { sources: [{
|
|
12
|
-
source:
|
|
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:
|
|
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 {
|
|
2
|
-
import {
|
|
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(
|
|
4
|
+
async function n(e, n, i = t) {
|
|
5
5
|
return (await i(n, {
|
|
6
6
|
...r,
|
|
7
7
|
parameters: {
|
|
8
|
-
instanceExternalId:
|
|
9
|
-
instanceSpace:
|
|
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
|
-
|
|
43
|
-
|
|
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:
|
|
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:
|
|
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 {
|
|
7
|
-
import {
|
|
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(
|
|
14
|
-
let g =
|
|
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(
|
|
17
|
+
modelReference: r(i),
|
|
18
18
|
treeIndexes: g,
|
|
19
|
-
revisionRefs: [r(
|
|
19
|
+
revisionRefs: [r(a)]
|
|
20
20
|
}
|
|
21
|
-
}, x = m(
|
|
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[
|
|
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[
|
|
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:
|
|
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
|
-
|
|
51
|
-
|
|
50
|
+
l,
|
|
51
|
+
a.externalId,
|
|
52
52
|
"model3D"
|
|
53
53
|
],
|
|
54
54
|
value: { parameter: "modelReference" }
|
|
55
55
|
} },
|
|
56
56
|
{ containsAny: {
|
|
57
57
|
property: [
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
l,
|
|
59
|
+
a.externalId,
|
|
60
60
|
"treeIndexes"
|
|
61
61
|
],
|
|
62
62
|
values: { parameter: "treeIndexes" }
|
|
63
63
|
} },
|
|
64
64
|
{ containsAny: {
|
|
65
65
|
property: [
|
|
66
|
-
|
|
67
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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 {
|
|
5
|
-
import {
|
|
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,
|
|
26
|
+
async function d(e, t, n, a, o) {
|
|
27
27
|
let s = {
|
|
28
|
-
...i(e,
|
|
28
|
+
...i(e, n, o.pageSize),
|
|
29
29
|
parameters: { revisionRefs: t }
|
|
30
|
-
}, c =
|
|
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,
|
|
33
|
+
async function f(e, t, n, i, a) {
|
|
34
34
|
let s = {
|
|
35
|
-
...o(e,
|
|
35
|
+
...o(e, n, a.pageSize),
|
|
36
36
|
parameters: { revisionRefs: t }
|
|
37
|
-
}, c =
|
|
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,
|
|
40
|
+
async function p(e, t, n, i, o) {
|
|
41
41
|
let s = {
|
|
42
|
-
...a(e, t,
|
|
42
|
+
...a(e, t, n, o.pageSize),
|
|
43
43
|
parameters: { revisionRefs: t }
|
|
44
|
-
}, c =
|
|
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,
|
|
47
|
+
function m(t, r, i) {
|
|
48
48
|
let a = [];
|
|
49
49
|
return i.forEach((i) => {
|
|
50
|
-
let o = i.properties[
|
|
51
|
-
e(o) &&
|
|
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';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ViewDefinition, CogniteClient
|
|
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:
|
|
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 {
|
|
3
|
-
import {
|
|
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
|
|
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
|
|
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:
|
|
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.
|
|
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 {
|
|
3
|
-
import {
|
|
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
|
|
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(
|
|
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
|
|
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)])
|
|
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])
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
|
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 };
|
package/dist/domains/index.d.ts
CHANGED
|
@@ -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';
|