@geode/opengeodeweb-front 12.2.0-rc.3 → 12.2.0-rc.5

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 (135) hide show
  1. package/.build/tests/browser/helpers/object_trees/common.js +3 -1
  2. package/.build/tests/browser/helpers/object_trees/model_tree_bar.js +41 -0
  3. package/.build/tests/browser/helpers/wait_for_action_settled.js +2 -2
  4. package/.build/tests/browser/suites/index.js +2 -0
  5. package/.build/tests/browser/suites/model/collections.js +1 -1
  6. package/.build/tests/browser/suites/object_tree/controls.js +2 -1
  7. package/.build/tests/browser/suites/object_tree/model_tree_bar.js +81 -0
  8. package/app/components/ClippingPlanes.vue +1 -1
  9. package/app/components/FactorFilterPanel.vue +1 -1
  10. package/app/components/Launcher.vue +3 -2
  11. package/app/components/ThresholdFilter.vue +1 -2
  12. package/app/components/Viewer/Basemap/CropOptions.vue +7 -8
  13. package/app/components/Viewer/Basemap/OpacityOptions.vue +7 -8
  14. package/app/components/Viewer/ContextMenu/CircularItems.vue +6 -43
  15. package/app/components/Viewer/ContextMenu/ContextMenu.vue +1 -6
  16. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +14 -16
  17. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +5 -4
  18. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +10 -13
  19. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +8 -11
  20. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +16 -13
  21. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +28 -31
  22. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +9 -11
  23. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +8 -11
  24. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +1 -1
  25. package/app/components/Viewer/Generic/Model/CornersOptions.vue +1 -1
  26. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +1 -1
  27. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +7 -8
  28. package/app/components/Viewer/Generic/Model/LinesOptions.vue +1 -1
  29. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +1 -1
  30. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +5 -7
  31. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +5 -7
  32. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +5 -7
  33. package/app/components/Viewer/Generic/Model/ModelStyleOptions.vue +7 -8
  34. package/app/components/Viewer/Generic/Model/PointsOptions.vue +7 -8
  35. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +1 -1
  36. package/app/components/Viewer/Grid/2D/CellsOptions.vue +6 -4
  37. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +6 -4
  38. package/app/components/Viewer/Grid/2D/PointsOptions.vue +5 -4
  39. package/app/components/Viewer/Grid/3D/CellsOptions.vue +6 -4
  40. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +6 -4
  41. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +6 -4
  42. package/app/components/Viewer/Grid/3D/PointsOptions.vue +5 -4
  43. package/app/components/Viewer/Image/ImageOptions.vue +10 -13
  44. package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +17 -1
  45. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +2 -2
  46. package/app/components/Viewer/ObjectTree/Base/Controls.vue +26 -2
  47. package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +4 -1
  48. package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +6 -8
  49. package/app/components/Viewer/ObjectTree/Box.vue +30 -5
  50. package/app/components/Viewer/ObjectTree/Layout.vue +183 -54
  51. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +10 -15
  52. package/app/components/Viewer/ObjectTree/Views/ModelTree.vue +3 -0
  53. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +28 -31
  54. package/app/components/Viewer/Scene/BackgroundOptions.vue +4 -7
  55. package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +4 -7
  56. package/app/components/Viewer/Scene/TextOptions.vue +4 -7
  57. package/app/components/Viewer/Solid/EdgesOptions.vue +6 -4
  58. package/app/components/Viewer/Solid/PointsOptions.vue +5 -4
  59. package/app/components/Viewer/Solid/PolygonsOptions.vue +6 -4
  60. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +8 -11
  61. package/app/components/Viewer/Surface/EdgesOptions.vue +6 -4
  62. package/app/components/Viewer/Surface/PointsOptions.vue +6 -4
  63. package/app/components/Viewer/Surface/PolygonsOptions.vue +8 -11
  64. package/app/components/Viewer/Surface/Triangulated/TrianglesOptions.vue +5 -4
  65. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +6 -4
  66. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +6 -4
  67. package/app/composables/circular_menu.ts +45 -0
  68. package/app/composables/hover_highlight.ts +1 -1
  69. package/app/composables/model_menu_context.ts +7 -11
  70. package/app/composables/model_tree.ts +3 -3
  71. package/app/composables/model_tree_drag.ts +56 -0
  72. package/app/composables/project_manager_helpers/types.ts +2 -3
  73. package/app/composables/use_adaptive_styles.ts +15 -8
  74. package/app/composables/use_overlapping_picker.ts +7 -19
  75. package/app/composables/viewer_context_menu.ts +2 -1
  76. package/app/composables/virtual_tree.ts +7 -1
  77. package/app/stores/api.ts +6 -59
  78. package/app/stores/app.ts +21 -55
  79. package/app/stores/back.ts +86 -145
  80. package/app/stores/camera_manager.ts +12 -25
  81. package/app/stores/cloud.ts +21 -101
  82. package/app/stores/crs.ts +3 -2
  83. package/app/stores/data.ts +66 -409
  84. package/app/stores/data_style.ts +99 -93
  85. package/app/stores/feedback.ts +57 -53
  86. package/app/stores/infra.ts +61 -101
  87. package/app/stores/treeview.ts +39 -30
  88. package/app/stores/viewer.ts +9 -29
  89. package/app/stores/viewer_helpers/actions.ts +1 -23
  90. package/app/utils/backend_lifecycle.ts +155 -0
  91. package/app/utils/import_item.ts +5 -4
  92. package/app/utils/threshold_sources.ts +3 -2
  93. package/app/utils/treeview.ts +25 -1
  94. package/app/utils/viewer_object_type.ts +21 -0
  95. package/internal/database/base_database.ts +2 -1
  96. package/internal/database/database.ts +90 -7
  97. package/internal/database/queries.ts +45 -0
  98. package/internal/database/tables/camera_positions.ts +11 -1
  99. package/internal/database/tables/data.ts +20 -1
  100. package/internal/database/tables/data_style.ts +3 -1
  101. package/internal/database/tables/model_component_datastyle.ts +3 -1
  102. package/internal/database/tables/model_component_type_datastyle.ts +3 -1
  103. package/internal/database/tables/model_components.ts +12 -1
  104. package/internal/database/tables/model_components_relation.ts +11 -1
  105. package/internal/database/tables/scene_style.ts +3 -1
  106. package/internal/database/tables/treeview_config.ts +31 -0
  107. package/internal/stores/data/items.ts +110 -0
  108. package/internal/stores/data/model/collections.ts +107 -0
  109. package/internal/stores/data/model/components.ts +129 -0
  110. package/internal/stores/data/model/mesh_components.ts +134 -0
  111. package/internal/stores/data/model/relations.ts +76 -0
  112. package/internal/stores/data/model/types.ts +14 -0
  113. package/internal/stores/data/registration.ts +54 -0
  114. package/internal/stores/data/snapshot.ts +83 -0
  115. package/internal/stores/data/types.ts +26 -0
  116. package/internal/stores/data_style/model/common_mutations.ts +47 -77
  117. package/internal/stores/data_style/model/selection.ts +3 -10
  118. package/internal/stores/data_style/scene.ts +2 -2
  119. package/internal/stores/data_style/state.ts +10 -8
  120. package/internal/stores/data_style/state_shared.ts +10 -7
  121. package/internal/stores/hybrid_viewer/brightness.ts +36 -19
  122. package/internal/stores/hybrid_viewer/highlight.ts +9 -14
  123. package/internal/stores/hybrid_viewer/scene.ts +1 -1
  124. package/internal/stores/microservice.ts +192 -0
  125. package/package.json +1 -1
  126. package/tests/browser/helpers/data/helpers/attribute.ts +2 -1
  127. package/tests/browser/helpers/object_trees/common.ts +4 -0
  128. package/tests/browser/helpers/object_trees/model_tree_bar.ts +78 -0
  129. package/tests/browser/helpers/wait_for_action_settled.ts +2 -3
  130. package/tests/browser/suites/model/collections.ts +2 -1
  131. package/tests/browser/suites/object_tree/controls.ts +3 -0
  132. package/tests/browser/suites/object_tree/model_tree_bar.ts +125 -0
  133. package/app/stores/data_helpers/collections.ts +0 -122
  134. package/app/stores/data_helpers/mesh.ts +0 -167
  135. package/app/stores/data_helpers/relations.ts +0 -94
@@ -1,16 +1,14 @@
1
1
  <script setup lang="ts">
2
- import ViewerContextMenuItem, {
3
- type ItemProps,
4
- } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
5
2
  import type { ColorRGBA } from "@geode/opengeodeweb-viewer/schema_types";
3
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
6
4
  import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
7
5
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
8
6
 
9
7
  interface Props {
10
- itemProps: ItemProps & { index: number };
8
+ index: number;
11
9
  }
12
10
 
13
- const { itemProps } = defineProps<Props>();
11
+ const { index } = defineProps<Props>();
14
12
 
15
13
  const dataStyleStore = useDataStyleStore();
16
14
 
@@ -25,8 +23,7 @@ const backgroundColor = computed<ColorRGBA>({
25
23
  <template>
26
24
  <ViewerContextMenuItem
27
25
  data-testid="sceneBackgroundMenu"
28
- :index="itemProps.index"
29
- :itemProps="itemProps"
26
+ :index="index"
30
27
  tooltip="Background"
31
28
  btnIcon="ph-image"
32
29
  >
@@ -1,16 +1,14 @@
1
1
  <script setup lang="ts">
2
- import ViewerContextMenuItem, {
3
- type ItemProps,
4
- } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
5
2
  import type { SceneOrientationWidget } from "@ogw_internal/stores/data_style/types";
3
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
6
4
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
7
5
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
8
6
 
9
7
  interface Props {
10
- itemProps: ItemProps & { index: number };
8
+ index: number;
11
9
  }
12
10
 
13
- const { itemProps } = defineProps<Props>();
11
+ const { index } = defineProps<Props>();
14
12
 
15
13
  const dataStyleStore = useDataStyleStore();
16
14
  const hybridViewerStore = useHybridViewerStore();
@@ -27,8 +25,7 @@ const orientationWidget = computed<SceneOrientationWidget>({
27
25
  <template>
28
26
  <ViewerContextMenuItem
29
27
  data-testid="sceneOrientationWidgetMenu"
30
- :index="itemProps.index"
31
- :itemProps="itemProps"
28
+ :index="index"
32
29
  tooltip="Orientation widget"
33
30
  btnIcon="ph-compass"
34
31
  >
@@ -1,18 +1,16 @@
1
1
  <script setup lang="ts">
2
- import ViewerContextMenuItem, {
3
- type ItemProps,
4
- } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
5
2
  import type { ColorRGBA } from "@geode/opengeodeweb-viewer/schema_types";
6
3
  import type { SceneFontFamily } from "@ogw_internal/stores/data_style/types";
4
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
7
5
  import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
8
6
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
9
7
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
10
8
 
11
9
  interface Props {
12
- itemProps: ItemProps & { index: number };
10
+ index: number;
13
11
  }
14
12
 
15
- const { itemProps } = defineProps<Props>();
13
+ const { index } = defineProps<Props>();
16
14
 
17
15
  const dataStyleStore = useDataStyleStore();
18
16
  const hybridViewerStore = useHybridViewerStore();
@@ -43,8 +41,7 @@ const fontFamily = computed<SceneFontFamily>({
43
41
  <template>
44
42
  <ViewerContextMenuItem
45
43
  data-testid="sceneTextMenu"
46
- :index="itemProps.index"
47
- :itemProps="itemProps"
44
+ :index="index"
48
45
  tooltip="Text"
49
46
  btnIcon="ph-text-aa"
50
47
  >
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
3
  import SolidEdges from "@ogw_front/assets/viewer_svgs/solid_edges.svg";
4
4
  import ViewerGenericMeshEdgesOptions from "@ogw_front/components/Viewer/Generic/Mesh/EdgesOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshEdgesOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="SolidEdges"
17
19
  :capabilities="{ edge: { available: false } }"
18
20
  />
@@ -1,15 +1,16 @@
1
1
  <script setup lang="ts">
2
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
3
  import SolidPoints from "@ogw_front/assets/viewer_svgs/solid_points.svg";
4
4
  import ViewerGenericMeshPointsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PointsOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
- <ViewerGenericMeshPointsOptions :itemProps="itemProps" :btnImage="SolidPoints" />
15
+ <ViewerGenericMeshPointsOptions :data-id="dataId" :index="index" :btnImage="SolidPoints" />
15
16
  </template>
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
3
  import SolidFacets from "@ogw_front/assets/viewer_svgs/solid_facets.svg";
4
4
  import ViewerGenericMeshPolygonsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PolygonsOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshPolygonsOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="SolidFacets"
17
19
  :capabilities="{ textures: { available: false } }"
18
20
  />
@@ -1,9 +1,8 @@
1
1
  <script setup lang="ts">
2
- import ViewerContextMenuItem, {
3
- type ItemProps,
4
- } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
5
3
  import type { MeshId } from "@ogw_front/types/identifiers";
6
4
  import SolidPolyhedra from "@ogw_front/assets/viewer_svgs/solid_polyhedra.svg";
5
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
7
6
  import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
8
7
  import ViewerSolidSpecificPolyhedraColoring from "@ogw_front/components/Viewer/Solid/SpecificPolyhedraColoring.vue";
9
8
  import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types";
@@ -16,18 +15,17 @@ const hybridViewerStore = useHybridViewerStore();
16
15
  const { applyBatchStyle } = useBatchStyle();
17
16
 
18
17
  interface Props {
19
- itemProps: ItemProps & { index: number };
18
+ dataId: DataId;
19
+ index: number;
20
20
  tooltip?: string;
21
21
  }
22
22
 
23
- const { itemProps, tooltip = "Polyhedra options" } = defineProps<Props>();
24
-
25
- const dataId = toRef(() => itemProps.id);
23
+ const { dataId, index, tooltip = "Polyhedra options" } = defineProps<Props>();
26
24
 
27
25
  const visibility = computed<Visibility>({
28
- get: () => dataStyleStore.meshPolyhedraVisibility(dataId.value),
26
+ get: () => dataStyleStore.meshPolyhedraVisibility(dataId),
29
27
  set: async (newValue) => {
30
- await applyBatchStyle(dataId.value, (meshId: MeshId) =>
28
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
31
29
  dataStyleStore.setMeshPolyhedraVisibility(meshId, newValue),
32
30
  );
33
31
  hybridViewerStore.remoteRender();
@@ -38,8 +36,7 @@ const visibility = computed<Visibility>({
38
36
  <template>
39
37
  <ViewerContextMenuItem
40
38
  data-testid="meshPolyhedraMenu"
41
- :index="itemProps.index"
42
- :itemProps="itemProps"
39
+ :index="index"
43
40
  :tooltip="tooltip"
44
41
  :btnImage="SolidPolyhedra"
45
42
  >
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
3
  import SurfaceEdges from "@ogw_front/assets/viewer_svgs/surface_edges.svg";
4
4
  import ViewerGenericMeshEdgesOptions from "@ogw_front/components/Viewer/Generic/Mesh/EdgesOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshEdgesOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="SurfaceEdges"
17
19
  :capabilities="{ edge: { available: false } }"
18
20
  />
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
3
  import TriangulatedSurfaceEdgesPoints from "@ogw_front/assets/viewer_svgs/surface_points.svg";
4
4
  import ViewerGenericMeshPointsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PointsOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshPointsOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="TriangulatedSurfaceEdgesPoints"
17
19
  />
18
20
  </template>
@@ -1,9 +1,8 @@
1
1
  <script setup lang="ts">
2
- import ViewerContextMenuItem, {
3
- type ItemProps,
4
- } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
5
3
  import type { MeshId } from "@ogw_front/types/identifiers";
6
4
  import PolygonalSurfacePolygons from "@ogw_front/assets/viewer_svgs/surface_triangles.svg";
5
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
7
6
  import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
8
7
  import ViewerSurfacePolygonsColoring from "@ogw_front/components/Viewer/Surface/PolygonsColoring.vue";
9
8
  import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types";
@@ -16,18 +15,17 @@ const hybridViewerStore = useHybridViewerStore();
16
15
  const { applyBatchStyle } = useBatchStyle();
17
16
 
18
17
  interface Props {
19
- itemProps: ItemProps & { index: number };
18
+ dataId: DataId;
19
+ index: number;
20
20
  tooltip?: string;
21
21
  }
22
22
 
23
- const { itemProps, tooltip = "Polygons options" } = defineProps<Props>();
24
-
25
- const dataId = toRef(() => itemProps.id);
23
+ const { dataId, index, tooltip = "Polygons options" } = defineProps<Props>();
26
24
 
27
25
  const visibility = computed<Visibility>({
28
- get: () => dataStyleStore.meshPolygonsVisibility(dataId.value),
26
+ get: () => dataStyleStore.meshPolygonsVisibility(dataId),
29
27
  set: async (newValue) => {
30
- await applyBatchStyle(dataId.value, (meshId: MeshId) =>
28
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
31
29
  dataStyleStore.setMeshPolygonsVisibility(meshId, newValue),
32
30
  );
33
31
  hybridViewerStore.remoteRender();
@@ -38,8 +36,7 @@ const visibility = computed<Visibility>({
38
36
  <template>
39
37
  <ViewerContextMenuItem
40
38
  data-testid="meshPolygonsMenu"
41
- :index="itemProps.index"
42
- :itemProps="itemProps"
39
+ :index="index"
43
40
  :tooltip="tooltip"
44
41
  :btnImage="PolygonalSurfacePolygons"
45
42
  >
@@ -1,14 +1,15 @@
1
1
  <script setup lang="ts">
2
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
3
  import ViewerSpecificPolygonsOptions from "@ogw_front/components/Viewer/Surface/PolygonsOptions.vue";
4
4
 
5
5
  interface Props {
6
- itemProps: ItemProps & { index: number };
6
+ dataId: DataId;
7
+ index: number;
7
8
  }
8
9
 
9
- const { itemProps } = defineProps<Props>();
10
+ const { dataId, index } = defineProps<Props>();
10
11
  </script>
11
12
 
12
13
  <template>
13
- <ViewerSpecificPolygonsOptions :itemProps="itemProps" tooltip="Triangles options" />
14
+ <ViewerSpecificPolygonsOptions :data-id="dataId" :index="index" tooltip="Triangles options" />
14
15
  </template>
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
3
  import TetrahedralSolidTetrahedra from "@ogw_front/assets/viewer_svgs/solid_polyhedra.svg";
4
4
  import ViewerGenericMeshPolyhedraOptions from "@ogw_front/components/Viewer/Generic/Mesh/PolyhedraOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshPolyhedraOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="TetrahedralSolidTetrahedra"
17
19
  tooltip="Tetrahedra options"
18
20
  />
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
3
  import TetrahedralSolidTriangles from "@ogw_front/assets/viewer_svgs/solid_facets.svg";
4
4
  import ViewerGenericMeshPolygonsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PolygonsOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshPolygonsOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="TetrahedralSolidTriangles"
17
19
  tooltip="Triangles options"
18
20
  />
@@ -0,0 +1,45 @@
1
+ import { type ComputedRef, type InjectionKey, computed, inject, provide } from "vue";
2
+
3
+ type MenuSide = "right" | "top" | "left" | "bottom";
4
+
5
+ const FULL_ANGLE = 360;
6
+ const ANGLE_45 = 45;
7
+ const ANGLE_135 = 135;
8
+ const ANGLE_225 = 225;
9
+ const ANGLE_315 = 315;
10
+
11
+ const OPPOSITE_SIDE: Record<MenuSide, MenuSide> = {
12
+ right: "left",
13
+ top: "bottom",
14
+ left: "right",
15
+ bottom: "top",
16
+ };
17
+
18
+ const MENU_ITEM_COUNT_KEY: InjectionKey<ComputedRef<number>> = Symbol("menu_item_count");
19
+
20
+ // The circular menu shares its item count with its items: each one places itself on the circle
21
+ function provideMenuItemCount(count: () => number): void {
22
+ provide(MENU_ITEM_COUNT_KEY, computed(count));
23
+ }
24
+
25
+ function injectMenuItemCount(): ComputedRef<number> {
26
+ return inject(MENU_ITEM_COUNT_KEY, () => computed(() => 1), true);
27
+ }
28
+
29
+ // Side of the circle an item sits on, where its tooltip shows
30
+ function menuItemSide(index: number, count: number): MenuSide {
31
+ const angle = (index / count) * FULL_ANGLE;
32
+ if (angle < ANGLE_45 || angle >= ANGLE_315) {
33
+ return "right";
34
+ }
35
+ if (angle < ANGLE_135) {
36
+ return "top";
37
+ }
38
+ if (angle < ANGLE_225) {
39
+ return "left";
40
+ }
41
+ return "bottom";
42
+ }
43
+
44
+ export { OPPOSITE_SIDE, injectMenuItemCount, menuItemSide, provideMenuItemCount };
45
+ export type { MenuSide };
@@ -56,7 +56,7 @@ function useHoverhighlight(): {
56
56
  async function highlightAction(): Promise<void> {
57
57
  currentId = dataId;
58
58
 
59
- if (!(await dataStore.isItemViewable(dataId))) {
59
+ if (!dataStore.isViewable(dataId)) {
60
60
  return;
61
61
  }
62
62
 
@@ -1,8 +1,9 @@
1
1
  import { type ComputedRef, type Ref, computed, ref, watch } from "vue";
2
+ import { type MenuViewerObjectType, useMenuStore } from "@ogw_front/stores/menu";
2
3
  import type { ModelId, ModelIdentified } from "@ogw_front/types/identifiers";
3
- import type { CollectionComponent } from "@ogw_front/stores/data_helpers/collections";
4
+ import type { CollectionComponent } from "@ogw_internal/stores/data/model/collections";
5
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
4
6
  import { MESH_COMPONENT_TYPES } from "@ogw_front/utils/default_styles";
5
- import type { MenuViewerObjectType } from "@ogw_front/stores/menu";
6
7
  import { useDataStore } from "@ogw_front/stores/data";
7
8
 
8
9
  interface ModelMenuMetaData extends Partial<ModelIdentified> {
@@ -12,11 +13,6 @@ interface ModelMenuMetaData extends Partial<ModelIdentified> {
12
13
  targetComponentIds?: string[];
13
14
  }
14
15
 
15
- interface ModelMenuItemProps {
16
- id: string;
17
- meta_data: Record<string, unknown>;
18
- }
19
-
20
16
  interface ModelMenuContext {
21
17
  modelId: ComputedRef<ModelId>;
22
18
  componentId: ComputedRef<string | undefined>;
@@ -27,12 +23,13 @@ interface ModelMenuContext {
27
23
 
28
24
  // Resolves what a model context menu targets: the whole model, a component type, a collection or one component
29
25
  // oxlint-disable-next-line max-lines-per-function
30
- function useModelMenuContext(getItemProps: () => ModelMenuItemProps): ModelMenuContext {
26
+ function useModelMenuContext(getDataId: () => DataId): ModelMenuContext {
31
27
  const dataStore = useDataStore();
28
+ const menuStore = useMenuStore();
32
29
  // oxlint-disable-next-line no-unsafe-type-assertion -- meta_data is filled by the viewer context menu with these keys.
33
- const metaData = computed(() => getItemProps().meta_data as ModelMenuMetaData);
30
+ const metaData = computed(() => menuStore.current_meta_data as ModelMenuMetaData);
34
31
 
35
- const modelId = computed<string>(() => metaData.value.modelId ?? getItemProps().id);
32
+ const modelId = computed<string>(() => metaData.value.modelId ?? getDataId());
36
33
  const componentId = computed<string | undefined>(() => metaData.value.pickedComponentId);
37
34
  const componentType = ref<string | undefined>(undefined);
38
35
  const collections = ref<CollectionComponent[] | undefined>(undefined);
@@ -104,4 +101,3 @@ function useModelMenuContext(getItemProps: () => ModelMenuItemProps): ModelMenuC
104
101
  }
105
102
 
106
103
  export { useModelMenuContext };
107
- export type { ModelMenuItemProps };
@@ -1,13 +1,13 @@
1
1
  import type {
2
2
  CollectionComponent,
3
3
  CollectionComponentGroup,
4
- } from "@ogw_front/stores/data_helpers/collections";
4
+ } from "@ogw_internal/stores/data/model/collections";
5
5
  import { type FilterableItem, sortAndFormatItems } from "@ogw_front/composables/tree_filter";
6
6
  import type {
7
7
  FormattedComponent,
8
8
  FormattedComponentGroup,
9
- } from "@ogw_front/stores/data_helpers/mesh";
10
- import type { ComponentRelations } from "@ogw_front/stores/data_helpers/relations";
9
+ } from "@ogw_internal/stores/data/model/mesh_components";
10
+ import type { ComponentRelations } from "@ogw_internal/stores/data/model/relations";
11
11
  import type { ModelId } from "@ogw_front/types/identifiers";
12
12
  import { compareSelections } from "@ogw_front/utils/treeview";
13
13
  import { useDataStore } from "@ogw_front/stores/data";
@@ -0,0 +1,56 @@
1
+ import { useTreeviewStore } from "@ogw_front/stores/treeview";
2
+
3
+ // A drop target has to accept the drag over it
4
+ function onDragOver(event: DragEvent): void {
5
+ event.preventDefault();
6
+ }
7
+
8
+ // Model trees are reordered by dragging their panel header or their button in the activity bar
9
+ export function useModelTreeDrag(): {
10
+ draggedId: Ref<string | undefined>;
11
+ dropTargetId: Ref<string | undefined>;
12
+ onDragStart: (id: string) => void;
13
+ onDragOver: (event: DragEvent) => void;
14
+ onDragEnd: () => void;
15
+ onDrop: (targetId: string) => void;
16
+ dropSide: (targetId: string) => string | undefined;
17
+ } {
18
+ const treeviewStore = useTreeviewStore();
19
+ const draggedId = ref<string | undefined>(undefined);
20
+ // Model button hovered while dragging another one: the line shows where the dragged one lands
21
+ const dropTargetId = ref<string | undefined>(undefined);
22
+
23
+ function viewIndex(id: string): number {
24
+ return treeviewStore.opened_views.findIndex((view) => view.id === id);
25
+ }
26
+
27
+ function onDragStart(id: string): void {
28
+ draggedId.value = id;
29
+ }
30
+
31
+ function onDragEnd(): void {
32
+ draggedId.value = undefined;
33
+ dropTargetId.value = undefined;
34
+ }
35
+
36
+ function onDrop(targetId: string): void {
37
+ if (draggedId.value !== undefined && draggedId.value !== targetId) {
38
+ treeviewStore.moveView(viewIndex(draggedId.value), viewIndex(targetId));
39
+ }
40
+ onDragEnd();
41
+ }
42
+
43
+ // The dragged tree takes the place of the target: before it when moving up, after it when moving down
44
+ function dropSide(targetId: string): string | undefined {
45
+ if (
46
+ draggedId.value === undefined ||
47
+ dropTargetId.value !== targetId ||
48
+ draggedId.value === targetId
49
+ ) {
50
+ return undefined;
51
+ }
52
+ return viewIndex(draggedId.value) > viewIndex(targetId) ? "drop-before" : "drop-after";
53
+ }
54
+
55
+ return { draggedId, dropTargetId, onDragStart, onDragOver, onDragEnd, onDrop, dropSide };
56
+ }
@@ -3,11 +3,10 @@ import type { CRS } from "@geode/opengeodeweb-back/schema_types";
3
3
  import type { CameraSnapshot } from "@ogw_internal/stores/hybrid_viewer/camera";
4
4
  import type { DataStyleSnapshot } from "@ogw_front/stores/data_style";
5
5
  import type { LegacyDataId } from "@ogw_front/utils/legacy_data_id";
6
- import type { ModelComponentRecord } from "@ogw_front/stores/data_helpers/mesh.js";
7
- import type { ModelComponentRelationRecord } from "@ogw_front/stores/data_helpers/relations";
6
+ import type { ModelComponentRecord } from "@ogw_internal/stores/data/model/mesh_components";
7
+ import type { ModelComponentRelationRecord } from "@ogw_internal/stores/data/model/relations";
8
8
  import type { NewDataItem } from "@ogw_front/stores/data";
9
9
  import type { TreeviewSnapshot } from "@ogw_front/stores/treeview";
10
-
11
10
  // Projects saved before data_id existed hold the data id of their rows as `id`
12
11
  interface ProjectDataSnapshot {
13
12
  items: (LegacyDataId<NewDataItem> | NewDataItem)[];
@@ -1,3 +1,4 @@
1
+ import type { BrightnessRange } from "@ogw_internal/stores/hybrid_viewer/brightness";
1
2
  import type { MaybeComputedElementRef } from "@vueuse/core";
2
3
  import { consola } from "consola";
3
4
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
@@ -62,9 +63,10 @@ function getValue(val: unknown): number {
62
63
  }
63
64
 
64
65
  // How much the glass has to cover its backdrop to keep the text readable: dark text (light theme)
65
- // Needs it over a dark backdrop, light text (dark theme) over a bright one. Same curve both ways.
66
- function contrastFactor(brightness: number, isDark: boolean): number {
67
- const backdrop = isDark ? 1 - brightness : brightness;
66
+ // Needs it over the darkest pixel of the backdrop, light text (dark theme) over the brightest one. Same curve
67
+ // Both ways.
68
+ function contrastFactor(range: BrightnessRange, isDark: boolean): number {
69
+ const backdrop = isDark ? 1 - range.brightest : range.darkest;
68
70
  const normalized = Math.min(1, backdrop / LUMINANCE_THRESHOLD);
69
71
  return (1 - normalized) ** ADAPTIVE_EXPONENT;
70
72
  }
@@ -76,7 +78,7 @@ interface GlassStyles {
76
78
  }
77
79
 
78
80
  function useGlassStyles(
79
- brightness: Ref<number>,
81
+ brightness: Ref<BrightnessRange>,
80
82
  options: AdaptiveStylesOptions,
81
83
  ): ComputedRef<GlassStyles> {
82
84
  const theme = useTheme();
@@ -99,12 +101,12 @@ function useGlassStyles(
99
101
  }
100
102
 
101
103
  // oxlint-disable max-lines-per-function
102
- export function useAdaptiveStyles(
104
+ function useAdaptiveStyles(
103
105
  target: AdaptiveStylesTarget,
104
106
  options: AdaptiveStylesOptions = {},
105
107
  ): {
106
108
  adaptiveStyles: ComputedRef<GlassStyles>;
107
- brightness: Ref<number>;
109
+ brightness: Ref<BrightnessRange>;
108
110
  } {
109
111
  const hybridViewerStore = useHybridViewerStore();
110
112
  const treeviewStore = useTreeviewStore();
@@ -154,10 +156,13 @@ export function useAdaptiveStyles(
154
156
  const width = computed(() => unwrapped.value.width);
155
157
  const height = computed(() => unwrapped.value.height);
156
158
 
157
- const brightness = ref(LUMINANCE_THRESHOLD);
159
+ const brightness = ref<BrightnessRange>({
160
+ darkest: LUMINANCE_THRESHOLD,
161
+ brightest: LUMINANCE_THRESHOLD,
162
+ });
158
163
 
159
164
  function calculateBrightness(): void {
160
- brightness.value = hybridViewerStore.getAverageBrightness({
165
+ brightness.value = hybridViewerStore.getBrightnessRange({
161
166
  x: x.value,
162
167
  y: y.value,
163
168
  width: width.value,
@@ -207,3 +212,5 @@ export function useAdaptiveStyles(
207
212
  brightness,
208
213
  };
209
214
  }
215
+
216
+ export { contrastFactor, useAdaptiveStyles };