@geode/opengeodeweb-front 10.43.2 → 10.44.0-rc.10

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 (254) hide show
  1. package/.build/server/utils/cleanup.js +7 -2
  2. package/.build/server/utils/microservices.js +9 -81
  3. package/.build/server/utils/microservices_process.js +85 -0
  4. package/.build/server/utils/scripts.js +34 -23
  5. package/.build/server/utils/typed_handler.js +5 -1
  6. package/.build/server/utils/ws_client.js +7 -2
  7. package/.build/shared/utils/fetch_raw.js +2 -2
  8. package/.build/shared/utils/parse_boolean.js +2 -1
  9. package/app/assets/geode_objects.ts +1 -0
  10. package/app/components/BasemapAttribution.vue +28 -0
  11. package/app/components/ClippingPlanes.vue +22 -78
  12. package/app/components/CrsSelector.vue +53 -46
  13. package/app/components/DragAndDrop.vue +16 -79
  14. package/app/components/FeedBack/Snackers.vue +27 -0
  15. package/app/components/FileSelector.vue +9 -6
  16. package/app/components/HybridViewerTooltip.vue +8 -2
  17. package/app/components/MissingFilesSelector.vue +40 -23
  18. package/app/components/ObjectSelector.vue +34 -20
  19. package/app/components/ProjectCrs.vue +37 -0
  20. package/app/components/Screenshot.vue +17 -59
  21. package/app/components/ThresholdCard.vue +205 -0
  22. package/app/components/ThresholdFilter.vue +81 -216
  23. package/app/components/ViewToolbar.vue +15 -231
  24. package/app/components/Viewer/Basemap/CropOptions.vue +50 -0
  25. package/app/components/Viewer/Basemap/OpacityOptions.vue +52 -0
  26. package/app/components/Viewer/ContextMenu/CircularItems.vue +1 -2
  27. package/app/components/Viewer/ContextMenu/ContextMenu.vue +11 -6
  28. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +10 -7
  29. package/app/components/Viewer/ContextMenu/InfoCard.vue +30 -0
  30. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +209 -0
  31. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +3 -191
  32. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +221 -0
  33. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +3 -210
  34. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +211 -0
  35. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -192
  36. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +13 -0
  37. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +227 -0
  38. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +3 -215
  39. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +221 -0
  40. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +3 -203
  41. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +14 -12
  42. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +2 -18
  43. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +145 -0
  44. package/app/components/Viewer/Generic/Model/CornersOptions.vue +15 -294
  45. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +173 -0
  46. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +218 -0
  47. package/app/components/Viewer/Generic/Model/LinesOptions.vue +15 -427
  48. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +229 -0
  49. package/app/components/Viewer/Generic/Model/ModelCardTabs.vue +35 -0
  50. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +34 -25
  51. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +34 -25
  52. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +17 -5
  53. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +16 -12
  54. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +4 -1
  55. package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +71 -1
  56. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +55 -10
  57. package/app/components/Viewer/Options/AttributeRangeSelector.vue +11 -4
  58. package/app/components/Viewer/Options/AttributeSelector.vue +40 -136
  59. package/app/components/Viewer/Options/ColorPicker.vue +4 -1
  60. package/app/components/Viewer/Options/ColoringTypeSelector.vue +48 -74
  61. package/app/components/Viewer/Options/ColormapQuickPicker.vue +13 -7
  62. package/app/components/Viewer/Options/NoDataColorInfo.vue +56 -0
  63. package/app/components/Viewer/Options/Sliders/Opacity.vue +22 -0
  64. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +13 -0
  65. package/app/components/Viewer/Scene/BackgroundOptions.vue +37 -0
  66. package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +48 -0
  67. package/app/components/Viewer/Scene/TextOptions.vue +63 -0
  68. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +217 -0
  69. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +4 -199
  70. package/app/components/Viewer/Surface/PolygonsColoring.vue +224 -0
  71. package/app/components/Viewer/Surface/PolygonsOptions.vue +3 -213
  72. package/app/components/Viewer/Ui.vue +9 -0
  73. package/app/components/csv-preview/CsvPreviewer.vue +4 -1
  74. package/app/composables/attribute_coloring_style.ts +8 -2
  75. package/app/composables/attribute_selector.ts +126 -0
  76. package/app/composables/batch_style_model.ts +34 -0
  77. package/app/composables/clipping_slices.ts +166 -0
  78. package/app/composables/global_attribute_style.ts +4 -3
  79. package/app/composables/hover_highlight.ts +19 -18
  80. package/app/composables/live_data_item.ts +39 -0
  81. package/app/composables/model_tabs.ts +86 -0
  82. package/app/composables/overlapping_picker_menu.ts +43 -0
  83. package/app/composables/project_manager.ts +5 -81
  84. package/app/composables/project_manager_helpers/reset.ts +34 -0
  85. package/app/composables/project_manager_helpers/restore.ts +67 -0
  86. package/app/composables/project_manager_helpers/types.ts +24 -0
  87. package/app/composables/project_manager_helpers/viewer_session.ts +25 -0
  88. package/app/composables/stepper_tree.ts +10 -2
  89. package/app/composables/tree_filter.ts +11 -2
  90. package/app/composables/tree_keyboard_nav.ts +4 -2
  91. package/app/composables/use_overlapping_picker.ts +30 -42
  92. package/app/composables/view_toolbar_options.ts +126 -0
  93. package/app/composables/view_toolbar_tool_options.ts +115 -0
  94. package/app/composables/view_toolbar_tools.ts +108 -0
  95. package/app/composables/viewer_context_menu.ts +19 -1
  96. package/app/composables/virtual_tree.ts +20 -131
  97. package/app/composables/virtual_tree_flatten.ts +109 -0
  98. package/app/composables/virtual_tree_types.ts +81 -0
  99. package/app/stores/app.ts +8 -55
  100. package/app/stores/app_helpers/extension.ts +90 -51
  101. package/app/stores/app_helpers/registry.ts +69 -0
  102. package/app/stores/basemap.ts +52 -0
  103. package/app/stores/basemap_detail.ts +51 -0
  104. package/app/stores/basemap_helpers/builds.ts +158 -0
  105. package/app/stores/basemap_helpers/detail_layers.ts +72 -0
  106. package/app/stores/basemap_helpers/detail_map.ts +62 -0
  107. package/app/stores/basemap_helpers/detail_refresh.ts +134 -0
  108. package/app/stores/basemap_helpers/detail_view.ts +94 -0
  109. package/app/stores/basemap_helpers/extent.ts +40 -0
  110. package/app/stores/basemap_helpers/georeferenced.ts +50 -0
  111. package/app/stores/basemap_helpers/layers.ts +66 -0
  112. package/app/stores/basemap_helpers/settings.ts +87 -0
  113. package/app/stores/basemap_helpers/viewer.ts +114 -0
  114. package/app/stores/crs.ts +136 -0
  115. package/app/stores/data.ts +24 -1
  116. package/app/stores/data_style.ts +8 -0
  117. package/app/stores/feedback.ts +12 -2
  118. package/app/stores/hybrid_viewer.ts +1 -1
  119. package/app/stores/infra.ts +26 -21
  120. package/app/stores/menu.ts +8 -124
  121. package/app/stores/menu_helpers/basemap.ts +10 -0
  122. package/app/stores/menu_helpers/menus_data.ts +27 -0
  123. package/app/stores/menu_helpers/mesh/edged_curve.ts +12 -0
  124. package/app/stores/menu_helpers/mesh/grid.ts +24 -0
  125. package/app/stores/menu_helpers/mesh/point_set.ts +11 -0
  126. package/app/stores/menu_helpers/mesh/solid.ts +29 -0
  127. package/app/stores/menu_helpers/mesh/surface.ts +22 -0
  128. package/app/stores/menu_helpers/model.ts +25 -0
  129. package/app/stores/menu_helpers/scene.ts +10 -0
  130. package/app/stores/menu_helpers/types.ts +5 -0
  131. package/app/stores/treeview.ts +17 -10
  132. package/app/stores/viewer.ts +17 -79
  133. package/app/stores/viewer_helpers/actions.ts +68 -0
  134. package/app/stores/viewer_helpers/request.ts +61 -0
  135. package/app/utils/basemap_tree.ts +76 -0
  136. package/app/utils/clipping_planes.ts +4 -131
  137. package/app/utils/clipping_planes_scene.ts +131 -0
  138. package/app/utils/color_picker.ts +18 -15
  139. package/app/utils/coloring_styles.ts +101 -0
  140. package/app/utils/crs.ts +38 -0
  141. package/app/utils/default_styles/constants.ts +10 -0
  142. package/app/utils/default_styles/index.ts +17 -1
  143. package/app/utils/default_styles/mesh_components.ts +168 -0
  144. package/app/utils/default_styles/meshes.ts +13 -153
  145. package/app/utils/default_styles/model_components.ts +170 -0
  146. package/app/utils/default_styles/models.ts +16 -153
  147. package/app/utils/drag_and_drop.ts +80 -0
  148. package/app/utils/extension.ts +1 -1
  149. package/app/utils/import_workflow.ts +26 -11
  150. package/app/utils/model_component_coloring.ts +46 -0
  151. package/app/utils/threshold.ts +33 -0
  152. package/app/utils/threshold_sources.ts +51 -0
  153. package/app/utils/treeview.ts +12 -1
  154. package/app/utils/upload_path.ts +15 -9
  155. package/app/utils/visible_map_area.ts +129 -0
  156. package/internal/database/base_database.ts +2 -0
  157. package/internal/database/database.ts +47 -29
  158. package/internal/database/tables/scene_style.ts +6 -0
  159. package/internal/stores/data_style/mesh/base_style.ts +74 -0
  160. package/internal/stores/data_style/mesh/cells/cell.ts +27 -150
  161. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +74 -0
  162. package/internal/stores/data_style/mesh/cells/cell_config.ts +152 -0
  163. package/internal/stores/data_style/mesh/cells/color.ts +3 -1
  164. package/internal/stores/data_style/mesh/cells/index.ts +17 -1
  165. package/internal/stores/data_style/mesh/cells/opacity.ts +54 -0
  166. package/internal/stores/data_style/mesh/cells/vertex.ts +26 -157
  167. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +80 -0
  168. package/internal/stores/data_style/mesh/cells/vertex_config.ts +152 -0
  169. package/internal/stores/data_style/mesh/edges/color.ts +3 -1
  170. package/internal/stores/data_style/mesh/edges/edge.ts +27 -150
  171. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +74 -0
  172. package/internal/stores/data_style/mesh/edges/edge_config.ts +152 -0
  173. package/internal/stores/data_style/mesh/edges/index.ts +17 -1
  174. package/internal/stores/data_style/mesh/edges/opacity.ts +54 -0
  175. package/internal/stores/data_style/mesh/edges/vertex.ts +26 -157
  176. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +80 -0
  177. package/internal/stores/data_style/mesh/edges/vertex_config.ts +152 -0
  178. package/internal/stores/data_style/mesh/index.ts +2 -57
  179. package/internal/stores/data_style/mesh/points/color.ts +3 -1
  180. package/internal/stores/data_style/mesh/points/index.ts +17 -1
  181. package/internal/stores/data_style/mesh/points/opacity.ts +54 -0
  182. package/internal/stores/data_style/mesh/points/vertex.ts +26 -157
  183. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +80 -0
  184. package/internal/stores/data_style/mesh/points/vertex_config.ts +152 -0
  185. package/internal/stores/data_style/mesh/polygons/color.ts +3 -1
  186. package/internal/stores/data_style/mesh/polygons/index.ts +17 -1
  187. package/internal/stores/data_style/mesh/polygons/opacity.ts +54 -0
  188. package/internal/stores/data_style/mesh/polygons/polygon.ts +27 -152
  189. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +80 -0
  190. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +148 -0
  191. package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -157
  192. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +80 -0
  193. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +152 -0
  194. package/internal/stores/data_style/mesh/polyhedra/color.ts +3 -1
  195. package/internal/stores/data_style/mesh/polyhedra/index.ts +17 -1
  196. package/internal/stores/data_style/mesh/polyhedra/opacity.ts +54 -0
  197. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -160
  198. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +82 -0
  199. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +157 -0
  200. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -157
  201. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +80 -0
  202. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +152 -0
  203. package/internal/stores/data_style/model/blocks/apply_coloring.ts +173 -0
  204. package/internal/stores/data_style/model/blocks/color.ts +58 -57
  205. package/internal/stores/data_style/model/blocks/coloring_groups.ts +18 -0
  206. package/internal/stores/data_style/model/blocks/index.ts +12 -140
  207. package/internal/stores/data_style/model/blocks/polyhedron.ts +102 -54
  208. package/internal/stores/data_style/model/blocks/vertex.ts +102 -54
  209. package/internal/stores/data_style/model/color.ts +25 -26
  210. package/internal/stores/data_style/model/common.ts +10 -119
  211. package/internal/stores/data_style/model/common_mutations.ts +184 -0
  212. package/internal/stores/data_style/model/corners/index.ts +85 -78
  213. package/internal/stores/data_style/model/corners/vertex.ts +97 -49
  214. package/internal/stores/data_style/model/lines/apply_coloring.ts +154 -0
  215. package/internal/stores/data_style/model/lines/color.ts +53 -40
  216. package/internal/stores/data_style/model/lines/coloring_groups.ts +18 -0
  217. package/internal/stores/data_style/model/lines/edge.ts +102 -54
  218. package/internal/stores/data_style/model/lines/index.ts +10 -134
  219. package/internal/stores/data_style/model/lines/vertex.ts +102 -54
  220. package/internal/stores/data_style/model/surfaces/apply_coloring.ts +186 -0
  221. package/internal/stores/data_style/model/surfaces/color.ts +68 -56
  222. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +18 -0
  223. package/internal/stores/data_style/model/surfaces/index.ts +16 -160
  224. package/internal/stores/data_style/model/surfaces/polygon.ts +94 -46
  225. package/internal/stores/data_style/model/surfaces/vertex.ts +94 -46
  226. package/internal/stores/data_style/model/visibility.ts +3 -156
  227. package/internal/stores/data_style/model/visibility_dispatch.ts +110 -0
  228. package/internal/stores/data_style/scene.ts +118 -0
  229. package/internal/stores/data_style/state.ts +5 -181
  230. package/internal/stores/data_style/state_shared.ts +199 -0
  231. package/internal/stores/data_style/types.ts +24 -1
  232. package/internal/stores/hybrid_viewer/brightness.ts +8 -2
  233. package/internal/stores/hybrid_viewer/camera.ts +7 -161
  234. package/internal/stores/hybrid_viewer/camera_animation.ts +4 -3
  235. package/internal/stores/hybrid_viewer/camera_helpers.ts +120 -0
  236. package/internal/stores/hybrid_viewer/camera_orientation.ts +60 -0
  237. package/internal/stores/hybrid_viewer/filters.ts +54 -11
  238. package/internal/stores/hybrid_viewer/highlight.ts +80 -63
  239. package/internal/stores/hybrid_viewer/ruler.ts +4 -3
  240. package/internal/stores/hybrid_viewer/scene.ts +34 -26
  241. package/internal/stores/hybrid_viewer/vtk_types.ts +2 -1
  242. package/internal/utils/ws_client.ts +8 -1
  243. package/package.json +5 -5
  244. package/server/api/local/extensions/run.post.ts +6 -4
  245. package/server/api/local/extensions/upload.put.ts +47 -20
  246. package/server/utils/cleanup.ts +12 -2
  247. package/server/utils/microservices.ts +10 -102
  248. package/server/utils/microservices_process.ts +127 -0
  249. package/server/utils/scripts.ts +35 -30
  250. package/server/utils/typed_handler.ts +8 -1
  251. package/server/utils/ws_client.ts +15 -2
  252. package/shared/utils/fetch_raw.ts +2 -2
  253. package/shared/utils/parse_boolean.ts +4 -1
  254. package/app/components/Viewer/Options/OptionsSection.vue +0 -76
@@ -0,0 +1,35 @@
1
+ <script setup lang="ts">
2
+ import type { ModelTabItem } from "@ogw_front/composables/model_tabs";
3
+
4
+ interface Props {
5
+ tabs: ModelTabItem[];
6
+ }
7
+
8
+ const { tabs } = defineProps<Props>();
9
+ const activeTab = defineModel<string>({ required: true });
10
+ </script>
11
+
12
+ <template>
13
+ <v-row v-if="tabs.length > 0" justify="center" dense class="mb-2">
14
+ <v-col cols="12" class="py-0 d-flex justify-center">
15
+ <v-btn-toggle
16
+ v-model="activeTab"
17
+ mandatory
18
+ color="primary"
19
+ variant="outlined"
20
+ density="compact"
21
+ >
22
+ <v-btn
23
+ v-for="tab in tabs"
24
+ :key="tab.value"
25
+ :value="tab.value"
26
+ :data-testid="tab.testId"
27
+ size="small"
28
+ class="text-caption text-none"
29
+ >
30
+ {{ tab.label }}
31
+ </v-btn>
32
+ </v-btn-toggle>
33
+ </v-col>
34
+ </v-row>
35
+ </template>
@@ -3,7 +3,7 @@ import {
3
3
  type ModelMenuItemProps,
4
4
  useModelMenuContext,
5
5
  } from "@ogw_front/composables/model_menu_context";
6
- import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.vue";
6
+ import ModelCardTabs from "./ModelCardTabs.vue";
7
7
  import ViewerGenericModelComponentEdgesOptions from "@ogw_front/components/Viewer/Generic/Model/ComponentEdgesOptions.vue";
8
8
  import ViewerOptionsWidthSlider from "@ogw_front/components/Viewer/Options/Sliders/Width.vue";
9
9
  import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
@@ -11,6 +11,7 @@ import { useBatchStyle } from "@ogw_front/composables/batch_style";
11
11
  import { useDataStore } from "@ogw_front/stores/data";
12
12
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
13
13
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
14
+ import { useModelTabs } from "@ogw_front/composables/model_tabs";
14
15
 
15
16
  // Lines are edges themselves and corners have none: no edges options for them
16
17
  const EDGES_TYPE_TITLES = {
@@ -87,67 +88,75 @@ watch(
87
88
  { immediate: true },
88
89
  );
89
90
 
90
- const typeTargets = computed(() =>
91
- edgesComponentType.value === undefined
92
- ? []
93
- : [{ componentType: edgesComponentType.value, componentIds: targetComponentIds.value }],
94
- );
91
+ const typeTargets = computed(() => {
92
+ if (edgesComponentType.value === undefined) {
93
+ return [];
94
+ }
95
+ return [{ componentType: edgesComponentType.value, componentIds: targetComponentIds.value }];
96
+ });
95
97
  const typeReferenceId = computed<string | undefined>(() =>
96
98
  collections.value ? targetComponentIds.value[0] : undefined,
97
99
  );
98
100
 
99
- const componentTargets = computed(() =>
100
- edgesComponentType.value === undefined || componentId.value === undefined
101
- ? []
102
- : [{ componentType: edgesComponentType.value, componentIds: [componentId.value] }],
103
- );
101
+ const componentTargets = computed(() => {
102
+ if (edgesComponentType.value === undefined || componentId.value === undefined) {
103
+ return [];
104
+ }
105
+ return [{ componentType: edgesComponentType.value, componentIds: [componentId.value] }];
106
+ });
107
+
108
+ const { tabs, activeTab } = useModelTabs({
109
+ componentType,
110
+ componentId,
111
+ isTypeSupported: (type) => isEdgesComponentType(type),
112
+ hasComponentsOptions: computed(() => allComponentsTargets.value.length > 0),
113
+ });
104
114
  </script>
105
115
 
106
116
  <template>
107
117
  <v-sheet class="model-edges-card" color="transparent">
108
- <OptionsSection title="Model Edges Options">
118
+ <ModelCardTabs v-model="activeTab" :tabs="tabs" />
119
+
120
+ <div v-show="activeTab === 'model'">
109
121
  <VisibilitySwitch data-testid="modelEdgesVisibilitySwitch" v-model="modelEdgesVisibility" />
110
122
  <ViewerOptionsWidthSlider
111
123
  v-if="modelEdgesVisibility"
112
124
  data-testid="modelEdgesWidthSlider"
113
125
  v-model="modelEdgesWidth"
114
126
  />
115
- </OptionsSection>
127
+ </div>
116
128
 
117
- <OptionsSection
129
+ <div
118
130
  v-if="!componentType && !componentId && allComponentsTargets.length > 0"
119
- title="Components Edges Options"
131
+ v-show="activeTab === 'components'"
120
132
  data-testid="modelEdgesComponentsOptions"
121
- class="mt-4"
122
133
  >
123
134
  <ViewerGenericModelComponentEdgesOptions :modelId="modelId" :targets="allComponentsTargets" />
124
- </OptionsSection>
135
+ </div>
125
136
 
126
- <OptionsSection
137
+ <div
127
138
  v-if="edgesComponentType"
128
- :title="EDGES_TYPE_TITLES[edgesComponentType]"
139
+ v-show="activeTab === 'type'"
129
140
  data-testid="modelEdgesComponentTypeOptions"
130
- class="mt-4"
131
141
  >
132
142
  <ViewerGenericModelComponentEdgesOptions
133
143
  :modelId="modelId"
134
144
  :targets="typeTargets"
135
145
  :referenceComponentId="typeReferenceId"
136
146
  />
137
- </OptionsSection>
147
+ </div>
138
148
 
139
- <OptionsSection
149
+ <div
140
150
  v-if="edgesComponentType && componentId"
141
- title="Component Edges Options"
151
+ v-show="activeTab === 'component'"
142
152
  data-testid="modelEdgesComponentOptions"
143
- class="mt-4"
144
153
  >
145
154
  <ViewerGenericModelComponentEdgesOptions
146
155
  :modelId="modelId"
147
156
  :targets="componentTargets"
148
157
  :referenceComponentId="componentId"
149
158
  />
150
- </OptionsSection>
159
+ </div>
151
160
  </v-sheet>
152
161
  </template>
153
162
 
@@ -3,13 +3,14 @@ import {
3
3
  type ModelMenuItemProps,
4
4
  useModelMenuContext,
5
5
  } from "@ogw_front/composables/model_menu_context";
6
- import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.vue";
6
+ import ModelCardTabs from "./ModelCardTabs.vue";
7
7
  import ViewerGenericModelComponentPointsOptions from "@ogw_front/components/Viewer/Generic/Model/ComponentPointsOptions.vue";
8
8
  import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
9
9
  import { useBatchStyle } from "@ogw_front/composables/batch_style";
10
10
  import { useDataStore } from "@ogw_front/stores/data";
11
11
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
12
12
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
13
+ import { useModelTabs } from "@ogw_front/composables/model_tabs";
13
14
 
14
15
  // Corners have no points options: their points are the corners themselves
15
16
  const POINTS_TYPE_TITLES = {
@@ -71,65 +72,73 @@ watch(
71
72
  { immediate: true },
72
73
  );
73
74
 
74
- const typeTargets = computed(() =>
75
- pointsComponentType.value === undefined
76
- ? []
77
- : [{ componentType: pointsComponentType.value, componentIds: targetComponentIds.value }],
78
- );
75
+ const typeTargets = computed(() => {
76
+ if (pointsComponentType.value === undefined) {
77
+ return [];
78
+ }
79
+ return [{ componentType: pointsComponentType.value, componentIds: targetComponentIds.value }];
80
+ });
79
81
  const typeReferenceId = computed<string | undefined>(() =>
80
82
  collections.value ? targetComponentIds.value[0] : undefined,
81
83
  );
82
84
 
83
- const componentTargets = computed(() =>
84
- pointsComponentType.value === undefined || componentId.value === undefined
85
- ? []
86
- : [{ componentType: pointsComponentType.value, componentIds: [componentId.value] }],
87
- );
85
+ const componentTargets = computed(() => {
86
+ if (pointsComponentType.value === undefined || componentId.value === undefined) {
87
+ return [];
88
+ }
89
+ return [{ componentType: pointsComponentType.value, componentIds: [componentId.value] }];
90
+ });
91
+
92
+ const { tabs, activeTab } = useModelTabs({
93
+ componentType,
94
+ componentId,
95
+ isTypeSupported: (type) => isPointsComponentType(type),
96
+ hasComponentsOptions: computed(() => allComponentsTargets.value.length > 0),
97
+ });
88
98
  </script>
89
99
 
90
100
  <template>
91
101
  <v-sheet class="model-points-card" color="transparent">
92
- <OptionsSection title="Model Points Options">
102
+ <ModelCardTabs v-model="activeTab" :tabs="tabs" />
103
+
104
+ <div v-show="activeTab === 'model'">
93
105
  <VisibilitySwitch data-testid="modelPointsVisibilitySwitch" v-model="modelPointsVisibility" />
94
- </OptionsSection>
106
+ </div>
95
107
 
96
- <OptionsSection
108
+ <div
97
109
  v-if="!componentType && !componentId && allComponentsTargets.length > 0"
98
- title="Components Points Options"
110
+ v-show="activeTab === 'components'"
99
111
  data-testid="modelPointsComponentsOptions"
100
- class="mt-4"
101
112
  >
102
113
  <ViewerGenericModelComponentPointsOptions
103
114
  :modelId="modelId"
104
115
  :targets="allComponentsTargets"
105
116
  />
106
- </OptionsSection>
117
+ </div>
107
118
 
108
- <OptionsSection
119
+ <div
109
120
  v-if="pointsComponentType"
110
- :title="POINTS_TYPE_TITLES[pointsComponentType]"
121
+ v-show="activeTab === 'type'"
111
122
  data-testid="modelPointsComponentTypeOptions"
112
- class="mt-4"
113
123
  >
114
124
  <ViewerGenericModelComponentPointsOptions
115
125
  :modelId="modelId"
116
126
  :targets="typeTargets"
117
127
  :referenceComponentId="typeReferenceId"
118
128
  />
119
- </OptionsSection>
129
+ </div>
120
130
 
121
- <OptionsSection
131
+ <div
122
132
  v-if="pointsComponentType && componentId"
123
- title="Component Points Options"
133
+ v-show="activeTab === 'component'"
124
134
  data-testid="modelPointsComponentOptions"
125
- class="mt-4"
126
135
  >
127
136
  <ViewerGenericModelComponentPointsOptions
128
137
  :modelId="modelId"
129
138
  :targets="componentTargets"
130
139
  :referenceComponentId="componentId"
131
140
  />
132
- </OptionsSection>
141
+ </div>
133
142
  </v-sheet>
134
143
  </template>
135
144
 
@@ -6,7 +6,7 @@ import {
6
6
  import BlocksOptions from "./BlocksOptions.vue";
7
7
  import CornersOptions from "./CornersOptions.vue";
8
8
  import LinesOptions from "./LinesOptions.vue";
9
- import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.vue";
9
+ import ModelCardTabs from "./ModelCardTabs.vue";
10
10
  import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
11
11
  import SurfacesOptions from "./SurfacesOptions.vue";
12
12
  import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
@@ -14,6 +14,7 @@ import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwi
14
14
  import { useBatchStyle } from "@ogw_front/composables/batch_style";
15
15
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
16
16
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
17
+ import { useModelTabs } from "@ogw_front/composables/model_tabs";
17
18
 
18
19
  const dataStyleStore = useDataStyleStore();
19
20
  const hybridViewerStore = useHybridViewerStore();
@@ -27,6 +28,11 @@ const { itemProps } = defineProps<Props>();
27
28
 
28
29
  const { modelId, componentId, componentType, collections, targetComponentIds } =
29
30
  useModelMenuContext(() => itemProps);
31
+
32
+ const { tabs, activeTab } = useModelTabs({
33
+ componentType,
34
+ componentId,
35
+ });
30
36
  function visibleComponents(targetId: string): string[] {
31
37
  return dataStyleStore.visibleMeshComponents(targetId).value || [];
32
38
  }
@@ -87,11 +93,13 @@ const modelComponentsActiveColoring = computed<string | undefined>({
87
93
 
88
94
  <template>
89
95
  <v-sheet class="model-style-card" color="transparent">
90
- <OptionsSection title="Model Options">
96
+ <ModelCardTabs v-model="activeTab" :tabs="tabs" />
97
+
98
+ <div v-show="activeTab === 'model'">
91
99
  <VisibilitySwitch data-testid="modelStyleVisibilitySwitch" v-model="modelVisibility" />
92
- </OptionsSection>
100
+ </div>
93
101
 
94
- <OptionsSection v-if="!componentType && !componentId" title="Components Options" class="mt-4">
102
+ <div v-if="!componentType && !componentId" v-show="activeTab === 'components'">
95
103
  <ViewerOptionsColoringTypeSelector
96
104
  :id="modelId"
97
105
  v-model:coloring_style_key="modelComponentsActiveColoring"
@@ -99,7 +107,7 @@ const modelComponentsActiveColoring = computed<string | undefined>({
99
107
  :capabilities="{ color: { available: true } }"
100
108
  :allowRandom="true"
101
109
  />
102
- </OptionsSection>
110
+ </div>
103
111
 
104
112
  <BlocksOptions
105
113
  v-if="componentType === 'Block'"
@@ -107,6 +115,7 @@ const modelComponentsActiveColoring = computed<string | undefined>({
107
115
  :blockId="componentId"
108
116
  :targetBlockIds="targetComponentIds"
109
117
  :collections="collections"
118
+ :activeTab="activeTab"
110
119
  />
111
120
  <SurfacesOptions
112
121
  v-else-if="componentType === 'Surface'"
@@ -114,6 +123,7 @@ const modelComponentsActiveColoring = computed<string | undefined>({
114
123
  :surfaceId="componentId"
115
124
  :targetSurfaceIds="targetComponentIds"
116
125
  :collections="collections"
126
+ :activeTab="activeTab"
117
127
  />
118
128
  <LinesOptions
119
129
  v-else-if="componentType === 'Line'"
@@ -121,6 +131,7 @@ const modelComponentsActiveColoring = computed<string | undefined>({
121
131
  :lineId="componentId"
122
132
  :targetLineIds="targetComponentIds"
123
133
  :collections="collections"
134
+ :activeTab="activeTab"
124
135
  />
125
136
  <CornersOptions
126
137
  v-else-if="componentType === 'Corner'"
@@ -128,6 +139,7 @@ const modelComponentsActiveColoring = computed<string | undefined>({
128
139
  :cornerId="componentId"
129
140
  :targetCornerIds="targetComponentIds"
130
141
  :collections="collections"
142
+ :activeTab="activeTab"
131
143
  />
132
144
  </v-sheet>
133
145
  </template>
@@ -1,7 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  // oxlint-disable eslint/max-lines
3
3
  import type { CollectionComponent } from "@ogw_front/stores/data_helpers/collections";
4
- import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.vue";
5
4
  import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
6
5
  import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
7
6
  import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
@@ -14,6 +13,7 @@ interface Props {
14
13
  surfaceId?: string;
15
14
  targetSurfaceIds: string[];
16
15
  collections?: CollectionComponent[];
16
+ activeTab?: string;
17
17
  }
18
18
 
19
19
  const {
@@ -21,6 +21,7 @@ const {
21
21
  surfaceId = undefined,
22
22
  targetSurfaceIds,
23
23
  collections = undefined,
24
+ activeTab = undefined,
24
25
  } = defineProps<Props>();
25
26
 
26
27
  const dataStyleStore = useDataStyleStore();
@@ -30,14 +31,18 @@ const referenceSurfaceId = computed<string | undefined>(() =>
30
31
  collections ? targetSurfaceIds[0] : undefined,
31
32
  );
32
33
 
33
- const surfaceComponentIds = computed<string[]>(() => (surfaceId === undefined ? [] : [surfaceId]));
34
+ const surfaceComponentIds = computed<string[]>(
35
+ () => (surfaceId !== undefined && [surfaceId]) || [],
36
+ );
34
37
 
35
38
  // Visibility
36
39
  const surfacesVisibility = computed<boolean>({
37
- get: () =>
38
- collections
39
- ? targetSurfaceIds.every((id) => dataStyleStore.modelSurfaceVisibility(modelId, id))
40
- : dataStyleStore.modelComponentTypeVisibility(modelId, "Surface"),
40
+ get: () => {
41
+ if (collections) {
42
+ return targetSurfaceIds.every((id) => dataStyleStore.modelSurfaceVisibility(modelId, id));
43
+ }
44
+ return dataStyleStore.modelComponentTypeVisibility(modelId, "Surface");
45
+ },
41
46
  set: async (newValue) => {
42
47
  await dataStyleStore.setModelSurfacesVisibility(modelId, targetSurfaceIds, newValue);
43
48
  hybridViewerStore.remoteRender();
@@ -442,7 +447,7 @@ const attributeSchemas = {
442
447
  </script>
443
448
 
444
449
  <template>
445
- <OptionsSection title="Surfaces Options" class="mt-4" data-testid="modelComponentTypeOptions">
450
+ <div v-show="!activeTab || activeTab === 'type'" data-testid="modelComponentTypeOptions">
446
451
  <VisibilitySwitch data-testid="modelSurfacesVisibilitySwitch" v-model="surfacesVisibility" />
447
452
  <ViewerOptionsColoringTypeSelector
448
453
  :id="modelId"
@@ -465,12 +470,11 @@ const attributeSchemas = {
465
470
  :schemas="attributeSchemas"
466
471
  :allowRandom="true"
467
472
  />
468
- </OptionsSection>
473
+ </div>
469
474
 
470
- <OptionsSection
475
+ <div
471
476
  v-if="surfaceId"
472
- title="Component Options"
473
- class="mt-4"
477
+ v-show="!activeTab || activeTab === 'component'"
474
478
  data-testid="modelComponentOptions"
475
479
  >
476
480
  <VisibilitySwitch v-model="surfaceVisibility" />
@@ -495,5 +499,5 @@ const attributeSchemas = {
495
499
  :schemas="attributeSchemas"
496
500
  :allowRandom="true"
497
501
  />
498
- </OptionsSection>
502
+ </div>
499
503
  </template>
@@ -31,7 +31,10 @@ function summarize(components: readonly FormattedComponent[]): string {
31
31
  return MESH_COMPONENT_TYPES.filter((type) => counts.has(type))
32
32
  .map((type) => {
33
33
  const count = counts.get(type) ?? 0;
34
- return `${count} ${count > 1 ? pluralize(type) : type}`;
34
+ if (count > 1) {
35
+ return `${count} ${pluralize(type)}`;
36
+ }
37
+ return `${count} ${type}`;
35
38
  })
36
39
  .join(", ");
37
40
  }
@@ -1,9 +1,12 @@
1
1
  <script setup lang="ts">
2
+ import { formatCrs, formatCrsCode } from "@ogw_front/utils/crs";
2
3
  import ComponentRelations from "@ogw_front/components/Viewer/ObjectTree/Base/ComponentRelations.vue";
3
4
  import type { DisplayItem } from "@ogw_front/composables/virtual_tree";
4
5
  import { middleTruncate } from "@ogw_front/utils/string";
5
6
  import { useClipboard } from "@vueuse/core";
7
+ import { useCrsStore } from "@ogw_front/stores/crs";
6
8
  import { useFeedbackStore } from "@ogw_front/stores/feedback";
9
+ import { useLiveDataItem } from "@ogw_front/composables/live_data_item";
7
10
  import { useResponsiveMiddleTruncate } from "@ogw_front/composables/responsive_middle_truncate";
8
11
 
9
12
  const feedbackStore = useFeedbackStore();
@@ -12,10 +15,11 @@ const { copy } = useClipboard();
12
15
  interface Props {
13
16
  item: DisplayItem;
14
17
  isLeaf?: boolean;
18
+ showCrs?: boolean;
15
19
  modelId?: string;
16
20
  }
17
21
 
18
- const { item, isLeaf, modelId = "" } = defineProps<Props>();
22
+ const { item, isLeaf, showCrs = false, modelId = "" } = defineProps<Props>();
19
23
 
20
24
  interface Emits {
21
25
  contextmenu: [event: MouseEvent];
@@ -55,6 +59,40 @@ const tooltipTitle = computed<string>(() =>
55
59
  ),
56
60
  );
57
61
 
62
+ const crsStore = useCrsStore();
63
+ const tooltipOpen = ref(false);
64
+ // Only top-level data carry a CRS: their stored item is read live, and only while the
65
+ // Tooltip is open, so the rows of a long tree do not each keep a database query
66
+ const dataItem = useLiveDataItem(() =>
67
+ showCrs && tooltipOpen.value ? actualItem.value.id : undefined,
68
+ );
69
+ const crsLabel = computed<string>(
70
+ () =>
71
+ middleTruncate(
72
+ formatCrs(dataItem.value?.crs),
73
+ TOOLTIP_NAME_MAX_LENGTH,
74
+ TOOLTIP_NAME_START_CHARS,
75
+ TOOLTIP_NAME_END_CHARS,
76
+ ) ?? "",
77
+ );
78
+
79
+ // Read from the store map: one database query for the whole tree, not one per row
80
+ const mismatched = computed(() => showCrs && crsStore.mismatchedCrs.has(actualItem.value.id));
81
+ const mismatchTooltip = computed<string>(() => {
82
+ const project = formatCrsCode(crsStore.projectCrs);
83
+ const crs = crsStore.mismatchedCrs.get(actualItem.value.id);
84
+ return crs === undefined
85
+ ? `No CRS, project in ${project}. Georeference it to show it on the map.`
86
+ : `In ${formatCrsCode(crs)}, project in ${project}. Convert it to show it on the map.`;
87
+ });
88
+
89
+ // The warning opens the CRS dialog of the data, when the app hosts it
90
+ function editCrs(): void {
91
+ if (crsStore.crsEditEnabled) {
92
+ crsStore.requestCrsEdit(actualItem.value.id);
93
+ }
94
+ }
95
+
58
96
  const tooltipDisabled = computed<boolean>(() => {
59
97
  if (actualItem.value.category !== undefined) {
60
98
  return false;
@@ -78,6 +116,7 @@ async function copyToClipboard(text: string, label: string): Promise<void> {
78
116
  class="tree-item-label-container w-100"
79
117
  >
80
118
  <v-tooltip
119
+ v-model="tooltipOpen"
81
120
  :disabled="tooltipDisabled"
82
121
  location="right"
83
122
  open-delay="400"
@@ -129,6 +168,22 @@ async function copyToClipboard(text: string, label: string): Promise<void> {
129
168
  <v-icon size="12">mdi-content-copy</v-icon>
130
169
  </v-btn>
131
170
  </span>
171
+ <span v-if="showCrs" class="text-caption d-flex align-center">
172
+ <strong class="text-white mr-1">CRS:</strong>
173
+ <span data-testid="tooltipCrsValue">{{ crsLabel }}</span>
174
+ <v-btn
175
+ v-if="crsStore.crsEditEnabled"
176
+ data-testid="editCrsBtn"
177
+ icon
178
+ variant="text"
179
+ density="compact"
180
+ class="ml-1 text-white"
181
+ style="width: 18px; height: 18px; min-width: 18px; min-height: 18px"
182
+ @click.stop="crsStore.requestCrsEdit(actualItem.id)"
183
+ >
184
+ <v-icon size="12">mdi-pencil</v-icon>
185
+ </v-btn>
186
+ </span>
132
187
  <span v-if="actualItem.is_active !== undefined" class="text-caption d-flex align-center">
133
188
  <strong class="text-white mr-1">Status:</strong>
134
189
  <i class="ml-1">{{ actualItem.is_active ? "Active" : "Inactive" }}</i>
@@ -140,6 +195,21 @@ async function copyToClipboard(text: string, label: string): Promise<void> {
140
195
  />
141
196
  </div>
142
197
  </v-tooltip>
198
+ <v-tooltip v-if="mismatched" location="right">
199
+ <template #activator="{ props: warningProps }">
200
+ <v-icon
201
+ v-bind="warningProps"
202
+ data-testid="crsMismatchIcon"
203
+ icon="mdi-alert"
204
+ color="warning"
205
+ size="14"
206
+ class="ml-1 flex-shrink-0"
207
+ :class="{ 'cursor-pointer': crsStore.crsEditEnabled }"
208
+ @click.stop="editCrs"
209
+ />
210
+ </template>
211
+ {{ mismatchTooltip }}
212
+ </v-tooltip>
143
213
  </div>
144
214
  </template>
145
215