|
| 1 | +import { Layer } from "@deck.gl/core"; |
1 | 2 | import { SeismicSliceData_trans } from "@modules/3DViewerNew/settings/queries/queryDataTransforms";
|
2 | 3 | import { VisualizationFunctionArgs } from "@modules/_shared/LayerFramework/visualization/VisualizationFactory";
|
3 | 4 | import { makeColorMapFunctionFromColorScale } from "@modules/_shared/LayerFramework/visualization/utils/colors";
|
| 5 | +import { MovableLayerWrapper } from "@modules/_shared/customDeckGlLayers/MovableLayerWrapper"; |
4 | 6 | import { SeismicFenceMeshLayer } from "@modules/_shared/customDeckGlLayers/SeismicFenceMeshLayer";
|
5 | 7 |
|
6 | 8 | /*
|
@@ -34,13 +36,6 @@ function generatePointFenceMesh(
|
34 | 36 | let indicesIndex = 0;
|
35 | 37 |
|
36 | 38 | for (let v = 0; v < numSamplesV; v++) {
|
37 |
| - /* |
38 |
| - if (i > 1) { |
39 |
| - // Draw a degenerated triangle to move to the next row |
40 |
| - indices[indicesIndex++] = (i - 1) * numSamplesXY + numSamplesXY - 1; |
41 |
| - indices[indicesIndex++] = i * numSamplesXY; |
42 |
| - } |
43 |
| - */ |
44 | 39 | for (let u = 0; u < numSamplesU; u++) {
|
45 | 40 | const [x, y, z] = transformUVToXYZ(u * stepU, v * stepV);
|
46 | 41 | vertices[verticesIndex++] = x;
|
@@ -75,7 +70,7 @@ export function makeSeismicFenceMeshLayerFunction(plane: Plane) {
|
75 | 70 | data,
|
76 | 71 | colorScale,
|
77 | 72 | settings,
|
78 |
| - }: VisualizationFunctionArgs<any, SeismicSliceData_trans>): SeismicFenceMeshLayer { |
| 73 | + }: VisualizationFunctionArgs<any, SeismicSliceData_trans>): Layer<any> { |
79 | 74 | const bbox = data.bbox_utm;
|
80 | 75 | const properties = data.dataFloat32Arr;
|
81 | 76 |
|
@@ -118,18 +113,20 @@ export function makeSeismicFenceMeshLayerFunction(plane: Plane) {
|
118 | 113 |
|
119 | 114 | const { vertices, indices } = generatePointFenceMesh(data.u_num_samples, data.v_num_samples, transformUVToXYZ);
|
120 | 115 |
|
121 |
| - return new SeismicFenceMeshLayer({ |
122 |
| - id, |
123 |
| - name, |
124 |
| - data: { |
125 |
| - vertices, |
126 |
| - indices, |
127 |
| - properties, |
128 |
| - }, |
129 |
| - startPosition, |
130 |
| - colorMapFunction: makeColorMapFunctionFromColorScale(colorScale, data.value_min, data.value_max, false), |
131 |
| - boundingBox, |
132 |
| - zIncreaseDownwards: true, |
| 116 | + return new MovableLayerWrapper({ |
| 117 | + wrappedLayer: new SeismicFenceMeshLayer({ |
| 118 | + id, |
| 119 | + name, |
| 120 | + data: { |
| 121 | + vertices, |
| 122 | + indices, |
| 123 | + properties, |
| 124 | + }, |
| 125 | + startPosition, |
| 126 | + colorMapFunction: makeColorMapFunctionFromColorScale(colorScale, data.value_min, data.value_max, false), |
| 127 | + boundingBox, |
| 128 | + zIncreaseDownwards: true, |
| 129 | + }), |
133 | 130 | });
|
134 | 131 | };
|
135 | 132 | }
|
0 commit comments