@geode/opengeodeweb-front 12.2.0-rc.4 → 12.2.0-rc.6

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 (124) hide show
  1. package/app/components/CameraOrientation.vue +85 -68
  2. package/app/components/CameraOrientationDial.vue +195 -0
  3. package/app/components/ClippingPlanes.vue +1 -1
  4. package/app/components/FactorFilterPanel.vue +1 -1
  5. package/app/components/Launcher.vue +3 -2
  6. package/app/components/ThresholdFilter.vue +1 -2
  7. package/app/components/Viewer/Basemap/CropOptions.vue +7 -8
  8. package/app/components/Viewer/Basemap/OpacityOptions.vue +7 -8
  9. package/app/components/Viewer/ContextMenu/CircularItems.vue +6 -43
  10. package/app/components/Viewer/ContextMenu/ContextMenu.vue +1 -6
  11. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +14 -16
  12. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +5 -4
  13. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +10 -13
  14. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +8 -11
  15. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +16 -13
  16. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +28 -31
  17. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +9 -11
  18. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +8 -11
  19. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +1 -1
  20. package/app/components/Viewer/Generic/Model/CornersOptions.vue +1 -1
  21. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +1 -1
  22. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +7 -8
  23. package/app/components/Viewer/Generic/Model/LinesOptions.vue +1 -1
  24. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +1 -1
  25. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +5 -7
  26. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +5 -7
  27. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +5 -7
  28. package/app/components/Viewer/Generic/Model/ModelStyleOptions.vue +7 -8
  29. package/app/components/Viewer/Generic/Model/PointsOptions.vue +7 -8
  30. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +1 -1
  31. package/app/components/Viewer/Grid/2D/CellsOptions.vue +6 -4
  32. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +6 -4
  33. package/app/components/Viewer/Grid/2D/PointsOptions.vue +5 -4
  34. package/app/components/Viewer/Grid/3D/CellsOptions.vue +6 -4
  35. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +6 -4
  36. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +6 -4
  37. package/app/components/Viewer/Grid/3D/PointsOptions.vue +5 -4
  38. package/app/components/Viewer/Image/ImageOptions.vue +10 -13
  39. package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +5 -0
  40. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +2 -2
  41. package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +4 -1
  42. package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +6 -8
  43. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +10 -15
  44. package/app/components/Viewer/ObjectTree/Views/ModelTree.vue +3 -0
  45. package/app/components/Viewer/OrientationCompass.vue +11 -34
  46. package/app/components/Viewer/OrientationGlobe.vue +2 -2
  47. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +28 -31
  48. package/app/components/Viewer/Scene/BackgroundOptions.vue +4 -7
  49. package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +4 -7
  50. package/app/components/Viewer/Scene/TextOptions.vue +4 -7
  51. package/app/components/Viewer/Solid/EdgesOptions.vue +6 -4
  52. package/app/components/Viewer/Solid/PointsOptions.vue +5 -4
  53. package/app/components/Viewer/Solid/PolygonsOptions.vue +6 -4
  54. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +8 -11
  55. package/app/components/Viewer/Surface/EdgesOptions.vue +6 -4
  56. package/app/components/Viewer/Surface/PointsOptions.vue +6 -4
  57. package/app/components/Viewer/Surface/PolygonsOptions.vue +8 -11
  58. package/app/components/Viewer/Surface/Triangulated/TrianglesOptions.vue +5 -4
  59. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +6 -4
  60. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +6 -4
  61. package/app/composables/circular_menu.ts +45 -0
  62. package/app/composables/compass_dial.ts +40 -0
  63. package/app/composables/hover_highlight.ts +1 -1
  64. package/app/composables/model_menu_context.ts +7 -11
  65. package/app/composables/model_tree.ts +3 -3
  66. package/app/composables/project_manager_helpers/types.ts +2 -3
  67. package/app/composables/use_overlapping_picker.ts +7 -19
  68. package/app/composables/viewer_context_menu.ts +2 -1
  69. package/app/stores/api.ts +6 -59
  70. package/app/stores/app.ts +21 -55
  71. package/app/stores/back.ts +86 -145
  72. package/app/stores/camera_manager.ts +12 -25
  73. package/app/stores/cloud.ts +21 -101
  74. package/app/stores/crs.ts +3 -2
  75. package/app/stores/data.ts +66 -409
  76. package/app/stores/data_style.ts +99 -93
  77. package/app/stores/feedback.ts +57 -53
  78. package/app/stores/infra.ts +61 -101
  79. package/app/stores/treeview.ts +12 -31
  80. package/app/stores/viewer.ts +9 -29
  81. package/app/stores/viewer_helpers/actions.ts +1 -23
  82. package/app/utils/backend_lifecycle.ts +155 -0
  83. package/app/utils/brand_colors.ts +9 -0
  84. package/app/utils/camera_orientations.ts +136 -0
  85. package/app/utils/import_item.ts +5 -4
  86. package/app/utils/orientation_compass.ts +15 -0
  87. package/app/utils/orientation_cube_style.ts +70 -0
  88. package/app/utils/threshold_sources.ts +3 -2
  89. package/app/utils/treeview.ts +25 -1
  90. package/app/utils/viewer_object_type.ts +21 -0
  91. package/internal/database/base_database.ts +2 -1
  92. package/internal/database/database.ts +90 -7
  93. package/internal/database/queries.ts +45 -0
  94. package/internal/database/tables/camera_positions.ts +11 -1
  95. package/internal/database/tables/data.ts +20 -1
  96. package/internal/database/tables/data_style.ts +3 -1
  97. package/internal/database/tables/model_component_datastyle.ts +3 -1
  98. package/internal/database/tables/model_component_type_datastyle.ts +3 -1
  99. package/internal/database/tables/model_components.ts +12 -1
  100. package/internal/database/tables/model_components_relation.ts +11 -1
  101. package/internal/database/tables/scene_style.ts +3 -1
  102. package/internal/database/tables/treeview_config.ts +31 -0
  103. package/internal/stores/data/items.ts +110 -0
  104. package/internal/stores/data/model/collections.ts +107 -0
  105. package/internal/stores/data/model/components.ts +129 -0
  106. package/internal/stores/data/model/mesh_components.ts +134 -0
  107. package/internal/stores/data/model/relations.ts +76 -0
  108. package/internal/stores/data/model/types.ts +14 -0
  109. package/internal/stores/data/registration.ts +54 -0
  110. package/internal/stores/data/snapshot.ts +83 -0
  111. package/internal/stores/data/types.ts +26 -0
  112. package/internal/stores/data_style/model/common_mutations.ts +47 -77
  113. package/internal/stores/data_style/model/selection.ts +3 -10
  114. package/internal/stores/data_style/scene.ts +2 -2
  115. package/internal/stores/data_style/state.ts +10 -8
  116. package/internal/stores/data_style/state_shared.ts +10 -7
  117. package/internal/stores/hybrid_viewer/highlight.ts +9 -14
  118. package/internal/stores/hybrid_viewer/scene.ts +1 -1
  119. package/internal/stores/microservice.ts +192 -0
  120. package/package.json +1 -1
  121. package/tests/browser/helpers/data/helpers/attribute.ts +2 -1
  122. package/app/stores/data_helpers/collections.ts +0 -122
  123. package/app/stores/data_helpers/mesh.ts +0 -167
  124. package/app/stores/data_helpers/relations.ts +0 -94
@@ -1,94 +0,0 @@
1
- import type { DataIdentified, ModelId } from "@ogw_front/types/identifiers";
2
- import {
3
- type FormattedComponent,
4
- type ModelComponentRecord,
5
- toFormattedComponent,
6
- } from "./mesh.js";
7
- import { Dexie } from "dexie";
8
- import { getTable } from "@ogw_internal/database/database.js";
9
-
10
- interface ComponentRelations {
11
- readonly boundaries: readonly FormattedComponent[];
12
- readonly internals: readonly FormattedComponent[];
13
- }
14
-
15
- interface ModelComponentRelationRecord extends DataIdentified {
16
- parent: string;
17
- child: string;
18
- type: string;
19
- }
20
-
21
- const RELATION_KEYS: Readonly<Record<string, keyof ComponentRelations>> = {
22
- boundary: "boundaries",
23
- internal: "internals",
24
- };
25
-
26
- type MutableComponentRelations = { [Key in keyof ComponentRelations]: FormattedComponent[] };
27
-
28
- function groupRelationsByParent(
29
- relations: readonly ModelComponentRelationRecord[],
30
- components: readonly FormattedComponent[],
31
- ): Record<string, ComponentRelations> {
32
- const componentsById = new Map(components.map((component) => [component.id, component]));
33
- const byParent: Record<string, MutableComponentRelations> = {};
34
- for (const relation of relations) {
35
- const key = RELATION_KEYS[relation.type];
36
- const child = componentsById.get(relation.child);
37
- if (key !== undefined && child !== undefined) {
38
- byParent[relation.parent] ??= { boundaries: [], internals: [] };
39
- byParent[relation.parent]?.[key].push(child);
40
- }
41
- }
42
- return byParent;
43
- }
44
-
45
- export function useDataRelations(): {
46
- getComponentRelations: typeof getComponentRelations;
47
- fetchAllComponentRelations: typeof fetchAllComponentRelations;
48
- } {
49
- const model_components_db = getTable<ModelComponentRecord>("model_components");
50
- const model_components_relation_db = getTable<ModelComponentRelationRecord>(
51
- "model_components_relation",
52
- );
53
-
54
- async function getRelatedComponents(
55
- modelId: ModelId,
56
- relations: readonly ModelComponentRelationRecord[],
57
- type: string,
58
- ): Promise<FormattedComponent[]> {
59
- const keys = relations
60
- .filter((relation) => relation.type === type)
61
- .map((relation) => [modelId, relation.child]);
62
- const components = await model_components_db.where("[data_id+geode_id]").anyOf(keys).toArray();
63
- return components.map((component) => toFormattedComponent(component));
64
- }
65
-
66
- async function getComponentRelations(
67
- modelId: ModelId,
68
- componentId: string,
69
- ): Promise<ComponentRelations> {
70
- const relations = await model_components_relation_db
71
- .where("[data_id+parent+child]")
72
- .between([modelId, componentId, Dexie.minKey], [modelId, componentId, Dexie.maxKey])
73
- .toArray();
74
- const [boundaries, internals] = await Promise.all([
75
- getRelatedComponents(modelId, relations, "boundary"),
76
- getRelatedComponents(modelId, relations, "internal"),
77
- ]);
78
- return { boundaries, internals };
79
- }
80
-
81
- // The boundaries and internals of every component of the model, among the given components:
82
- // The caller already holds them, so only the relations are read
83
- async function fetchAllComponentRelations(
84
- modelId: ModelId,
85
- components: readonly FormattedComponent[],
86
- ): Promise<Record<string, ComponentRelations>> {
87
- const relations = await model_components_relation_db.where("data_id").equals(modelId).toArray();
88
- return groupRelationsByParent(relations, components);
89
- }
90
-
91
- return { getComponentRelations, fetchAllComponentRelations };
92
- }
93
-
94
- export type { ComponentRelations, ModelComponentRelationRecord };