@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
@@ -1,327 +0,0 @@
1
- // Global variables
2
- const points_defaultVisibility = true;
3
- const edges_defaultVisibility = true;
4
- const cells_defaultVisibility = true;
5
- const polygons_defaultVisibility = true;
6
- const polyhedra_defaultVisibility = true;
7
- const points_defaultSize = 10;
8
- const points_defaultColor = { red: 20, green: 20, blue: 20, alpha: 1 };
9
- const edges_defaultWidth = 2;
10
- const edges_defaultColor = { red: 20, green: 20, blue: 20, alpha: 1 };
11
- const cells_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
12
- const polygons_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
13
- const polyhedra_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
14
-
15
- const corners_defaultVisibility = true;
16
- const corners_defaultColor = { red: 20, green: 20, blue: 20, alpha: 1 };
17
- const lines_defaultVisibility = true;
18
- const lines_defaultColor = { red: 20, green: 20, blue: 20, alpha: 1 };
19
- const surfaces_defaultVisibility = true;
20
- const surfaces_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
21
- const blocks_defaultVisibility = true;
22
- const blocks_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
23
-
24
- const DEFAULT_MODEL_COMPONENT_TYPE_COLORS = {
25
- Corner: corners_defaultColor,
26
- Line: lines_defaultColor,
27
- Surface: surfaces_defaultColor,
28
- Block: blocks_defaultColor,
29
- };
30
-
31
- const MESH_TYPES = ["Corner", "Line", "Surface", "Block"];
32
-
33
- // Mesh functions
34
- function meshPointsDefaultStyle(
35
- visibility = points_defaultVisibility,
36
- size = points_defaultSize,
37
- color = points_defaultColor,
38
- ) {
39
- return {
40
- visibility,
41
- coloring: {
42
- active: "color",
43
- color,
44
- vertex: {
45
- name: undefined,
46
- storedConfigs: {},
47
- },
48
- },
49
- size,
50
- };
51
- }
52
-
53
- function meshEdgesDefaultStyle(
54
- visibility = edges_defaultVisibility,
55
- width = edges_defaultWidth,
56
- color = edges_defaultColor,
57
- ) {
58
- return {
59
- visibility,
60
- coloring: {
61
- active: "color",
62
- color,
63
- edge: {
64
- name: undefined,
65
- storedConfigs: {},
66
- },
67
- vertex: {
68
- name: undefined,
69
- storedConfigs: {},
70
- },
71
- },
72
- width,
73
- };
74
- }
75
-
76
- function meshCellsDefaultStyle(visibility = cells_defaultVisibility, color = cells_defaultColor) {
77
- return {
78
- visibility,
79
- coloring: {
80
- active: "color",
81
- cell: {
82
- name: undefined,
83
- storedConfigs: {},
84
- },
85
- color,
86
- textures: undefined,
87
- vertex: {
88
- name: undefined,
89
- storedConfigs: {},
90
- },
91
- },
92
- };
93
- }
94
-
95
- function meshPolygonsDefaultStyle(
96
- visibility = polygons_defaultVisibility,
97
- color = polygons_defaultColor,
98
- ) {
99
- return {
100
- visibility,
101
- coloring: {
102
- active: "color",
103
- color,
104
- textures: undefined,
105
- polygon: {
106
- name: undefined,
107
- storedConfigs: {},
108
- },
109
- vertex: {
110
- name: undefined,
111
- storedConfigs: {},
112
- },
113
- },
114
- };
115
- }
116
-
117
- function meshPolyhedraDefaultStyle(
118
- visibility = polyhedra_defaultVisibility,
119
- color = polyhedra_defaultColor,
120
- ) {
121
- return {
122
- visibility,
123
- coloring: {
124
- active: "color",
125
- color,
126
- polyhedron: {
127
- name: undefined,
128
- storedConfigs: {},
129
- },
130
- vertex: {
131
- name: undefined,
132
- storedConfigs: {},
133
- },
134
- },
135
- };
136
- }
137
-
138
- function pointSet_defaultStyle() {
139
- return {
140
- visibility: true,
141
- points: meshPointsDefaultStyle(),
142
- };
143
- }
144
-
145
- function edgedCurve_defaultStyle() {
146
- return {
147
- visibility: true,
148
- points: meshPointsDefaultStyle(),
149
- edges: meshEdgesDefaultStyle(),
150
- };
151
- }
152
-
153
- function grid2d_defaultStyle() {
154
- return {
155
- visibility: true,
156
- points: meshPointsDefaultStyle(false),
157
- edges: meshEdgesDefaultStyle(false),
158
- cells: meshCellsDefaultStyle(),
159
- };
160
- }
161
-
162
- function grid3d_defaultStyle() {
163
- return {
164
- visibility: true,
165
- points: meshPointsDefaultStyle(false),
166
- edges: meshEdgesDefaultStyle(false),
167
- cells: meshCellsDefaultStyle(),
168
- polyhedra: meshPolyhedraDefaultStyle(),
169
- };
170
- }
171
- function surface_defaultStyle() {
172
- return {
173
- visibility: true,
174
- points: meshPointsDefaultStyle(false),
175
- edges: meshEdgesDefaultStyle(false),
176
- polygons: meshPolygonsDefaultStyle(),
177
- };
178
- }
179
-
180
- function solid_defaultStyle() {
181
- return {
182
- visibility: true,
183
- points: meshPointsDefaultStyle(false),
184
- edges: meshEdgesDefaultStyle(false),
185
- polygons: meshPolygonsDefaultStyle(),
186
- polyhedra: meshPolyhedraDefaultStyle(),
187
- };
188
- }
189
-
190
- // Model functions
191
- function modelCornersDefaultStyle(
192
- visibility = corners_defaultVisibility,
193
- color = corners_defaultColor,
194
- ) {
195
- return { visibility, color };
196
- }
197
-
198
- function modelLinesDefaultStyle(visibility = lines_defaultVisibility, color = lines_defaultColor) {
199
- return { visibility, color };
200
- }
201
-
202
- function modelSurfacesDefaultStyle(
203
- visibility = surfaces_defaultVisibility,
204
- color = surfaces_defaultColor,
205
- ) {
206
- return { visibility, color };
207
- }
208
-
209
- function modelBlocksDefaultStyle(
210
- visibility = blocks_defaultVisibility,
211
- color = blocks_defaultColor,
212
- ) {
213
- return { visibility, color };
214
- }
215
-
216
- function modelPointsDefaultStyle(visibility = points_defaultVisibility, size = points_defaultSize) {
217
- return { visibility, size };
218
- }
219
-
220
- function modelEdgesDefaultStyle(visibility = edges_defaultVisibility, width = edges_defaultWidth) {
221
- return { visibility, width };
222
- }
223
-
224
- function brep_defaultStyle() {
225
- return {
226
- visibility: true,
227
- corners: modelCornersDefaultStyle(),
228
- lines: modelLinesDefaultStyle(),
229
- surfaces: modelSurfacesDefaultStyle(),
230
- blocks: modelBlocksDefaultStyle(),
231
- points: modelPointsDefaultStyle(false, points_defaultSize),
232
- edges: modelEdgesDefaultStyle(false, edges_defaultWidth),
233
- };
234
- }
235
-
236
- function crossSection_defaultStyle() {
237
- return {
238
- visibility: true,
239
- corners: modelCornersDefaultStyle(),
240
- lines: modelLinesDefaultStyle(),
241
- surfaces: modelSurfacesDefaultStyle(),
242
- points: modelPointsDefaultStyle(false, points_defaultSize),
243
- edges: modelEdgesDefaultStyle(false, edges_defaultWidth),
244
- };
245
- }
246
-
247
- function structuralModel_defaultStyle() {
248
- return {
249
- visibility: true,
250
- corners: modelCornersDefaultStyle(),
251
- lines: modelLinesDefaultStyle(),
252
- surfaces: modelSurfacesDefaultStyle(),
253
- blocks: modelBlocksDefaultStyle(),
254
- points: modelPointsDefaultStyle(false, points_defaultSize),
255
- edges: modelEdgesDefaultStyle(false, edges_defaultWidth),
256
- };
257
- }
258
-
259
- function section_defaultStyle() {
260
- return {
261
- visibility: true,
262
- corners: modelCornersDefaultStyle(),
263
- lines: modelLinesDefaultStyle(),
264
- surfaces: modelSurfacesDefaultStyle(),
265
- points: modelPointsDefaultStyle(false, points_defaultSize),
266
- edges: modelEdgesDefaultStyle(false, edges_defaultWidth),
267
- };
268
- }
269
-
270
- function implicitCrossSection_defaultStyle() {
271
- return {
272
- visibility: true,
273
- corners: modelCornersDefaultStyle(),
274
- lines: modelLinesDefaultStyle(),
275
- surfaces: modelSurfacesDefaultStyle(),
276
- points: modelPointsDefaultStyle(false, points_defaultSize),
277
- edges: modelEdgesDefaultStyle(false, edges_defaultWidth),
278
- };
279
- }
280
-
281
- function implicitStructuralModel_defaultStyle() {
282
- return {
283
- visibility: true,
284
- corners: modelCornersDefaultStyle(),
285
- lines: modelLinesDefaultStyle(),
286
- surfaces: modelSurfacesDefaultStyle(),
287
- blocks: modelBlocksDefaultStyle(),
288
- points: modelPointsDefaultStyle(false, points_defaultSize),
289
- edges: modelEdgesDefaultStyle(false, edges_defaultWidth),
290
- };
291
- }
292
-
293
- function default_styles() {
294
- return {
295
- BRep: brep_defaultStyle(),
296
- CrossSection: crossSection_defaultStyle(),
297
- EdgedCurve2D: edgedCurve_defaultStyle(),
298
- EdgedCurve3D: edgedCurve_defaultStyle(),
299
- Graph: {},
300
- HybridSolid3D: solid_defaultStyle(),
301
- ImplicitCrossSection: implicitCrossSection_defaultStyle(),
302
- ImplicitStructuralModel: implicitStructuralModel_defaultStyle(),
303
- LightRegularGrid2D: grid2d_defaultStyle(),
304
- LightRegularGrid3D: grid3d_defaultStyle(),
305
- PointSet2D: pointSet_defaultStyle(),
306
- PointSet3D: pointSet_defaultStyle(),
307
- PolygonalSurface2D: surface_defaultStyle(),
308
- PolygonalSurface3D: surface_defaultStyle(),
309
- PolyhedralSolid3D: solid_defaultStyle(),
310
- RasterImage2D: {},
311
- RasterImage3D: {},
312
- RegularGrid2D: grid2d_defaultStyle(),
313
- RegularGrid3D: grid3d_defaultStyle(),
314
- Section: section_defaultStyle(),
315
- StructuralModel: structuralModel_defaultStyle(),
316
- TetrahedralSolid3D: solid_defaultStyle(),
317
- TriangulatedSurface2D: surface_defaultStyle(),
318
- TriangulatedSurface3D: surface_defaultStyle(),
319
- VertexSet: {},
320
- };
321
- }
322
-
323
- function getDefaultStyle(type) {
324
- return default_styles()[type];
325
- }
326
-
327
- export { getDefaultStyle, DEFAULT_MODEL_COMPONENT_TYPE_COLORS, MESH_TYPES };