@geode/opengeodeweb-front 10.22.1 → 10.23.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +256 -0
  2. package/app/components/Viewer/Generic/Model/CornersOptions.vue +187 -0
  3. package/app/components/Viewer/Generic/Model/LinesOptions.vue +252 -0
  4. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +72 -132
  5. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +260 -0
  6. package/app/components/Viewer/Options/AttributeSelector.vue +15 -2
  7. package/app/components/Viewer/Options/ColoringTypeSelector.vue +53 -11
  8. package/app/stores/app.js +1 -0
  9. package/app/stores/hybrid_viewer.js +21 -2
  10. package/app/utils/default_styles/constants.js +57 -0
  11. package/app/utils/default_styles/index.js +54 -0
  12. package/app/utils/default_styles/meshes.js +185 -0
  13. package/app/utils/default_styles/models.js +192 -0
  14. package/internal/stores/data_style/model/blocks/color.js +6 -1
  15. package/internal/stores/data_style/model/blocks/index.js +60 -4
  16. package/internal/stores/data_style/model/blocks/polyhedron.js +144 -0
  17. package/internal/stores/data_style/model/blocks/vertex.js +141 -0
  18. package/internal/stores/data_style/model/color.js +119 -12
  19. package/internal/stores/data_style/model/common.js +18 -21
  20. package/internal/stores/data_style/model/corners/color.js +6 -1
  21. package/internal/stores/data_style/model/corners/index.js +48 -4
  22. package/internal/stores/data_style/model/corners/vertex.js +144 -0
  23. package/internal/stores/data_style/model/lines/color.js +6 -1
  24. package/internal/stores/data_style/model/lines/edge.js +138 -0
  25. package/internal/stores/data_style/model/lines/index.js +58 -4
  26. package/internal/stores/data_style/model/lines/vertex.js +138 -0
  27. package/internal/stores/data_style/model/selection.js +50 -29
  28. package/internal/stores/data_style/model/surfaces/color.js +11 -1
  29. package/internal/stores/data_style/model/surfaces/index.js +60 -4
  30. package/internal/stores/data_style/model/surfaces/polygon.js +144 -0
  31. package/internal/stores/data_style/model/surfaces/vertex.js +144 -0
  32. package/internal/stores/data_style/model/visibility.js +17 -4
  33. package/internal/stores/data_style/state.js +101 -21
  34. package/package.json +3 -3
  35. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +118 -0
  36. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +64 -0
  37. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +112 -0
  38. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +118 -0
  39. package/app/utils/default_styles.js +0 -327
@@ -0,0 +1,256 @@
1
+ <script setup>
2
+ import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.vue";
3
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
4
+ import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
5
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
6
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
7
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
8
+
9
+ const { modelId, blockId, targetBlockIds } = defineProps({
10
+ modelId: { type: String, required: true },
11
+ blockId: { type: String, default: undefined },
12
+ targetBlockIds: { type: Array, required: true },
13
+ });
14
+
15
+ const dataStyleStore = useDataStyleStore();
16
+ const hybridViewerStore = useHybridViewerStore();
17
+
18
+ // Visibility
19
+ const blocksVisibility = computed({
20
+ get: () => dataStyleStore.modelComponentTypeVisibility(modelId, "Block"),
21
+ set: async (newValue) => {
22
+ await dataStyleStore.setModelComponentTypeVisibility(modelId, "Block", newValue);
23
+ hybridViewerStore.remoteRender();
24
+ },
25
+ });
26
+
27
+ const blockVisibility = computed({
28
+ get: () => dataStyleStore.modelBlockVisibility(modelId, blockId),
29
+ set: async (newValue) => {
30
+ await dataStyleStore.setModelBlocksVisibility(modelId, [blockId], newValue);
31
+ hybridViewerStore.remoteRender();
32
+ },
33
+ });
34
+
35
+ // Color
36
+ const blocksColor = computed({
37
+ get: () => dataStyleStore.modelComponentTypeColor(modelId, "Block"),
38
+ set: async (color) => {
39
+ await dataStyleStore.setModelComponentTypeColor(modelId, "Block", color);
40
+ hybridViewerStore.remoteRender();
41
+ },
42
+ });
43
+
44
+ const blockColor = computed({
45
+ get: () => dataStyleStore.modelBlockColor(modelId, blockId),
46
+ set: async (color) => {
47
+ if (blockId) {
48
+ await dataStyleStore.setModelBlocksColor(modelId, [blockId], color);
49
+ hybridViewerStore.remoteRender();
50
+ }
51
+ },
52
+ });
53
+
54
+ const blocksColorMode = computed({
55
+ get: () => dataStyleStore.getModelComponentTypeColorMode(modelId, "Block"),
56
+ set: async (colorMode) => {
57
+ await dataStyleStore.setModelComponentTypeColorMode(modelId, "Block", colorMode);
58
+ hybridViewerStore.remoteRender();
59
+ },
60
+ });
61
+
62
+ const blockColorMode = computed({
63
+ get: () => dataStyleStore.modelBlockColorMode(modelId, blockId),
64
+ set: async (colorMode) => {
65
+ if (blockId) {
66
+ await dataStyleStore.setModelComponentColorMode(modelId, blockId, colorMode);
67
+ hybridViewerStore.remoteRender();
68
+ }
69
+ },
70
+ });
71
+
72
+ // Group Attributes
73
+ const blocksVertexAttributeName = computed({
74
+ get: () => dataStyleStore.modelBlocksVertexAttributeName(modelId, targetBlockIds[0]),
75
+ set: async (newValue) => {
76
+ await dataStyleStore.setModelBlocksVertexAttributeName(modelId, targetBlockIds, newValue);
77
+ hybridViewerStore.remoteRender();
78
+ },
79
+ });
80
+
81
+ const blocksVertexAttributeRange = computed({
82
+ get: () => dataStyleStore.modelBlocksVertexAttributeRange(modelId, targetBlockIds[0]),
83
+ set: async (newValue) => {
84
+ await dataStyleStore.setModelBlocksVertexAttributeRange(
85
+ modelId,
86
+ targetBlockIds,
87
+ newValue[0],
88
+ newValue[1],
89
+ );
90
+ hybridViewerStore.remoteRender();
91
+ },
92
+ });
93
+
94
+ const blocksVertexAttributeColorMap = computed({
95
+ get: () => dataStyleStore.modelBlocksVertexAttributeColorMap(modelId, targetBlockIds[0]),
96
+ set: async (newValue) => {
97
+ await dataStyleStore.setModelBlocksVertexAttributeColorMap(modelId, targetBlockIds, newValue);
98
+ hybridViewerStore.remoteRender();
99
+ },
100
+ });
101
+
102
+ const blocksPolyhedronAttributeName = computed({
103
+ get: () => dataStyleStore.modelBlocksPolyhedronAttributeName(modelId, targetBlockIds[0]),
104
+ set: async (newValue) => {
105
+ await dataStyleStore.setModelBlocksPolyhedronAttributeName(modelId, targetBlockIds, newValue);
106
+ hybridViewerStore.remoteRender();
107
+ },
108
+ });
109
+
110
+ const blocksPolyhedronAttributeRange = computed({
111
+ get: () => dataStyleStore.modelBlocksPolyhedronAttributeRange(modelId, targetBlockIds[0]),
112
+ set: async (newValue) => {
113
+ await dataStyleStore.setModelBlocksPolyhedronAttributeRange(
114
+ modelId,
115
+ targetBlockIds,
116
+ newValue[0],
117
+ newValue[1],
118
+ );
119
+ hybridViewerStore.remoteRender();
120
+ },
121
+ });
122
+
123
+ const blocksPolyhedronAttributeColorMap = computed({
124
+ get: () => dataStyleStore.modelBlocksPolyhedronAttributeColorMap(modelId, targetBlockIds[0]),
125
+ set: async (newValue) => {
126
+ await dataStyleStore.setModelBlocksPolyhedronAttributeColorMap(
127
+ modelId,
128
+ targetBlockIds,
129
+ newValue,
130
+ );
131
+ hybridViewerStore.remoteRender();
132
+ },
133
+ });
134
+
135
+ // Individual Attributes
136
+ const vertexAttributeName = computed({
137
+ get: () => dataStyleStore.modelBlocksVertexAttributeName(modelId, blockId),
138
+ set: async (newValue) => {
139
+ await dataStyleStore.setModelBlocksVertexAttributeName(modelId, [blockId], newValue);
140
+ hybridViewerStore.remoteRender();
141
+ },
142
+ });
143
+
144
+ const vertexAttributeRange = computed({
145
+ get: () => dataStyleStore.modelBlocksVertexAttributeRange(modelId, blockId),
146
+ set: async (newValue) => {
147
+ await dataStyleStore.setModelBlocksVertexAttributeRange(
148
+ modelId,
149
+ [blockId],
150
+ newValue[0],
151
+ newValue[1],
152
+ );
153
+ hybridViewerStore.remoteRender();
154
+ },
155
+ });
156
+
157
+ const vertexAttributeColorMap = computed({
158
+ get: () => dataStyleStore.modelBlocksVertexAttributeColorMap(modelId, blockId),
159
+ set: async (newValue) => {
160
+ await dataStyleStore.setModelBlocksVertexAttributeColorMap(modelId, [blockId], newValue);
161
+ hybridViewerStore.remoteRender();
162
+ },
163
+ });
164
+
165
+ const polyhedronAttributeName = computed({
166
+ get: () => dataStyleStore.modelBlocksPolyhedronAttributeName(modelId, blockId),
167
+ set: async (newValue) => {
168
+ await dataStyleStore.setModelBlocksPolyhedronAttributeName(modelId, [blockId], newValue);
169
+ hybridViewerStore.remoteRender();
170
+ },
171
+ });
172
+
173
+ const polyhedronAttributeRange = computed({
174
+ get: () => dataStyleStore.modelBlocksPolyhedronAttributeRange(modelId, blockId),
175
+ set: async (newValue) => {
176
+ await dataStyleStore.setModelBlocksPolyhedronAttributeRange(
177
+ modelId,
178
+ [blockId],
179
+ newValue[0],
180
+ newValue[1],
181
+ );
182
+ hybridViewerStore.remoteRender();
183
+ },
184
+ });
185
+
186
+ const polyhedronAttributeColorMap = computed({
187
+ get: () => dataStyleStore.modelBlocksPolyhedronAttributeColorMap(modelId, blockId),
188
+ set: async (newValue) => {
189
+ await dataStyleStore.setModelBlocksPolyhedronAttributeColorMap(modelId, [blockId], newValue);
190
+ hybridViewerStore.remoteRender();
191
+ },
192
+ });
193
+
194
+ const capabilities = {
195
+ color: { available: true },
196
+ textures: { available: false },
197
+ vertex: { available: true },
198
+ edge: { available: false },
199
+ cell: { available: false },
200
+ polygon: { available: false },
201
+ polyhedron: { available: true },
202
+ };
203
+
204
+ const vertexSchema = back_schemas.opengeodeweb_back.model_component_vertex_attribute_names;
205
+ const polyhedronSchema = back_schemas.opengeodeweb_back.model_component_polyhedron_attribute_names;
206
+ </script>
207
+
208
+ <template>
209
+ <div>
210
+ <OptionsSection title="Blocks Options" class="mt-6">
211
+ <VisibilitySwitch v-model="blocksVisibility" />
212
+ <v-row class="mt-2 pa-0">
213
+ <v-col class="pa-0">
214
+ <ViewerOptionsColoringTypeSelector
215
+ :id="modelId"
216
+ :componentId="targetBlockIds[0]"
217
+ v-model:coloring_style_key="blocksColorMode"
218
+ v-model:color="blocksColor"
219
+ v-model:vertex_attribute_name="blocksVertexAttributeName"
220
+ v-model:vertex_attribute_range="blocksVertexAttributeRange"
221
+ v-model:vertex_attribute_color_map="blocksVertexAttributeColorMap"
222
+ v-model:polyhedron_attribute_name="blocksPolyhedronAttributeName"
223
+ v-model:polyhedron_attribute_range="blocksPolyhedronAttributeRange"
224
+ v-model:polyhedron_attribute_color_map="blocksPolyhedronAttributeColorMap"
225
+ :capabilities="capabilities"
226
+ :schemas="{ vertex: vertexSchema, polyhedron: polyhedronSchema }"
227
+ :allowRandom="true"
228
+ />
229
+ </v-col>
230
+ </v-row>
231
+ </OptionsSection>
232
+
233
+ <OptionsSection v-if="blockId" title="Component Options" class="mt-6">
234
+ <VisibilitySwitch v-model="blockVisibility" />
235
+ <v-row class="mt-2 pa-0">
236
+ <v-col class="pa-0">
237
+ <ViewerOptionsColoringTypeSelector
238
+ :id="modelId"
239
+ :componentId="blockId"
240
+ v-model:coloring_style_key="blockColorMode"
241
+ v-model:color="blockColor"
242
+ v-model:vertex_attribute_name="vertexAttributeName"
243
+ v-model:vertex_attribute_range="vertexAttributeRange"
244
+ v-model:vertex_attribute_color_map="vertexAttributeColorMap"
245
+ v-model:polyhedron_attribute_name="polyhedronAttributeName"
246
+ v-model:polyhedron_attribute_range="polyhedronAttributeRange"
247
+ v-model:polyhedron_attribute_color_map="polyhedronAttributeColorMap"
248
+ :capabilities="capabilities"
249
+ :schemas="{ vertex: vertexSchema, polyhedron: polyhedronSchema }"
250
+ :allowRandom="true"
251
+ />
252
+ </v-col>
253
+ </v-row>
254
+ </OptionsSection>
255
+ </div>
256
+ </template>
@@ -0,0 +1,187 @@
1
+ <script setup>
2
+ import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.vue";
3
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
4
+ import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
5
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
6
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
7
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
8
+
9
+ const { modelId, cornerId, targetCornerIds } = defineProps({
10
+ modelId: { type: String, required: true },
11
+ cornerId: { type: String, default: undefined },
12
+ targetCornerIds: { type: Array, required: true },
13
+ });
14
+
15
+ const dataStyleStore = useDataStyleStore();
16
+ const hybridViewerStore = useHybridViewerStore();
17
+
18
+ // Visibility
19
+ const cornersVisibility = computed({
20
+ get: () => dataStyleStore.modelComponentTypeVisibility(modelId, "Corner"),
21
+ set: async (newValue) => {
22
+ await dataStyleStore.setModelComponentTypeVisibility(modelId, "Corner", newValue);
23
+ hybridViewerStore.remoteRender();
24
+ },
25
+ });
26
+
27
+ const cornerVisibility = computed({
28
+ get: () => dataStyleStore.modelCornerVisibility(modelId, cornerId),
29
+ set: async (newValue) => {
30
+ await dataStyleStore.setModelCornersVisibility(modelId, [cornerId], newValue);
31
+ hybridViewerStore.remoteRender();
32
+ },
33
+ });
34
+
35
+ // Color
36
+ const cornersColor = computed({
37
+ get: () => dataStyleStore.modelComponentTypeColor(modelId, "Corner"),
38
+ set: async (color) => {
39
+ await dataStyleStore.setModelComponentTypeColor(modelId, "Corner", color);
40
+ hybridViewerStore.remoteRender();
41
+ },
42
+ });
43
+
44
+ const cornerColor = computed({
45
+ get: () => dataStyleStore.modelCornerColor(modelId, cornerId),
46
+ set: async (color) => {
47
+ if (cornerId) {
48
+ await dataStyleStore.setModelCornersColor(modelId, [cornerId], color);
49
+ hybridViewerStore.remoteRender();
50
+ }
51
+ },
52
+ });
53
+
54
+ const cornersColorMode = computed({
55
+ get: () => dataStyleStore.getModelComponentTypeColorMode(modelId, "Corner"),
56
+ set: async (colorMode) => {
57
+ await dataStyleStore.setModelComponentTypeColorMode(modelId, "Corner", colorMode);
58
+ hybridViewerStore.remoteRender();
59
+ },
60
+ });
61
+
62
+ const cornerColorMode = computed({
63
+ get: () => dataStyleStore.modelCornerColorMode(modelId, cornerId),
64
+ set: async (colorMode) => {
65
+ if (cornerId) {
66
+ await dataStyleStore.setModelComponentColorMode(modelId, cornerId, colorMode);
67
+ hybridViewerStore.remoteRender();
68
+ }
69
+ },
70
+ });
71
+
72
+ // Group Attributes
73
+ const cornersVertexAttributeName = computed({
74
+ get: () => dataStyleStore.modelCornersVertexAttributeName(modelId, targetCornerIds[0]),
75
+ set: async (newValue) => {
76
+ await dataStyleStore.setModelCornersVertexAttributeName(modelId, targetCornerIds, newValue);
77
+ hybridViewerStore.remoteRender();
78
+ },
79
+ });
80
+
81
+ const cornersVertexAttributeRange = computed({
82
+ get: () => dataStyleStore.modelCornersVertexAttributeRange(modelId, targetCornerIds[0]),
83
+ set: async (newValue) => {
84
+ await dataStyleStore.setModelCornersVertexAttributeRange(
85
+ modelId,
86
+ targetCornerIds,
87
+ newValue[0],
88
+ newValue[1],
89
+ );
90
+ hybridViewerStore.remoteRender();
91
+ },
92
+ });
93
+
94
+ const cornersVertexAttributeColorMap = computed({
95
+ get: () => dataStyleStore.modelCornersVertexAttributeColorMap(modelId, targetCornerIds[0]),
96
+ set: async (newValue) => {
97
+ await dataStyleStore.setModelCornersVertexAttributeColorMap(modelId, targetCornerIds, newValue);
98
+ hybridViewerStore.remoteRender();
99
+ },
100
+ });
101
+
102
+ // Individual Attributes
103
+ const vertexAttributeName = computed({
104
+ get: () => dataStyleStore.modelCornersVertexAttributeName(modelId, cornerId),
105
+ set: async (newValue) => {
106
+ await dataStyleStore.setModelCornersVertexAttributeName(modelId, [cornerId], newValue);
107
+ hybridViewerStore.remoteRender();
108
+ },
109
+ });
110
+
111
+ const vertexAttributeRange = computed({
112
+ get: () => dataStyleStore.modelCornersVertexAttributeRange(modelId, cornerId),
113
+ set: async (newValue) => {
114
+ await dataStyleStore.setModelCornersVertexAttributeRange(
115
+ modelId,
116
+ [cornerId],
117
+ newValue[0],
118
+ newValue[1],
119
+ );
120
+ hybridViewerStore.remoteRender();
121
+ },
122
+ });
123
+
124
+ const vertexAttributeColorMap = computed({
125
+ get: () => dataStyleStore.modelCornersVertexAttributeColorMap(modelId, cornerId),
126
+ set: async (newValue) => {
127
+ await dataStyleStore.setModelCornersVertexAttributeColorMap(modelId, [cornerId], newValue);
128
+ hybridViewerStore.remoteRender();
129
+ },
130
+ });
131
+
132
+ const capabilities = {
133
+ color: { available: true },
134
+ textures: { available: false },
135
+ vertex: { available: true },
136
+ edge: { available: false },
137
+ cell: { available: false },
138
+ polygon: { available: false },
139
+ polyhedron: { available: false },
140
+ };
141
+
142
+ const vertexSchema = back_schemas.opengeodeweb_back.model_component_vertex_attribute_names;
143
+ </script>
144
+
145
+ <template>
146
+ <div>
147
+ <OptionsSection title="Corners Options" class="mt-6">
148
+ <VisibilitySwitch v-model="cornersVisibility" />
149
+ <v-row class="mt-2 pa-0">
150
+ <v-col class="pa-0">
151
+ <ViewerOptionsColoringTypeSelector
152
+ :id="modelId"
153
+ :componentId="targetCornerIds[0]"
154
+ v-model:coloring_style_key="cornersColorMode"
155
+ v-model:color="cornersColor"
156
+ v-model:vertex_attribute_name="cornersVertexAttributeName"
157
+ v-model:vertex_attribute_range="cornersVertexAttributeRange"
158
+ v-model:vertex_attribute_color_map="cornersVertexAttributeColorMap"
159
+ :capabilities="capabilities"
160
+ :schemas="{ vertex: vertexSchema }"
161
+ :allowRandom="true"
162
+ />
163
+ </v-col>
164
+ </v-row>
165
+ </OptionsSection>
166
+
167
+ <OptionsSection v-if="cornerId" title="Component Options" class="mt-6">
168
+ <VisibilitySwitch v-model="cornerVisibility" />
169
+ <v-row class="mt-2 pa-0">
170
+ <v-col class="pa-0">
171
+ <ViewerOptionsColoringTypeSelector
172
+ :id="modelId"
173
+ :componentId="cornerId"
174
+ v-model:coloring_style_key="cornerColorMode"
175
+ v-model:color="cornerColor"
176
+ v-model:vertex_attribute_name="vertexAttributeName"
177
+ v-model:vertex_attribute_range="vertexAttributeRange"
178
+ v-model:vertex_attribute_color_map="vertexAttributeColorMap"
179
+ :capabilities="capabilities"
180
+ :schemas="{ vertex: vertexSchema }"
181
+ :allowRandom="true"
182
+ />
183
+ </v-col>
184
+ </v-row>
185
+ </OptionsSection>
186
+ </div>
187
+ </template>
@@ -0,0 +1,252 @@
1
+ <script setup>
2
+ import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.vue";
3
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
4
+ import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
5
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
6
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
7
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
8
+
9
+ const { modelId, lineId, targetLineIds } = defineProps({
10
+ modelId: { type: String, required: true },
11
+ lineId: { type: String, default: undefined },
12
+ targetLineIds: { type: Array, required: true },
13
+ });
14
+
15
+ const dataStyleStore = useDataStyleStore();
16
+ const hybridViewerStore = useHybridViewerStore();
17
+
18
+ // Visibility
19
+ const linesVisibility = computed({
20
+ get: () => dataStyleStore.modelComponentTypeVisibility(modelId, "Line"),
21
+ set: async (newValue) => {
22
+ await dataStyleStore.setModelComponentTypeVisibility(modelId, "Line", newValue);
23
+ hybridViewerStore.remoteRender();
24
+ },
25
+ });
26
+
27
+ const lineVisibility = computed({
28
+ get: () => dataStyleStore.modelLineVisibility(modelId, lineId),
29
+ set: async (newValue) => {
30
+ await dataStyleStore.setModelLinesVisibility(modelId, [lineId], newValue);
31
+ hybridViewerStore.remoteRender();
32
+ },
33
+ });
34
+
35
+ // Color
36
+ const linesColor = computed({
37
+ get: () => dataStyleStore.modelComponentTypeColor(modelId, "Line"),
38
+ set: async (color) => {
39
+ await dataStyleStore.setModelComponentTypeColor(modelId, "Line", color);
40
+ hybridViewerStore.remoteRender();
41
+ },
42
+ });
43
+
44
+ const lineColor = computed({
45
+ get: () => dataStyleStore.modelLineColor(modelId, lineId),
46
+ set: async (color) => {
47
+ if (lineId) {
48
+ await dataStyleStore.setModelLinesColor(modelId, [lineId], color);
49
+ hybridViewerStore.remoteRender();
50
+ }
51
+ },
52
+ });
53
+
54
+ const linesColorMode = computed({
55
+ get: () => dataStyleStore.getModelComponentTypeColorMode(modelId, "Line"),
56
+ set: async (colorMode) => {
57
+ await dataStyleStore.setModelComponentTypeColorMode(modelId, "Line", colorMode);
58
+ hybridViewerStore.remoteRender();
59
+ },
60
+ });
61
+
62
+ const lineColorMode = computed({
63
+ get: () => dataStyleStore.modelLineColorMode(modelId, lineId),
64
+ set: async (colorMode) => {
65
+ if (lineId) {
66
+ await dataStyleStore.setModelComponentColorMode(modelId, lineId, colorMode);
67
+ hybridViewerStore.remoteRender();
68
+ }
69
+ },
70
+ });
71
+
72
+ // Group Attributes
73
+ const linesVertexAttributeName = computed({
74
+ get: () => dataStyleStore.modelLinesVertexAttributeName(modelId, targetLineIds[0]),
75
+ set: async (newValue) => {
76
+ await dataStyleStore.setModelLinesVertexAttributeName(modelId, targetLineIds, newValue);
77
+ hybridViewerStore.remoteRender();
78
+ },
79
+ });
80
+
81
+ const linesVertexAttributeRange = computed({
82
+ get: () => dataStyleStore.modelLinesVertexAttributeRange(modelId, targetLineIds[0]),
83
+ set: async (newValue) => {
84
+ await dataStyleStore.setModelLinesVertexAttributeRange(
85
+ modelId,
86
+ targetLineIds,
87
+ newValue[0],
88
+ newValue[1],
89
+ );
90
+ hybridViewerStore.remoteRender();
91
+ },
92
+ });
93
+
94
+ const linesVertexAttributeColorMap = computed({
95
+ get: () => dataStyleStore.modelLinesVertexAttributeColorMap(modelId, targetLineIds[0]),
96
+ set: async (newValue) => {
97
+ await dataStyleStore.setModelLinesVertexAttributeColorMap(modelId, targetLineIds, newValue);
98
+ hybridViewerStore.remoteRender();
99
+ },
100
+ });
101
+
102
+ const linesEdgeAttributeName = computed({
103
+ get: () => dataStyleStore.modelLinesEdgeAttributeName(modelId, targetLineIds[0]),
104
+ set: async (newValue) => {
105
+ await dataStyleStore.setModelLinesEdgeAttributeName(modelId, targetLineIds, newValue);
106
+ hybridViewerStore.remoteRender();
107
+ },
108
+ });
109
+
110
+ const linesEdgeAttributeRange = computed({
111
+ get: () => dataStyleStore.modelLinesEdgeAttributeRange(modelId, targetLineIds[0]),
112
+ set: async (newValue) => {
113
+ await dataStyleStore.setModelLinesEdgeAttributeRange(
114
+ modelId,
115
+ targetLineIds,
116
+ newValue[0],
117
+ newValue[1],
118
+ );
119
+ hybridViewerStore.remoteRender();
120
+ },
121
+ });
122
+
123
+ const linesEdgeAttributeColorMap = computed({
124
+ get: () => dataStyleStore.modelLinesEdgeAttributeColorMap(modelId, targetLineIds[0]),
125
+ set: async (newValue) => {
126
+ await dataStyleStore.setModelLinesEdgeAttributeColorMap(modelId, targetLineIds, newValue);
127
+ hybridViewerStore.remoteRender();
128
+ },
129
+ });
130
+
131
+ // Individual Attributes
132
+ const vertexAttributeName = computed({
133
+ get: () => dataStyleStore.modelLinesVertexAttributeName(modelId, lineId),
134
+ set: async (newValue) => {
135
+ await dataStyleStore.setModelLinesVertexAttributeName(modelId, [lineId], newValue);
136
+ hybridViewerStore.remoteRender();
137
+ },
138
+ });
139
+
140
+ const vertexAttributeRange = computed({
141
+ get: () => dataStyleStore.modelLinesVertexAttributeRange(modelId, lineId),
142
+ set: async (newValue) => {
143
+ await dataStyleStore.setModelLinesVertexAttributeRange(
144
+ modelId,
145
+ [lineId],
146
+ newValue[0],
147
+ newValue[1],
148
+ );
149
+ hybridViewerStore.remoteRender();
150
+ },
151
+ });
152
+
153
+ const vertexAttributeColorMap = computed({
154
+ get: () => dataStyleStore.modelLinesVertexAttributeColorMap(modelId, lineId),
155
+ set: async (newValue) => {
156
+ await dataStyleStore.setModelLinesVertexAttributeColorMap(modelId, [lineId], newValue);
157
+ hybridViewerStore.remoteRender();
158
+ },
159
+ });
160
+
161
+ const edgeAttributeName = computed({
162
+ get: () => dataStyleStore.modelLinesEdgeAttributeName(modelId, lineId),
163
+ set: async (newValue) => {
164
+ await dataStyleStore.setModelLinesEdgeAttributeName(modelId, [lineId], newValue);
165
+ hybridViewerStore.remoteRender();
166
+ },
167
+ });
168
+
169
+ const edgeAttributeRange = computed({
170
+ get: () => dataStyleStore.modelLinesEdgeAttributeRange(modelId, lineId),
171
+ set: async (newValue) => {
172
+ await dataStyleStore.setModelLinesEdgeAttributeRange(
173
+ modelId,
174
+ [lineId],
175
+ newValue[0],
176
+ newValue[1],
177
+ );
178
+ hybridViewerStore.remoteRender();
179
+ },
180
+ });
181
+
182
+ const edgeAttributeColorMap = computed({
183
+ get: () => dataStyleStore.modelLinesEdgeAttributeColorMap(modelId, lineId),
184
+ set: async (newValue) => {
185
+ await dataStyleStore.setModelLinesEdgeAttributeColorMap(modelId, [lineId], newValue);
186
+ hybridViewerStore.remoteRender();
187
+ },
188
+ });
189
+
190
+ const capabilities = {
191
+ color: { available: true },
192
+ textures: { available: false },
193
+ vertex: { available: true },
194
+ edge: { available: true },
195
+ cell: { available: false },
196
+ polygon: { available: false },
197
+ polyhedron: { available: false },
198
+ };
199
+
200
+ const vertexSchema = back_schemas.opengeodeweb_back.model_component_vertex_attribute_names;
201
+ const edgeSchema = back_schemas.opengeodeweb_back.model_component_edge_attribute_names;
202
+ </script>
203
+
204
+ <template>
205
+ <div>
206
+ <OptionsSection title="Lines Options" class="mt-6">
207
+ <VisibilitySwitch v-model="linesVisibility" />
208
+ <v-row class="mt-2 pa-0">
209
+ <v-col class="pa-0">
210
+ <ViewerOptionsColoringTypeSelector
211
+ :id="modelId"
212
+ :componentId="targetLineIds[0]"
213
+ v-model:coloring_style_key="linesColorMode"
214
+ v-model:color="linesColor"
215
+ v-model:vertex_attribute_name="linesVertexAttributeName"
216
+ v-model:vertex_attribute_range="linesVertexAttributeRange"
217
+ v-model:vertex_attribute_color_map="linesVertexAttributeColorMap"
218
+ v-model:edge_attribute_name="linesEdgeAttributeName"
219
+ v-model:edge_attribute_range="linesEdgeAttributeRange"
220
+ v-model:edge_attribute_color_map="linesEdgeAttributeColorMap"
221
+ :capabilities="capabilities"
222
+ :schemas="{ vertex: vertexSchema, edge: edgeSchema }"
223
+ :allowRandom="true"
224
+ />
225
+ </v-col>
226
+ </v-row>
227
+ </OptionsSection>
228
+
229
+ <OptionsSection v-if="lineId" title="Component Options" class="mt-6">
230
+ <VisibilitySwitch v-model="lineVisibility" />
231
+ <v-row class="mt-2 pa-0">
232
+ <v-col class="pa-0">
233
+ <ViewerOptionsColoringTypeSelector
234
+ :id="modelId"
235
+ :componentId="lineId"
236
+ v-model:coloring_style_key="lineColorMode"
237
+ v-model:color="lineColor"
238
+ v-model:vertex_attribute_name="vertexAttributeName"
239
+ v-model:vertex_attribute_range="vertexAttributeRange"
240
+ v-model:vertex_attribute_color_map="vertexAttributeColorMap"
241
+ v-model:edge_attribute_name="edgeAttributeName"
242
+ v-model:edge_attribute_range="edgeAttributeRange"
243
+ v-model:edge_attribute_color_map="edgeAttributeColorMap"
244
+ :capabilities="capabilities"
245
+ :schemas="{ vertex: vertexSchema, edge: edgeSchema }"
246
+ :allowRandom="true"
247
+ />
248
+ </v-col>
249
+ </v-row>
250
+ </OptionsSection>
251
+ </div>
252
+ </template>