@geode/opengeodeweb-front 10.3.0 → 10.3.1
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.
- package/.eslintrc.cjs +1 -0
- package/app/assets/geode_objects.js +1 -3
- package/app/components/Carousel.vue +7 -4
- package/app/components/CrsSelector.vue +5 -6
- package/app/components/DragAndDrop.vue +18 -8
- package/app/components/ExtensionSelector.vue +9 -17
- package/app/components/FeedBack/ErrorBanner.vue +1 -1
- package/app/components/FeedBack/Snackers.vue +4 -1
- package/app/components/FileSelector.vue +21 -10
- package/app/components/FileUploader.vue +15 -32
- package/app/components/HybridRenderingView.vue +5 -3
- package/app/components/Inspector/InspectionButton.vue +2 -2
- package/app/components/Inspector/ResultPanel.vue +4 -4
- package/app/components/Launcher.vue +1 -1
- package/app/components/Loading.vue +6 -6
- package/app/components/MissingFilesSelector.vue +23 -29
- package/app/components/ObjectSelector.vue +11 -10
- package/app/components/OptionCard.vue +1 -1
- package/app/components/PackagesVersions.vue +5 -3
- package/app/components/Recaptcha.vue +6 -4
- package/app/components/RemoteRenderingView.vue +4 -3
- package/app/components/Screenshot.vue +4 -4
- package/app/components/Step.vue +7 -7
- package/app/components/VeaseViewToolbar.vue +3 -3
- package/app/components/Viewer/BreadCrumb.vue +2 -4
- package/app/components/Viewer/ContextMenu.vue +77 -45
- package/app/components/Viewer/ContextMenuItem.vue +42 -33
- package/app/components/Viewer/EdgedCurve/PointsOptions.vue +3 -3
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +5 -5
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +6 -6
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +5 -5
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +5 -5
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +6 -7
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -6
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +4 -4
- package/app/components/Viewer/Grid/2D/CellsOptions.vue +3 -3
- package/app/components/Viewer/Grid/2D/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Grid/2D/PointsOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/CellsOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/FacetsOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/PointsOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/EdgesOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/PointsOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +3 -3
- package/app/components/Viewer/Options/CellAttributeSelector.vue +23 -20
- package/app/components/Viewer/Options/ColorMapList.vue +75 -50
- package/app/components/Viewer/Options/ColorMapPicker.vue +38 -32
- package/app/components/Viewer/Options/ColorPicker.vue +3 -3
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +29 -21
- package/app/components/Viewer/Options/EdgeAttributeSelector.vue +7 -7
- package/app/components/Viewer/Options/PolygonAttributeSelector.vue +7 -7
- package/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +7 -7
- package/app/components/Viewer/Options/TextureItem.vue +5 -5
- package/app/components/Viewer/Options/TexturesSelector.vue +5 -5
- package/app/components/Viewer/Options/VertexAttributeSelector.vue +7 -7
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +5 -5
- package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +3 -3
- package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +3 -3
- package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +6 -6
- package/app/components/Viewer/Solid/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Solid/PointsOptions.vue +3 -3
- package/app/components/Viewer/Solid/PolygonsOptions.vue +3 -3
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +6 -6
- package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +3 -3
- package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +3 -3
- package/app/components/Viewer/Tree/ObjectTree.vue +7 -9
- package/app/components/Viewer/TreeComponent.vue +9 -13
- package/app/components/Viewer/TreeObject.vue +8 -9
- package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +3 -3
- package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +3 -3
- package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +3 -3
- package/app/components/Wrapper.vue +1 -2
- package/app/components/ZScaling.vue +1 -1
- package/app/composables/project_manager.js +6 -6
- package/app/plugins/auto_store_register.js +1 -1
- package/app/stores/app.js +45 -41
- package/app/stores/data.js +52 -51
- package/app/stores/data_style.js +12 -11
- package/app/stores/feedback.js +5 -1
- package/app/stores/geode.js +16 -13
- package/app/stores/hybrid_viewer.js +72 -44
- package/app/stores/infra.js +18 -16
- package/app/stores/lambda.js +1 -9
- package/app/stores/menu.js +13 -13
- package/app/stores/treeview.js +15 -13
- package/app/stores/viewer.js +39 -33
- package/app/utils/app_mode.js +4 -3
- package/app/utils/default_styles.js +55 -47
- package/app/utils/file_import_workflow.js +4 -17
- package/app/utils/local.js +195 -184
- package/app/utils/upload_file.js +1 -2
- package/eslint.config.js +2 -2
- package/internal/database/database.js +17 -32
- package/internal/database/extended_database.js +25 -0
- package/internal/stores/data_style/mesh/cells/cell.js +3 -3
- package/internal/stores/data_style/mesh/cells/color.js +1 -1
- package/internal/stores/data_style/mesh/cells/index.js +7 -7
- package/internal/stores/data_style/mesh/cells/textures.js +1 -1
- package/internal/stores/data_style/mesh/cells/vertex.js +3 -3
- package/internal/stores/data_style/mesh/cells/visibility.js +1 -1
- package/internal/stores/data_style/mesh/edges/color.js +1 -1
- package/internal/stores/data_style/mesh/edges/edge.js +22 -22
- package/internal/stores/data_style/mesh/edges/index.js +7 -7
- package/internal/stores/data_style/mesh/edges/vertex.js +3 -3
- package/internal/stores/data_style/mesh/edges/visibility.js +1 -1
- package/internal/stores/data_style/mesh/edges/width.js +1 -1
- package/internal/stores/data_style/mesh/index.js +4 -5
- package/internal/stores/data_style/mesh/points/color.js +1 -1
- package/internal/stores/data_style/mesh/points/index.js +6 -6
- package/internal/stores/data_style/mesh/points/size.js +1 -1
- package/internal/stores/data_style/mesh/points/vertex.js +3 -3
- package/internal/stores/data_style/mesh/points/visibility.js +1 -1
- package/internal/stores/data_style/mesh/polygons/color.js +1 -1
- package/internal/stores/data_style/mesh/polygons/index.js +7 -7
- package/internal/stores/data_style/mesh/polygons/polygon.js +3 -3
- package/internal/stores/data_style/mesh/polygons/textures.js +1 -1
- package/internal/stores/data_style/mesh/polygons/vertex.js +3 -3
- package/internal/stores/data_style/mesh/polygons/visibility.js +1 -1
- package/internal/stores/data_style/mesh/polyhedra/color.js +1 -1
- package/internal/stores/data_style/mesh/polyhedra/index.js +6 -6
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +3 -3
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +3 -3
- package/internal/stores/data_style/mesh/polyhedra/visibility.js +1 -1
- package/internal/stores/data_style/model/edges.js +1 -1
- package/internal/stores/data_style/model/index.js +32 -22
- package/internal/utils/api_fetch.js +8 -5
- package/internal/utils/viewer_call.js +42 -46
- package/nuxt.config.js +3 -3
- package/package.json +1 -1
- package/scripts/generate_geode_objects.js +8 -7
- package/tests/integration/setup.js +28 -21
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +17 -10
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +10 -6
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +10 -6
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +10 -6
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +10 -6
- package/tests/integration/stores/viewer.nuxt.test.js +55 -39
- package/tests/setup_indexeddb.js +1 -0
- package/tests/unit/components/CrsSelector.nuxt.test.js +18 -19
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +24 -19
- package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -36
- package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +20 -25
- package/tests/unit/components/FileSelector.nuxt.test.js +27 -27
- package/tests/unit/components/FileUploader.nuxt.test.js +18 -17
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +9 -16
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +8 -6
- package/tests/unit/components/Launcher.nuxt.test.js +12 -17
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +16 -19
- package/tests/unit/components/ObjectSelector.nuxt.test.js +30 -34
- package/tests/unit/components/PackagesVersions.nuxt.test.js +8 -11
- package/tests/unit/components/Step.nuxt.test.js +8 -7
- package/tests/unit/components/Stepper.nuxt.test.js +14 -12
- package/tests/unit/composables/ProjectManager.nuxt.test.js +142 -100
- package/tests/unit/composables/api_fetch.nuxt.test.js +12 -39
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -61
- package/tests/unit/composables/upload_file.nuxt.test.js +21 -25
- package/tests/unit/plugins/project_load.nuxt.test.js +22 -21
- package/tests/unit/stores/App.nuxt.test.js +45 -43
- package/tests/unit/stores/Feedback.nuxt.test.js +16 -18
- package/tests/unit/stores/Geode.nuxt.test.js +135 -137
- package/tests/unit/stores/Infra.nuxt.test.js +20 -26
- package/tests/unit/stores/Lambda.nuxt.test.js +30 -31
- package/tests/unit/stores/Treeview.nuxt.test.js +53 -55
- package/tests/unit/stores/Viewer.nuxt.test.js +16 -23
- package/tests/unit/utils/validate_schema.nuxt.test.js +18 -18
- package/tests/utils.js +15 -2
- package/tests/vitest.config.js +6 -2
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps"
|
|
3
|
-
import vtkColorTransferFunction from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction"
|
|
3
|
+
import { newInstance as vtkColorTransferFunction } from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction"
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const LAST_POINT_OFFSET = 4
|
|
6
|
+
const THREE = 3
|
|
7
|
+
const CHUNK_SIZE = 5
|
|
8
|
+
|
|
9
|
+
const { presets } = defineProps({
|
|
6
10
|
presets: { type: Array, required: true },
|
|
7
11
|
})
|
|
8
12
|
|
|
@@ -11,92 +15,113 @@
|
|
|
11
15
|
const filterText = ref("")
|
|
12
16
|
const canvasRefs = ref({})
|
|
13
17
|
const loading = ref(true)
|
|
14
|
-
|
|
18
|
+
const renderJobId = ref(0)
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
canvasRefs.value[id] = {
|
|
20
|
+
function setCanvasRef(presetName, element, id) {
|
|
21
|
+
if (element) {
|
|
22
|
+
canvasRefs.value[id] = { element, presetName }
|
|
19
23
|
} else {
|
|
20
24
|
delete canvasRefs.value[id]
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
const filteredPresets = computed(() => {
|
|
25
|
-
if (!filterText.value)
|
|
29
|
+
if (!filterText.value) {
|
|
30
|
+
return presets
|
|
31
|
+
}
|
|
26
32
|
const term = filterText.value.toLowerCase()
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
const result = []
|
|
35
|
+
for (const item of presets) {
|
|
29
36
|
if (item.Children) {
|
|
30
|
-
const children = item.Children.filter((
|
|
31
|
-
|
|
37
|
+
const children = item.Children.filter((child) =>
|
|
38
|
+
child.Name.toLowerCase().includes(term),
|
|
32
39
|
)
|
|
33
|
-
if (children.length)
|
|
40
|
+
if (children.length > 0) {
|
|
41
|
+
result.push({ ...item, Children: children })
|
|
42
|
+
}
|
|
34
43
|
} else if (item.Name.toLowerCase().includes(term)) {
|
|
35
|
-
|
|
44
|
+
result.push(item)
|
|
36
45
|
}
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
}
|
|
47
|
+
return result
|
|
39
48
|
})
|
|
40
49
|
|
|
41
50
|
function drawPresetCanvas(presetName, canvas) {
|
|
42
|
-
if (!canvas)
|
|
51
|
+
if (!canvas) {
|
|
52
|
+
return
|
|
53
|
+
}
|
|
43
54
|
const preset = vtkColorMaps.getPresetByName(presetName)
|
|
44
|
-
if (!preset || !preset.RGBPoints)
|
|
55
|
+
if (!preset || !preset.RGBPoints) {
|
|
56
|
+
return
|
|
57
|
+
}
|
|
45
58
|
|
|
46
59
|
const ctx = canvas.getContext("2d")
|
|
47
|
-
const {
|
|
48
|
-
const lut = vtkColorTransferFunction
|
|
60
|
+
const { height, width } = canvas
|
|
61
|
+
const lut = vtkColorTransferFunction()
|
|
49
62
|
const rgbPoints = preset.RGBPoints
|
|
50
63
|
|
|
51
|
-
for (let
|
|
64
|
+
for (let pointIdx = 0; pointIdx < rgbPoints.length; pointIdx += 4) {
|
|
52
65
|
lut.addRGBPoint(
|
|
53
|
-
rgbPoints[
|
|
54
|
-
rgbPoints[
|
|
55
|
-
rgbPoints[
|
|
56
|
-
rgbPoints[
|
|
66
|
+
rgbPoints[pointIdx],
|
|
67
|
+
rgbPoints[pointIdx + 1],
|
|
68
|
+
rgbPoints[pointIdx + 2],
|
|
69
|
+
rgbPoints[pointIdx + THREE],
|
|
57
70
|
)
|
|
58
71
|
}
|
|
59
72
|
|
|
60
73
|
const table = lut.getUint8Table(
|
|
61
74
|
rgbPoints[0],
|
|
62
|
-
rgbPoints
|
|
75
|
+
rgbPoints.at(-LAST_POINT_OFFSET),
|
|
63
76
|
width,
|
|
64
77
|
true,
|
|
65
78
|
)
|
|
66
79
|
const imageData = ctx.createImageData(width, height)
|
|
67
80
|
|
|
68
|
-
for (let
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
for (let
|
|
74
|
-
const
|
|
75
|
-
imageData.data[
|
|
76
|
-
imageData.data[
|
|
77
|
-
imageData.data[
|
|
78
|
-
imageData.data[
|
|
81
|
+
for (let xCoord = 0; xCoord < width; xCoord += 1) {
|
|
82
|
+
const alpha = table[xCoord * 4 + THREE],
|
|
83
|
+
blue = table[xCoord * 4 + 2],
|
|
84
|
+
green = table[xCoord * 4 + 1],
|
|
85
|
+
red = table[xCoord * 4]
|
|
86
|
+
for (let yCoord = 0; yCoord < height; yCoord += 1) {
|
|
87
|
+
const pixelIdx = (yCoord * width + xCoord) * 4
|
|
88
|
+
imageData.data[pixelIdx] = red
|
|
89
|
+
imageData.data[pixelIdx + 1] = green
|
|
90
|
+
imageData.data[pixelIdx + 2] = blue
|
|
91
|
+
imageData.data[pixelIdx + THREE] = alpha
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
94
|
ctx.putImageData(imageData, 0, 0)
|
|
82
95
|
}
|
|
83
96
|
|
|
84
|
-
|
|
85
|
-
renderJobId
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const entries = Object.entries(canvasRefs.value)
|
|
92
|
-
for (let i = 0; i < entries.length; i += 5) {
|
|
93
|
-
if (currentJobId !== renderJobId) return
|
|
94
|
-
entries
|
|
95
|
-
.slice(i, i + 5)
|
|
96
|
-
.forEach(([_, { presetName, el }]) => drawPresetCanvas(presetName, el))
|
|
97
|
-
await new Promise((r) => setTimeout(r, 0))
|
|
97
|
+
function processChunk(entries, index, jobId) {
|
|
98
|
+
if (jobId !== renderJobId.value || index >= entries.length) {
|
|
99
|
+
if (jobId === renderJobId.value) {
|
|
100
|
+
loading.value = false
|
|
101
|
+
}
|
|
102
|
+
return
|
|
98
103
|
}
|
|
99
|
-
|
|
104
|
+
|
|
105
|
+
const end = Math.min(index + CHUNK_SIZE, entries.length)
|
|
106
|
+
for (let i = index; i < end; i += 1) {
|
|
107
|
+
const [unusedKey, refValue] = entries[i]
|
|
108
|
+
drawPresetCanvas(refValue.presetName, refValue.element)
|
|
109
|
+
}
|
|
110
|
+
const ZERO = 0
|
|
111
|
+
setTimeout(() => processChunk(entries, end, jobId), ZERO)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function drawAllCanvases() {
|
|
115
|
+
renderJobId.value += 1
|
|
116
|
+
const jobId = renderJobId.value
|
|
117
|
+
loading.value = true
|
|
118
|
+
nextTick(() => {
|
|
119
|
+
const WAIT_MS = 50
|
|
120
|
+
setTimeout(
|
|
121
|
+
() => processChunk(Object.entries(canvasRefs.value), 0, jobId),
|
|
122
|
+
WAIT_MS,
|
|
123
|
+
)
|
|
124
|
+
})
|
|
100
125
|
}
|
|
101
126
|
|
|
102
127
|
onMounted(drawAllCanvases)
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps"
|
|
3
|
-
import vtkColorTransferFunction from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction"
|
|
4
2
|
import ColorMapList from "./ColorMapList.vue"
|
|
3
|
+
import { newInstance } from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction"
|
|
4
|
+
import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps"
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const LAST_POINT_OFFSET = 4
|
|
7
|
+
const THREE = 3
|
|
8
|
+
|
|
9
|
+
const { max, min, modelValue } = defineProps({
|
|
7
10
|
modelValue: { type: String, default: "Cool to Warm" },
|
|
8
11
|
min: { type: Number, required: true },
|
|
9
12
|
max: { type: Number, required: true },
|
|
@@ -12,8 +15,8 @@
|
|
|
12
15
|
const emit = defineEmits(["update:modelValue"])
|
|
13
16
|
|
|
14
17
|
const menuOpen = ref(false)
|
|
15
|
-
const lutCanvas = ref(
|
|
16
|
-
const selectedPresetName = ref(
|
|
18
|
+
const lutCanvas = ref()
|
|
19
|
+
const selectedPresetName = ref(modelValue)
|
|
17
20
|
|
|
18
21
|
const presets = computed(() => {
|
|
19
22
|
const allPresets = vtkColorMaps.rgbPresetNames.map((name) =>
|
|
@@ -59,45 +62,49 @@
|
|
|
59
62
|
})
|
|
60
63
|
|
|
61
64
|
function drawLutCanvas() {
|
|
62
|
-
if (!lutCanvas.value)
|
|
65
|
+
if (!lutCanvas.value) {
|
|
66
|
+
return
|
|
67
|
+
}
|
|
63
68
|
const preset = vtkColorMaps.getPresetByName(selectedPresetName.value)
|
|
64
|
-
if (!preset || !preset.RGBPoints)
|
|
69
|
+
if (!preset || !preset.RGBPoints) {
|
|
70
|
+
return
|
|
71
|
+
}
|
|
65
72
|
|
|
66
73
|
const canvas = lutCanvas.value
|
|
67
74
|
const ctx = canvas.getContext("2d")
|
|
68
|
-
const {
|
|
75
|
+
const { height, width } = canvas
|
|
69
76
|
|
|
70
|
-
const lut =
|
|
77
|
+
const lut = newInstance()
|
|
71
78
|
const rgbPoints = preset.RGBPoints
|
|
72
79
|
|
|
73
|
-
for (let
|
|
80
|
+
for (let pointIdx = 0; pointIdx < rgbPoints.length; pointIdx += 4) {
|
|
74
81
|
lut.addRGBPoint(
|
|
75
|
-
rgbPoints[
|
|
76
|
-
rgbPoints[
|
|
77
|
-
rgbPoints[
|
|
78
|
-
rgbPoints[
|
|
82
|
+
rgbPoints[pointIdx],
|
|
83
|
+
rgbPoints[pointIdx + 1],
|
|
84
|
+
rgbPoints[pointIdx + 2],
|
|
85
|
+
rgbPoints[pointIdx + THREE],
|
|
79
86
|
)
|
|
80
87
|
}
|
|
81
88
|
|
|
82
89
|
const table = lut.getUint8Table(
|
|
83
90
|
rgbPoints[0],
|
|
84
|
-
rgbPoints
|
|
91
|
+
rgbPoints.at(-LAST_POINT_OFFSET),
|
|
85
92
|
width,
|
|
86
93
|
true,
|
|
87
94
|
)
|
|
88
95
|
const imageData = ctx.createImageData(width, height)
|
|
89
96
|
|
|
90
|
-
for (let
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
for (let
|
|
96
|
-
const
|
|
97
|
-
imageData.data[
|
|
98
|
-
imageData.data[
|
|
99
|
-
imageData.data[
|
|
100
|
-
imageData.data[
|
|
97
|
+
for (let xCoord = 0; xCoord < width; xCoord += 1) {
|
|
98
|
+
const red = table[xCoord * 4]
|
|
99
|
+
const green = table[xCoord * 4 + 1]
|
|
100
|
+
const blue = table[xCoord * 4 + 2]
|
|
101
|
+
const alpha = table[xCoord * 4 + THREE]
|
|
102
|
+
for (let yCoord = 0; yCoord < height; yCoord += 1) {
|
|
103
|
+
const pixelIdx = (yCoord * width + xCoord) * 4
|
|
104
|
+
imageData.data[pixelIdx] = red
|
|
105
|
+
imageData.data[pixelIdx + 1] = green
|
|
106
|
+
imageData.data[pixelIdx + 2] = blue
|
|
107
|
+
imageData.data[pixelIdx + THREE] = alpha
|
|
101
108
|
}
|
|
102
109
|
}
|
|
103
110
|
ctx.putImageData(imageData, 0, 0)
|
|
@@ -110,14 +117,13 @@
|
|
|
110
117
|
}
|
|
111
118
|
|
|
112
119
|
onMounted(() => nextTick(drawLutCanvas))
|
|
120
|
+
watch([lutCanvas, selectedPresetName, () => min, () => max], drawLutCanvas)
|
|
113
121
|
watch(
|
|
114
|
-
|
|
115
|
-
drawLutCanvas,
|
|
116
|
-
)
|
|
117
|
-
watch(
|
|
118
|
-
() => props.modelValue,
|
|
122
|
+
() => modelValue,
|
|
119
123
|
(nv) => {
|
|
120
|
-
if (nv !== selectedPresetName.value)
|
|
124
|
+
if (nv !== selectedPresetName.value) {
|
|
125
|
+
selectedPresetName.value = nv
|
|
126
|
+
}
|
|
121
127
|
},
|
|
122
128
|
)
|
|
123
129
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
const
|
|
2
|
+
const colorPickerRef = useTemplateRef("colorPickerRef")
|
|
3
3
|
const model = defineModel()
|
|
4
|
-
const { pressed } = useMousePressed({ target:
|
|
4
|
+
const { pressed } = useMousePressed({ target: colorPickerRef })
|
|
5
5
|
|
|
6
6
|
const color = ref(model)
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
<template>
|
|
16
16
|
<v-color-picker
|
|
17
|
-
ref="
|
|
17
|
+
ref="colorPickerRef"
|
|
18
18
|
v-model="color"
|
|
19
19
|
flat
|
|
20
20
|
canvas-height="100"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import ViewerOptionsCellAttributeSelector from "@ogw_front/components/Viewer/Options/CellAttributeSelector"
|
|
2
3
|
import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker"
|
|
3
|
-
import ViewerOptionsTexturesSelector from "@ogw_front/components/Viewer/Options/TexturesSelector"
|
|
4
|
-
import ViewerOptionsVertexAttributeSelector from "@ogw_front/components/Viewer/Options/VertexAttributeSelector"
|
|
5
4
|
import ViewerOptionsEdgeAttributeSelector from "@ogw_front/components/Viewer/Options/EdgeAttributeSelector"
|
|
6
5
|
import ViewerOptionsPolygonAttributeSelector from "@ogw_front/components/Viewer/Options/PolygonAttributeSelector"
|
|
7
|
-
import ViewerOptionsCellAttributeSelector from "@ogw_front/components/Viewer/Options/CellAttributeSelector"
|
|
8
6
|
import ViewerOptionsPolyhedronAttributeSelector from "@ogw_front/components/Viewer/Options/PolyhedronAttributeSelector"
|
|
7
|
+
import ViewerOptionsTexturesSelector from "@ogw_front/components/Viewer/Options/TexturesSelector"
|
|
8
|
+
import ViewerOptionsVertexAttributeSelector from "@ogw_front/components/Viewer/Options/VertexAttributeSelector"
|
|
9
9
|
|
|
10
10
|
const coloring_style_key = defineModel("coloring_style_key")
|
|
11
11
|
|
|
@@ -34,14 +34,12 @@
|
|
|
34
34
|
"polyhedron_attribute_color_map",
|
|
35
35
|
)
|
|
36
36
|
|
|
37
|
-
const
|
|
37
|
+
const { id } = defineProps({
|
|
38
38
|
id: { type: String, required: true },
|
|
39
39
|
})
|
|
40
40
|
|
|
41
|
-
const has_color = computed(() =>
|
|
42
|
-
const has_textures = computed(() =>
|
|
43
|
-
textures.value !== undefined ? true : false,
|
|
44
|
-
)
|
|
41
|
+
const has_color = computed(() => color.value !== undefined)
|
|
42
|
+
const has_textures = computed(() => textures.value !== undefined)
|
|
45
43
|
const has_vertex = computed(() => vertex_attribute_range.value !== undefined)
|
|
46
44
|
const has_edge = computed(() => edge_attribute_range.value !== undefined)
|
|
47
45
|
const has_cells = computed(() => cell_attribute_range.value !== undefined)
|
|
@@ -64,20 +62,30 @@
|
|
|
64
62
|
}
|
|
65
63
|
const coloring_styles = computed(() => {
|
|
66
64
|
let array = []
|
|
67
|
-
if (has_color.value)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (
|
|
65
|
+
if (has_color.value) {
|
|
66
|
+
array.push(color_dict)
|
|
67
|
+
}
|
|
68
|
+
if (has_textures.value) {
|
|
69
|
+
array.push(textures_dict)
|
|
70
|
+
}
|
|
71
|
+
if (has_vertex.value) {
|
|
72
|
+
array.push(vertex_dict)
|
|
73
|
+
}
|
|
74
|
+
if (has_edge.value) {
|
|
75
|
+
array.push(edge_dict)
|
|
76
|
+
}
|
|
77
|
+
if (has_cells.value) {
|
|
78
|
+
array.push(cell_dict)
|
|
79
|
+
}
|
|
80
|
+
if (has_polygons.value) {
|
|
81
|
+
array.push(polygon_dict)
|
|
82
|
+
}
|
|
83
|
+
if (has_polyhedra.value) {
|
|
84
|
+
array.push(polyhedron_dict)
|
|
85
|
+
}
|
|
74
86
|
|
|
75
|
-
const labels = array.map((coloring) =>
|
|
76
|
-
|
|
77
|
-
})
|
|
78
|
-
const values = array.map((coloring) => {
|
|
79
|
-
return coloring.value
|
|
80
|
-
})
|
|
87
|
+
const labels = array.map((coloring) => coloring.name)
|
|
88
|
+
const values = array.map((coloring) => coloring.value)
|
|
81
89
|
|
|
82
90
|
return { labels, values }
|
|
83
91
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
|
|
2
3
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
3
4
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
4
|
-
import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
|
|
5
5
|
|
|
6
6
|
const geodeStore = useGeodeStore()
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
})
|
|
17
17
|
const edge_attributes = ref([])
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const { id } = defineProps({
|
|
20
20
|
id: { type: String, required: true },
|
|
21
21
|
})
|
|
22
22
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
function getEdgeAttributes() {
|
|
41
41
|
geodeStore.request(
|
|
42
42
|
back_schemas.opengeodeweb_back.edge_attribute_names,
|
|
43
|
-
{ id:
|
|
43
|
+
{ id: id },
|
|
44
44
|
{
|
|
45
45
|
response_function: (response) => {
|
|
46
46
|
edge_attributes.value = response.attributes
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const currentAttribute = computed(() =>
|
|
53
|
-
|
|
52
|
+
const currentAttribute = computed(() =>
|
|
53
|
+
edge_attributes.value.find(
|
|
54
54
|
(attr) => attr.attribute_name === edge_attribute_name.value,
|
|
55
|
-
)
|
|
56
|
-
|
|
55
|
+
),
|
|
56
|
+
)
|
|
57
57
|
|
|
58
58
|
function resetRange() {
|
|
59
59
|
if (currentAttribute.value) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
|
|
2
3
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
3
4
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
4
|
-
import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
|
|
5
5
|
|
|
6
6
|
const geodeStore = useGeodeStore()
|
|
7
7
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
)
|
|
18
18
|
const polygon_attributes = ref([])
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const { id } = defineProps({
|
|
21
21
|
id: { type: String, required: true },
|
|
22
22
|
})
|
|
23
23
|
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
function getPolygonAttributes() {
|
|
42
42
|
geodeStore.request(
|
|
43
43
|
back_schemas.opengeodeweb_back.polygon_attribute_names,
|
|
44
|
-
{ id:
|
|
44
|
+
{ id: id },
|
|
45
45
|
{
|
|
46
46
|
response_function: (response) => {
|
|
47
47
|
polygon_attributes.value = response.attributes
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
)
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const currentAttribute = computed(() =>
|
|
54
|
-
|
|
53
|
+
const currentAttribute = computed(() =>
|
|
54
|
+
polygon_attributes.value.find(
|
|
55
55
|
(attr) => attr.attribute_name === polygon_attribute_name.value,
|
|
56
|
-
)
|
|
57
|
-
|
|
56
|
+
),
|
|
57
|
+
)
|
|
58
58
|
|
|
59
59
|
function resetRange() {
|
|
60
60
|
if (currentAttribute.value) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
|
|
2
3
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
3
4
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
4
|
-
import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
|
|
5
5
|
|
|
6
6
|
const geodeStore = useGeodeStore()
|
|
7
7
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
)
|
|
18
18
|
const polyhedron_attributes = ref([])
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const { id } = defineProps({
|
|
21
21
|
id: { type: String, required: true },
|
|
22
22
|
})
|
|
23
23
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
function getPolyhedronAttributes() {
|
|
48
48
|
geodeStore.request(
|
|
49
49
|
back_schemas.opengeodeweb_back.polyhedron_attribute_names,
|
|
50
|
-
{ id:
|
|
50
|
+
{ id: id },
|
|
51
51
|
{
|
|
52
52
|
response_function: (response) => {
|
|
53
53
|
polyhedron_attributes.value = response.attributes
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const currentAttribute = computed(() =>
|
|
60
|
-
|
|
59
|
+
const currentAttribute = computed(() =>
|
|
60
|
+
polyhedron_attributes.value.find(
|
|
61
61
|
(attr) => attr.attribute_name === polyhedron_attribute_name.value,
|
|
62
|
-
)
|
|
63
|
-
|
|
62
|
+
),
|
|
63
|
+
)
|
|
64
64
|
|
|
65
65
|
function resetRange() {
|
|
66
66
|
if (currentAttribute.value) {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
3
2
|
import FileUploader from "@ogw_front/components/FileUploader"
|
|
3
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
4
4
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
5
5
|
|
|
6
6
|
const emit = defineEmits(["update_value"])
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const { id } = defineProps({
|
|
9
9
|
id: { type: String, required: true },
|
|
10
10
|
texture_id: { type: String, required: true },
|
|
11
11
|
texture_name: { type: String, required: true },
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
const texture_name = ref("")
|
|
15
|
-
texture_name.value =
|
|
15
|
+
texture_name.value = texture_name
|
|
16
16
|
|
|
17
17
|
const texture_id = ref("")
|
|
18
|
-
texture_id.value =
|
|
18
|
+
texture_id.value = texture_id
|
|
19
19
|
|
|
20
20
|
const texture_coordinates = ref([])
|
|
21
21
|
const geodeStore = useGeodeStore()
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
function getTextureCoordinates() {
|
|
28
28
|
geodeStore.request(
|
|
29
29
|
back_schemas.opengeodeweb_back.texture_coordinates,
|
|
30
|
-
{ id:
|
|
30
|
+
{ id: id },
|
|
31
31
|
{
|
|
32
32
|
response_function: (response) => {
|
|
33
33
|
texture_coordinates.value = response.texture_coordinates
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
const textures = defineModel()
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const { id } = defineProps({
|
|
7
7
|
id: { type: String, required: true },
|
|
8
8
|
})
|
|
9
9
|
|
|
10
10
|
const internal_textures = ref([])
|
|
11
11
|
|
|
12
12
|
onMounted(() => {
|
|
13
|
-
if (textures.value
|
|
13
|
+
if (textures.value !== null) {
|
|
14
14
|
internal_textures.value = textures.value
|
|
15
15
|
} else {
|
|
16
16
|
internal_textures.value = [{ id: "", texture_name: "" }]
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
|
|
20
20
|
function update_value_event($event, index) {
|
|
21
21
|
internal_textures.value[index][$event.key] = $event.value
|
|
22
|
-
const filtered = internal_textures.value.filter(
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const filtered = internal_textures.value.filter(
|
|
23
|
+
(texture) => texture.texture_name !== "" && texture.id !== "",
|
|
24
|
+
)
|
|
25
25
|
if (filtered.length !== 0) {
|
|
26
26
|
textures.value = filtered
|
|
27
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
|
|
2
3
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
3
4
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
4
|
-
import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar"
|
|
5
5
|
|
|
6
6
|
const geodeStore = useGeodeStore()
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
})
|
|
17
17
|
const vertex_attributes = ref([])
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const { id } = defineProps({
|
|
20
20
|
id: { type: String, required: true },
|
|
21
21
|
})
|
|
22
22
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
function getVertexAttributes() {
|
|
41
41
|
geodeStore.request(
|
|
42
42
|
back_schemas.opengeodeweb_back.vertex_attribute_names,
|
|
43
|
-
{ id:
|
|
43
|
+
{ id: id },
|
|
44
44
|
{
|
|
45
45
|
response_function: (response) => {
|
|
46
46
|
vertex_attributes.value = response.attributes
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const currentAttribute = computed(() =>
|
|
53
|
-
|
|
52
|
+
const currentAttribute = computed(() =>
|
|
53
|
+
vertex_attributes.value.find(
|
|
54
54
|
(attr) => attr.attribute_name === vertex_attribute_name.value,
|
|
55
|
-
)
|
|
56
|
-
|
|
55
|
+
),
|
|
56
|
+
)
|
|
57
57
|
|
|
58
58
|
function resetRange() {
|
|
59
59
|
if (currentAttribute.value) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import PointSetPoints from "@ogw_front/assets/viewer_svgs/point_set_points.svg"
|
|
2
3
|
import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenuItem"
|
|
3
|
-
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
|
|
4
4
|
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector"
|
|
5
|
-
import
|
|
5
|
+
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch"
|
|
6
6
|
|
|
7
7
|
import { useDataStyleStore } from "@ogw_front/stores/data_style"
|
|
8
8
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
const dataStyleStore = useDataStyleStore()
|
|
11
11
|
const hybridViewerStore = useHybridViewerStore()
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const { itemProps } = defineProps({
|
|
14
14
|
itemProps: { type: Object, required: true },
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
const id = toRef(() =>
|
|
17
|
+
const id = toRef(() => itemProps.id)
|
|
18
18
|
|
|
19
19
|
const visibility = computed({
|
|
20
20
|
get: () => dataStyleStore.meshPointsVisibility(id.value),
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
</script>
|
|
78
78
|
<template>
|
|
79
79
|
<ViewerContextMenuItem
|
|
80
|
-
:itemProps="
|
|
80
|
+
:itemProps="itemProps"
|
|
81
81
|
tooltip="Points options"
|
|
82
82
|
:btn_image="PointSetPoints"
|
|
83
83
|
>
|