From 9c2aca1bfd4fa23db9ceed85a9b7bbee2a4f623a Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Thu, 29 Jan 2026 14:18:51 +0100 Subject: [PATCH 01/27] fix(colorbar): simplifying attribute protocols --- .../rpc/mesh/mesh_protocols.py | 40 +++++++++---------- src/opengeodeweb_viewer/vtk_protocol.py | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py index f9e6947a..27b2056a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py @@ -141,7 +141,7 @@ def displayAttributeOnVertices(self, data_id: str, name: str) -> None: mapper = self.get_object(data_id).mapper mapper.ScalarVisibilityOn() mapper.SetScalarModeToUsePointData() - mapper.SetScalarRange(points.GetScalars().GetRange()) + # mapper.SetScalarRange(points.GetScalars().GetRange()) def displayAttributeOnCells(self, data_id: str, name: str) -> None: reader = self.get_object(data_id).reader @@ -150,31 +150,31 @@ def displayAttributeOnCells(self, data_id: str, name: str) -> None: mapper = self.get_object(data_id).mapper mapper.ScalarVisibilityOn() mapper.SetScalarModeToUseCellData() - mapper.SetScalarRange(cells.GetScalars().GetRange()) + # mapper.SetScalarRange(cells.GetScalars().GetRange()) def displayScalarRange(self, data_id: str, minimum: float, maximum: float) -> None: data = self.get_object(data_id) data.mapper.SetScalarRange(minimum, maximum) - if hasattr(data, "color_map_points") and data.color_map_points: - lut = vtkColorTransferFunction() - for ratio, red, green, blue in data.color_map_points: - scalar_value = minimum + ratio * (maximum - minimum) - lut.AddRGBPoint(scalar_value, red / 255, green / 255, blue / 255) - data.mapper.SetLookupTable(lut) def setupColorMap(self, data_id: str, points: list[list[float]]) -> None: data = self.get_object(data_id) - sorted_points = sorted(points, key=lambda x: x[0]) - points_min = sorted_points[0][0] - points_max = sorted_points[-1][0] - points_range = points_max - points_min if points_max != points_min else 1.0 - - data.color_map_points = [] - for point in sorted_points: - ratio = (point[0] - points_min) / points_range - data.color_map_points.append([ratio, *point[1:]]) - + # sorted_points = sorted(points, key=lambda x: x[0]) + # points_min = sorted_points[0][0] + # points_max = sorted_points[-1][0] + # points_range = points_max - points_min if points_max != points_min else 1.0 + + # data.color_map_points = [] + # for point in points: + # # ratio = (point[0] - points_min) / points_range + # data.color_map_points.append(point) + + lut = vtkColorTransferFunction() + for ratio, red, green, blue in points: + # scalar_value = minimum + ratio * (maximum - minimum) + # lut.AddRGBPoint(scalar_value, red / 255, green / 255, blue / 255) + lut.AddRGBPoint(ratio, red, green, blue) + data.mapper.SetLookupTable(lut) data.mapper.InterpolateScalarsBeforeMappingOn() - minimum, maximum = data.mapper.GetScalarRange() - self.displayScalarRange(data_id, minimum, maximum) + # minimum, maximum = data.mapper.GetScalarRange() + # self.displayScalarRange(data_id, minimum, maximum) diff --git a/src/opengeodeweb_viewer/vtk_protocol.py b/src/opengeodeweb_viewer/vtk_protocol.py index 7b640bcc..f5ad0302 100644 --- a/src/opengeodeweb_viewer/vtk_protocol.py +++ b/src/opengeodeweb_viewer/vtk_protocol.py @@ -35,7 +35,7 @@ class vtkData: max_dimension: Literal["points", "edges", "polygons", "polyhedra", "default"] = ( "default" ) - color_map_points: list[list[float]] = field(default_factory=list) + # color_map_points: list[list[float]] = field(default_factory=list) class VtkTypingMixin: From 13eec4afd8b42949485d034f3dd3eb01d26f6718 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Thu, 29 Jan 2026 15:12:46 +0100 Subject: [PATCH 02/27] fixing tests with workflow --- tests/mesh/cells/test_mesh_cells_protocols.py | 162 ++++++++++++++--- tests/mesh/edges/test_mesh_edges_protocols.py | 81 +++++++-- .../mesh/points/test_mesh_points_protocols.py | 79 ++++++-- .../polygons/test_mesh_polygons_protocols.py | 162 ++++++++++++++--- .../test_mesh_polyhedra_protocols.py | 172 +++++++++++++++--- 5 files changed, 544 insertions(+), 112 deletions(-) diff --git a/tests/mesh/cells/test_mesh_cells_protocols.py b/tests/mesh/cells/test_mesh_cells_protocols.py index 5ec42e43..1d24c27f 100644 --- a/tests/mesh/cells/test_mesh_cells_protocols.py +++ b/tests/mesh/cells/test_mesh_cells_protocols.py @@ -63,6 +63,11 @@ def test_cells_vertex_attribute( + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], [{"id": mesh_id, "name": "points"}], ) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], + [{"id": mesh_id, "minimum": 2, "maximum": 498}], + ) assert server.compare_image("mesh/cells/vertex_attribute.jpeg") == True server.call( @@ -84,6 +89,11 @@ def test_cells_cell_attribute( + VtkMeshCellsView.mesh_cells_schemas_dict["cell_attribute"]["rpc"], [{"id": mesh_id, "name": "RGB_data"}], ) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["cell_scalar_range"]["rpc"], + [{"id": mesh_id, "minimum": 0, "maximum": 255}], + ) assert server.compare_image("mesh/cells/cell_attribute.jpeg") == True server.call( @@ -122,8 +132,8 @@ def test_cells_vertex_color_map( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [2.0, 0, 0, 1.0], + [498.0, 1.0, 0, 0], ], } ], @@ -153,8 +163,8 @@ def test_cells_vertex_color_map_range_update( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [2.0, 0, 0, 1.0], + [498.0, 1.0, 0, 0], ], } ], @@ -169,6 +179,20 @@ def test_cells_vertex_color_map_range_update( [{"id": mesh_id, "minimum": 200.0, "maximum": 300.0}], ) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [200.0, 0, 0, 1.0], + [300.0, 1.0, 0, 0], + ], + } + ], + ) + assert server.compare_image("mesh/cells/vertex_color_map_range_update.jpeg") == True @@ -193,8 +217,8 @@ def test_cells_vertex_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [2.0, 0, 0, 1.0], + [498.0, 1.0, 0, 0], ], } ], @@ -209,6 +233,20 @@ def test_cells_vertex_color_map_red_shift( [{"id": mesh_id, "minimum": 0.0, "maximum": 50.0}], ) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [0.0, 0, 0, 1.0], + [50.0, 1.0, 0, 0], + ], + } + ], + ) + assert server.compare_image("mesh/cells/vertex_color_map_red_shift.jpeg") == True @@ -233,14 +271,14 @@ def test_cells_vertex_color_map_rainbow( { "id": mesh_id, "points": [ - [0.0, 71, 71, 219], - [0.143, 0, 0, 92], - [0.285, 0, 255, 255], - [0.429, 0, 128, 0], - [0.571, 255, 255, 0], - [0.714, 255, 97, 0], - [0.857, 107, 0, 0], - [1.0, 224, 77, 77], + [2 + 0.0 * 496, 71 / 255, 71 / 255, 219 / 255], + [2 + 0.143 * 496, 0, 0, 92 / 255], + [2 + 0.285 * 496, 0, 255 / 255, 255 / 255], + [2 + 0.429 * 496, 0, 128 / 255, 0], + [2 + 0.571 * 496, 255 / 255, 255 / 255, 0], + [2 + 0.714 * 496, 255 / 255, 97 / 255, 0], + [2 + 0.857 * 496, 107 / 255, 0, 0], + [2 + 1.0 * 496, 224 / 255, 77 / 255, 77 / 255], ], } ], @@ -257,6 +295,26 @@ def test_cells_vertex_color_map_rainbow( [{"id": mesh_id, "minimum": 50.0, "maximum": 200.0}], ) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [50 + 0.0 * 150, 71 / 255, 71 / 255, 219 / 255], + [50 + 0.143 * 150, 0, 0, 92 / 255], + [50 + 0.285 * 150, 0, 255 / 255, 255 / 255], + [50 + 0.429 * 150, 0, 128 / 255, 0], + [50 + 0.571 * 150, 255 / 255, 255 / 255, 0], + [50 + 0.714 * 150, 255 / 255, 97 / 255, 0], + [50 + 0.857 * 150, 107 / 255, 0, 0], + [50 + 1.0 * 150, 224 / 255, 77 / 255, 77 / 255], + ], + } + ], + ) + assert server.compare_image("mesh/cells/vertex_color_map_rainbow.jpeg") == True @@ -288,8 +346,8 @@ def test_cells_cell_color_map( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [255.0, 1.0, 0, 0], ], } ], @@ -319,8 +377,8 @@ def test_cells_cell_color_map_range_update( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [255.0, 1.0, 0, 0], ], } ], @@ -335,6 +393,20 @@ def test_cells_cell_color_map_range_update( [{"id": mesh_id, "minimum": 100.0, "maximum": 150.0}], ) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [100.0, 0, 0, 1.0], + [150.0, 1.0, 0, 0], + ], + } + ], + ) + assert server.compare_image("mesh/cells/cell_color_map_range_update.jpeg") == True @@ -359,8 +431,8 @@ def test_cells_cell_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [255.0, 1.0, 0, 0], ], } ], @@ -375,6 +447,20 @@ def test_cells_cell_color_map_red_shift( [{"id": mesh_id, "minimum": 0.0, "maximum": 20.0}], ) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [0.0, 0, 0, 1.0], + [20.0, 1.0, 0, 0], + ], + } + ], + ) + assert server.compare_image("mesh/cells/cell_color_map_red_shift.jpeg") == True @@ -399,14 +485,14 @@ def test_cells_cell_color_map_rainbow( { "id": mesh_id, "points": [ - [0.0, 71, 71, 219], - [0.143, 0, 0, 92], - [0.285, 0, 255, 255], - [0.429, 0, 128, 0], - [0.571, 255, 255, 0], - [0.714, 255, 97, 0], - [0.857, 107, 0, 0], - [1.0, 224, 77, 77], + [0.0 * 255, 71 / 255, 71 / 255, 219 / 255], + [0.143 * 255, 0, 0, 92 / 255], + [0.285 * 255, 0, 255 / 255, 255 / 255], + [0.429 * 255, 0, 128 / 255, 0], + [0.571 * 255, 255 / 255, 255 / 255, 0], + [0.714 * 255, 255 / 255, 97 / 255, 0], + [0.857 * 255, 107 / 255, 0, 0], + [1.0 * 255, 224 / 255, 77 / 255, 77 / 255], ], } ], @@ -423,4 +509,24 @@ def test_cells_cell_color_map_rainbow( [{"id": mesh_id, "minimum": 50.0, "maximum": 100.0}], ) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [50 + 0.0 * 50, 71 / 255, 71 / 255, 219 / 255], + [50 + 0.143 * 50, 0, 0, 92 / 255], + [50 + 0.285 * 50, 0, 255 / 255, 255 / 255], + [50 + 0.429 * 50, 0, 128 / 255, 0], + [50 + 0.571 * 50, 255 / 255, 255 / 255, 0], + [50 + 0.714 * 50, 255 / 255, 97 / 255, 0], + [50 + 0.857 * 50, 107 / 255, 0, 0], + [50 + 1.0 * 50, 224 / 255, 77 / 255, 77 / 255], + ], + } + ], + ) + assert server.compare_image("mesh/cells/cell_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/edges/test_mesh_edges_protocols.py b/tests/mesh/edges/test_mesh_edges_protocols.py index ff53df4f..cdeea56c 100644 --- a/tests/mesh/edges/test_mesh_edges_protocols.py +++ b/tests/mesh/edges/test_mesh_edges_protocols.py @@ -78,6 +78,11 @@ def test_edges_vertex_attribute( + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_attribute"]["rpc"], [{"id": mesh_id, "name": "vertex_attribute"}], ) + server.call( + VtkMeshEdgesView.mesh_edges_prefix + + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_scalar_range"]["rpc"], + [{"id": mesh_id, "minimum": 0, "maximum": 58}], + ) assert server.compare_image("mesh/edges/vertex_attribute.jpeg") == True server.call( @@ -121,8 +126,8 @@ def test_edges_vertex_color_map( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [58.0, 1.0, 0, 0], ], } ], @@ -157,8 +162,8 @@ def test_edges_vertex_color_map_range_update( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [58.0, 1.0, 0, 0], ], } ], @@ -173,6 +178,20 @@ def test_edges_vertex_color_map_range_update( [{"id": mesh_id, "minimum": 50.0, "maximum": 58.0}], ) + server.call( + VtkMeshEdgesView.mesh_edges_prefix + + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [50.0, 0, 0, 1.0], + [58.0, 1.0, 0, 0], + ], + } + ], + ) + assert server.compare_image("mesh/edges/vertex_color_map_range_update.jpeg") == True @@ -202,8 +221,8 @@ def test_edges_vertex_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [58.0, 1.0, 0, 0], ], } ], @@ -218,6 +237,20 @@ def test_edges_vertex_color_map_red_shift( [{"id": mesh_id, "minimum": 0.0, "maximum": 1.0}], ) + server.call( + VtkMeshEdgesView.mesh_edges_prefix + + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], + ], + } + ], + ) + assert server.compare_image("mesh/edges/vertex_color_map_red_shift.jpeg") == True @@ -247,14 +280,14 @@ def test_edges_vertex_color_map_rainbow( { "id": mesh_id, "points": [ - [0.0, 71, 71, 219], - [0.143, 0, 0, 92], - [0.285, 0, 255, 255], - [0.429, 0, 128, 0], - [0.571, 255, 255, 0], - [0.714, 255, 97, 0], - [0.857, 107, 0, 0], - [1.0, 224, 77, 77], + [0.0 * 58.0, 71 / 255, 71 / 255, 219 / 255], + [0.143 * 58.0, 0, 0, 92 / 255], + [0.285 * 58.0, 0, 255 / 255, 255 / 255], + [0.429 * 58.0, 0, 128 / 255, 0], + [0.571 * 58.0, 255 / 255, 255 / 255, 0], + [0.714 * 58.0, 255 / 255, 97 / 255, 0], + [0.857 * 58.0, 107 / 255, 0, 0], + [1.0 * 58.0, 224 / 255, 77 / 255, 77 / 255], ], } ], @@ -271,4 +304,24 @@ def test_edges_vertex_color_map_rainbow( [{"id": mesh_id, "minimum": 10.0, "maximum": 20.0}], ) + server.call( + VtkMeshEdgesView.mesh_edges_prefix + + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [10 + 0.0 * 10, 71 / 255, 71 / 255, 219 / 255], + [10 + 0.143 * 10, 0, 0, 92 / 255], + [10 + 0.285 * 10, 0, 255 / 255, 255 / 255], + [10 + 0.429 * 10, 0, 128 / 255, 0], + [10 + 0.571 * 10, 255 / 255, 255 / 255, 0], + [10 + 0.714 * 10, 255 / 255, 97 / 255, 0], + [10 + 0.857 * 10, 107 / 255, 0, 0], + [10 + 1.0 * 10, 224 / 255, 77 / 255, 77 / 255], + ], + } + ], + ) + assert server.compare_image("mesh/edges/vertex_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/points/test_mesh_points_protocols.py b/tests/mesh/points/test_mesh_points_protocols.py index 0d2b086b..409ca0e5 100644 --- a/tests/mesh/points/test_mesh_points_protocols.py +++ b/tests/mesh/points/test_mesh_points_protocols.py @@ -137,8 +137,8 @@ def test_points_vertex_color_map( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], ], } ], @@ -168,8 +168,8 @@ def test_points_vertex_color_map_range_update( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], ], } ], @@ -184,6 +184,21 @@ def test_points_vertex_color_map_range_update( [{"id": mesh_id, "minimum": 0.8, "maximum": 1.0}], ) + # Coordinated update for stretching + server.call( + VtkMeshPointsView.mesh_points_prefix + + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [0.8, 0, 0, 1.0], + [1.0, 1.0, 0, 0], + ], + } + ], + ) + assert ( server.compare_image("mesh/points/vertex_color_map_range_update.jpeg") == True ) @@ -210,8 +225,8 @@ def test_points_vertex_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], ], } ], @@ -226,6 +241,21 @@ def test_points_vertex_color_map_red_shift( [{"id": mesh_id, "minimum": 0.0, "maximum": 0.1}], ) + # Coordinated update for red shift + server.call( + VtkMeshPointsView.mesh_points_prefix + + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [0.0, 0, 0, 1.0], + [0.1, 1.0, 0, 0], + ], + } + ], + ) + assert server.compare_image("mesh/points/vertex_color_map_red_shift.jpeg") == True @@ -250,14 +280,14 @@ def test_points_vertex_color_map_rainbow( { "id": mesh_id, "points": [ - [0.0, 71, 71, 219], - [0.143, 0, 0, 92], - [0.285, 0, 255, 255], - [0.429, 0, 128, 0], - [0.571, 255, 255, 0], - [0.714, 255, 97, 0], - [0.857, 107, 0, 0], - [1.0, 224, 77, 77], + [0.0, 71 / 255, 71 / 255, 219 / 255], + [0.143, 0, 0, 92 / 255], + [0.285, 0, 255 / 255, 255 / 255], + [0.429, 0, 128 / 255, 0], + [0.571, 255 / 255, 255 / 255, 0], + [0.714, 255 / 255, 97 / 255, 0], + [0.857, 107 / 255, 0, 0], + [1.0, 224 / 255, 77 / 255, 77 / 255], ], } ], @@ -275,4 +305,25 @@ def test_points_vertex_color_map_rainbow( [{"id": mesh_id, "minimum": 0.1, "maximum": 0.4}], ) + # Coordinated update for rainbow stretching + server.call( + VtkMeshPointsView.mesh_points_prefix + + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [0.1 + 0.0 * 0.3, 71 / 255, 71 / 255, 219 / 255], + [0.1 + 0.143 * 0.3, 0, 0, 92 / 255], + [0.1 + 0.285 * 0.3, 0, 255 / 255, 255 / 255], + [0.1 + 0.429 * 0.3, 0, 128 / 255, 0], + [0.1 + 0.571 * 0.3, 255 / 255, 255 / 255, 0], + [0.1 + 0.714 * 0.3, 255 / 255, 97 / 255, 0], + [0.1 + 0.857 * 0.3, 107 / 255, 0, 0], + [0.1 + 1.0 * 0.3, 224 / 255, 77 / 255, 77 / 255], + ], + } + ], + ) + assert server.compare_image("mesh/points/vertex_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/polygons/test_mesh_polygons_protocols.py b/tests/mesh/polygons/test_mesh_polygons_protocols.py index 7bb72791..5ce74a8e 100644 --- a/tests/mesh/polygons/test_mesh_polygons_protocols.py +++ b/tests/mesh/polygons/test_mesh_polygons_protocols.py @@ -49,6 +49,11 @@ def test_polygons_vertex_attribute( + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_attribute"]["rpc"], [{"id": "123456789", "name": "lambert2SG"}], ) + server.call( + VtkMeshPolygonsView.mesh_polygons_prefix + + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"], + [{"id": "123456789", "minimum": 0, "maximum": 1}], + ) assert server.compare_image("mesh/polygons/vertex_attribute.jpeg") == True server.call( @@ -76,6 +81,11 @@ def test_polygons_polygon_attribute( + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_attribute"]["rpc"], [{"id": "123456789", "name": "triangle_vertices"}], ) + server.call( + VtkMeshPolygonsView.mesh_polygons_prefix + + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"], + [{"id": "123456789", "minimum": 3, "maximum": 45}], + ) assert server.compare_image("mesh/polygons/polygon_attribute.jpeg") == True server.call( @@ -113,8 +123,8 @@ def test_polygons_vertex_color_map( { "id": "123456789", "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], ], } ], @@ -143,8 +153,8 @@ def test_polygons_vertex_color_map_range_update( { "id": "123456789", "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], ], } ], @@ -159,6 +169,20 @@ def test_polygons_vertex_color_map_range_update( [{"id": "123456789", "minimum": 0.8, "maximum": 1.0}], ) + server.call( + VtkMeshPolygonsView.mesh_polygons_prefix + + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": "123456789", + "points": [ + [0.8, 0, 0, 1.0], + [1.0, 1.0, 0, 0], + ], + } + ], + ) + assert ( server.compare_image("mesh/polygons/vertex_color_map_range_update.jpeg") == True ) @@ -184,8 +208,8 @@ def test_polygons_vertex_color_map_red_shift( { "id": "123456789", "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], ], } ], @@ -200,6 +224,20 @@ def test_polygons_vertex_color_map_red_shift( [{"id": "123456789", "minimum": 0.0, "maximum": 0.1}], ) + server.call( + VtkMeshPolygonsView.mesh_polygons_prefix + + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": "123456789", + "points": [ + [0.0, 0, 0, 1.0], + [0.1, 1.0, 0, 0], + ], + } + ], + ) + assert server.compare_image("mesh/polygons/vertex_color_map_red_shift.jpeg") == True @@ -223,14 +261,14 @@ def test_polygons_vertex_color_map_rainbow( { "id": "123456789", "points": [ - [0.0, 71, 71, 219], - [0.143, 0, 0, 92], - [0.285, 0, 255, 255], - [0.429, 0, 128, 0], - [0.571, 255, 255, 0], - [0.714, 255, 97, 0], - [0.857, 107, 0, 0], - [1.0, 224, 77, 77], + [0.0, 71 / 255, 71 / 255, 219 / 255], + [0.143, 0, 0, 92 / 255], + [0.285, 0, 255 / 255, 255 / 255], + [0.429, 0, 128 / 255, 0], + [0.571, 255 / 255, 255 / 255, 0], + [0.714, 255 / 255, 97 / 255, 0], + [0.857, 107 / 255, 0, 0], + [1.0, 224 / 255, 77 / 255, 77 / 255], ], } ], @@ -248,6 +286,26 @@ def test_polygons_vertex_color_map_rainbow( [{"id": "123456789", "minimum": 0.1, "maximum": 0.4}], ) + server.call( + VtkMeshPolygonsView.mesh_polygons_prefix + + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": "123456789", + "points": [ + [0.1 + 0.0 * 0.3, 71 / 255, 71 / 255, 219 / 255], + [0.1 + 0.143 * 0.3, 0, 0, 92 / 255], + [0.1 + 0.285 * 0.3, 0, 255 / 255, 255 / 255], + [0.1 + 0.429 * 0.3, 0, 128 / 255, 0], + [0.1 + 0.571 * 0.3, 255 / 255, 255 / 255, 0], + [0.1 + 0.714 * 0.3, 255 / 255, 97 / 255, 0], + [0.1 + 0.857 * 0.3, 107 / 255, 0, 0], + [0.1 + 1.0 * 0.3, 224 / 255, 77 / 255, 77 / 255], + ], + } + ], + ) + assert server.compare_image("mesh/polygons/vertex_color_map_rainbow.jpeg") == True @@ -284,8 +342,8 @@ def test_polygons_polygon_color_map( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [50.0, 1.0, 0, 0], ], } ], @@ -320,8 +378,8 @@ def test_polygons_polygon_color_map_range_update( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [50.0, 1.0, 0, 0], ], } ], @@ -336,6 +394,20 @@ def test_polygons_polygon_color_map_range_update( [{"id": mesh_id, "minimum": 40.0, "maximum": 45.0}], ) + server.call( + VtkMeshPolygonsView.mesh_polygons_prefix + + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [40.0, 0, 0, 1.0], + [45.0, 1.0, 0, 0], + ], + } + ], + ) + assert ( server.compare_image("mesh/polygons/polygon_color_map_range_update.jpeg") == True @@ -368,8 +440,8 @@ def test_polygons_polygon_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [0.0, 0, 0, 1.0], + [50.0, 1.0, 0, 0], ], } ], @@ -384,6 +456,20 @@ def test_polygons_polygon_color_map_red_shift( [{"id": mesh_id, "minimum": 3.0, "maximum": 4.0}], ) + server.call( + VtkMeshPolygonsView.mesh_polygons_prefix + + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [3.0, 0, 0, 1.0], + [4.0, 1.0, 0, 0], + ], + } + ], + ) + assert ( server.compare_image("mesh/polygons/polygon_color_map_red_shift.jpeg") == True ) @@ -415,14 +501,14 @@ def test_polygons_polygon_color_map_rainbow( { "id": mesh_id, "points": [ - [0.0, 71, 71, 219], - [0.143, 0, 0, 92], - [0.285, 0, 255, 255], - [0.429, 0, 128, 0], - [0.571, 255, 255, 0], - [0.714, 255, 97, 0], - [0.857, 107, 0, 0], - [1.0, 224, 77, 77], + [0.0 * 50, 71 / 255, 71 / 255, 219 / 255], + [0.143 * 50, 0, 0, 92 / 255], + [0.285 * 50, 0, 255 / 255, 255 / 255], + [0.429 * 50, 0, 128 / 255, 0], + [0.571 * 50, 255 / 255, 255 / 255, 0], + [0.714 * 50, 255 / 255, 97 / 255, 0], + [0.857 * 50, 107 / 255, 0, 0], + [1.0 * 50, 224 / 255, 77 / 255, 77 / 255], ], } ], @@ -440,4 +526,24 @@ def test_polygons_polygon_color_map_rainbow( [{"id": mesh_id, "minimum": 5.0, "maximum": 15.0}], ) + server.call( + VtkMeshPolygonsView.mesh_polygons_prefix + + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [5 + 0.0 * 10, 71 / 255, 71 / 255, 219 / 255], + [5 + 0.143 * 10, 0, 0, 92 / 255], + [5 + 0.285 * 10, 0, 255 / 255, 255 / 255], + [5 + 0.429 * 10, 0, 128 / 255, 0], + [5 + 0.571 * 10, 255 / 255, 255 / 255, 0], + [5 + 0.714 * 10, 255 / 255, 97 / 255, 0], + [5 + 0.857 * 10, 107 / 255, 0, 0], + [5 + 1.0 * 10, 224 / 255, 77 / 255, 77 / 255], + ], + } + ], + ) + assert server.compare_image("mesh/polygons/polygon_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py index f5af4e87..074adf67 100644 --- a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py +++ b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py @@ -59,6 +59,13 @@ def test_vertex_attribute( + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_attribute"]["rpc"], [{"id": "123456789", "name": "toto_on_vertices"}], ) + server.call( + VtkMeshPolyhedraView.mesh_polyhedra_prefix + + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_scalar_range"][ + "rpc" + ], + [{"id": "123456789", "minimum": 1, "maximum": 11}], + ) assert server.compare_image("mesh/polyhedra/vertex_attribute.jpeg") == True server.call( @@ -83,6 +90,13 @@ def test_polyhedron_attribute( ], [{"id": "123456789", "name": "toto_on_polyhedra"}], ) + server.call( + VtkMeshPolyhedraView.mesh_polyhedra_prefix + + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_scalar_range"][ + "rpc" + ], + [{"id": "123456789", "minimum": 3, "maximum": 6}], + ) assert server.compare_image("mesh/polyhedra/polyhedron_attribute.jpeg") == True server.call( @@ -124,8 +138,8 @@ def test_polyhedra_vertex_color_map( { "id": "123456789", "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [1.0, 0, 0, 1.0], + [11.0, 1.0, 0, 0], ], } ], @@ -154,8 +168,8 @@ def test_polyhedra_vertex_color_map_range_update( { "id": "123456789", "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [1.0, 0, 0, 1.0], + [11.0, 1.0, 0, 0], ], } ], @@ -172,6 +186,20 @@ def test_polyhedra_vertex_color_map_range_update( [{"id": "123456789", "minimum": 10.0, "maximum": 11.0}], ) + server.call( + VtkMeshPolyhedraView.mesh_polyhedra_prefix + + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": "123456789", + "points": [ + [10.0, 0, 0, 1.0], + [11.0, 1.0, 0, 0], + ], + } + ], + ) + assert ( server.compare_image("mesh/polyhedra/vertex_color_map_range_update.jpeg") == True @@ -198,8 +226,8 @@ def test_polyhedra_vertex_color_map_red_shift( { "id": "123456789", "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [1.0, 0, 0, 1.0], + [11.0, 1.0, 0, 0], ], } ], @@ -216,6 +244,20 @@ def test_polyhedra_vertex_color_map_red_shift( [{"id": "123456789", "minimum": 0.0, "maximum": 1.0}], ) + server.call( + VtkMeshPolyhedraView.mesh_polyhedra_prefix + + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": "123456789", + "points": [ + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], + ], + } + ], + ) + assert ( server.compare_image("mesh/polyhedra/vertex_color_map_red_shift.jpeg") == True ) @@ -241,14 +283,14 @@ def test_polyhedra_vertex_color_map_rainbow( { "id": "123456789", "points": [ - [0.0, 71, 71, 219], - [0.143, 0, 0, 92], - [0.285, 0, 255, 255], - [0.429, 0, 128, 0], - [0.571, 255, 255, 0], - [0.714, 255, 97, 0], - [0.857, 107, 0, 0], - [1.0, 224, 77, 77], + [1 + 0.0 * 10, 71 / 255, 71 / 255, 219 / 255], + [1 + 0.143 * 10, 0, 0, 92 / 255], + [1 + 0.285 * 10, 0, 255 / 255, 255 / 255], + [1 + 0.429 * 10, 0, 128 / 255, 0], + [1 + 0.571 * 10, 255 / 255, 255 / 255, 0], + [1 + 0.714 * 10, 255 / 255, 97 / 255, 0], + [1 + 0.857 * 10, 107 / 255, 0, 0], + [1 + 1.0 * 10, 224 / 255, 77 / 255, 77 / 255], ], } ], @@ -268,6 +310,26 @@ def test_polyhedra_vertex_color_map_rainbow( [{"id": "123456789", "minimum": 2.0, "maximum": 8.0}], ) + server.call( + VtkMeshPolyhedraView.mesh_polyhedra_prefix + + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": "123456789", + "points": [ + [2 + 0.0 * 6, 71 / 255, 71 / 255, 219 / 255], + [2 + 0.143 * 6, 0, 0, 92 / 255], + [2 + 0.285 * 6, 0, 255 / 255, 255 / 255], + [2 + 0.429 * 6, 0, 128 / 255, 0], + [2 + 0.571 * 6, 255 / 255, 255 / 255, 0], + [2 + 0.714 * 6, 255 / 255, 97 / 255, 0], + [2 + 0.857 * 6, 107 / 255, 0, 0], + [2 + 1.0 * 6, 224 / 255, 77 / 255, 77 / 255], + ], + } + ], + ) + assert server.compare_image("mesh/polyhedra/vertex_color_map_rainbow.jpeg") == True @@ -304,8 +366,8 @@ def test_polyhedra_polyhedron_color_map( { "id": "123456789", "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [3.0, 0, 0, 1.0], + [6.0, 1.0, 0, 0], ], } ], @@ -338,8 +400,8 @@ def test_polyhedra_polyhedron_color_map_range_update( { "id": "123456789", "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [3.0, 0, 0, 1.0], + [6.0, 1.0, 0, 0], ], } ], @@ -356,6 +418,22 @@ def test_polyhedra_polyhedron_color_map_range_update( [{"id": "123456789", "minimum": 5.0, "maximum": 6.0}], ) + server.call( + VtkMeshPolyhedraView.mesh_polyhedra_prefix + + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ + "rpc" + ], + [ + { + "id": "123456789", + "points": [ + [5.0, 0, 0, 1.0], + [6.0, 1.0, 0, 0], + ], + } + ], + ) + assert ( server.compare_image("mesh/polyhedra/polyhedron_color_map_range_update.jpeg") == True @@ -386,8 +464,8 @@ def test_polyhedra_polyhedron_color_map_red_shift( { "id": "123456789", "points": [ - [0.0, 0, 0, 255], - [1.0, 255, 0, 0], + [3.0, 0, 0, 1.0], + [6.0, 1.0, 0, 0], ], } ], @@ -404,6 +482,22 @@ def test_polyhedra_polyhedron_color_map_red_shift( [{"id": "123456789", "minimum": 0.0, "maximum": 1.0}], ) + server.call( + VtkMeshPolyhedraView.mesh_polyhedra_prefix + + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ + "rpc" + ], + [ + { + "id": "123456789", + "points": [ + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], + ], + } + ], + ) + assert ( server.compare_image("mesh/polyhedra/polyhedron_color_map_red_shift.jpeg") == True @@ -434,14 +528,14 @@ def test_polyhedra_polyhedron_color_map_rainbow( { "id": "123456789", "points": [ - [0.0, 71, 71, 219], - [0.143, 0, 0, 92], - [0.285, 0, 255, 255], - [0.429, 0, 128, 0], - [0.571, 255, 255, 0], - [0.714, 255, 97, 0], - [0.857, 107, 0, 0], - [1.0, 224, 77, 77], + [3 + 0.0 * 3, 71 / 255, 71 / 255, 219 / 255], + [3 + 0.143 * 3, 0, 0, 92 / 255], + [3 + 0.285 * 3, 0, 255 / 255, 255 / 255], + [3 + 0.429 * 3, 0, 128 / 255, 0], + [3 + 0.571 * 3, 255 / 255, 255 / 255, 0], + [3 + 0.714 * 3, 255 / 255, 97 / 255, 0], + [3 + 0.857 * 3, 107 / 255, 0, 0], + [3 + 1.0 * 3, 224 / 255, 77 / 255, 77 / 255], ], } ], @@ -461,6 +555,28 @@ def test_polyhedra_polyhedron_color_map_rainbow( [{"id": "123456789", "minimum": 3.5, "maximum": 5.5}], ) + server.call( + VtkMeshPolyhedraView.mesh_polyhedra_prefix + + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ + "rpc" + ], + [ + { + "id": "123456789", + "points": [ + [3.5 + 0.0 * 2.0, 71 / 255, 71 / 255, 219 / 255], + [3.5 + 0.143 * 2.0, 0, 0, 92 / 255], + [3.5 + 0.285 * 2.0, 0, 255 / 255, 255 / 255], + [3.5 + 0.429 * 2.0, 0, 128 / 255, 0], + [3.5 + 0.571 * 2.0, 255 / 255, 255 / 255, 0], + [3.5 + 0.714 * 2.0, 255 / 255, 97 / 255, 0], + [3.5 + 0.857 * 2.0, 107 / 255, 0, 0], + [3.5 + 1.0 * 2.0, 224 / 255, 77 / 255, 77 / 255], + ], + } + ], + ) + assert ( server.compare_image("mesh/polyhedra/polyhedron_color_map_rainbow.jpeg") == True ) From b6be71c3b3b965d5e6d4ac3b76702736cd7e054b Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Thu, 29 Jan 2026 14:13:57 +0000 Subject: [PATCH 03/27] Apply prepare changes --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 45ab6462..e7f9f284 100644 --- a/requirements.txt +++ b/requirements.txt @@ -61,4 +61,3 @@ wslink==1.12.4 yarl>=1 # via aiohttp -opengeodeweb-microservice==1.*,>=1.0.13rc1 From 69083aa46a47e19c34940c36f67ccc3aa987fa02 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Thu, 29 Jan 2026 15:18:49 +0100 Subject: [PATCH 04/27] rm comments --- .../rpc/mesh/mesh_protocols.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py index 27b2056a..844cd34f 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py @@ -141,7 +141,6 @@ def displayAttributeOnVertices(self, data_id: str, name: str) -> None: mapper = self.get_object(data_id).mapper mapper.ScalarVisibilityOn() mapper.SetScalarModeToUsePointData() - # mapper.SetScalarRange(points.GetScalars().GetRange()) def displayAttributeOnCells(self, data_id: str, name: str) -> None: reader = self.get_object(data_id).reader @@ -150,7 +149,6 @@ def displayAttributeOnCells(self, data_id: str, name: str) -> None: mapper = self.get_object(data_id).mapper mapper.ScalarVisibilityOn() mapper.SetScalarModeToUseCellData() - # mapper.SetScalarRange(cells.GetScalars().GetRange()) def displayScalarRange(self, data_id: str, minimum: float, maximum: float) -> None: data = self.get_object(data_id) @@ -158,23 +156,8 @@ def displayScalarRange(self, data_id: str, minimum: float, maximum: float) -> No def setupColorMap(self, data_id: str, points: list[list[float]]) -> None: data = self.get_object(data_id) - # sorted_points = sorted(points, key=lambda x: x[0]) - # points_min = sorted_points[0][0] - # points_max = sorted_points[-1][0] - # points_range = points_max - points_min if points_max != points_min else 1.0 - - # data.color_map_points = [] - # for point in points: - # # ratio = (point[0] - points_min) / points_range - # data.color_map_points.append(point) - lut = vtkColorTransferFunction() for ratio, red, green, blue in points: - # scalar_value = minimum + ratio * (maximum - minimum) - # lut.AddRGBPoint(scalar_value, red / 255, green / 255, blue / 255) lut.AddRGBPoint(ratio, red, green, blue) data.mapper.SetLookupTable(lut) data.mapper.InterpolateScalarsBeforeMappingOn() - - # minimum, maximum = data.mapper.GetScalarRange() - # self.displayScalarRange(data_id, minimum, maximum) From 2510cfcd4673db427926b2a3c2e2d9354c497ce1 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Thu, 29 Jan 2026 15:19:25 +0100 Subject: [PATCH 05/27] rm com --- src/opengeodeweb_viewer/vtk_protocol.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/opengeodeweb_viewer/vtk_protocol.py b/src/opengeodeweb_viewer/vtk_protocol.py index f5ad0302..fc16e30e 100644 --- a/src/opengeodeweb_viewer/vtk_protocol.py +++ b/src/opengeodeweb_viewer/vtk_protocol.py @@ -35,7 +35,6 @@ class vtkData: max_dimension: Literal["points", "edges", "polygons", "polyhedra", "default"] = ( "default" ) - # color_map_points: list[list[float]] = field(default_factory=list) class VtkTypingMixin: From 16a8fe86c5b6f8a466352a5068afef0662896c60 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 30 Jan 2026 10:04:53 +0100 Subject: [PATCH 06/27] test scalar_range comparison --- src/opengeodeweb_viewer/vtk_protocol.py | 1 + .../data/comparison/coord_lut_1_register.jpeg | Bin 0 -> 2645 bytes .../comparison/coord_lut_2_attribute.jpeg | Bin 0 -> 3699 bytes .../comparison/coord_lut_3_range_0_1.jpeg | Bin 0 -> 3699 bytes .../coord_lut_4_lut_0_1_saturated.jpeg | Bin 0 -> 4058 bytes .../coord_lut_5_coordinated_update.jpeg | Bin 0 -> 8715 bytes .../data/comparison/fixed_lut_1_register.jpeg | Bin 0 -> 2645 bytes .../comparison/fixed_lut_2_attribute.jpeg | Bin 0 -> 3699 bytes .../comparison/fixed_lut_3_range_0_1.jpeg | Bin 0 -> 3699 bytes .../fixed_lut_4_lut_0_1_saturated.jpeg | Bin 0 -> 4058 bytes .../fixed_lut_5_range_500_lut_fixed.jpeg | Bin 0 -> 4058 bytes tests/mesh/test_mesh_scalar_range.py | 90 ++++++++++++++++ tests/mesh/test_mesh_scalar_range_lut.py | 102 ++++++++++++++++++ 13 files changed, 193 insertions(+) create mode 100644 tests/data/comparison/coord_lut_1_register.jpeg create mode 100644 tests/data/comparison/coord_lut_2_attribute.jpeg create mode 100644 tests/data/comparison/coord_lut_3_range_0_1.jpeg create mode 100644 tests/data/comparison/coord_lut_4_lut_0_1_saturated.jpeg create mode 100644 tests/data/comparison/coord_lut_5_coordinated_update.jpeg create mode 100644 tests/data/comparison/fixed_lut_1_register.jpeg create mode 100644 tests/data/comparison/fixed_lut_2_attribute.jpeg create mode 100644 tests/data/comparison/fixed_lut_3_range_0_1.jpeg create mode 100644 tests/data/comparison/fixed_lut_4_lut_0_1_saturated.jpeg create mode 100644 tests/data/comparison/fixed_lut_5_range_500_lut_fixed.jpeg create mode 100644 tests/mesh/test_mesh_scalar_range.py create mode 100644 tests/mesh/test_mesh_scalar_range_lut.py diff --git a/src/opengeodeweb_viewer/vtk_protocol.py b/src/opengeodeweb_viewer/vtk_protocol.py index fc16e30e..cc640594 100644 --- a/src/opengeodeweb_viewer/vtk_protocol.py +++ b/src/opengeodeweb_viewer/vtk_protocol.py @@ -31,6 +31,7 @@ class vtkData: reader: vtkXMLReader mapper: vtkMapper filter: vtkAlgorithm | None = None + color_map_points: list[list[float]] = field(default_factory=list) actor: vtkActor = field(default_factory=vtkActor) max_dimension: Literal["points", "edges", "polygons", "polyhedra", "default"] = ( "default" diff --git a/tests/data/comparison/coord_lut_1_register.jpeg b/tests/data/comparison/coord_lut_1_register.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..14b2bacd0e44a9739550819224789f4108ce3c2c GIT binary patch literal 2645 zcmex=qb(k5I7?=bZ znFSgDA7PMyIF11caB*<517$=&en18PZ!z#NGcqs^H~#~wEKumpuY?1<{|uPx zdl>FNW-$MO$tix=0M^C4`O01slRXd<7$1K)UOeF#gi}^EeOcRdh$;q~I*E5h5(mIC zeCLC{T(|_al)eA3>^Wx%umt1HS8=nX;=pVMhL1mzcb-UwaI9^;FFSi5fNJG3nMGjzt>0lYa7MCUp>5Lb$etu-==l4sWDckc9c#nc&+vD zS}125Hguq9!pHg(VY`pjRv^KhTmY@xHyKi&?$hxTf`p>Pl!u8H8*}SebD!=wj1S0>ZZa zUaWQNC;n$p1Z6)#^z7FF4rO2**fW~^XTYO`386$w09XidGcW_A2AZAOfYHdpYUWV3 zZ0j{fAz=|gQ86WDcnq@HGyP}SRo&Wl$iAYku=vmSW%BcR+W*Y8J2Us+eviekyG8#q z+}vzxE4d|d`L}OhzJAy~U&zcy{(?&HWcDwd$|(o`GI`uIsCSq|T|s+S`9uHs46d6` z|9~ijQnC|m?)Dl>5DRfD? z{%1%ptdsfl;MM&PN`?HZ@4w6Am)D=8d-CU|`Hzk+`uA3H)%jn)e*dlvKR)xhq`~t` zmB)N6zsxI~%vY;EC*|;bPwEPCEzDz^U;bjklfr{1+dp197N5TTMDpd`yY&}m2%G8r z>z$>se0NxvaroD7v8ACOpP&Ed3d~P3z|6wTid+gZ3OY0@8YUDhfE94|isz;$PLVNO z&NkzE?f3gg$dso;-NAg#hkY-Lm!6w$6+;45`dwN^5Yt3aUJiDkiLc~g)h;j_GcX7s zyARCfKoQ}B@)m$;rUnRC141o;P*62cL8zKRrm+FVsSpkpk{M4q2r4QC2p5%5B~ri& zjtLaPaKI?27>FGA0_Rq^adcXytmtlcT(jx44gwuh@ReQ5$awa)dCuLNqE literal 0 HcmV?d00001 diff --git a/tests/data/comparison/coord_lut_2_attribute.jpeg b/tests/data/comparison/coord_lut_2_attribute.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..4010661a0fbe0c19c4477713233e3b9ba30c004f GIT binary patch literal 3699 zcmex=qb(k5I7?=bZ znFSgDA7PM$I*tJW*w|TFxIj`+D-kjbY#f}-tp9H@@GvtnFbOaV06qEhKaxC@DR-|m zzMb=Kt-qb{E(^aG53Lusyz4_|Zaq5p8-MF7u=1$;2jahGnV5>a0CU+Vi`^>BE4j`l zxeUzL&3~Z(Ypax0R|%NQe6l;&V!Ks#GtXr(Uu^pa@xM{MyslPYF5{D<+vY^iH9gpt z*#HvYj{d>@Z>?L~qPbvchEGYi{dCXGdT`j}07!s!?H|_v3}K6%1N|C6e1=NH+~s1= zeG3w2C4jh0*Zwj6XILG$aK&;55TC(j##wf3a3y#Fh|3`7 z6P9Oj*8L6pUtP(_(!2oX@~i1?d35LHIv!&mFn@@9eP%?-KL1@0P4W-E z+u^+HA>Zp3>vaN1%$G^G%95M4n56^3zQsv^(xE&sEwKZ04KqR&GYhMzk%KW4V?qHi z$#DQB8CjWrU(`Gopd8k5b&+XCZxmt1mwTJf9}~-dY~MDhh@&jazp8Y2DhYYCOj0Ds zXk5qfSM(=8FqpIj85o#ZxPie03n(UL76wK(13?jElaS()DVw%j5;Amj2nYlR88aiJ zJ>x&iF5yYvSstI%@Gn1k(BJ~&dtUwWljj8HeBU+Q_R8O&=es|yKC!X0oV7aZlTK3X z!MIy{x+SI;gl}7~bWHV*=v!hWlg_EUit}75_2BQG%}iFB{~7A^YlV`cAJqz2Yb|vS z^V-b)NYhaFqg{vW)S!i{RU=zJip-eyW4;UDsg(g&C#^a3qszy;#(xoeYRHPLlVOQ9 zu4=0L)Gsn`S`}iNvf5yu(qy6g!Y>+chH6P|3Y`%z=-HXy`NiSQs;Rt@T4(e-mK@oB zX0sk$2GJE|cXQ2@8*jDFi#X ze*ILu^51%30?+{^09H0&RsmHpAi%=P#>m9XVZgvH9zN}=kg0iT*`_Um!VUr86u<;Z z0sk2+t#}I-vK_6x=KlQ4DPe-cW5*ni`ZbS>`#aBHD>R(H z?NIgQ)1m)*19PuYn`Ps@GFXuLP>{NR@I}`he;hWP=W?HNM3_%H;*I;^9X2-Xi!FJd z&n^AFaN{$p>obneI<|F6D*NJvdpbVfvDLi){Ds_w(r-x+za0ao$n~{-Qa)esWqJMl1=Wt%Z*lc3 z_)=m%QLegusr8?~%(wXVT?nDOtENtUBx_r$c)I^urjs$7yv(r-;Z{M%jAKq+fB2t^ zE^O;*mYndY&b;v-pZI?U=|k84MT_ZeHku%H(t5{jDzk1CT;*J9c}qlBD^U${f@1C#P@)*pSlKA*D|T(|X^)wNy6HunB!m<~+8ngR@rOl-^y zOpGkh5{#MAfq}`mXz``ujhloF6$O=)or2&cKASzT{;dk(nQz~J|J}6s-BXqN9P>qr zxGNSOVu7`!>I;3wLxr zjFh`+9oF_py)~seSkmZ`iyXB020m#n)M>hf>?Cw*Yd%L;&M za9FH^N-jo0Lq!M2z=VPYu=?Fz@$+&WhPi@{=Qkd`RerzrI|3D!T=&p&)ZtkhlAQTgdAVUL~3l(HgfJj0F83u_)1&F7N4nQ1-i)04IpQIqD%7HaIKq?sp z4IBa*;0+Cd$FpU3eYoiPBs8m8{{H^DzrVk~KenkM>`=3nqhlA(huLgBQU)0Z7h_OT zbH6@qntqGpf}TA@*ZsL&xhY(6tgITERr?`UGcY0BjBGWih7&mMCA|5;$;D;|8ck-K z<=otyc6K($foZZW!gE_bO#a>f&VI+g#~73A}~Ff2gO7|da^*a%779q z6SBRGf{KO?DCt$;^V)gxExxi$CO!?*+cXw+A)#;gj!NmOEpk{^S#V7N literal 0 HcmV?d00001 diff --git a/tests/data/comparison/coord_lut_3_range_0_1.jpeg b/tests/data/comparison/coord_lut_3_range_0_1.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..4010661a0fbe0c19c4477713233e3b9ba30c004f GIT binary patch literal 3699 zcmex=qb(k5I7?=bZ znFSgDA7PM$I*tJW*w|TFxIj`+D-kjbY#f}-tp9H@@GvtnFbOaV06qEhKaxC@DR-|m zzMb=Kt-qb{E(^aG53Lusyz4_|Zaq5p8-MF7u=1$;2jahGnV5>a0CU+Vi`^>BE4j`l zxeUzL&3~Z(Ypax0R|%NQe6l;&V!Ks#GtXr(Uu^pa@xM{MyslPYF5{D<+vY^iH9gpt z*#HvYj{d>@Z>?L~qPbvchEGYi{dCXGdT`j}07!s!?H|_v3}K6%1N|C6e1=NH+~s1= zeG3w2C4jh0*Zwj6XILG$aK&;55TC(j##wf3a3y#Fh|3`7 z6P9Oj*8L6pUtP(_(!2oX@~i1?d35LHIv!&mFn@@9eP%?-KL1@0P4W-E z+u^+HA>Zp3>vaN1%$G^G%95M4n56^3zQsv^(xE&sEwKZ04KqR&GYhMzk%KW4V?qHi z$#DQB8CjWrU(`Gopd8k5b&+XCZxmt1mwTJf9}~-dY~MDhh@&jazp8Y2DhYYCOj0Ds zXk5qfSM(=8FqpIj85o#ZxPie03n(UL76wK(13?jElaS()DVw%j5;Amj2nYlR88aiJ zJ>x&iF5yYvSstI%@Gn1k(BJ~&dtUwWljj8HeBU+Q_R8O&=es|yKC!X0oV7aZlTK3X z!MIy{x+SI;gl}7~bWHV*=v!hWlg_EUit}75_2BQG%}iFB{~7A^YlV`cAJqz2Yb|vS z^V-b)NYhaFqg{vW)S!i{RU=zJip-eyW4;UDsg(g&C#^a3qszy;#(xoeYRHPLlVOQ9 zu4=0L)Gsn`S`}iNvf5yu(qy6g!Y>+chH6P|3Y`%z=-HXy`NiSQs;Rt@T4(e-mK@oB zX0sk$2GJE|cXQ2@8*jDFi#X ze*ILu^51%30?+{^09H0&RsmHpAi%=P#>m9XVZgvH9zN}=kg0iT*`_Um!VUr86u<;Z z0sk2+t#}I-vK_6x=KlQ4DPe-cW5*ni`ZbS>`#aBHD>R(H z?NIgQ)1m)*19PuYn`Ps@GFXuLP>{NR@I}`he;hWP=W?HNM3_%H;*I;^9X2-Xi!FJd z&n^AFaN{$p>obneI<|F6D*NJvdpbVfvDLi){Ds_w(r-x+za0ao$n~{-Qa)esWqJMl1=Wt%Z*lc3 z_)=m%QLegusr8?~%(wXVT?nDOtENtUBx_r$c)I^urjs$7yv(r-;Z{M%jAKq+fB2t^ zE^O;*mYndY&b;v-pZI?U=|k84MT_ZeHku%H(t5{jDzk1CT;*J9c}qlBD^U${f@1C#P@)*pSlKA*D|T(|X^)wNy6HunB!m<~+8ngR@rOl-^y zOpGkh5{#MAfq}`mXz``ujhloF6$O=)or2&cKASzT{;dk(nQz~J|J}6s-BXqN9P>qr zxGNSOVu7`!>I;3wLxr zjFh`+9oF_py)~seSkmZ`iyXB020m#n)M>hf>?Cw*Yd%L;&M za9FH^N-jo0Lq!M2z=VPYu=?Fz@$+&WhPi@{=Qkd`RerzrI|3D!T=&p&)ZtkhlAQTgdAVUL~3l(HgfJj0F83u_)1&F7N4nQ1-i)04IpQIqD%7HaIKq?sp z4IBa*;0+Cd$FpU3eYoiPBs8m8{{H^DzrVk~KenkM>`=3nqhlA(huLgBQU)0Z7h_OT zbH6@qntqGpf}TA@*ZsL&xhY(6tgITERr?`UGcY0BjBGWih7&mMCA|5;$;D;|8ck-K z<=otyc6K($foZZW!gE_bO#a>f&VI+g#~73A}~Ff2gO7|da^*a%779q z6SBRGf{KO?DCt$;^V)gxExxi$CO!?*+cXw+A)#;gj!NmOEpk{^S#V7N literal 0 HcmV?d00001 diff --git a/tests/data/comparison/coord_lut_4_lut_0_1_saturated.jpeg b/tests/data/comparison/coord_lut_4_lut_0_1_saturated.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..7776304242b7b42cd5b0cb38957571aa4ef8ce4f GIT binary patch literal 4058 zcmex=qb(k5I7?=bZ znFSgDA7PLJI+7VE%YXpv9Gt9dTp&51Fs2+E3+w+|3_Q$?3`_#d0zhy6{EyHJW69o+ zfB5RL$&Al`JZf~nUP&2M z!N4%I!$W=Jgl{uEJI)@tanew-6C3J}pF7=Z#;Fhkm8cw8D#A{)1Cyql00Sc{I7`6P zI54oXiJ7u9vm_J%lP3o-=`yl1{k>eBf9vII|B0(=dV`;2%~uZjDYg8>RXewppG@%y zW?xhL&+zyezx_4d^CoijYozC8*!*XRFt@o-`ENsB<$}+D6YhL=eE#d;&S%Z%zcv@2 zWuO0=?fI+$R^Ps}#y8KL!1{8%4IA0m3P6 z3_YR872k9G(3{typ7c>ES496YD`#7$umoF&bks4s$MSzI|E9m}*(Q8%-mLZCvby`I z&Dv6^x73FtMpdcIYM#jL{*DlfCn|qboE6)ySt&ogV;95TR$xA_^!h#Ce#2{fj@eu@ zU9(uDRz~xQ;r$Gg<@NRs-#V_}^6FXmrC|AlpWW_0YcdkmF@>{%`_s?IjU1a)g(vUW4%N}R-cMH~7*=_c6c*J)+S=q)- zZ&8c0pMjz)=R&Sa%l(+FnFV{YV`|sc#s4$^bnUj7-sYeQ(kHD?P@8qD;40@*n_MBS zTvw)mmLPF)o(mH!Hgar8Z4tQX-du3_2@l^3{f^h`Z5}T&y|(9g)b)sKhWkJLX8@*N z9boEZVPY55tmX4~YZZ1}urpi9icq{}y1fRC;wDN z@8tROU;l18yYza(uc+8E{-xApM7mC4el#n97|gYP59;@83{E0s?LYmS6Xhd*1E#_ z4h$go0lN=qfRo4IFbF|}xf&q!5-`QI0K(IRP%9u5mjjsAg7BCofayV|u?ONQs{;^6 z;v$)Wu_q}Aj69^c1I3!*z~1vmC) zOjUF!_eM1a?kg@DTW#s)dHiHcv}Mb& zX2zBlB36|?MxyJxc@DT`$9avu`DDWB{Ie+pa2S+1aUc^YL*?fpLvz&A0!>^_ z+YS$K;*J`*dO}>RK-LW9T#z;WdvIOdUz1sret7-9yATdSuA`vVe(6*=n1U8ZXgUIi z!8scGkqS**QvPmm;y{9dogkO~d62bgA;kKUm$N(RL`+09m(Z0zu0cTSMf8s>BBBFM zFX?is>xo{yV{Yw31d^xL}3xg z&70uXE}-&pfCFG`a29ZN)@NhHsBgr?^5mSA_hK;n_!RYBlP^DEaj!8GOQp8?T(Oy> zM-08BKJNChBF|Yc29=6UI~DSoT{N(#ga@=6m;SEQ9Eh*kUet7uJCe7O1zqfxsBC|la_8_j$$DXTqDW7>^|Rf#zDexHkkwpz+C_76kNFI$6b+)`h}Tw|xfL%!J(^nk(nrmOT_BiOFxI zQ!aLDKUL16m?sXK+45O&B_tc48#T?s@ELQv?(~-AbJ)luCnGjkjg!6RbjIePyb&FAbu5+)E^t%3mxO zKlO^e@U7ZiVZLD@&kBCCwM$C>Qt~zZOX{Nhr=4O|Uw-0`vX1Ps~+My!WePt^aoqSXCD>?ES|RFZavU}j_l`>jfC7FmEJes&Q#@itP;k}^ziwWSJf}!%-hQ-D`I^Pu@wc2KRc9NUOm!tk-o)>;nj8q) zzAN%`)|)bnbcGq9^EHUO_oRN^bm1ku!lukYn*7c|?f~5zRmW^2khA{MLE8NXX^I=RK1AP?U;z=JN?}2jLLgD7 z4bY05YwD>;P%Oo-_JGW6xeody}t1=a{E6$kQCN3?0s_~rXb=pXMb8C+l(73r6n(>AkCz@A5WBh{S0fCes=8X-urLE7p>fZs+!MZiPHRU z`=_kjHS12?94pYc|F$&6yN0`YY+A#@%EjT8wtG)Zb-&a5q9K%tuH;36$`i@9GYh#q z^)F83Y^}TGoI&D?l-e&t?@)dk-n0~V<78DuN79qfL4hgKH?ryHNL-rH#w?XnQN>JY zx(`fWHFND}*TLU?gpSv)j7RRXozCkX>$&=yREcv2S!}~WY27q(O=|qJY@)ei<9?&e z1j(Yi!KZlK538qj4Qw8iI7xmS8Ai~mZQZNbAdquEK7MM{csSg5G&hB#)nrlN!q}k$ zt?x*w4lKYE8!XaO@28X3!ap@?l$z(u)o+td`y$n9mgoK4e+th63LhBrdn$A7mS+Fj zZg?E$KiAx9(ky)-pPFnl*1o)XGv|} zi^ZT~$$%RZ2sU;E68`fu9)Z*ZU~o1?H&T2;c3BgeuUSA$0jo`r|MgLi!oioPX0>kR zf4gG5P`>fi_}qRv^9-V@7bT?;eButf1hL<*rn$Z3a;}oRk5OW!Y)y0CV1DF%kyi?Y zA+Aa6HtP&^f<2d8?&h<}>IOr)bKLmHlAp0C$B4Vlf^n8dy?vZQ!+I^EBtB=};K1j| zJ-w|ZK7Ekdh2$-gqJH4t=sB-i?|WGF`;sc}!_%?4a(Ph===Fd9J_iD>+*>X@!5sEH zw58aMI-5T>*%w^Vdw{q5BH<=Z_>|4Yw=F6X<5+#pke#U|@^4#AP!zKapnijq9o;3@ z-n@|@P*3Y&kUhJvfsM;iW!6hSDY2dN;dIU;&wP1~C%~&ycKZ3Q* zuXQ6%Yn*iQi>+ADR`~8k0)fk?mE)&N1isG2}tBd1(G$^A^!Hcm~)<80GXGC!1oY^l0T_Y}{Hp!6{)Pc) zd0sJBKbqVV*ItXjR>2M z9vOstj)E{nTZcJm5-0i^&oCn3`G!HY6j>b{x_Y?9N@OV~G@=n_ufRY~exe-MFPpyf;XAcawa9O} z?H$Ug{)hIX?Yg4KYnlga?an%UkgMCdKi|wSE!R?c8rn}x(}rLj z%l!Rn=3OS&C2N?^-J9(Wm7(-)BFL#y7=!J{^erj#?k?T)O8orPCkH;>e9Nd`m>}}U zWXYM&yAwB1Lwvl$O9mOC#kR28WIOqMkAac)W6tI*AVaLNT(CmV+KsX3!RcT3RocJ4 z9^+hxpz4&Jxjb3flpQeGLhBlk5XF??i689S4cZCUwMU(#3f^CBJQik*x53-!aBiSw z#*GL$XK%|PWX2=?+o3Vvn-}Ssv1?uOqv^QE+g}8f1(XHxZLzgE)T;Q=e!pY*-!k_j+~zlf?wroqmO0AB>49VGcYoL{oSuHb2H^ zRrD!#%<);bZm->;Oqb~K+Q9+nXMp;BQR)e0R{xRUivxzOvlLL_XU1niC%ehQn8DD6j0R VcVTAWO51MWr9c(OFXLGq{{qJjZN>lq literal 0 HcmV?d00001 diff --git a/tests/data/comparison/fixed_lut_1_register.jpeg b/tests/data/comparison/fixed_lut_1_register.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..14b2bacd0e44a9739550819224789f4108ce3c2c GIT binary patch literal 2645 zcmex=qb(k5I7?=bZ znFSgDA7PMyIF11caB*<517$=&en18PZ!z#NGcqs^H~#~wEKumpuY?1<{|uPx zdl>FNW-$MO$tix=0M^C4`O01slRXd<7$1K)UOeF#gi}^EeOcRdh$;q~I*E5h5(mIC zeCLC{T(|_al)eA3>^Wx%umt1HS8=nX;=pVMhL1mzcb-UwaI9^;FFSi5fNJG3nMGjzt>0lYa7MCUp>5Lb$etu-==l4sWDckc9c#nc&+vD zS}125Hguq9!pHg(VY`pjRv^KhTmY@xHyKi&?$hxTf`p>Pl!u8H8*}SebD!=wj1S0>ZZa zUaWQNC;n$p1Z6)#^z7FF4rO2**fW~^XTYO`386$w09XidGcW_A2AZAOfYHdpYUWV3 zZ0j{fAz=|gQ86WDcnq@HGyP}SRo&Wl$iAYku=vmSW%BcR+W*Y8J2Us+eviekyG8#q z+}vzxE4d|d`L}OhzJAy~U&zcy{(?&HWcDwd$|(o`GI`uIsCSq|T|s+S`9uHs46d6` z|9~ijQnC|m?)Dl>5DRfD? z{%1%ptdsfl;MM&PN`?HZ@4w6Am)D=8d-CU|`Hzk+`uA3H)%jn)e*dlvKR)xhq`~t` zmB)N6zsxI~%vY;EC*|;bPwEPCEzDz^U;bjklfr{1+dp197N5TTMDpd`yY&}m2%G8r z>z$>se0NxvaroD7v8ACOpP&Ed3d~P3z|6wTid+gZ3OY0@8YUDhfE94|isz;$PLVNO z&NkzE?f3gg$dso;-NAg#hkY-Lm!6w$6+;45`dwN^5Yt3aUJiDkiLc~g)h;j_GcX7s zyARCfKoQ}B@)m$;rUnRC141o;P*62cL8zKRrm+FVsSpkpk{M4q2r4QC2p5%5B~ri& zjtLaPaKI?27>FGA0_Rq^adcXytmtlcT(jx44gwuh@ReQ5$awa)dCuLNqE literal 0 HcmV?d00001 diff --git a/tests/data/comparison/fixed_lut_2_attribute.jpeg b/tests/data/comparison/fixed_lut_2_attribute.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..4010661a0fbe0c19c4477713233e3b9ba30c004f GIT binary patch literal 3699 zcmex=qb(k5I7?=bZ znFSgDA7PM$I*tJW*w|TFxIj`+D-kjbY#f}-tp9H@@GvtnFbOaV06qEhKaxC@DR-|m zzMb=Kt-qb{E(^aG53Lusyz4_|Zaq5p8-MF7u=1$;2jahGnV5>a0CU+Vi`^>BE4j`l zxeUzL&3~Z(Ypax0R|%NQe6l;&V!Ks#GtXr(Uu^pa@xM{MyslPYF5{D<+vY^iH9gpt z*#HvYj{d>@Z>?L~qPbvchEGYi{dCXGdT`j}07!s!?H|_v3}K6%1N|C6e1=NH+~s1= zeG3w2C4jh0*Zwj6XILG$aK&;55TC(j##wf3a3y#Fh|3`7 z6P9Oj*8L6pUtP(_(!2oX@~i1?d35LHIv!&mFn@@9eP%?-KL1@0P4W-E z+u^+HA>Zp3>vaN1%$G^G%95M4n56^3zQsv^(xE&sEwKZ04KqR&GYhMzk%KW4V?qHi z$#DQB8CjWrU(`Gopd8k5b&+XCZxmt1mwTJf9}~-dY~MDhh@&jazp8Y2DhYYCOj0Ds zXk5qfSM(=8FqpIj85o#ZxPie03n(UL76wK(13?jElaS()DVw%j5;Amj2nYlR88aiJ zJ>x&iF5yYvSstI%@Gn1k(BJ~&dtUwWljj8HeBU+Q_R8O&=es|yKC!X0oV7aZlTK3X z!MIy{x+SI;gl}7~bWHV*=v!hWlg_EUit}75_2BQG%}iFB{~7A^YlV`cAJqz2Yb|vS z^V-b)NYhaFqg{vW)S!i{RU=zJip-eyW4;UDsg(g&C#^a3qszy;#(xoeYRHPLlVOQ9 zu4=0L)Gsn`S`}iNvf5yu(qy6g!Y>+chH6P|3Y`%z=-HXy`NiSQs;Rt@T4(e-mK@oB zX0sk$2GJE|cXQ2@8*jDFi#X ze*ILu^51%30?+{^09H0&RsmHpAi%=P#>m9XVZgvH9zN}=kg0iT*`_Um!VUr86u<;Z z0sk2+t#}I-vK_6x=KlQ4DPe-cW5*ni`ZbS>`#aBHD>R(H z?NIgQ)1m)*19PuYn`Ps@GFXuLP>{NR@I}`he;hWP=W?HNM3_%H;*I;^9X2-Xi!FJd z&n^AFaN{$p>obneI<|F6D*NJvdpbVfvDLi){Ds_w(r-x+za0ao$n~{-Qa)esWqJMl1=Wt%Z*lc3 z_)=m%QLegusr8?~%(wXVT?nDOtENtUBx_r$c)I^urjs$7yv(r-;Z{M%jAKq+fB2t^ zE^O;*mYndY&b;v-pZI?U=|k84MT_ZeHku%H(t5{jDzk1CT;*J9c}qlBD^U${f@1C#P@)*pSlKA*D|T(|X^)wNy6HunB!m<~+8ngR@rOl-^y zOpGkh5{#MAfq}`mXz``ujhloF6$O=)or2&cKASzT{;dk(nQz~J|J}6s-BXqN9P>qr zxGNSOVu7`!>I;3wLxr zjFh`+9oF_py)~seSkmZ`iyXB020m#n)M>hf>?Cw*Yd%L;&M za9FH^N-jo0Lq!M2z=VPYu=?Fz@$+&WhPi@{=Qkd`RerzrI|3D!T=&p&)ZtkhlAQTgdAVUL~3l(HgfJj0F83u_)1&F7N4nQ1-i)04IpQIqD%7HaIKq?sp z4IBa*;0+Cd$FpU3eYoiPBs8m8{{H^DzrVk~KenkM>`=3nqhlA(huLgBQU)0Z7h_OT zbH6@qntqGpf}TA@*ZsL&xhY(6tgITERr?`UGcY0BjBGWih7&mMCA|5;$;D;|8ck-K z<=otyc6K($foZZW!gE_bO#a>f&VI+g#~73A}~Ff2gO7|da^*a%779q z6SBRGf{KO?DCt$;^V)gxExxi$CO!?*+cXw+A)#;gj!NmOEpk{^S#V7N literal 0 HcmV?d00001 diff --git a/tests/data/comparison/fixed_lut_3_range_0_1.jpeg b/tests/data/comparison/fixed_lut_3_range_0_1.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..4010661a0fbe0c19c4477713233e3b9ba30c004f GIT binary patch literal 3699 zcmex=qb(k5I7?=bZ znFSgDA7PM$I*tJW*w|TFxIj`+D-kjbY#f}-tp9H@@GvtnFbOaV06qEhKaxC@DR-|m zzMb=Kt-qb{E(^aG53Lusyz4_|Zaq5p8-MF7u=1$;2jahGnV5>a0CU+Vi`^>BE4j`l zxeUzL&3~Z(Ypax0R|%NQe6l;&V!Ks#GtXr(Uu^pa@xM{MyslPYF5{D<+vY^iH9gpt z*#HvYj{d>@Z>?L~qPbvchEGYi{dCXGdT`j}07!s!?H|_v3}K6%1N|C6e1=NH+~s1= zeG3w2C4jh0*Zwj6XILG$aK&;55TC(j##wf3a3y#Fh|3`7 z6P9Oj*8L6pUtP(_(!2oX@~i1?d35LHIv!&mFn@@9eP%?-KL1@0P4W-E z+u^+HA>Zp3>vaN1%$G^G%95M4n56^3zQsv^(xE&sEwKZ04KqR&GYhMzk%KW4V?qHi z$#DQB8CjWrU(`Gopd8k5b&+XCZxmt1mwTJf9}~-dY~MDhh@&jazp8Y2DhYYCOj0Ds zXk5qfSM(=8FqpIj85o#ZxPie03n(UL76wK(13?jElaS()DVw%j5;Amj2nYlR88aiJ zJ>x&iF5yYvSstI%@Gn1k(BJ~&dtUwWljj8HeBU+Q_R8O&=es|yKC!X0oV7aZlTK3X z!MIy{x+SI;gl}7~bWHV*=v!hWlg_EUit}75_2BQG%}iFB{~7A^YlV`cAJqz2Yb|vS z^V-b)NYhaFqg{vW)S!i{RU=zJip-eyW4;UDsg(g&C#^a3qszy;#(xoeYRHPLlVOQ9 zu4=0L)Gsn`S`}iNvf5yu(qy6g!Y>+chH6P|3Y`%z=-HXy`NiSQs;Rt@T4(e-mK@oB zX0sk$2GJE|cXQ2@8*jDFi#X ze*ILu^51%30?+{^09H0&RsmHpAi%=P#>m9XVZgvH9zN}=kg0iT*`_Um!VUr86u<;Z z0sk2+t#}I-vK_6x=KlQ4DPe-cW5*ni`ZbS>`#aBHD>R(H z?NIgQ)1m)*19PuYn`Ps@GFXuLP>{NR@I}`he;hWP=W?HNM3_%H;*I;^9X2-Xi!FJd z&n^AFaN{$p>obneI<|F6D*NJvdpbVfvDLi){Ds_w(r-x+za0ao$n~{-Qa)esWqJMl1=Wt%Z*lc3 z_)=m%QLegusr8?~%(wXVT?nDOtENtUBx_r$c)I^urjs$7yv(r-;Z{M%jAKq+fB2t^ zE^O;*mYndY&b;v-pZI?U=|k84MT_ZeHku%H(t5{jDzk1CT;*J9c}qlBD^U${f@1C#P@)*pSlKA*D|T(|X^)wNy6HunB!m<~+8ngR@rOl-^y zOpGkh5{#MAfq}`mXz``ujhloF6$O=)or2&cKASzT{;dk(nQz~J|J}6s-BXqN9P>qr zxGNSOVu7`!>I;3wLxr zjFh`+9oF_py)~seSkmZ`iyXB020m#n)M>hf>?Cw*Yd%L;&M za9FH^N-jo0Lq!M2z=VPYu=?Fz@$+&WhPi@{=Qkd`RerzrI|3D!T=&p&)ZtkhlAQTgdAVUL~3l(HgfJj0F83u_)1&F7N4nQ1-i)04IpQIqD%7HaIKq?sp z4IBa*;0+Cd$FpU3eYoiPBs8m8{{H^DzrVk~KenkM>`=3nqhlA(huLgBQU)0Z7h_OT zbH6@qntqGpf}TA@*ZsL&xhY(6tgITERr?`UGcY0BjBGWih7&mMCA|5;$;D;|8ck-K z<=otyc6K($foZZW!gE_bO#a>f&VI+g#~73A}~Ff2gO7|da^*a%779q z6SBRGf{KO?DCt$;^V)gxExxi$CO!?*+cXw+A)#;gj!NmOEpk{^S#V7N literal 0 HcmV?d00001 diff --git a/tests/data/comparison/fixed_lut_4_lut_0_1_saturated.jpeg b/tests/data/comparison/fixed_lut_4_lut_0_1_saturated.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..7776304242b7b42cd5b0cb38957571aa4ef8ce4f GIT binary patch literal 4058 zcmex=qb(k5I7?=bZ znFSgDA7PLJI+7VE%YXpv9Gt9dTp&51Fs2+E3+w+|3_Q$?3`_#d0zhy6{EyHJW69o+ zfB5RL$&Al`JZf~nUP&2M z!N4%I!$W=Jgl{uEJI)@tanew-6C3J}pF7=Z#;Fhkm8cw8D#A{)1Cyql00Sc{I7`6P zI54oXiJ7u9vm_J%lP3o-=`yl1{k>eBf9vII|B0(=dV`;2%~uZjDYg8>RXewppG@%y zW?xhL&+zyezx_4d^CoijYozC8*!*XRFt@o-`ENsB<$}+D6YhL=eE#d;&S%Z%zcv@2 zWuO0=?fI+$R^Ps}#y8KL!1{8%4IA0m3P6 z3_YR872k9G(3{typ7c>ES496YD`#7$umoF&bks4s$MSzI|E9m}*(Q8%-mLZCvby`I z&Dv6^x73FtMpdcIYM#jL{*DlfCn|qboE6)ySt&ogV;95TR$xA_^!h#Ce#2{fj@eu@ zU9(uDRz~xQ;r$Gg<@NRs-#V_}^6FXmrC|AlpWW_0YcdkmF@>{%`_s?IjU1a)g(vUW4%N}R-cMH~7*=_c6c*J)+S=q)- zZ&8c0pMjz)=R&Sa%l(+FnFV{YV`|sc#s4$^bnUj7-sYeQ(kHD?P@8qD;40@*n_MBS zTvw)mmLPF)o(mH!Hgar8Z4tQX-du3_2@l^3{f^h`Z5}T&y|(9g)b)sKhWkJLX8@*N z9boEZVPY55tmX4~YZZ1}urpi9icq{}y1fRC;wDN z@8tROU;l18yYza(uc+8E{-xApM7mC4el#n97|gYP59;@83{E0s?LYmS6Xhd*1E#_ z4h$go0lN=qfRo4IFbF|}xf&q!5-`QI0K(IRP%9u5mjjsAg7BCofayV|u?ONQs{;^6 z;v$)Wu_q}Aj69^c1I3qb(k5I7?=bZ znFSgDA7PLJI+7VE%YXpv9Gt9dTp&51Fs2+E3+w+|3_Q$?3`_#d0zhy6{EyHJW69o+ zfB5RL$&Al`JZf~nUP&2M z!N4%I!$W=Jgl{uEJI)@tanew-6C3J}pF7=Z#;Fhkm8cw8D#A{)1Cyql00Sc{I7`6P zI54oXiJ7u9vm_J%lP3o-=`yl1{k>eBf9vII|B0(=dV`;2%~uZjDYg8>RXewppG@%y zW?xhL&+zyezx_4d^CoijYozC8*!*XRFt@o-`ENsB<$}+D6YhL=eE#d;&S%Z%zcv@2 zWuO0=?fI+$R^Ps}#y8KL!1{8%4IA0m3P6 z3_YR872k9G(3{typ7c>ES496YD`#7$umoF&bks4s$MSzI|E9m}*(Q8%-mLZCvby`I z&Dv6^x73FtMpdcIYM#jL{*DlfCn|qboE6)ySt&ogV;95TR$xA_^!h#Ce#2{fj@eu@ zU9(uDRz~xQ;r$Gg<@NRs-#V_}^6FXmrC|AlpWW_0YcdkmF@>{%`_s?IjU1a)g(vUW4%N}R-cMH~7*=_c6c*J)+S=q)- zZ&8c0pMjz)=R&Sa%l(+FnFV{YV`|sc#s4$^bnUj7-sYeQ(kHD?P@8qD;40@*n_MBS zTvw)mmLPF)o(mH!Hgar8Z4tQX-du3_2@l^3{f^h`Z5}T&y|(9g)b)sKhWkJLX8@*N z9boEZVPY55tmX4~YZZ1}urpi9icq{}y1fRC;wDN z@8tROU;l18yYza(uc+8E{-xApM7mC4el#n97|gYP59;@83{E0s?LYmS6Xhd*1E#_ z4h$go0lN=qfRo4IFbF|}xf&q!5-`QI0K(IRP%9u5mjjsAg7BCofayV|u?ONQs{;^6 z;v$)Wu_q}Aj69^c1I3 None: + server.call( + VtkViewerView.viewer_prefix + VtkViewerView.viewer_schemas_dict["render"]["rpc"] + ) + while True: + image = server.ws.recv() + if isinstance(image, bytes): + response = server.ws.recv() + result = json.loads(response)["result"] + if result["stale"]: + continue + comparison_dir = os.path.join( + os.path.dirname(os.path.dirname(__file__)), "data", "comparison" + ) + output_path = os.path.join(comparison_dir, filename) + with open(output_path, "wb") as f: + f.write(image) + print(f"Image saved to {output_path}") + break + + +def test_mesh_scalar_range_fixed_lut( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + # 1. Register mesh (points values ~2 to 498) + dataset_factory(id=mesh_id, viewable_file="regular_grid_2d.vti") + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + save_image(server, "fixed_lut_1_register.jpeg") + + # 2. Set active attribute "points" + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], + [{"id": mesh_id, "name": "points"}], + ) + save_image(server, "fixed_lut_2_attribute.jpeg") + + # 3. Apply a scalarRange of [0, 1] + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], + [{"id": mesh_id, "minimum": 0.0, "maximum": 1.0}], + ) + save_image(server, "fixed_lut_3_range_0_1.jpeg") + + # 4. Set LUT on [0, 1] (Blue to Red) + # Since range is [0, 1] and values are [2, 498], all should be Red (saturated) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], + ], + } + ], + ) + save_image(server, "fixed_lut_4_lut_0_1_saturated.jpeg") + + # 5. Modify scalar range to [0, 500] WITHOUT changing the LUT + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], + [{"id": mesh_id, "minimum": 0.0, "maximum": 500.0}], + ) + # The image should still be saturated Red because the LUT points are stuck at 0 and 1. + save_image(server, "fixed_lut_5_range_500_lut_fixed.jpeg") diff --git a/tests/mesh/test_mesh_scalar_range_lut.py b/tests/mesh/test_mesh_scalar_range_lut.py new file mode 100644 index 00000000..b5c6c7d3 --- /dev/null +++ b/tests/mesh/test_mesh_scalar_range_lut.py @@ -0,0 +1,102 @@ +# Standard library imports +from typing import Callable + +# Third party imports +import os +import json +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.cells.cells_protocols import VtkMeshCellsView +from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def save_image(server: ServerMonitor, filename: str) -> None: + server.call( + VtkViewerView.viewer_prefix + VtkViewerView.viewer_schemas_dict["render"]["rpc"] + ) + while True: + image = server.ws.recv() + if isinstance(image, bytes): + response = server.ws.recv() + result = json.loads(response)["result"] + if result["stale"]: + continue + comparison_dir = os.path.join( + os.path.dirname(os.path.dirname(__file__)), "data", "comparison" + ) + output_path = os.path.join(comparison_dir, filename) + with open(output_path, "wb") as f: + f.write(image) + print(f"Image saved to {output_path}") + break + + +def test_mesh_scalar_range_coordinated_lut( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + # 1. Register mesh + dataset_factory(id=mesh_id, viewable_file="regular_grid_2d.vti") + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + save_image(server, "coord_lut_1_register.jpeg") + + # 2. Set active attribute "points" + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], + [{"id": mesh_id, "name": "points"}], + ) + save_image(server, "coord_lut_2_attribute.jpeg") + + # 3. Apply a scalarRange of [0, 1] + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], + [{"id": mesh_id, "minimum": 0.0, "maximum": 1.0}], + ) + save_image(server, "coord_lut_3_range_0_1.jpeg") + + # 4. Set LUT on [0, 1] (Blue to Red) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [0.0, 0, 0, 1.0], + [1.0, 1.0, 0, 0], + ], + } + ], + ) + save_image(server, "coord_lut_4_lut_0_1_saturated.jpeg") + + # 5. Modify scalar range to [0, 500] AND MANUALLY update the LUT + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], + [{"id": mesh_id, "minimum": 0.0, "maximum": 500.0}], + ) + server.call( + VtkMeshCellsView.mesh_cells_prefix + + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], + [ + { + "id": mesh_id, + "points": [ + [0.0, 0, 0, 1.0], + [500.0, 1.0, 0, 0], + ], + } + ], + ) + # The image should be a nice gradient because LUT matches Data Range + save_image(server, "coord_lut_5_coordinated_update.jpeg") From 6eaa40a180413c6e8968ef864412e4f88c5b71d3 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 30 Jan 2026 10:07:57 +0100 Subject: [PATCH 07/27] coms --- tests/mesh/test_mesh_scalar_range.py | 6 ++---- tests/mesh/test_mesh_scalar_range_lut.py | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/mesh/test_mesh_scalar_range.py b/tests/mesh/test_mesh_scalar_range.py index 1ca13b93..c5f9a4b6 100644 --- a/tests/mesh/test_mesh_scalar_range.py +++ b/tests/mesh/test_mesh_scalar_range.py @@ -47,7 +47,7 @@ def test_mesh_scalar_range_fixed_lut( ) save_image(server, "fixed_lut_1_register.jpeg") - # 2. Set active attribute "points" + # 2. Set active attribute "points", should be blue server.call( VtkMeshCellsView.mesh_cells_prefix + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], @@ -63,8 +63,7 @@ def test_mesh_scalar_range_fixed_lut( ) save_image(server, "fixed_lut_3_range_0_1.jpeg") - # 4. Set LUT on [0, 1] (Blue to Red) - # Since range is [0, 1] and values are [2, 498], all should be Red (saturated) + # 4. Set LUT on [0, 1] (Blue to Red), should be red server.call( VtkMeshCellsView.mesh_cells_prefix + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], @@ -86,5 +85,4 @@ def test_mesh_scalar_range_fixed_lut( + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], [{"id": mesh_id, "minimum": 0.0, "maximum": 500.0}], ) - # The image should still be saturated Red because the LUT points are stuck at 0 and 1. save_image(server, "fixed_lut_5_range_500_lut_fixed.jpeg") diff --git a/tests/mesh/test_mesh_scalar_range_lut.py b/tests/mesh/test_mesh_scalar_range_lut.py index b5c6c7d3..e5fb2571 100644 --- a/tests/mesh/test_mesh_scalar_range_lut.py +++ b/tests/mesh/test_mesh_scalar_range_lut.py @@ -47,7 +47,7 @@ def test_mesh_scalar_range_coordinated_lut( ) save_image(server, "coord_lut_1_register.jpeg") - # 2. Set active attribute "points" + # 2. Set active attribute "points", should be blue server.call( VtkMeshCellsView.mesh_cells_prefix + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], @@ -63,7 +63,7 @@ def test_mesh_scalar_range_coordinated_lut( ) save_image(server, "coord_lut_3_range_0_1.jpeg") - # 4. Set LUT on [0, 1] (Blue to Red) + # 4. Set LUT on [0, 1] (Blue to Red), should be red server.call( VtkMeshCellsView.mesh_cells_prefix + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], @@ -98,5 +98,4 @@ def test_mesh_scalar_range_coordinated_lut( } ], ) - # The image should be a nice gradient because LUT matches Data Range save_image(server, "coord_lut_5_coordinated_update.jpeg") From ac8183ba4d5f67509fd584401a40db73730ef033 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 30 Jan 2026 11:32:08 +0100 Subject: [PATCH 08/27] update mesh color map schemas to use flattened point arrays and remove separate scalar range RPCs. --- .../mesh/cells/schemas/cell_color_map.json | 11 +- .../rpc/mesh/cells/schemas/cell_color_map.py | 2 +- .../mesh/cells/schemas/vertex_color_map.json | 11 +- .../mesh/cells/schemas/vertex_color_map.py | 2 +- .../mesh/edges/schemas/vertex_color_map.json | 11 +- .../mesh/edges/schemas/vertex_color_map.py | 2 +- .../rpc/mesh/mesh_protocols.py | 13 +- .../mesh/points/schemas/vertex_color_map.json | 11 +- .../mesh/points/schemas/vertex_color_map.py | 2 +- .../polygons/schemas/polygon_color_map.json | 11 +- .../polygons/schemas/polygon_color_map.py | 2 +- .../polygons/schemas/vertex_color_map.json | 11 +- .../mesh/polygons/schemas/vertex_color_map.py | 2 +- .../schemas/polyhedra_color_map.json | 11 +- .../polyhedra/schemas/polyhedra_color_map.py | 2 +- .../polyhedra/schemas/vertex_color_map.json | 11 +- .../polyhedra/schemas/vertex_color_map.py | 2 +- .../data/comparison/coord_lut_1_register.jpeg | Bin 2645 -> 0 bytes .../comparison/coord_lut_2_attribute.jpeg | Bin 3699 -> 0 bytes .../comparison/coord_lut_3_range_0_1.jpeg | Bin 3699 -> 0 bytes .../coord_lut_4_lut_0_1_saturated.jpeg | Bin 4058 -> 0 bytes .../coord_lut_5_coordinated_update.jpeg | Bin 8715 -> 0 bytes .../data/comparison/fixed_lut_1_register.jpeg | Bin 2645 -> 0 bytes .../comparison/fixed_lut_2_attribute.jpeg | Bin 3699 -> 0 bytes .../comparison/fixed_lut_3_range_0_1.jpeg | Bin 3699 -> 0 bytes .../fixed_lut_4_lut_0_1_saturated.jpeg | Bin 4058 -> 0 bytes .../fixed_lut_5_range_500_lut_fixed.jpeg | Bin 4058 -> 0 bytes tests/mesh/cells/test_mesh_cells_protocols.py | 322 +++++++++++------ tests/mesh/edges/test_mesh_edges_protocols.py | 163 ++++++--- .../mesh/points/test_mesh_points_protocols.py | 164 ++++++--- .../polygons/test_mesh_polygons_protocols.py | 324 +++++++++++------ .../test_mesh_polyhedra_protocols.py | 342 +++++++++++------- tests/mesh/test_mesh_scalar_range.py | 88 ----- tests/mesh/test_mesh_scalar_range_lut.py | 101 ------ 34 files changed, 902 insertions(+), 719 deletions(-) delete mode 100644 tests/data/comparison/coord_lut_1_register.jpeg delete mode 100644 tests/data/comparison/coord_lut_2_attribute.jpeg delete mode 100644 tests/data/comparison/coord_lut_3_range_0_1.jpeg delete mode 100644 tests/data/comparison/coord_lut_4_lut_0_1_saturated.jpeg delete mode 100644 tests/data/comparison/coord_lut_5_coordinated_update.jpeg delete mode 100644 tests/data/comparison/fixed_lut_1_register.jpeg delete mode 100644 tests/data/comparison/fixed_lut_2_attribute.jpeg delete mode 100644 tests/data/comparison/fixed_lut_3_range_0_1.jpeg delete mode 100644 tests/data/comparison/fixed_lut_4_lut_0_1_saturated.jpeg delete mode 100644 tests/data/comparison/fixed_lut_5_range_500_lut_fixed.jpeg delete mode 100644 tests/mesh/test_mesh_scalar_range.py delete mode 100644 tests/mesh/test_mesh_scalar_range_lut.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json index 9f543d6d..738d9de8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json @@ -8,16 +8,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py index 11f868a9..667bb07c 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py @@ -9,4 +9,4 @@ def __post_init__(self) -> None: print(self, flush=True) id: str - points: List[List[float]] + points: List[float] diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json index 9f543d6d..738d9de8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json @@ -8,16 +8,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py index 81fb473e..cf15be78 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py @@ -9,4 +9,4 @@ def __post_init__(self) -> None: print(self, flush=True) id: str - points: List[List[float]] + points: List[float] diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json index 9f543d6d..738d9de8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json @@ -8,16 +8,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py index 81fb473e..cf15be78 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py @@ -9,4 +9,4 @@ def __post_init__(self) -> None: print(self, flush=True) id: str - points: List[List[float]] + points: List[float] diff --git a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py index 844cd34f..a8b10316 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py @@ -154,10 +154,17 @@ def displayScalarRange(self, data_id: str, minimum: float, maximum: float) -> No data = self.get_object(data_id) data.mapper.SetScalarRange(minimum, maximum) - def setupColorMap(self, data_id: str, points: list[list[float]]) -> None: + def setupColorMap(self, data_id: str, points: list[float]) -> None: data = self.get_object(data_id) lut = vtkColorTransferFunction() - for ratio, red, green, blue in points: - lut.AddRGBPoint(ratio, red, green, blue) + minimum = points[0] + maximum = points[-4] + for i in range(0, len(points), 4): + x = points[i] + r = points[i + 1] + g = points[i + 2] + b = points[i + 3] + lut.AddRGBPoint(x, r, g, b) data.mapper.SetLookupTable(lut) + data.mapper.SetScalarRange(minimum, maximum) data.mapper.InterpolateScalarsBeforeMappingOn() diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json index 9f543d6d..738d9de8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json @@ -8,16 +8,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py index 81fb473e..cf15be78 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py @@ -9,4 +9,4 @@ def __post_init__(self) -> None: print(self, flush=True) id: str - points: List[List[float]] + points: List[float] diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json index 9f543d6d..738d9de8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json @@ -8,16 +8,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py index 73b82115..27095abf 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py @@ -9,4 +9,4 @@ def __post_init__(self) -> None: print(self, flush=True) id: str - points: List[List[float]] + points: List[float] diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json index 9f543d6d..738d9de8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json @@ -8,16 +8,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py index 81fb473e..cf15be78 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py @@ -9,4 +9,4 @@ def __post_init__(self) -> None: print(self, flush=True) id: str - points: List[List[float]] + points: List[float] diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json index 9f543d6d..738d9de8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json @@ -8,16 +8,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py index f2e054f9..603b942e 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py @@ -9,4 +9,4 @@ def __post_init__(self) -> None: print(self, flush=True) id: str - points: List[List[float]] + points: List[float] diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json index 9f543d6d..738d9de8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json @@ -8,16 +8,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py index 81fb473e..cf15be78 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py @@ -9,4 +9,4 @@ def __post_init__(self) -> None: print(self, flush=True) id: str - points: List[List[float]] + points: List[float] diff --git a/tests/data/comparison/coord_lut_1_register.jpeg b/tests/data/comparison/coord_lut_1_register.jpeg deleted file mode 100644 index 14b2bacd0e44a9739550819224789f4108ce3c2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2645 zcmex=qb(k5I7?=bZ znFSgDA7PMyIF11caB*<517$=&en18PZ!z#NGcqs^H~#~wEKumpuY?1<{|uPx zdl>FNW-$MO$tix=0M^C4`O01slRXd<7$1K)UOeF#gi}^EeOcRdh$;q~I*E5h5(mIC zeCLC{T(|_al)eA3>^Wx%umt1HS8=nX;=pVMhL1mzcb-UwaI9^;FFSi5fNJG3nMGjzt>0lYa7MCUp>5Lb$etu-==l4sWDckc9c#nc&+vD zS}125Hguq9!pHg(VY`pjRv^KhTmY@xHyKi&?$hxTf`p>Pl!u8H8*}SebD!=wj1S0>ZZa zUaWQNC;n$p1Z6)#^z7FF4rO2**fW~^XTYO`386$w09XidGcW_A2AZAOfYHdpYUWV3 zZ0j{fAz=|gQ86WDcnq@HGyP}SRo&Wl$iAYku=vmSW%BcR+W*Y8J2Us+eviekyG8#q z+}vzxE4d|d`L}OhzJAy~U&zcy{(?&HWcDwd$|(o`GI`uIsCSq|T|s+S`9uHs46d6` z|9~ijQnC|m?)Dl>5DRfD? z{%1%ptdsfl;MM&PN`?HZ@4w6Am)D=8d-CU|`Hzk+`uA3H)%jn)e*dlvKR)xhq`~t` zmB)N6zsxI~%vY;EC*|;bPwEPCEzDz^U;bjklfr{1+dp197N5TTMDpd`yY&}m2%G8r z>z$>se0NxvaroD7v8ACOpP&Ed3d~P3z|6wTid+gZ3OY0@8YUDhfE94|isz;$PLVNO z&NkzE?f3gg$dso;-NAg#hkY-Lm!6w$6+;45`dwN^5Yt3aUJiDkiLc~g)h;j_GcX7s zyARCfKoQ}B@)m$;rUnRC141o;P*62cL8zKRrm+FVsSpkpk{M4q2r4QC2p5%5B~ri& zjtLaPaKI?27>FGA0_Rq^adcXytmtlcT(jx44gwuh@ReQ5$awa)dCuLNqE diff --git a/tests/data/comparison/coord_lut_2_attribute.jpeg b/tests/data/comparison/coord_lut_2_attribute.jpeg deleted file mode 100644 index 4010661a0fbe0c19c4477713233e3b9ba30c004f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3699 zcmex=qb(k5I7?=bZ znFSgDA7PM$I*tJW*w|TFxIj`+D-kjbY#f}-tp9H@@GvtnFbOaV06qEhKaxC@DR-|m zzMb=Kt-qb{E(^aG53Lusyz4_|Zaq5p8-MF7u=1$;2jahGnV5>a0CU+Vi`^>BE4j`l zxeUzL&3~Z(Ypax0R|%NQe6l;&V!Ks#GtXr(Uu^pa@xM{MyslPYF5{D<+vY^iH9gpt z*#HvYj{d>@Z>?L~qPbvchEGYi{dCXGdT`j}07!s!?H|_v3}K6%1N|C6e1=NH+~s1= zeG3w2C4jh0*Zwj6XILG$aK&;55TC(j##wf3a3y#Fh|3`7 z6P9Oj*8L6pUtP(_(!2oX@~i1?d35LHIv!&mFn@@9eP%?-KL1@0P4W-E z+u^+HA>Zp3>vaN1%$G^G%95M4n56^3zQsv^(xE&sEwKZ04KqR&GYhMzk%KW4V?qHi z$#DQB8CjWrU(`Gopd8k5b&+XCZxmt1mwTJf9}~-dY~MDhh@&jazp8Y2DhYYCOj0Ds zXk5qfSM(=8FqpIj85o#ZxPie03n(UL76wK(13?jElaS()DVw%j5;Amj2nYlR88aiJ zJ>x&iF5yYvSstI%@Gn1k(BJ~&dtUwWljj8HeBU+Q_R8O&=es|yKC!X0oV7aZlTK3X z!MIy{x+SI;gl}7~bWHV*=v!hWlg_EUit}75_2BQG%}iFB{~7A^YlV`cAJqz2Yb|vS z^V-b)NYhaFqg{vW)S!i{RU=zJip-eyW4;UDsg(g&C#^a3qszy;#(xoeYRHPLlVOQ9 zu4=0L)Gsn`S`}iNvf5yu(qy6g!Y>+chH6P|3Y`%z=-HXy`NiSQs;Rt@T4(e-mK@oB zX0sk$2GJE|cXQ2@8*jDFi#X ze*ILu^51%30?+{^09H0&RsmHpAi%=P#>m9XVZgvH9zN}=kg0iT*`_Um!VUr86u<;Z z0sk2+t#}I-vK_6x=KlQ4DPe-cW5*ni`ZbS>`#aBHD>R(H z?NIgQ)1m)*19PuYn`Ps@GFXuLP>{NR@I}`he;hWP=W?HNM3_%H;*I;^9X2-Xi!FJd z&n^AFaN{$p>obneI<|F6D*NJvdpbVfvDLi){Ds_w(r-x+za0ao$n~{-Qa)esWqJMl1=Wt%Z*lc3 z_)=m%QLegusr8?~%(wXVT?nDOtENtUBx_r$c)I^urjs$7yv(r-;Z{M%jAKq+fB2t^ zE^O;*mYndY&b;v-pZI?U=|k84MT_ZeHku%H(t5{jDzk1CT;*J9c}qlBD^U${f@1C#P@)*pSlKA*D|T(|X^)wNy6HunB!m<~+8ngR@rOl-^y zOpGkh5{#MAfq}`mXz``ujhloF6$O=)or2&cKASzT{;dk(nQz~J|J}6s-BXqN9P>qr zxGNSOVu7`!>I;3wLxr zjFh`+9oF_py)~seSkmZ`iyXB020m#n)M>hf>?Cw*Yd%L;&M za9FH^N-jo0Lq!M2z=VPYu=?Fz@$+&WhPi@{=Qkd`RerzrI|3D!T=&p&)ZtkhlAQTgdAVUL~3l(HgfJj0F83u_)1&F7N4nQ1-i)04IpQIqD%7HaIKq?sp z4IBa*;0+Cd$FpU3eYoiPBs8m8{{H^DzrVk~KenkM>`=3nqhlA(huLgBQU)0Z7h_OT zbH6@qntqGpf}TA@*ZsL&xhY(6tgITERr?`UGcY0BjBGWih7&mMCA|5;$;D;|8ck-K z<=otyc6K($foZZW!gE_bO#a>f&VI+g#~73A}~Ff2gO7|da^*a%779q z6SBRGf{KO?DCt$;^V)gxExxi$CO!?*+cXw+A)#;gj!NmOEpk{^S#V7N diff --git a/tests/data/comparison/coord_lut_3_range_0_1.jpeg b/tests/data/comparison/coord_lut_3_range_0_1.jpeg deleted file mode 100644 index 4010661a0fbe0c19c4477713233e3b9ba30c004f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3699 zcmex=qb(k5I7?=bZ znFSgDA7PM$I*tJW*w|TFxIj`+D-kjbY#f}-tp9H@@GvtnFbOaV06qEhKaxC@DR-|m zzMb=Kt-qb{E(^aG53Lusyz4_|Zaq5p8-MF7u=1$;2jahGnV5>a0CU+Vi`^>BE4j`l zxeUzL&3~Z(Ypax0R|%NQe6l;&V!Ks#GtXr(Uu^pa@xM{MyslPYF5{D<+vY^iH9gpt z*#HvYj{d>@Z>?L~qPbvchEGYi{dCXGdT`j}07!s!?H|_v3}K6%1N|C6e1=NH+~s1= zeG3w2C4jh0*Zwj6XILG$aK&;55TC(j##wf3a3y#Fh|3`7 z6P9Oj*8L6pUtP(_(!2oX@~i1?d35LHIv!&mFn@@9eP%?-KL1@0P4W-E z+u^+HA>Zp3>vaN1%$G^G%95M4n56^3zQsv^(xE&sEwKZ04KqR&GYhMzk%KW4V?qHi z$#DQB8CjWrU(`Gopd8k5b&+XCZxmt1mwTJf9}~-dY~MDhh@&jazp8Y2DhYYCOj0Ds zXk5qfSM(=8FqpIj85o#ZxPie03n(UL76wK(13?jElaS()DVw%j5;Amj2nYlR88aiJ zJ>x&iF5yYvSstI%@Gn1k(BJ~&dtUwWljj8HeBU+Q_R8O&=es|yKC!X0oV7aZlTK3X z!MIy{x+SI;gl}7~bWHV*=v!hWlg_EUit}75_2BQG%}iFB{~7A^YlV`cAJqz2Yb|vS z^V-b)NYhaFqg{vW)S!i{RU=zJip-eyW4;UDsg(g&C#^a3qszy;#(xoeYRHPLlVOQ9 zu4=0L)Gsn`S`}iNvf5yu(qy6g!Y>+chH6P|3Y`%z=-HXy`NiSQs;Rt@T4(e-mK@oB zX0sk$2GJE|cXQ2@8*jDFi#X ze*ILu^51%30?+{^09H0&RsmHpAi%=P#>m9XVZgvH9zN}=kg0iT*`_Um!VUr86u<;Z z0sk2+t#}I-vK_6x=KlQ4DPe-cW5*ni`ZbS>`#aBHD>R(H z?NIgQ)1m)*19PuYn`Ps@GFXuLP>{NR@I}`he;hWP=W?HNM3_%H;*I;^9X2-Xi!FJd z&n^AFaN{$p>obneI<|F6D*NJvdpbVfvDLi){Ds_w(r-x+za0ao$n~{-Qa)esWqJMl1=Wt%Z*lc3 z_)=m%QLegusr8?~%(wXVT?nDOtENtUBx_r$c)I^urjs$7yv(r-;Z{M%jAKq+fB2t^ zE^O;*mYndY&b;v-pZI?U=|k84MT_ZeHku%H(t5{jDzk1CT;*J9c}qlBD^U${f@1C#P@)*pSlKA*D|T(|X^)wNy6HunB!m<~+8ngR@rOl-^y zOpGkh5{#MAfq}`mXz``ujhloF6$O=)or2&cKASzT{;dk(nQz~J|J}6s-BXqN9P>qr zxGNSOVu7`!>I;3wLxr zjFh`+9oF_py)~seSkmZ`iyXB020m#n)M>hf>?Cw*Yd%L;&M za9FH^N-jo0Lq!M2z=VPYu=?Fz@$+&WhPi@{=Qkd`RerzrI|3D!T=&p&)ZtkhlAQTgdAVUL~3l(HgfJj0F83u_)1&F7N4nQ1-i)04IpQIqD%7HaIKq?sp z4IBa*;0+Cd$FpU3eYoiPBs8m8{{H^DzrVk~KenkM>`=3nqhlA(huLgBQU)0Z7h_OT zbH6@qntqGpf}TA@*ZsL&xhY(6tgITERr?`UGcY0BjBGWih7&mMCA|5;$;D;|8ck-K z<=otyc6K($foZZW!gE_bO#a>f&VI+g#~73A}~Ff2gO7|da^*a%779q z6SBRGf{KO?DCt$;^V)gxExxi$CO!?*+cXw+A)#;gj!NmOEpk{^S#V7N diff --git a/tests/data/comparison/coord_lut_4_lut_0_1_saturated.jpeg b/tests/data/comparison/coord_lut_4_lut_0_1_saturated.jpeg deleted file mode 100644 index 7776304242b7b42cd5b0cb38957571aa4ef8ce4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4058 zcmex=qb(k5I7?=bZ znFSgDA7PLJI+7VE%YXpv9Gt9dTp&51Fs2+E3+w+|3_Q$?3`_#d0zhy6{EyHJW69o+ zfB5RL$&Al`JZf~nUP&2M z!N4%I!$W=Jgl{uEJI)@tanew-6C3J}pF7=Z#;Fhkm8cw8D#A{)1Cyql00Sc{I7`6P zI54oXiJ7u9vm_J%lP3o-=`yl1{k>eBf9vII|B0(=dV`;2%~uZjDYg8>RXewppG@%y zW?xhL&+zyezx_4d^CoijYozC8*!*XRFt@o-`ENsB<$}+D6YhL=eE#d;&S%Z%zcv@2 zWuO0=?fI+$R^Ps}#y8KL!1{8%4IA0m3P6 z3_YR872k9G(3{typ7c>ES496YD`#7$umoF&bks4s$MSzI|E9m}*(Q8%-mLZCvby`I z&Dv6^x73FtMpdcIYM#jL{*DlfCn|qboE6)ySt&ogV;95TR$xA_^!h#Ce#2{fj@eu@ zU9(uDRz~xQ;r$Gg<@NRs-#V_}^6FXmrC|AlpWW_0YcdkmF@>{%`_s?IjU1a)g(vUW4%N}R-cMH~7*=_c6c*J)+S=q)- zZ&8c0pMjz)=R&Sa%l(+FnFV{YV`|sc#s4$^bnUj7-sYeQ(kHD?P@8qD;40@*n_MBS zTvw)mmLPF)o(mH!Hgar8Z4tQX-du3_2@l^3{f^h`Z5}T&y|(9g)b)sKhWkJLX8@*N z9boEZVPY55tmX4~YZZ1}urpi9icq{}y1fRC;wDN z@8tROU;l18yYza(uc+8E{-xApM7mC4el#n97|gYP59;@83{E0s?LYmS6Xhd*1E#_ z4h$go0lN=qfRo4IFbF|}xf&q!5-`QI0K(IRP%9u5mjjsAg7BCofayV|u?ONQs{;^6 z;v$)Wu_q}Aj69^c1I3!*z~1vmC) zOjUF!_eM1a?kg@DTW#s)dHiHcv}Mb& zX2zBlB36|?MxyJxc@DT`$9avu`DDWB{Ie+pa2S+1aUc^YL*?fpLvz&A0!>^_ z+YS$K;*J`*dO}>RK-LW9T#z;WdvIOdUz1sret7-9yATdSuA`vVe(6*=n1U8ZXgUIi z!8scGkqS**QvPmm;y{9dogkO~d62bgA;kKUm$N(RL`+09m(Z0zu0cTSMf8s>BBBFM zFX?is>xo{yV{Yw31d^xL}3xg z&70uXE}-&pfCFG`a29ZN)@NhHsBgr?^5mSA_hK;n_!RYBlP^DEaj!8GOQp8?T(Oy> zM-08BKJNChBF|Yc29=6UI~DSoT{N(#ga@=6m;SEQ9Eh*kUet7uJCe7O1zqfxsBC|la_8_j$$DXTqDW7>^|Rf#zDexHkkwpz+C_76kNFI$6b+)`h}Tw|xfL%!J(^nk(nrmOT_BiOFxI zQ!aLDKUL16m?sXK+45O&B_tc48#T?s@ELQv?(~-AbJ)luCnGjkjg!6RbjIePyb&FAbu5+)E^t%3mxO zKlO^e@U7ZiVZLD@&kBCCwM$C>Qt~zZOX{Nhr=4O|Uw-0`vX1Ps~+My!WePt^aoqSXCD>?ES|RFZavU}j_l`>jfC7FmEJes&Q#@itP;k}^ziwWSJf}!%-hQ-D`I^Pu@wc2KRc9NUOm!tk-o)>;nj8q) zzAN%`)|)bnbcGq9^EHUO_oRN^bm1ku!lukYn*7c|?f~5zRmW^2khA{MLE8NXX^I=RK1AP?U;z=JN?}2jLLgD7 z4bY05YwD>;P%Oo-_JGW6xeody}t1=a{E6$kQCN3?0s_~rXb=pXMb8C+l(73r6n(>AkCz@A5WBh{S0fCes=8X-urLE7p>fZs+!MZiPHRU z`=_kjHS12?94pYc|F$&6yN0`YY+A#@%EjT8wtG)Zb-&a5q9K%tuH;36$`i@9GYh#q z^)F83Y^}TGoI&D?l-e&t?@)dk-n0~V<78DuN79qfL4hgKH?ryHNL-rH#w?XnQN>JY zx(`fWHFND}*TLU?gpSv)j7RRXozCkX>$&=yREcv2S!}~WY27q(O=|qJY@)ei<9?&e z1j(Yi!KZlK538qj4Qw8iI7xmS8Ai~mZQZNbAdquEK7MM{csSg5G&hB#)nrlN!q}k$ zt?x*w4lKYE8!XaO@28X3!ap@?l$z(u)o+td`y$n9mgoK4e+th63LhBrdn$A7mS+Fj zZg?E$KiAx9(ky)-pPFnl*1o)XGv|} zi^ZT~$$%RZ2sU;E68`fu9)Z*ZU~o1?H&T2;c3BgeuUSA$0jo`r|MgLi!oioPX0>kR zf4gG5P`>fi_}qRv^9-V@7bT?;eButf1hL<*rn$Z3a;}oRk5OW!Y)y0CV1DF%kyi?Y zA+Aa6HtP&^f<2d8?&h<}>IOr)bKLmHlAp0C$B4Vlf^n8dy?vZQ!+I^EBtB=};K1j| zJ-w|ZK7Ekdh2$-gqJH4t=sB-i?|WGF`;sc}!_%?4a(Ph===Fd9J_iD>+*>X@!5sEH zw58aMI-5T>*%w^Vdw{q5BH<=Z_>|4Yw=F6X<5+#pke#U|@^4#AP!zKapnijq9o;3@ z-n@|@P*3Y&kUhJvfsM;iW!6hSDY2dN;dIU;&wP1~C%~&ycKZ3Q* zuXQ6%Yn*iQi>+ADR`~8k0)fk?mE)&N1isG2}tBd1(G$^A^!Hcm~)<80GXGC!1oY^l0T_Y}{Hp!6{)Pc) zd0sJBKbqVV*ItXjR>2M z9vOstj)E{nTZcJm5-0i^&oCn3`G!HY6j>b{x_Y?9N@OV~G@=n_ufRY~exe-MFPpyf;XAcawa9O} z?H$Ug{)hIX?Yg4KYnlga?an%UkgMCdKi|wSE!R?c8rn}x(}rLj z%l!Rn=3OS&C2N?^-J9(Wm7(-)BFL#y7=!J{^erj#?k?T)O8orPCkH;>e9Nd`m>}}U zWXYM&yAwB1Lwvl$O9mOC#kR28WIOqMkAac)W6tI*AVaLNT(CmV+KsX3!RcT3RocJ4 z9^+hxpz4&Jxjb3flpQeGLhBlk5XF??i689S4cZCUwMU(#3f^CBJQik*x53-!aBiSw z#*GL$XK%|PWX2=?+o3Vvn-}Ssv1?uOqv^QE+g}8f1(XHxZLzgE)T;Q=e!pY*-!k_j+~zlf?wroqmO0AB>49VGcYoL{oSuHb2H^ zRrD!#%<);bZm->;Oqb~K+Q9+nXMp;BQR)e0R{xRUivxzOvlLL_XU1niC%ehQn8DD6j0R VcVTAWO51MWr9c(OFXLGq{{qJjZN>lq diff --git a/tests/data/comparison/fixed_lut_1_register.jpeg b/tests/data/comparison/fixed_lut_1_register.jpeg deleted file mode 100644 index 14b2bacd0e44a9739550819224789f4108ce3c2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2645 zcmex=qb(k5I7?=bZ znFSgDA7PMyIF11caB*<517$=&en18PZ!z#NGcqs^H~#~wEKumpuY?1<{|uPx zdl>FNW-$MO$tix=0M^C4`O01slRXd<7$1K)UOeF#gi}^EeOcRdh$;q~I*E5h5(mIC zeCLC{T(|_al)eA3>^Wx%umt1HS8=nX;=pVMhL1mzcb-UwaI9^;FFSi5fNJG3nMGjzt>0lYa7MCUp>5Lb$etu-==l4sWDckc9c#nc&+vD zS}125Hguq9!pHg(VY`pjRv^KhTmY@xHyKi&?$hxTf`p>Pl!u8H8*}SebD!=wj1S0>ZZa zUaWQNC;n$p1Z6)#^z7FF4rO2**fW~^XTYO`386$w09XidGcW_A2AZAOfYHdpYUWV3 zZ0j{fAz=|gQ86WDcnq@HGyP}SRo&Wl$iAYku=vmSW%BcR+W*Y8J2Us+eviekyG8#q z+}vzxE4d|d`L}OhzJAy~U&zcy{(?&HWcDwd$|(o`GI`uIsCSq|T|s+S`9uHs46d6` z|9~ijQnC|m?)Dl>5DRfD? z{%1%ptdsfl;MM&PN`?HZ@4w6Am)D=8d-CU|`Hzk+`uA3H)%jn)e*dlvKR)xhq`~t` zmB)N6zsxI~%vY;EC*|;bPwEPCEzDz^U;bjklfr{1+dp197N5TTMDpd`yY&}m2%G8r z>z$>se0NxvaroD7v8ACOpP&Ed3d~P3z|6wTid+gZ3OY0@8YUDhfE94|isz;$PLVNO z&NkzE?f3gg$dso;-NAg#hkY-Lm!6w$6+;45`dwN^5Yt3aUJiDkiLc~g)h;j_GcX7s zyARCfKoQ}B@)m$;rUnRC141o;P*62cL8zKRrm+FVsSpkpk{M4q2r4QC2p5%5B~ri& zjtLaPaKI?27>FGA0_Rq^adcXytmtlcT(jx44gwuh@ReQ5$awa)dCuLNqE diff --git a/tests/data/comparison/fixed_lut_2_attribute.jpeg b/tests/data/comparison/fixed_lut_2_attribute.jpeg deleted file mode 100644 index 4010661a0fbe0c19c4477713233e3b9ba30c004f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3699 zcmex=qb(k5I7?=bZ znFSgDA7PM$I*tJW*w|TFxIj`+D-kjbY#f}-tp9H@@GvtnFbOaV06qEhKaxC@DR-|m zzMb=Kt-qb{E(^aG53Lusyz4_|Zaq5p8-MF7u=1$;2jahGnV5>a0CU+Vi`^>BE4j`l zxeUzL&3~Z(Ypax0R|%NQe6l;&V!Ks#GtXr(Uu^pa@xM{MyslPYF5{D<+vY^iH9gpt z*#HvYj{d>@Z>?L~qPbvchEGYi{dCXGdT`j}07!s!?H|_v3}K6%1N|C6e1=NH+~s1= zeG3w2C4jh0*Zwj6XILG$aK&;55TC(j##wf3a3y#Fh|3`7 z6P9Oj*8L6pUtP(_(!2oX@~i1?d35LHIv!&mFn@@9eP%?-KL1@0P4W-E z+u^+HA>Zp3>vaN1%$G^G%95M4n56^3zQsv^(xE&sEwKZ04KqR&GYhMzk%KW4V?qHi z$#DQB8CjWrU(`Gopd8k5b&+XCZxmt1mwTJf9}~-dY~MDhh@&jazp8Y2DhYYCOj0Ds zXk5qfSM(=8FqpIj85o#ZxPie03n(UL76wK(13?jElaS()DVw%j5;Amj2nYlR88aiJ zJ>x&iF5yYvSstI%@Gn1k(BJ~&dtUwWljj8HeBU+Q_R8O&=es|yKC!X0oV7aZlTK3X z!MIy{x+SI;gl}7~bWHV*=v!hWlg_EUit}75_2BQG%}iFB{~7A^YlV`cAJqz2Yb|vS z^V-b)NYhaFqg{vW)S!i{RU=zJip-eyW4;UDsg(g&C#^a3qszy;#(xoeYRHPLlVOQ9 zu4=0L)Gsn`S`}iNvf5yu(qy6g!Y>+chH6P|3Y`%z=-HXy`NiSQs;Rt@T4(e-mK@oB zX0sk$2GJE|cXQ2@8*jDFi#X ze*ILu^51%30?+{^09H0&RsmHpAi%=P#>m9XVZgvH9zN}=kg0iT*`_Um!VUr86u<;Z z0sk2+t#}I-vK_6x=KlQ4DPe-cW5*ni`ZbS>`#aBHD>R(H z?NIgQ)1m)*19PuYn`Ps@GFXuLP>{NR@I}`he;hWP=W?HNM3_%H;*I;^9X2-Xi!FJd z&n^AFaN{$p>obneI<|F6D*NJvdpbVfvDLi){Ds_w(r-x+za0ao$n~{-Qa)esWqJMl1=Wt%Z*lc3 z_)=m%QLegusr8?~%(wXVT?nDOtENtUBx_r$c)I^urjs$7yv(r-;Z{M%jAKq+fB2t^ zE^O;*mYndY&b;v-pZI?U=|k84MT_ZeHku%H(t5{jDzk1CT;*J9c}qlBD^U${f@1C#P@)*pSlKA*D|T(|X^)wNy6HunB!m<~+8ngR@rOl-^y zOpGkh5{#MAfq}`mXz``ujhloF6$O=)or2&cKASzT{;dk(nQz~J|J}6s-BXqN9P>qr zxGNSOVu7`!>I;3wLxr zjFh`+9oF_py)~seSkmZ`iyXB020m#n)M>hf>?Cw*Yd%L;&M za9FH^N-jo0Lq!M2z=VPYu=?Fz@$+&WhPi@{=Qkd`RerzrI|3D!T=&p&)ZtkhlAQTgdAVUL~3l(HgfJj0F83u_)1&F7N4nQ1-i)04IpQIqD%7HaIKq?sp z4IBa*;0+Cd$FpU3eYoiPBs8m8{{H^DzrVk~KenkM>`=3nqhlA(huLgBQU)0Z7h_OT zbH6@qntqGpf}TA@*ZsL&xhY(6tgITERr?`UGcY0BjBGWih7&mMCA|5;$;D;|8ck-K z<=otyc6K($foZZW!gE_bO#a>f&VI+g#~73A}~Ff2gO7|da^*a%779q z6SBRGf{KO?DCt$;^V)gxExxi$CO!?*+cXw+A)#;gj!NmOEpk{^S#V7N diff --git a/tests/data/comparison/fixed_lut_3_range_0_1.jpeg b/tests/data/comparison/fixed_lut_3_range_0_1.jpeg deleted file mode 100644 index 4010661a0fbe0c19c4477713233e3b9ba30c004f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3699 zcmex=qb(k5I7?=bZ znFSgDA7PM$I*tJW*w|TFxIj`+D-kjbY#f}-tp9H@@GvtnFbOaV06qEhKaxC@DR-|m zzMb=Kt-qb{E(^aG53Lusyz4_|Zaq5p8-MF7u=1$;2jahGnV5>a0CU+Vi`^>BE4j`l zxeUzL&3~Z(Ypax0R|%NQe6l;&V!Ks#GtXr(Uu^pa@xM{MyslPYF5{D<+vY^iH9gpt z*#HvYj{d>@Z>?L~qPbvchEGYi{dCXGdT`j}07!s!?H|_v3}K6%1N|C6e1=NH+~s1= zeG3w2C4jh0*Zwj6XILG$aK&;55TC(j##wf3a3y#Fh|3`7 z6P9Oj*8L6pUtP(_(!2oX@~i1?d35LHIv!&mFn@@9eP%?-KL1@0P4W-E z+u^+HA>Zp3>vaN1%$G^G%95M4n56^3zQsv^(xE&sEwKZ04KqR&GYhMzk%KW4V?qHi z$#DQB8CjWrU(`Gopd8k5b&+XCZxmt1mwTJf9}~-dY~MDhh@&jazp8Y2DhYYCOj0Ds zXk5qfSM(=8FqpIj85o#ZxPie03n(UL76wK(13?jElaS()DVw%j5;Amj2nYlR88aiJ zJ>x&iF5yYvSstI%@Gn1k(BJ~&dtUwWljj8HeBU+Q_R8O&=es|yKC!X0oV7aZlTK3X z!MIy{x+SI;gl}7~bWHV*=v!hWlg_EUit}75_2BQG%}iFB{~7A^YlV`cAJqz2Yb|vS z^V-b)NYhaFqg{vW)S!i{RU=zJip-eyW4;UDsg(g&C#^a3qszy;#(xoeYRHPLlVOQ9 zu4=0L)Gsn`S`}iNvf5yu(qy6g!Y>+chH6P|3Y`%z=-HXy`NiSQs;Rt@T4(e-mK@oB zX0sk$2GJE|cXQ2@8*jDFi#X ze*ILu^51%30?+{^09H0&RsmHpAi%=P#>m9XVZgvH9zN}=kg0iT*`_Um!VUr86u<;Z z0sk2+t#}I-vK_6x=KlQ4DPe-cW5*ni`ZbS>`#aBHD>R(H z?NIgQ)1m)*19PuYn`Ps@GFXuLP>{NR@I}`he;hWP=W?HNM3_%H;*I;^9X2-Xi!FJd z&n^AFaN{$p>obneI<|F6D*NJvdpbVfvDLi){Ds_w(r-x+za0ao$n~{-Qa)esWqJMl1=Wt%Z*lc3 z_)=m%QLegusr8?~%(wXVT?nDOtENtUBx_r$c)I^urjs$7yv(r-;Z{M%jAKq+fB2t^ zE^O;*mYndY&b;v-pZI?U=|k84MT_ZeHku%H(t5{jDzk1CT;*J9c}qlBD^U${f@1C#P@)*pSlKA*D|T(|X^)wNy6HunB!m<~+8ngR@rOl-^y zOpGkh5{#MAfq}`mXz``ujhloF6$O=)or2&cKASzT{;dk(nQz~J|J}6s-BXqN9P>qr zxGNSOVu7`!>I;3wLxr zjFh`+9oF_py)~seSkmZ`iyXB020m#n)M>hf>?Cw*Yd%L;&M za9FH^N-jo0Lq!M2z=VPYu=?Fz@$+&WhPi@{=Qkd`RerzrI|3D!T=&p&)ZtkhlAQTgdAVUL~3l(HgfJj0F83u_)1&F7N4nQ1-i)04IpQIqD%7HaIKq?sp z4IBa*;0+Cd$FpU3eYoiPBs8m8{{H^DzrVk~KenkM>`=3nqhlA(huLgBQU)0Z7h_OT zbH6@qntqGpf}TA@*ZsL&xhY(6tgITERr?`UGcY0BjBGWih7&mMCA|5;$;D;|8ck-K z<=otyc6K($foZZW!gE_bO#a>f&VI+g#~73A}~Ff2gO7|da^*a%779q z6SBRGf{KO?DCt$;^V)gxExxi$CO!?*+cXw+A)#;gj!NmOEpk{^S#V7N diff --git a/tests/data/comparison/fixed_lut_4_lut_0_1_saturated.jpeg b/tests/data/comparison/fixed_lut_4_lut_0_1_saturated.jpeg deleted file mode 100644 index 7776304242b7b42cd5b0cb38957571aa4ef8ce4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4058 zcmex=qb(k5I7?=bZ znFSgDA7PLJI+7VE%YXpv9Gt9dTp&51Fs2+E3+w+|3_Q$?3`_#d0zhy6{EyHJW69o+ zfB5RL$&Al`JZf~nUP&2M z!N4%I!$W=Jgl{uEJI)@tanew-6C3J}pF7=Z#;Fhkm8cw8D#A{)1Cyql00Sc{I7`6P zI54oXiJ7u9vm_J%lP3o-=`yl1{k>eBf9vII|B0(=dV`;2%~uZjDYg8>RXewppG@%y zW?xhL&+zyezx_4d^CoijYozC8*!*XRFt@o-`ENsB<$}+D6YhL=eE#d;&S%Z%zcv@2 zWuO0=?fI+$R^Ps}#y8KL!1{8%4IA0m3P6 z3_YR872k9G(3{typ7c>ES496YD`#7$umoF&bks4s$MSzI|E9m}*(Q8%-mLZCvby`I z&Dv6^x73FtMpdcIYM#jL{*DlfCn|qboE6)ySt&ogV;95TR$xA_^!h#Ce#2{fj@eu@ zU9(uDRz~xQ;r$Gg<@NRs-#V_}^6FXmrC|AlpWW_0YcdkmF@>{%`_s?IjU1a)g(vUW4%N}R-cMH~7*=_c6c*J)+S=q)- zZ&8c0pMjz)=R&Sa%l(+FnFV{YV`|sc#s4$^bnUj7-sYeQ(kHD?P@8qD;40@*n_MBS zTvw)mmLPF)o(mH!Hgar8Z4tQX-du3_2@l^3{f^h`Z5}T&y|(9g)b)sKhWkJLX8@*N z9boEZVPY55tmX4~YZZ1}urpi9icq{}y1fRC;wDN z@8tROU;l18yYza(uc+8E{-xApM7mC4el#n97|gYP59;@83{E0s?LYmS6Xhd*1E#_ z4h$go0lN=qfRo4IFbF|}xf&q!5-`QI0K(IRP%9u5mjjsAg7BCofayV|u?ONQs{;^6 z;v$)Wu_q}Aj69^c1I3qb(k5I7?=bZ znFSgDA7PLJI+7VE%YXpv9Gt9dTp&51Fs2+E3+w+|3_Q$?3`_#d0zhy6{EyHJW69o+ zfB5RL$&Al`JZf~nUP&2M z!N4%I!$W=Jgl{uEJI)@tanew-6C3J}pF7=Z#;Fhkm8cw8D#A{)1Cyql00Sc{I7`6P zI54oXiJ7u9vm_J%lP3o-=`yl1{k>eBf9vII|B0(=dV`;2%~uZjDYg8>RXewppG@%y zW?xhL&+zyezx_4d^CoijYozC8*!*XRFt@o-`ENsB<$}+D6YhL=eE#d;&S%Z%zcv@2 zWuO0=?fI+$R^Ps}#y8KL!1{8%4IA0m3P6 z3_YR872k9G(3{typ7c>ES496YD`#7$umoF&bks4s$MSzI|E9m}*(Q8%-mLZCvby`I z&Dv6^x73FtMpdcIYM#jL{*DlfCn|qboE6)ySt&ogV;95TR$xA_^!h#Ce#2{fj@eu@ zU9(uDRz~xQ;r$Gg<@NRs-#V_}^6FXmrC|AlpWW_0YcdkmF@>{%`_s?IjU1a)g(vUW4%N}R-cMH~7*=_c6c*J)+S=q)- zZ&8c0pMjz)=R&Sa%l(+FnFV{YV`|sc#s4$^bnUj7-sYeQ(kHD?P@8qD;40@*n_MBS zTvw)mmLPF)o(mH!Hgar8Z4tQX-du3_2@l^3{f^h`Z5}T&y|(9g)b)sKhWkJLX8@*N z9boEZVPY55tmX4~YZZ1}urpi9icq{}y1fRC;wDN z@8tROU;l18yYza(uc+8E{-xApM7mC4el#n97|gYP59;@83{E0s?LYmS6Xhd*1E#_ z4h$go0lN=qfRo4IFbF|}xf&q!5-`QI0K(IRP%9u5mjjsAg7BCofayV|u?ONQs{;^6 z;v$)Wu_q}Aj69^c1I3 mostly BLUE) - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 50.0, "maximum": 58.0}], - ) - + # Update range via color map server.call( VtkMeshEdgesView.mesh_edges_prefix + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], @@ -185,8 +184,14 @@ def test_edges_vertex_color_map_range_update( { "id": mesh_id, "points": [ - [50.0, 0, 0, 1.0], - [58.0, 1.0, 0, 0], + 50.0, + 0, + 0, + 1.0, + 58.0, + 1.0, + 0, + 0, ], } ], @@ -213,7 +218,7 @@ def test_edges_vertex_color_map_red_shift( [{"id": mesh_id, "name": "vertex_attribute"}], ) - # Set Blue to Red Map on [0, 1] + # Set Blue to Red Map on [0, 58] server.call( VtkMeshEdgesView.mesh_edges_prefix + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], @@ -221,8 +226,14 @@ def test_edges_vertex_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 1.0], - [58.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 58.0, + 1.0, + 0, + 0, ], } ], @@ -230,13 +241,7 @@ def test_edges_vertex_color_map_red_shift( assert server.compare_image("mesh/edges/vertex_color_map.jpeg") == True - # Set scalar range: 0.0 to 1.0 (all data > 1.0 should become RED) - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0.0, "maximum": 1.0}], - ) - + # Update range via color map server.call( VtkMeshEdgesView.mesh_edges_prefix + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], @@ -244,8 +249,14 @@ def test_edges_vertex_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -280,14 +291,38 @@ def test_edges_vertex_color_map_rainbow( { "id": mesh_id, "points": [ - [0.0 * 58.0, 71 / 255, 71 / 255, 219 / 255], - [0.143 * 58.0, 0, 0, 92 / 255], - [0.285 * 58.0, 0, 255 / 255, 255 / 255], - [0.429 * 58.0, 0, 128 / 255, 0], - [0.571 * 58.0, 255 / 255, 255 / 255, 0], - [0.714 * 58.0, 255 / 255, 97 / 255, 0], - [0.857 * 58.0, 107 / 255, 0, 0], - [1.0 * 58.0, 224 / 255, 77 / 255, 77 / 255], + 0.0, + 71 / 255, + 71 / 255, + 219 / 255, + 0.143 * 58, + 0, + 0, + 92 / 255, + 0.285 * 58, + 0, + 255 / 255, + 255 / 255, + 0.429 * 58, + 0, + 128 / 255, + 0, + 0.571 * 58, + 255 / 255, + 255 / 255, + 0, + 0.714 * 58, + 255 / 255, + 97 / 255, + 0, + 0.857 * 58, + 107 / 255, + 0, + 0, + 58.0, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], @@ -297,13 +332,7 @@ def test_edges_vertex_color_map_rainbow( server.compare_image("mesh/edges/vertex_color_map_rainbow_initial.jpeg") == True ) - # Set scalar range - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 10.0, "maximum": 20.0}], - ) - + # Update rainbow range via color map server.call( VtkMeshEdgesView.mesh_edges_prefix + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], @@ -311,14 +340,38 @@ def test_edges_vertex_color_map_rainbow( { "id": mesh_id, "points": [ - [10 + 0.0 * 10, 71 / 255, 71 / 255, 219 / 255], - [10 + 0.143 * 10, 0, 0, 92 / 255], - [10 + 0.285 * 10, 0, 255 / 255, 255 / 255], - [10 + 0.429 * 10, 0, 128 / 255, 0], - [10 + 0.571 * 10, 255 / 255, 255 / 255, 0], - [10 + 0.714 * 10, 255 / 255, 97 / 255, 0], - [10 + 0.857 * 10, 107 / 255, 0, 0], - [10 + 1.0 * 10, 224 / 255, 77 / 255, 77 / 255], + 10.0, + 71 / 255, + 71 / 255, + 219 / 255, + 10.0 + 0.143 * 10, + 0, + 0, + 92 / 255, + 10.0 + 0.285 * 10, + 0, + 255 / 255, + 255 / 255, + 10.0 + 0.429 * 10, + 0, + 128 / 255, + 0, + 10.0 + 0.571 * 10, + 255 / 255, + 255 / 255, + 0, + 10.0 + 0.714 * 10, + 255 / 255, + 97 / 255, + 0, + 10.0 + 0.857 * 10, + 107 / 255, + 0, + 0, + 20.0, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], diff --git a/tests/mesh/points/test_mesh_points_protocols.py b/tests/mesh/points/test_mesh_points_protocols.py index 409ca0e5..51f19302 100644 --- a/tests/mesh/points/test_mesh_points_protocols.py +++ b/tests/mesh/points/test_mesh_points_protocols.py @@ -122,13 +122,6 @@ def test_points_vertex_color_map( [{"id": mesh_id, "name": "lambert2SG"}], ) - # Set scalar range - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0, "maximum": 1}], - ) - # Set color map: Blue to Red server.call( VtkMeshPointsView.mesh_points_prefix @@ -137,8 +130,14 @@ def test_points_vertex_color_map( { "id": mesh_id, "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -168,8 +167,14 @@ def test_points_vertex_color_map_range_update( { "id": mesh_id, "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -177,14 +182,7 @@ def test_points_vertex_color_map_range_update( assert server.compare_image("mesh/points/vertex_color_map.jpeg") == True - # Set scalar range: 0.8 to 1 (clamping data to the minimum color -> mostly BLUE) - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0.8, "maximum": 1.0}], - ) - - # Coordinated update for stretching + # Update range via color map server.call( VtkMeshPointsView.mesh_points_prefix + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], @@ -192,8 +190,14 @@ def test_points_vertex_color_map_range_update( { "id": mesh_id, "points": [ - [0.8, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.8, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -225,8 +229,14 @@ def test_points_vertex_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -234,14 +244,7 @@ def test_points_vertex_color_map_red_shift( assert server.compare_image("mesh/points/vertex_color_map.jpeg") == True - # Set scalar range: 0.0 to 0.1 (all data > 0.1 should become RED) - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0.0, "maximum": 0.1}], - ) - - # Coordinated update for red shift + # Update range via color map server.call( VtkMeshPointsView.mesh_points_prefix + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], @@ -249,8 +252,14 @@ def test_points_vertex_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 1.0], - [0.1, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 0.1, + 1.0, + 0, + 0, ], } ], @@ -280,14 +289,38 @@ def test_points_vertex_color_map_rainbow( { "id": mesh_id, "points": [ - [0.0, 71 / 255, 71 / 255, 219 / 255], - [0.143, 0, 0, 92 / 255], - [0.285, 0, 255 / 255, 255 / 255], - [0.429, 0, 128 / 255, 0], - [0.571, 255 / 255, 255 / 255, 0], - [0.714, 255 / 255, 97 / 255, 0], - [0.857, 107 / 255, 0, 0], - [1.0, 224 / 255, 77 / 255, 77 / 255], + 0.0, + 71 / 255, + 71 / 255, + 219 / 255, + 0.143, + 0, + 0, + 92 / 255, + 0.285, + 0, + 255 / 255, + 255 / 255, + 0.429, + 0, + 128 / 255, + 0, + 0.571, + 255 / 255, + 255 / 255, + 0, + 0.714, + 255 / 255, + 97 / 255, + 0, + 0.857, + 107 / 255, + 0, + 0, + 1.0, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], @@ -298,14 +331,7 @@ def test_points_vertex_color_map_rainbow( == True ) - # Set scalar range: 0.1 to 0.4 - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0.1, "maximum": 0.4}], - ) - - # Coordinated update for rainbow stretching + # Update rainbow range via color map server.call( VtkMeshPointsView.mesh_points_prefix + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], @@ -313,14 +339,38 @@ def test_points_vertex_color_map_rainbow( { "id": mesh_id, "points": [ - [0.1 + 0.0 * 0.3, 71 / 255, 71 / 255, 219 / 255], - [0.1 + 0.143 * 0.3, 0, 0, 92 / 255], - [0.1 + 0.285 * 0.3, 0, 255 / 255, 255 / 255], - [0.1 + 0.429 * 0.3, 0, 128 / 255, 0], - [0.1 + 0.571 * 0.3, 255 / 255, 255 / 255, 0], - [0.1 + 0.714 * 0.3, 255 / 255, 97 / 255, 0], - [0.1 + 0.857 * 0.3, 107 / 255, 0, 0], - [0.1 + 1.0 * 0.3, 224 / 255, 77 / 255, 77 / 255], + 0.1, + 71 / 255, + 71 / 255, + 219 / 255, + 0.1 + 0.143 * 0.3, + 0, + 0, + 92 / 255, + 0.1 + 0.285 * 0.3, + 0, + 255 / 255, + 255 / 255, + 0.1 + 0.429 * 0.3, + 0, + 128 / 255, + 0, + 0.1 + 0.571 * 0.3, + 255 / 255, + 255 / 255, + 0, + 0.1 + 0.714 * 0.3, + 255 / 255, + 97 / 255, + 0, + 0.1 + 0.857 * 0.3, + 107 / 255, + 0, + 0, + 0.4, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], diff --git a/tests/mesh/polygons/test_mesh_polygons_protocols.py b/tests/mesh/polygons/test_mesh_polygons_protocols.py index 5ce74a8e..9ce13337 100644 --- a/tests/mesh/polygons/test_mesh_polygons_protocols.py +++ b/tests/mesh/polygons/test_mesh_polygons_protocols.py @@ -108,13 +108,6 @@ def test_polygons_vertex_color_map( [{"id": "123456789", "name": "lambert2SG"}], ) - # Set scalar range - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": "123456789", "minimum": 0, "maximum": 1}], - ) - # Set color map: Blue to Red server.call( VtkMeshPolygonsView.mesh_polygons_prefix @@ -123,8 +116,14 @@ def test_polygons_vertex_color_map( { "id": "123456789", "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -153,8 +152,14 @@ def test_polygons_vertex_color_map_range_update( { "id": "123456789", "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -162,13 +167,7 @@ def test_polygons_vertex_color_map_range_update( assert server.compare_image("mesh/polygons/vertex_color_map.jpeg") == True - # Set scalar range: 0.8 to 1 (clamping data to the minimum color -> mostly BLUE) - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": "123456789", "minimum": 0.8, "maximum": 1.0}], - ) - + # Update range via color map server.call( VtkMeshPolygonsView.mesh_polygons_prefix + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], @@ -176,8 +175,14 @@ def test_polygons_vertex_color_map_range_update( { "id": "123456789", "points": [ - [0.8, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.8, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -208,8 +213,14 @@ def test_polygons_vertex_color_map_red_shift( { "id": "123456789", "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -217,13 +228,7 @@ def test_polygons_vertex_color_map_red_shift( assert server.compare_image("mesh/polygons/vertex_color_map.jpeg") == True - # Set scalar range: 0.0 to 0.1 (all data > 0.1 should become RED) - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": "123456789", "minimum": 0.0, "maximum": 0.1}], - ) - + # Update range via color map server.call( VtkMeshPolygonsView.mesh_polygons_prefix + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], @@ -231,8 +236,14 @@ def test_polygons_vertex_color_map_red_shift( { "id": "123456789", "points": [ - [0.0, 0, 0, 1.0], - [0.1, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 0.1, + 1.0, + 0, + 0, ], } ], @@ -261,14 +272,38 @@ def test_polygons_vertex_color_map_rainbow( { "id": "123456789", "points": [ - [0.0, 71 / 255, 71 / 255, 219 / 255], - [0.143, 0, 0, 92 / 255], - [0.285, 0, 255 / 255, 255 / 255], - [0.429, 0, 128 / 255, 0], - [0.571, 255 / 255, 255 / 255, 0], - [0.714, 255 / 255, 97 / 255, 0], - [0.857, 107 / 255, 0, 0], - [1.0, 224 / 255, 77 / 255, 77 / 255], + 0.0, + 71 / 255, + 71 / 255, + 219 / 255, + 0.143, + 0, + 0, + 92 / 255, + 0.285, + 0, + 255 / 255, + 255 / 255, + 0.429, + 0, + 128 / 255, + 0, + 0.571, + 255 / 255, + 255 / 255, + 0, + 0.714, + 255 / 255, + 97 / 255, + 0, + 0.857, + 107 / 255, + 0, + 0, + 1.0, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], @@ -279,13 +314,7 @@ def test_polygons_vertex_color_map_rainbow( == True ) - # Set scalar range: 0.1 to 0.4 - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": "123456789", "minimum": 0.1, "maximum": 0.4}], - ) - + # Update rainbow range via color map server.call( VtkMeshPolygonsView.mesh_polygons_prefix + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], @@ -293,14 +322,38 @@ def test_polygons_vertex_color_map_rainbow( { "id": "123456789", "points": [ - [0.1 + 0.0 * 0.3, 71 / 255, 71 / 255, 219 / 255], - [0.1 + 0.143 * 0.3, 0, 0, 92 / 255], - [0.1 + 0.285 * 0.3, 0, 255 / 255, 255 / 255], - [0.1 + 0.429 * 0.3, 0, 128 / 255, 0], - [0.1 + 0.571 * 0.3, 255 / 255, 255 / 255, 0], - [0.1 + 0.714 * 0.3, 255 / 255, 97 / 255, 0], - [0.1 + 0.857 * 0.3, 107 / 255, 0, 0], - [0.1 + 1.0 * 0.3, 224 / 255, 77 / 255, 77 / 255], + 0.1, + 71 / 255, + 71 / 255, + 219 / 255, + 0.1 + 0.143 * 0.3, + 0, + 0, + 92 / 255, + 0.1 + 0.285 * 0.3, + 0, + 255 / 255, + 255 / 255, + 0.1 + 0.429 * 0.3, + 0, + 128 / 255, + 0, + 0.1 + 0.571 * 0.3, + 255 / 255, + 255 / 255, + 0, + 0.1 + 0.714 * 0.3, + 255 / 255, + 97 / 255, + 0, + 0.1 + 0.857 * 0.3, + 107 / 255, + 0, + 0, + 0.4, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], @@ -327,13 +380,6 @@ def test_polygons_polygon_color_map( [{"id": mesh_id, "name": "triangle_vertices"}], ) - # Set scalar range - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0, "maximum": 50}], - ) - # Set color map: Blue to Red server.call( VtkMeshPolygonsView.mesh_polygons_prefix @@ -342,8 +388,14 @@ def test_polygons_polygon_color_map( { "id": mesh_id, "points": [ - [0.0, 0, 0, 1.0], - [50.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 50.0, + 1.0, + 0, + 0, ], } ], @@ -378,8 +430,14 @@ def test_polygons_polygon_color_map_range_update( { "id": mesh_id, "points": [ - [0.0, 0, 0, 1.0], - [50.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 50.0, + 1.0, + 0, + 0, ], } ], @@ -387,13 +445,7 @@ def test_polygons_polygon_color_map_range_update( assert server.compare_image("mesh/polygons/polygon_color_map.jpeg") == True - # Set scalar range: 40 to 45 (clamping data to the minimum color -> mostly BLUE) - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 40.0, "maximum": 45.0}], - ) - + # Update range via color map server.call( VtkMeshPolygonsView.mesh_polygons_prefix + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], @@ -401,8 +453,14 @@ def test_polygons_polygon_color_map_range_update( { "id": mesh_id, "points": [ - [40.0, 0, 0, 1.0], - [45.0, 1.0, 0, 0], + 40.0, + 0, + 0, + 1.0, + 45.0, + 1.0, + 0, + 0, ], } ], @@ -432,7 +490,7 @@ def test_polygons_polygon_color_map_red_shift( [{"id": mesh_id, "name": "triangle_vertices"}], ) - # Set Blue to Red Map on [0, 1] + # Set Blue to Red Map on [0, 50] server.call( VtkMeshPolygonsView.mesh_polygons_prefix + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], @@ -440,8 +498,14 @@ def test_polygons_polygon_color_map_red_shift( { "id": mesh_id, "points": [ - [0.0, 0, 0, 1.0], - [50.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 50.0, + 1.0, + 0, + 0, ], } ], @@ -449,13 +513,7 @@ def test_polygons_polygon_color_map_red_shift( assert server.compare_image("mesh/polygons/polygon_color_map.jpeg") == True - # Set scalar range: 3.0 to 4.0 (all data > 4 should become RED) - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 3.0, "maximum": 4.0}], - ) - + # Update range via color map server.call( VtkMeshPolygonsView.mesh_polygons_prefix + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], @@ -463,8 +521,14 @@ def test_polygons_polygon_color_map_red_shift( { "id": mesh_id, "points": [ - [3.0, 0, 0, 1.0], - [4.0, 1.0, 0, 0], + 3.0, + 0, + 0, + 1.0, + 4.0, + 1.0, + 0, + 0, ], } ], @@ -501,14 +565,38 @@ def test_polygons_polygon_color_map_rainbow( { "id": mesh_id, "points": [ - [0.0 * 50, 71 / 255, 71 / 255, 219 / 255], - [0.143 * 50, 0, 0, 92 / 255], - [0.285 * 50, 0, 255 / 255, 255 / 255], - [0.429 * 50, 0, 128 / 255, 0], - [0.571 * 50, 255 / 255, 255 / 255, 0], - [0.714 * 50, 255 / 255, 97 / 255, 0], - [0.857 * 50, 107 / 255, 0, 0], - [1.0 * 50, 224 / 255, 77 / 255, 77 / 255], + 0.0, + 71 / 255, + 71 / 255, + 219 / 255, + 0.143 * 50, + 0, + 0, + 92 / 255, + 0.285 * 50, + 0, + 255 / 255, + 255 / 255, + 0.429 * 50, + 0, + 128 / 255, + 0, + 0.571 * 50, + 255 / 255, + 255 / 255, + 0, + 0.714 * 50, + 255 / 255, + 97 / 255, + 0, + 0.857 * 50, + 107 / 255, + 0, + 0, + 50.0, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], @@ -519,13 +607,7 @@ def test_polygons_polygon_color_map_rainbow( == True ) - # Set scalar range: 5.0 to 15.0 - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 5.0, "maximum": 15.0}], - ) - + # Update rainbow range via color map server.call( VtkMeshPolygonsView.mesh_polygons_prefix + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], @@ -533,14 +615,38 @@ def test_polygons_polygon_color_map_rainbow( { "id": mesh_id, "points": [ - [5 + 0.0 * 10, 71 / 255, 71 / 255, 219 / 255], - [5 + 0.143 * 10, 0, 0, 92 / 255], - [5 + 0.285 * 10, 0, 255 / 255, 255 / 255], - [5 + 0.429 * 10, 0, 128 / 255, 0], - [5 + 0.571 * 10, 255 / 255, 255 / 255, 0], - [5 + 0.714 * 10, 255 / 255, 97 / 255, 0], - [5 + 0.857 * 10, 107 / 255, 0, 0], - [5 + 1.0 * 10, 224 / 255, 77 / 255, 77 / 255], + 5.0, + 71 / 255, + 71 / 255, + 219 / 255, + 5.0 + 0.143 * 10, + 0, + 0, + 92 / 255, + 5.0 + 0.285 * 10, + 0, + 255 / 255, + 255 / 255, + 5.0 + 0.429 * 10, + 0, + 128 / 255, + 0, + 5.0 + 0.571 * 10, + 255 / 255, + 255 / 255, + 0, + 5.0 + 0.714 * 10, + 255 / 255, + 97 / 255, + 0, + 5.0 + 0.857 * 10, + 107 / 255, + 0, + 0, + 15.0, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], diff --git a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py index 074adf67..1f4e13b6 100644 --- a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py +++ b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py @@ -121,15 +121,6 @@ def test_polyhedra_vertex_color_map( [{"id": "123456789", "name": "toto_on_vertices"}], ) - # Set scalar range - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 0, "maximum": 1}], - ) - # Set color map: Blue to Red server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix @@ -138,8 +129,14 @@ def test_polyhedra_vertex_color_map( { "id": "123456789", "points": [ - [1.0, 0, 0, 1.0], - [11.0, 1.0, 0, 0], + 1.0, + 0, + 0, + 1.0, + 11.0, + 1.0, + 0, + 0, ], } ], @@ -168,8 +165,14 @@ def test_polyhedra_vertex_color_map_range_update( { "id": "123456789", "points": [ - [1.0, 0, 0, 1.0], - [11.0, 1.0, 0, 0], + 1.0, + 0, + 0, + 1.0, + 11.0, + 1.0, + 0, + 0, ], } ], @@ -177,15 +180,7 @@ def test_polyhedra_vertex_color_map_range_update( assert server.compare_image("mesh/polyhedra/vertex_color_map.jpeg") == True - # Set scalar range: 10 to 11 (clamping data to the minimum color -> mostly BLUE) - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 10.0, "maximum": 11.0}], - ) - + # Update range via color map server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], @@ -193,8 +188,14 @@ def test_polyhedra_vertex_color_map_range_update( { "id": "123456789", "points": [ - [10.0, 0, 0, 1.0], - [11.0, 1.0, 0, 0], + 10.0, + 0, + 0, + 1.0, + 11.0, + 1.0, + 0, + 0, ], } ], @@ -218,7 +219,7 @@ def test_polyhedra_vertex_color_map_red_shift( [{"id": "123456789", "name": "toto_on_vertices"}], ) - # Set Blue to Red Map on [0, 1] + # Set Blue to Red Map on [1, 11] server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], @@ -226,8 +227,14 @@ def test_polyhedra_vertex_color_map_red_shift( { "id": "123456789", "points": [ - [1.0, 0, 0, 1.0], - [11.0, 1.0, 0, 0], + 1.0, + 0, + 0, + 1.0, + 11.0, + 1.0, + 0, + 0, ], } ], @@ -235,15 +242,7 @@ def test_polyhedra_vertex_color_map_red_shift( assert server.compare_image("mesh/polyhedra/vertex_color_map.jpeg") == True - # Set scalar range: 0.0 to 1.0 (all data > 1.0 should become RED) - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 0.0, "maximum": 1.0}], - ) - + # Update range via color map server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], @@ -251,8 +250,14 @@ def test_polyhedra_vertex_color_map_red_shift( { "id": "123456789", "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -283,14 +288,38 @@ def test_polyhedra_vertex_color_map_rainbow( { "id": "123456789", "points": [ - [1 + 0.0 * 10, 71 / 255, 71 / 255, 219 / 255], - [1 + 0.143 * 10, 0, 0, 92 / 255], - [1 + 0.285 * 10, 0, 255 / 255, 255 / 255], - [1 + 0.429 * 10, 0, 128 / 255, 0], - [1 + 0.571 * 10, 255 / 255, 255 / 255, 0], - [1 + 0.714 * 10, 255 / 255, 97 / 255, 0], - [1 + 0.857 * 10, 107 / 255, 0, 0], - [1 + 1.0 * 10, 224 / 255, 77 / 255, 77 / 255], + 1.0, + 71 / 255, + 71 / 255, + 219 / 255, + 1.0 + 0.143 * 10, + 0, + 0, + 92 / 255, + 1.0 + 0.285 * 10, + 0, + 255 / 255, + 255 / 255, + 1.0 + 0.429 * 10, + 0, + 128 / 255, + 0, + 1.0 + 0.571 * 10, + 255 / 255, + 255 / 255, + 0, + 1.0 + 0.714 * 10, + 255 / 255, + 97 / 255, + 0, + 1.0 + 0.857 * 10, + 107 / 255, + 0, + 0, + 11.0, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], @@ -301,15 +330,7 @@ def test_polyhedra_vertex_color_map_rainbow( == True ) - # Set scalar range: 2.0 to 8.0 - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 2.0, "maximum": 8.0}], - ) - + # Update rainbow range via color map server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], @@ -317,14 +338,38 @@ def test_polyhedra_vertex_color_map_rainbow( { "id": "123456789", "points": [ - [2 + 0.0 * 6, 71 / 255, 71 / 255, 219 / 255], - [2 + 0.143 * 6, 0, 0, 92 / 255], - [2 + 0.285 * 6, 0, 255 / 255, 255 / 255], - [2 + 0.429 * 6, 0, 128 / 255, 0], - [2 + 0.571 * 6, 255 / 255, 255 / 255, 0], - [2 + 0.714 * 6, 255 / 255, 97 / 255, 0], - [2 + 0.857 * 6, 107 / 255, 0, 0], - [2 + 1.0 * 6, 224 / 255, 77 / 255, 77 / 255], + 2.0, + 71 / 255, + 71 / 255, + 219 / 255, + 2.0 + 0.143 * 6, + 0, + 0, + 92 / 255, + 2.0 + 0.285 * 6, + 0, + 255 / 255, + 255 / 255, + 2.0 + 0.429 * 6, + 0, + 128 / 255, + 0, + 2.0 + 0.571 * 6, + 255 / 255, + 255 / 255, + 0, + 2.0 + 0.714 * 6, + 255 / 255, + 97 / 255, + 0, + 2.0 + 0.857 * 6, + 107 / 255, + 0, + 0, + 8.0, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], @@ -347,15 +392,6 @@ def test_polyhedra_polyhedron_color_map( [{"id": "123456789", "name": "toto_on_polyhedra"}], ) - # Set scalar range - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 0, "maximum": 1}], - ) - # Set color map: Blue to Red server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix @@ -366,8 +402,14 @@ def test_polyhedra_polyhedron_color_map( { "id": "123456789", "points": [ - [3.0, 0, 0, 1.0], - [6.0, 1.0, 0, 0], + 3.0, + 0, + 0, + 1.0, + 6.0, + 1.0, + 0, + 0, ], } ], @@ -400,8 +442,14 @@ def test_polyhedra_polyhedron_color_map_range_update( { "id": "123456789", "points": [ - [3.0, 0, 0, 1.0], - [6.0, 1.0, 0, 0], + 3.0, + 0, + 0, + 1.0, + 6.0, + 1.0, + 0, + 0, ], } ], @@ -409,15 +457,7 @@ def test_polyhedra_polyhedron_color_map_range_update( assert server.compare_image("mesh/polyhedra/polyhedron_color_map.jpeg") == True - # Set scalar range: 5 to 6 (clamping data to the minimum color -> mostly BLUE) - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 5.0, "maximum": 6.0}], - ) - + # Update range via color map server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ @@ -427,8 +467,14 @@ def test_polyhedra_polyhedron_color_map_range_update( { "id": "123456789", "points": [ - [5.0, 0, 0, 1.0], - [6.0, 1.0, 0, 0], + 5.0, + 0, + 0, + 1.0, + 6.0, + 1.0, + 0, + 0, ], } ], @@ -454,7 +500,7 @@ def test_polyhedra_polyhedron_color_map_red_shift( [{"id": "123456789", "name": "toto_on_polyhedra"}], ) - # Set Blue to Red Map on [0, 1] + # Set Blue to Red Map on [3, 6] server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ @@ -464,8 +510,14 @@ def test_polyhedra_polyhedron_color_map_red_shift( { "id": "123456789", "points": [ - [3.0, 0, 0, 1.0], - [6.0, 1.0, 0, 0], + 3.0, + 0, + 0, + 1.0, + 6.0, + 1.0, + 0, + 0, ], } ], @@ -473,15 +525,7 @@ def test_polyhedra_polyhedron_color_map_red_shift( assert server.compare_image("mesh/polyhedra/polyhedron_color_map.jpeg") == True - # Set scalar range: 0.0 to 1.0 (all data > 1 should become RED) - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 0.0, "maximum": 1.0}], - ) - + # Update range via color map server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ @@ -491,8 +535,14 @@ def test_polyhedra_polyhedron_color_map_red_shift( { "id": "123456789", "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, ], } ], @@ -528,14 +578,38 @@ def test_polyhedra_polyhedron_color_map_rainbow( { "id": "123456789", "points": [ - [3 + 0.0 * 3, 71 / 255, 71 / 255, 219 / 255], - [3 + 0.143 * 3, 0, 0, 92 / 255], - [3 + 0.285 * 3, 0, 255 / 255, 255 / 255], - [3 + 0.429 * 3, 0, 128 / 255, 0], - [3 + 0.571 * 3, 255 / 255, 255 / 255, 0], - [3 + 0.714 * 3, 255 / 255, 97 / 255, 0], - [3 + 0.857 * 3, 107 / 255, 0, 0], - [3 + 1.0 * 3, 224 / 255, 77 / 255, 77 / 255], + 3.0, + 71 / 255, + 71 / 255, + 219 / 255, + 3.0 + 0.143 * 3, + 0, + 0, + 92 / 255, + 3.0 + 0.285 * 3, + 0, + 255 / 255, + 255 / 255, + 3.0 + 0.429 * 3, + 0, + 128 / 255, + 0, + 3.0 + 0.571 * 3, + 255 / 255, + 255 / 255, + 0, + 3.0 + 0.714 * 3, + 255 / 255, + 97 / 255, + 0, + 3.0 + 0.857 * 3, + 107 / 255, + 0, + 0, + 6.0, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], @@ -546,15 +620,7 @@ def test_polyhedra_polyhedron_color_map_rainbow( == True ) - # Set scalar range: 3.5 to 5.5 - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 3.5, "maximum": 5.5}], - ) - + # Update rainbow range via color map server.call( VtkMeshPolyhedraView.mesh_polyhedra_prefix + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ @@ -564,14 +630,38 @@ def test_polyhedra_polyhedron_color_map_rainbow( { "id": "123456789", "points": [ - [3.5 + 0.0 * 2.0, 71 / 255, 71 / 255, 219 / 255], - [3.5 + 0.143 * 2.0, 0, 0, 92 / 255], - [3.5 + 0.285 * 2.0, 0, 255 / 255, 255 / 255], - [3.5 + 0.429 * 2.0, 0, 128 / 255, 0], - [3.5 + 0.571 * 2.0, 255 / 255, 255 / 255, 0], - [3.5 + 0.714 * 2.0, 255 / 255, 97 / 255, 0], - [3.5 + 0.857 * 2.0, 107 / 255, 0, 0], - [3.5 + 1.0 * 2.0, 224 / 255, 77 / 255, 77 / 255], + 3.5, + 71 / 255, + 71 / 255, + 219 / 255, + 3.5 + 0.143 * 2, + 0, + 0, + 92 / 255, + 3.5 + 0.285 * 2, + 0, + 255 / 255, + 255 / 255, + 3.5 + 0.429 * 2, + 0, + 128 / 255, + 0, + 3.5 + 0.571 * 2, + 255 / 255, + 255 / 255, + 0, + 3.5 + 0.714 * 2, + 255 / 255, + 97 / 255, + 0, + 3.5 + 0.857 * 2, + 107 / 255, + 0, + 0, + 5.5, + 224 / 255, + 77 / 255, + 77 / 255, ], } ], diff --git a/tests/mesh/test_mesh_scalar_range.py b/tests/mesh/test_mesh_scalar_range.py deleted file mode 100644 index c5f9a4b6..00000000 --- a/tests/mesh/test_mesh_scalar_range.py +++ /dev/null @@ -1,88 +0,0 @@ -# Standard library imports -from typing import Callable - -# Third party imports -import os -import json -from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView -from opengeodeweb_viewer.rpc.mesh.cells.cells_protocols import VtkMeshCellsView -from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView - -# Local application imports -from tests.conftest import ServerMonitor - -# Local constants -mesh_id = "123456789" - - -def save_image(server: ServerMonitor, filename: str) -> None: - server.call( - VtkViewerView.viewer_prefix + VtkViewerView.viewer_schemas_dict["render"]["rpc"] - ) - while True: - image = server.ws.recv() - if isinstance(image, bytes): - response = server.ws.recv() - result = json.loads(response)["result"] - if result["stale"]: - continue - comparison_dir = os.path.join( - os.path.dirname(os.path.dirname(__file__)), "data", "comparison" - ) - output_path = os.path.join(comparison_dir, filename) - with open(output_path, "wb") as f: - f.write(image) - print(f"Image saved to {output_path}") - break - - -def test_mesh_scalar_range_fixed_lut( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - # 1. Register mesh (points values ~2 to 498) - dataset_factory(id=mesh_id, viewable_file="regular_grid_2d.vti") - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - save_image(server, "fixed_lut_1_register.jpeg") - - # 2. Set active attribute "points", should be blue - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "points"}], - ) - save_image(server, "fixed_lut_2_attribute.jpeg") - - # 3. Apply a scalarRange of [0, 1] - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0.0, "maximum": 1.0}], - ) - save_image(server, "fixed_lut_3_range_0_1.jpeg") - - # 4. Set LUT on [0, 1] (Blue to Red), should be red - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], - ], - } - ], - ) - save_image(server, "fixed_lut_4_lut_0_1_saturated.jpeg") - - # 5. Modify scalar range to [0, 500] WITHOUT changing the LUT - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0.0, "maximum": 500.0}], - ) - save_image(server, "fixed_lut_5_range_500_lut_fixed.jpeg") diff --git a/tests/mesh/test_mesh_scalar_range_lut.py b/tests/mesh/test_mesh_scalar_range_lut.py deleted file mode 100644 index e5fb2571..00000000 --- a/tests/mesh/test_mesh_scalar_range_lut.py +++ /dev/null @@ -1,101 +0,0 @@ -# Standard library imports -from typing import Callable - -# Third party imports -import os -import json -from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView -from opengeodeweb_viewer.rpc.mesh.cells.cells_protocols import VtkMeshCellsView -from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView - -# Local application imports -from tests.conftest import ServerMonitor - -# Local constants -mesh_id = "123456789" - - -def save_image(server: ServerMonitor, filename: str) -> None: - server.call( - VtkViewerView.viewer_prefix + VtkViewerView.viewer_schemas_dict["render"]["rpc"] - ) - while True: - image = server.ws.recv() - if isinstance(image, bytes): - response = server.ws.recv() - result = json.loads(response)["result"] - if result["stale"]: - continue - comparison_dir = os.path.join( - os.path.dirname(os.path.dirname(__file__)), "data", "comparison" - ) - output_path = os.path.join(comparison_dir, filename) - with open(output_path, "wb") as f: - f.write(image) - print(f"Image saved to {output_path}") - break - - -def test_mesh_scalar_range_coordinated_lut( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - # 1. Register mesh - dataset_factory(id=mesh_id, viewable_file="regular_grid_2d.vti") - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - save_image(server, "coord_lut_1_register.jpeg") - - # 2. Set active attribute "points", should be blue - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "points"}], - ) - save_image(server, "coord_lut_2_attribute.jpeg") - - # 3. Apply a scalarRange of [0, 1] - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0.0, "maximum": 1.0}], - ) - save_image(server, "coord_lut_3_range_0_1.jpeg") - - # 4. Set LUT on [0, 1] (Blue to Red), should be red - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - [0.0, 0, 0, 1.0], - [1.0, 1.0, 0, 0], - ], - } - ], - ) - save_image(server, "coord_lut_4_lut_0_1_saturated.jpeg") - - # 5. Modify scalar range to [0, 500] AND MANUALLY update the LUT - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0.0, "maximum": 500.0}], - ) - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - [0.0, 0, 0, 1.0], - [500.0, 1.0, 0, 0], - ], - } - ], - ) - save_image(server, "coord_lut_5_coordinated_update.jpeg") From bbffeb3c39c60fb3b24506772aeaf1f4ffaf2f49 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Fri, 30 Jan 2026 10:32:56 +0000 Subject: [PATCH 09/27] Apply prepare changes --- opengeodeweb_viewer_schemas.json | 88 +++++-------------- .../rpc/mesh/cells/schemas/cell_color_map.py | 1 + .../mesh/cells/schemas/vertex_color_map.py | 1 + .../mesh/edges/schemas/vertex_color_map.py | 1 + .../mesh/points/schemas/vertex_color_map.py | 1 + .../polygons/schemas/polygon_color_map.py | 1 + .../mesh/polygons/schemas/vertex_color_map.py | 1 + .../polyhedra/schemas/polyhedra_color_map.py | 1 + .../polyhedra/schemas/vertex_color_map.py | 1 + 9 files changed, 32 insertions(+), 64 deletions(-) diff --git a/opengeodeweb_viewer_schemas.json b/opengeodeweb_viewer_schemas.json index 411b5178..338fae71 100644 --- a/opengeodeweb_viewer_schemas.json +++ b/opengeodeweb_viewer_schemas.json @@ -87,16 +87,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": [ @@ -207,16 +202,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": [ @@ -319,16 +309,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": [ @@ -480,16 +465,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": [ @@ -640,16 +620,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": [ @@ -712,16 +687,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": [ @@ -853,16 +823,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": [ @@ -945,16 +910,11 @@ }, "points": { "type": "array", + "description": "Flat array of [value, r, g, b, ...]", "items": { - "type": "array", - "description": "[value, r, g, b]", - "items": { - "type": "number" - }, - "minItems": 4, - "maxItems": 4 + "type": "number" }, - "minLength": 2 + "minItems": 8 } }, "required": [ diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py index 667bb07c..a6474154 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py @@ -10,3 +10,4 @@ def __post_init__(self) -> None: id: str points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py index cf15be78..1748c230 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py @@ -10,3 +10,4 @@ def __post_init__(self) -> None: id: str points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py index cf15be78..1748c230 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py @@ -10,3 +10,4 @@ def __post_init__(self) -> None: id: str points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py index cf15be78..1748c230 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py @@ -10,3 +10,4 @@ def __post_init__(self) -> None: id: str points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py index 27095abf..2e8e29e4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py @@ -10,3 +10,4 @@ def __post_init__(self) -> None: id: str points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py index cf15be78..1748c230 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py @@ -10,3 +10,4 @@ def __post_init__(self) -> None: id: str points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py index 603b942e..98929ece 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py @@ -10,3 +10,4 @@ def __post_init__(self) -> None: id: str points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py index cf15be78..1748c230 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py @@ -10,3 +10,4 @@ def __post_init__(self) -> None: id: str points: List[float] + """Flat array of [value, r, g, b, ...]""" From 4f0959428a901123e88f9e6b1ceeee6bb0481d5c Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 30 Jan 2026 13:14:00 +0100 Subject: [PATCH 10/27] refacto scalar range and color map setup by integrating lookup table --- .../rpc/mesh/mesh_protocols.py | 21 +++++++++++-------- src/opengeodeweb_viewer/vtk_protocol.py | 1 - tests/mesh/edges/test_mesh_edges_protocols.py | 7 ------- .../mesh/points/test_mesh_points_protocols.py | 7 ------- .../polygons/test_mesh_polygons_protocols.py | 14 ------------- .../test_mesh_polyhedra_protocols.py | 18 ---------------- 6 files changed, 12 insertions(+), 56 deletions(-) diff --git a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py index a8b10316..f67ed4b6 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py @@ -153,18 +153,21 @@ def displayAttributeOnCells(self, data_id: str, name: str) -> None: def displayScalarRange(self, data_id: str, minimum: float, maximum: float) -> None: data = self.get_object(data_id) data.mapper.SetScalarRange(minimum, maximum) + data.mapper.GetLookupTable().SetRange(minimum, maximum) + data.mapper.SetUseLookupTableScalarRange(False) def setupColorMap(self, data_id: str, points: list[float]) -> None: data = self.get_object(data_id) - lut = vtkColorTransferFunction() - minimum = points[0] - maximum = points[-4] - for i in range(0, len(points), 4): - x = points[i] - r = points[i + 1] - g = points[i + 2] - b = points[i + 3] + lut = data.mapper.GetLookupTable() + if not isinstance(lut, vtkColorTransferFunction): + lut = vtkColorTransferFunction() + data.mapper.SetLookupTable(lut) + + lut.RemoveAllPoints() + for x, r, g, b in zip(*[iter(points)] * 4): lut.AddRGBPoint(x, r, g, b) - data.mapper.SetLookupTable(lut) + + minimum, maximum = points[0], points[-4] data.mapper.SetScalarRange(minimum, maximum) + data.mapper.SetUseLookupTableScalarRange(False) data.mapper.InterpolateScalarsBeforeMappingOn() diff --git a/src/opengeodeweb_viewer/vtk_protocol.py b/src/opengeodeweb_viewer/vtk_protocol.py index cc640594..fc16e30e 100644 --- a/src/opengeodeweb_viewer/vtk_protocol.py +++ b/src/opengeodeweb_viewer/vtk_protocol.py @@ -31,7 +31,6 @@ class vtkData: reader: vtkXMLReader mapper: vtkMapper filter: vtkAlgorithm | None = None - color_map_points: list[list[float]] = field(default_factory=list) actor: vtkActor = field(default_factory=vtkActor) max_dimension: Literal["points", "edges", "polygons", "polyhedra", "default"] = ( "default" diff --git a/tests/mesh/edges/test_mesh_edges_protocols.py b/tests/mesh/edges/test_mesh_edges_protocols.py index 9a0ad079..d0d20dad 100644 --- a/tests/mesh/edges/test_mesh_edges_protocols.py +++ b/tests/mesh/edges/test_mesh_edges_protocols.py @@ -85,13 +85,6 @@ def test_edges_vertex_attribute( ) assert server.compare_image("mesh/edges/vertex_attribute.jpeg") == True - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0, "maximum": 10}], - ) - assert server.compare_image("mesh/edges/vertex_scalar_range.jpeg") == True - def test_edges_vertex_color_map( server: ServerMonitor, dataset_factory: Callable[..., str] diff --git a/tests/mesh/points/test_mesh_points_protocols.py b/tests/mesh/points/test_mesh_points_protocols.py index 51f19302..e613249a 100644 --- a/tests/mesh/points/test_mesh_points_protocols.py +++ b/tests/mesh/points/test_mesh_points_protocols.py @@ -101,13 +101,6 @@ def test_points_vertex_attribute( ) assert server.compare_image("mesh/points/vertex_attribute.jpeg") == True - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0, "maximum": 10}], - ) - assert server.compare_image("mesh/points/vertex_scalar_range.jpeg") == True - def test_points_vertex_color_map( server: ServerMonitor, dataset_factory: Callable[..., str] diff --git a/tests/mesh/polygons/test_mesh_polygons_protocols.py b/tests/mesh/polygons/test_mesh_polygons_protocols.py index 9ce13337..cfdd39dc 100644 --- a/tests/mesh/polygons/test_mesh_polygons_protocols.py +++ b/tests/mesh/polygons/test_mesh_polygons_protocols.py @@ -56,13 +56,6 @@ def test_polygons_vertex_attribute( ) assert server.compare_image("mesh/polygons/vertex_attribute.jpeg") == True - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": "123456789", "minimum": 0, "maximum": 10}], - ) - assert server.compare_image("mesh/polygons/vertex_scalar_range.jpeg") == True - def test_polygons_polygon_attribute( server: ServerMonitor, dataset_factory: Callable[..., str] @@ -88,13 +81,6 @@ def test_polygons_polygon_attribute( ) assert server.compare_image("mesh/polygons/polygon_attribute.jpeg") == True - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"], - [{"id": "123456789", "minimum": 0, "maximum": 10}], - ) - assert server.compare_image("mesh/polygons/polygon_scalar_range.jpeg") == True - def test_polygons_vertex_color_map( server: ServerMonitor, dataset_factory: Callable[..., str] diff --git a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py index 1f4e13b6..83cbe725 100644 --- a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py +++ b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py @@ -68,15 +68,6 @@ def test_vertex_attribute( ) assert server.compare_image("mesh/polyhedra/vertex_attribute.jpeg") == True - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 0, "maximum": 10}], - ) - assert server.compare_image("mesh/polyhedra/vertex_scalar_range.jpeg") == True - def test_polyhedron_attribute( server: ServerMonitor, dataset_factory: Callable[..., str] @@ -99,15 +90,6 @@ def test_polyhedron_attribute( ) assert server.compare_image("mesh/polyhedra/polyhedron_attribute.jpeg") == True - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 0, "maximum": 10}], - ) - assert server.compare_image("mesh/polyhedra/polyhedron_scalar_range.jpeg") == True - def test_polyhedra_vertex_color_map( server: ServerMonitor, dataset_factory: Callable[..., str] From 540e4ca68d380434f1de882ad1269b29b20a5c94 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 30 Jan 2026 16:31:32 +0100 Subject: [PATCH 11/27] minimum adn maximum added to setupColorMap --- .../rpc/mesh/cells/cells_protocols.py | 4 +-- .../mesh/cells/schemas/cell_color_map.json | 8 +++++- .../rpc/mesh/cells/schemas/cell_color_map.py | 2 ++ .../mesh/cells/schemas/vertex_color_map.json | 8 +++++- .../mesh/cells/schemas/vertex_color_map.py | 2 ++ .../rpc/mesh/edges/mesh_edges_protocols.py | 2 +- .../mesh/edges/schemas/vertex_color_map.json | 6 ++++ .../mesh/edges/schemas/vertex_color_map.py | 2 ++ .../rpc/mesh/mesh_protocols.py | 12 ++++---- .../rpc/mesh/points/mesh_points_protocols.py | 2 +- .../mesh/points/schemas/vertex_color_map.json | 6 ++++ .../mesh/points/schemas/vertex_color_map.py | 2 ++ .../rpc/mesh/polygons/polygons_protocols.py | 4 +-- .../polygons/schemas/polygon_color_map.json | 6 ++++ .../polygons/schemas/polygon_color_map.py | 2 ++ .../polygons/schemas/vertex_color_map.json | 6 ++++ .../mesh/polygons/schemas/vertex_color_map.py | 2 ++ .../rpc/mesh/polyhedra/polyhedra_protocols.py | 4 +-- .../schemas/polyhedra_color_map.json | 6 ++++ .../polyhedra/schemas/polyhedra_color_map.py | 2 ++ .../polyhedra/schemas/vertex_color_map.json | 6 ++++ .../polyhedra/schemas/vertex_color_map.py | 2 ++ tests/mesh/cells/test_mesh_cells_protocols.py | 28 +++++++++++++++++++ tests/mesh/edges/test_mesh_edges_protocols.py | 14 ++++++++++ .../mesh/points/test_mesh_points_protocols.py | 14 ++++++++++ .../polygons/test_mesh_polygons_protocols.py | 28 +++++++++++++++++++ .../test_mesh_polyhedra_protocols.py | 28 +++++++++++++++++++ 27 files changed, 192 insertions(+), 16 deletions(-) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py index cd15a79e..be6dcda1 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py @@ -94,7 +94,7 @@ def setMeshCellsVertexColorMap(self, rpc_params: RpcParams) -> None: self.mesh_cells_prefix, ) params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["cell_color_map"]["rpc"]) def setMeshCellsCellColorMap(self, rpc_params: RpcParams) -> None: @@ -104,4 +104,4 @@ def setMeshCellsCellColorMap(self, rpc_params: RpcParams) -> None: self.mesh_cells_prefix, ) params = schemas.CellColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json index 738d9de8..95737cc6 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json @@ -13,8 +13,14 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, - "required": ["id", "points"], + "required": ["id", "points", "minimum", "maximum"], "additionalProperties": false } diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py index a6474154..26ad83ee 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py @@ -11,3 +11,5 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" + minimum: float + maximum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json index 738d9de8..95737cc6 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json @@ -13,8 +13,14 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, - "required": ["id", "points"], + "required": ["id", "points", "minimum", "maximum"], "additionalProperties": false } diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py index 1748c230..24d36460 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py @@ -11,3 +11,5 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" + minimum: float + maximum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/mesh_edges_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/edges/mesh_edges_protocols.py index 076d2fae..9321f7bf 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/mesh_edges_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/mesh_edges_protocols.py @@ -80,7 +80,7 @@ def setMeshEdgesVertexColorMap(self, rpc_params: RpcParams) -> None: self.mesh_edges_prefix, ) params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["edge_attribute"]["rpc"]) def setMeshEdgesEdgeAttribute(self, rpc_params: RpcParams) -> None: diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json index 738d9de8..0fbc5858 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json @@ -13,6 +13,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py index 1748c230..24d36460 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py @@ -11,3 +11,5 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" + minimum: float + maximum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py index f67ed4b6..c9d1238b 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py @@ -156,18 +156,18 @@ def displayScalarRange(self, data_id: str, minimum: float, maximum: float) -> No data.mapper.GetLookupTable().SetRange(minimum, maximum) data.mapper.SetUseLookupTableScalarRange(False) - def setupColorMap(self, data_id: str, points: list[float]) -> None: + def setupColorMap( + self, data_id: str, points: list[float], minimum: float, maximum: float + ) -> None: data = self.get_object(data_id) - lut = data.mapper.GetLookupTable() - if not isinstance(lut, vtkColorTransferFunction): - lut = vtkColorTransferFunction() - data.mapper.SetLookupTable(lut) + lut = vtkColorTransferFunction() + data.mapper.SetLookupTable(lut) lut.RemoveAllPoints() for x, r, g, b in zip(*[iter(points)] * 4): lut.AddRGBPoint(x, r, g, b) - minimum, maximum = points[0], points[-4] data.mapper.SetScalarRange(minimum, maximum) + lut.SetRange(minimum, maximum) data.mapper.SetUseLookupTableScalarRange(False) data.mapper.InterpolateScalarsBeforeMappingOn() diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/mesh_points_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/points/mesh_points_protocols.py index 26e8fe13..28a70c24 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/mesh_points_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/mesh_points_protocols.py @@ -80,4 +80,4 @@ def setMeshPointsVertexColorMap(self, rpc_params: RpcParams) -> None: self.mesh_points_prefix, ) params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json index 738d9de8..0fbc5858 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json @@ -13,6 +13,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py index 1748c230..24d36460 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py @@ -11,3 +11,5 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" + minimum: float + maximum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/polygons_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/polygons_protocols.py index 5e7a8b52..fa7932dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/polygons_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/polygons_protocols.py @@ -102,7 +102,7 @@ def setMeshPolygonsVertexColorMap(self, rpc_params: RpcParams) -> None: self.mesh_polygons_prefix, ) params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) @exportRpc( mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_color_map"]["rpc"] @@ -114,4 +114,4 @@ def setMeshPolygonsPolygonColorMap(self, rpc_params: RpcParams) -> None: self.mesh_polygons_prefix, ) params = schemas.PolygonColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json index 738d9de8..0fbc5858 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json @@ -13,6 +13,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py index 2e8e29e4..e366e075 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py @@ -11,3 +11,5 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" + minimum: float + maximum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json index 738d9de8..0fbc5858 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json @@ -13,6 +13,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py index 1748c230..24d36460 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py @@ -11,3 +11,5 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" + minimum: float + maximum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/polyhedra_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/polyhedra_protocols.py index da24f02b..590845e2 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/polyhedra_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/polyhedra_protocols.py @@ -105,7 +105,7 @@ def setMeshPolyhedraVertexColorMap(self, rpc_params: RpcParams) -> None: self.mesh_polyhedra_prefix, ) params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) @exportRpc( mesh_polyhedra_prefix @@ -118,4 +118,4 @@ def setMeshPolyhedraPolyhedraColorMap(self, rpc_params: RpcParams) -> None: self.mesh_polyhedra_prefix, ) params = schemas.PolyhedraColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json index 738d9de8..0fbc5858 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json @@ -13,6 +13,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py index 98929ece..7ce49714 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py @@ -11,3 +11,5 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" + minimum: float + maximum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json index 738d9de8..0fbc5858 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json @@ -13,6 +13,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": ["id", "points"], diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py index 1748c230..24d36460 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py @@ -11,3 +11,5 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" + minimum: float + maximum: float diff --git a/tests/mesh/cells/test_mesh_cells_protocols.py b/tests/mesh/cells/test_mesh_cells_protocols.py index 5eec79ec..aff63cc6 100644 --- a/tests/mesh/cells/test_mesh_cells_protocols.py +++ b/tests/mesh/cells/test_mesh_cells_protocols.py @@ -134,6 +134,8 @@ def test_cells_vertex_color_map( 0, 0, ], + "minimum": 2.0, + "maximum": 498.0, } ], ) @@ -171,6 +173,8 @@ def test_cells_vertex_color_map_range_update( 0, 0, ], + "minimum": 2.0, + "maximum": 498.0, } ], ) @@ -194,6 +198,8 @@ def test_cells_vertex_color_map_range_update( 0, 0, ], + "minimum": 200.0, + "maximum": 300.0, } ], ) @@ -231,6 +237,8 @@ def test_cells_vertex_color_map_red_shift( 0, 0, ], + "minimum": 2.0, + "maximum": 498.0, } ], ) @@ -254,6 +262,8 @@ def test_cells_vertex_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 50.0, } ], ) @@ -315,6 +325,8 @@ def test_cells_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 2.0, + "maximum": 498.0, } ], ) @@ -364,6 +376,8 @@ def test_cells_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 50.0, + "maximum": 200.0, } ], ) @@ -401,6 +415,8 @@ def test_cells_cell_color_map( 0, 0, ], + "minimum": 0.0, + "maximum": 255.0, } ], ) @@ -438,6 +454,8 @@ def test_cells_cell_color_map_range_update( 0, 0, ], + "minimum": 0.0, + "maximum": 255.0, } ], ) @@ -461,6 +479,8 @@ def test_cells_cell_color_map_range_update( 0, 0, ], + "minimum": 100.0, + "maximum": 150.0, } ], ) @@ -498,6 +518,8 @@ def test_cells_cell_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 255.0, } ], ) @@ -521,6 +543,8 @@ def test_cells_cell_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 20.0, } ], ) @@ -582,6 +606,8 @@ def test_cells_cell_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.0, + "maximum": 255.0, } ], ) @@ -631,6 +657,8 @@ def test_cells_cell_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 50.0, + "maximum": 100.0, } ], ) diff --git a/tests/mesh/edges/test_mesh_edges_protocols.py b/tests/mesh/edges/test_mesh_edges_protocols.py index d0d20dad..aa9862d9 100644 --- a/tests/mesh/edges/test_mesh_edges_protocols.py +++ b/tests/mesh/edges/test_mesh_edges_protocols.py @@ -121,6 +121,8 @@ def test_edges_vertex_color_map( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -163,6 +165,8 @@ def test_edges_vertex_color_map_range_update( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -186,6 +190,8 @@ def test_edges_vertex_color_map_range_update( 0, 0, ], + "minimum": 50.0, + "maximum": 58.0, } ], ) @@ -228,6 +234,8 @@ def test_edges_vertex_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -251,6 +259,8 @@ def test_edges_vertex_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 1.0, } ], ) @@ -317,6 +327,8 @@ def test_edges_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -366,6 +378,8 @@ def test_edges_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 10.0, + "maximum": 20.0, } ], ) diff --git a/tests/mesh/points/test_mesh_points_protocols.py b/tests/mesh/points/test_mesh_points_protocols.py index e613249a..8c08b6a8 100644 --- a/tests/mesh/points/test_mesh_points_protocols.py +++ b/tests/mesh/points/test_mesh_points_protocols.py @@ -132,6 +132,8 @@ def test_points_vertex_color_map( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -169,6 +171,8 @@ def test_points_vertex_color_map_range_update( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -192,6 +196,8 @@ def test_points_vertex_color_map_range_update( 0, 0, ], + "minimum": 0.8, + "maximum": 1.0, } ], ) @@ -231,6 +237,8 @@ def test_points_vertex_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -254,6 +262,8 @@ def test_points_vertex_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -315,6 +325,8 @@ def test_points_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -365,6 +377,8 @@ def test_points_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.1, + "maximum": 0.4, } ], ) diff --git a/tests/mesh/polygons/test_mesh_polygons_protocols.py b/tests/mesh/polygons/test_mesh_polygons_protocols.py index cfdd39dc..f2f40e72 100644 --- a/tests/mesh/polygons/test_mesh_polygons_protocols.py +++ b/tests/mesh/polygons/test_mesh_polygons_protocols.py @@ -111,6 +111,8 @@ def test_polygons_vertex_color_map( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -147,6 +149,8 @@ def test_polygons_vertex_color_map_range_update( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -170,6 +174,8 @@ def test_polygons_vertex_color_map_range_update( 0, 0, ], + "minimum": 0.8, + "maximum": 1.0, } ], ) @@ -208,6 +214,8 @@ def test_polygons_vertex_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -231,6 +239,8 @@ def test_polygons_vertex_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -291,6 +301,8 @@ def test_polygons_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -341,6 +353,8 @@ def test_polygons_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.1, + "maximum": 0.4, } ], ) @@ -383,6 +397,8 @@ def test_polygons_polygon_color_map( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -425,6 +441,8 @@ def test_polygons_polygon_color_map_range_update( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -448,6 +466,8 @@ def test_polygons_polygon_color_map_range_update( 0, 0, ], + "minimum": 40.0, + "maximum": 45.0, } ], ) @@ -493,6 +513,8 @@ def test_polygons_polygon_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 50.0, } ], ) @@ -516,6 +538,8 @@ def test_polygons_polygon_color_map_red_shift( 0, 0, ], + "minimum": 3.0, + "maximum": 4.0, } ], ) @@ -584,6 +608,8 @@ def test_polygons_polygon_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -634,6 +660,8 @@ def test_polygons_polygon_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 5.0, + "maximum": 15.0, } ], ) diff --git a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py index 83cbe725..7d11c06a 100644 --- a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py +++ b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py @@ -120,6 +120,8 @@ def test_polyhedra_vertex_color_map( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -156,6 +158,8 @@ def test_polyhedra_vertex_color_map_range_update( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -179,6 +183,8 @@ def test_polyhedra_vertex_color_map_range_update( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -218,6 +224,8 @@ def test_polyhedra_vertex_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -241,6 +249,8 @@ def test_polyhedra_vertex_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -303,6 +313,8 @@ def test_polyhedra_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -353,6 +365,8 @@ def test_polyhedra_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -393,6 +407,8 @@ def test_polyhedra_polyhedron_color_map( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -433,6 +449,8 @@ def test_polyhedra_polyhedron_color_map_range_update( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -458,6 +476,8 @@ def test_polyhedra_polyhedron_color_map_range_update( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -501,6 +521,8 @@ def test_polyhedra_polyhedron_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -526,6 +548,8 @@ def test_polyhedra_polyhedron_color_map_red_shift( 0, 0, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -593,6 +617,8 @@ def test_polyhedra_polyhedron_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) @@ -645,6 +671,8 @@ def test_polyhedra_polyhedron_color_map_rainbow( 77 / 255, 77 / 255, ], + "minimum": 0.0, + "maximum": 58.0, } ], ) From 7460325f6c889841478ea3ffac7c349657b2f158 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Fri, 30 Jan 2026 15:32:13 +0000 Subject: [PATCH 12/27] Apply prepare changes --- opengeodeweb_viewer_schemas.json | 56 ++++++++++++++++++- .../rpc/mesh/cells/schemas/cell_color_map.py | 4 +- .../mesh/cells/schemas/vertex_color_map.py | 4 +- .../mesh/edges/schemas/vertex_color_map.py | 7 ++- .../mesh/points/schemas/vertex_color_map.py | 7 ++- .../polygons/schemas/polygon_color_map.py | 7 ++- .../mesh/polygons/schemas/vertex_color_map.py | 7 ++- .../polyhedra/schemas/polyhedra_color_map.py | 7 ++- .../polyhedra/schemas/vertex_color_map.py | 7 ++- 9 files changed, 82 insertions(+), 24 deletions(-) diff --git a/opengeodeweb_viewer_schemas.json b/opengeodeweb_viewer_schemas.json index 338fae71..4f3e935a 100644 --- a/opengeodeweb_viewer_schemas.json +++ b/opengeodeweb_viewer_schemas.json @@ -92,11 +92,19 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ "id", - "points" + "points", + "minimum", + "maximum" ], "additionalProperties": false }, @@ -207,11 +215,19 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ "id", - "points" + "points", + "minimum", + "maximum" ], "additionalProperties": false }, @@ -314,6 +330,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ @@ -470,6 +492,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ @@ -625,6 +653,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ @@ -692,6 +726,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ @@ -828,6 +868,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ @@ -915,6 +961,12 @@ "type": "number" }, "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py index 26ad83ee..609e883a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py @@ -9,7 +9,7 @@ def __post_init__(self) -> None: print(self, flush=True) id: str + maximum: float + minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - minimum: float - maximum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py index 24d36460..14239388 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py @@ -9,7 +9,7 @@ def __post_init__(self) -> None: print(self, flush=True) id: str + maximum: float + minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - minimum: float - maximum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py index 24d36460..33086116 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List +from typing import List, Optional @dataclass @@ -11,5 +11,6 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" - minimum: float - maximum: float + + maximum: Optional[float] = None + minimum: Optional[float] = None diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py index 24d36460..33086116 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List +from typing import List, Optional @dataclass @@ -11,5 +11,6 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" - minimum: float - maximum: float + + maximum: Optional[float] = None + minimum: Optional[float] = None diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py index e366e075..2608efa5 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List +from typing import List, Optional @dataclass @@ -11,5 +11,6 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" - minimum: float - maximum: float + + maximum: Optional[float] = None + minimum: Optional[float] = None diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py index 24d36460..33086116 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List +from typing import List, Optional @dataclass @@ -11,5 +11,6 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" - minimum: float - maximum: float + + maximum: Optional[float] = None + minimum: Optional[float] = None diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py index 7ce49714..cb064cf0 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List +from typing import List, Optional @dataclass @@ -11,5 +11,6 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" - minimum: float - maximum: float + + maximum: Optional[float] = None + minimum: Optional[float] = None diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py index 24d36460..33086116 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List +from typing import List, Optional @dataclass @@ -11,5 +11,6 @@ def __post_init__(self) -> None: id: str points: List[float] """Flat array of [value, r, g, b, ...]""" - minimum: float - maximum: float + + maximum: Optional[float] = None + minimum: Optional[float] = None From d89007ab9dc85ff306792a008e952bdca70dc079 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 30 Jan 2026 16:39:30 +0100 Subject: [PATCH 13/27] fixed schemas --- .../rpc/mesh/edges/schemas/vertex_color_map.json | 2 +- .../rpc/mesh/points/schemas/vertex_color_map.json | 2 +- .../rpc/mesh/polygons/schemas/vertex_color_map.json | 2 +- .../rpc/mesh/polyhedra/schemas/polyhedra_color_map.json | 2 +- .../rpc/mesh/polyhedra/schemas/vertex_color_map.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json index 0fbc5858..95737cc6 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json @@ -21,6 +21,6 @@ "type": "number" } }, - "required": ["id", "points"], + "required": ["id", "points", "minimum", "maximum"], "additionalProperties": false } diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json index 0fbc5858..95737cc6 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.json @@ -21,6 +21,6 @@ "type": "number" } }, - "required": ["id", "points"], + "required": ["id", "points", "minimum", "maximum"], "additionalProperties": false } diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json index 0fbc5858..95737cc6 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json @@ -21,6 +21,6 @@ "type": "number" } }, - "required": ["id", "points"], + "required": ["id", "points", "minimum", "maximum"], "additionalProperties": false } diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json index 0fbc5858..95737cc6 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json @@ -21,6 +21,6 @@ "type": "number" } }, - "required": ["id", "points"], + "required": ["id", "points", "minimum", "maximum"], "additionalProperties": false } diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json index 0fbc5858..95737cc6 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json @@ -21,6 +21,6 @@ "type": "number" } }, - "required": ["id", "points"], + "required": ["id", "points", "minimum", "maximum"], "additionalProperties": false } From 3411729861577111a99981302c63222013d30132 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Fri, 30 Jan 2026 15:40:10 +0000 Subject: [PATCH 14/27] Apply prepare changes --- opengeodeweb_viewer_schemas.json | 20 ++++++++++++++----- .../mesh/edges/schemas/vertex_color_map.py | 7 +++---- .../mesh/points/schemas/vertex_color_map.py | 7 +++---- .../mesh/polygons/schemas/vertex_color_map.py | 7 +++---- .../polyhedra/schemas/polyhedra_color_map.py | 7 +++---- .../polyhedra/schemas/vertex_color_map.py | 7 +++---- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/opengeodeweb_viewer_schemas.json b/opengeodeweb_viewer_schemas.json index 4f3e935a..c8b08446 100644 --- a/opengeodeweb_viewer_schemas.json +++ b/opengeodeweb_viewer_schemas.json @@ -340,7 +340,9 @@ }, "required": [ "id", - "points" + "points", + "minimum", + "maximum" ], "additionalProperties": false }, @@ -502,7 +504,9 @@ }, "required": [ "id", - "points" + "points", + "minimum", + "maximum" ], "additionalProperties": false }, @@ -663,7 +667,9 @@ }, "required": [ "id", - "points" + "points", + "minimum", + "maximum" ], "additionalProperties": false }, @@ -878,7 +884,9 @@ }, "required": [ "id", - "points" + "points", + "minimum", + "maximum" ], "additionalProperties": false }, @@ -971,7 +979,9 @@ }, "required": [ "id", - "points" + "points", + "minimum", + "maximum" ], "additionalProperties": false }, diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py index 33086116..14239388 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -9,8 +9,7 @@ def __post_init__(self) -> None: print(self, flush=True) id: str + maximum: float + minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - - maximum: Optional[float] = None - minimum: Optional[float] = None diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py index 33086116..14239388 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -9,8 +9,7 @@ def __post_init__(self) -> None: print(self, flush=True) id: str + maximum: float + minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - - maximum: Optional[float] = None - minimum: Optional[float] = None diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py index 33086116..14239388 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -9,8 +9,7 @@ def __post_init__(self) -> None: print(self, flush=True) id: str + maximum: float + minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - - maximum: Optional[float] = None - minimum: Optional[float] = None diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py index cb064cf0..01d1bad8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -9,8 +9,7 @@ def __post_init__(self) -> None: print(self, flush=True) id: str + maximum: float + minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - - maximum: Optional[float] = None - minimum: Optional[float] = None diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py index 33086116..14239388 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -9,8 +9,7 @@ def __post_init__(self) -> None: print(self, flush=True) id: str + maximum: float + minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - - maximum: Optional[float] = None - minimum: Optional[float] = None From 89fe79b94fe4c2df543eaab76336db78482ac25c Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 30 Jan 2026 16:45:10 +0100 Subject: [PATCH 15/27] missed this one --- .../rpc/mesh/points/schemas/vertex_color_map.py | 6 +++--- .../rpc/mesh/polygons/schemas/polygon_color_map.json | 2 +- .../rpc/mesh/polygons/schemas/polygon_color_map.py | 6 +++--- .../rpc/mesh/polygons/schemas/vertex_color_map.py | 6 +++--- .../rpc/mesh/polyhedra/schemas/polyhedra_color_map.py | 6 +++--- .../rpc/mesh/polyhedra/schemas/vertex_color_map.py | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py index 33086116..4ece1df0 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -12,5 +12,5 @@ def __post_init__(self) -> None: points: List[float] """Flat array of [value, r, g, b, ...]""" - maximum: Optional[float] = None - minimum: Optional[float] = None + maximum: float + minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json index 0fbc5858..95737cc6 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json @@ -21,6 +21,6 @@ "type": "number" } }, - "required": ["id", "points"], + "required": ["id", "points", "minimum", "maximum"], "additionalProperties": false } diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py index 2608efa5..64a59ffe 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -12,5 +12,5 @@ def __post_init__(self) -> None: points: List[float] """Flat array of [value, r, g, b, ...]""" - maximum: Optional[float] = None - minimum: Optional[float] = None + maximum: float + minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py index 33086116..4ece1df0 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -12,5 +12,5 @@ def __post_init__(self) -> None: points: List[float] """Flat array of [value, r, g, b, ...]""" - maximum: Optional[float] = None - minimum: Optional[float] = None + maximum: float + minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py index cb064cf0..e963a33b 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -12,5 +12,5 @@ def __post_init__(self) -> None: points: List[float] """Flat array of [value, r, g, b, ...]""" - maximum: Optional[float] = None - minimum: Optional[float] = None + maximum: float + minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py index 33086116..4ece1df0 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py @@ -1,6 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass -from typing import List, Optional +from typing import List @dataclass @@ -12,5 +12,5 @@ def __post_init__(self) -> None: points: List[float] """Flat array of [value, r, g, b, ...]""" - maximum: Optional[float] = None - minimum: Optional[float] = None + maximum: float + minimum: float From 9b90ac5054d1a7633db949f89a88716983050c98 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Fri, 30 Jan 2026 15:46:41 +0000 Subject: [PATCH 16/27] Apply prepare changes --- opengeodeweb_viewer_schemas.json | 4 +++- .../rpc/mesh/points/schemas/vertex_color_map.py | 4 ---- .../rpc/mesh/polygons/schemas/polygon_color_map.py | 5 ++--- .../rpc/mesh/polygons/schemas/vertex_color_map.py | 4 ---- .../rpc/mesh/polyhedra/schemas/polyhedra_color_map.py | 4 ---- .../rpc/mesh/polyhedra/schemas/vertex_color_map.py | 4 ---- 6 files changed, 5 insertions(+), 20 deletions(-) diff --git a/opengeodeweb_viewer_schemas.json b/opengeodeweb_viewer_schemas.json index c8b08446..e94ab924 100644 --- a/opengeodeweb_viewer_schemas.json +++ b/opengeodeweb_viewer_schemas.json @@ -742,7 +742,9 @@ }, "required": [ "id", - "points" + "points", + "minimum", + "maximum" ], "additionalProperties": false }, diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py index 9c6f699d..14239388 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/schemas/vertex_color_map.py @@ -1,7 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass from typing import List -from typing import List @dataclass @@ -14,6 +13,3 @@ def __post_init__(self) -> None: minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - - maximum: float - minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py index 64a59ffe..5841a9c8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py @@ -9,8 +9,7 @@ def __post_init__(self) -> None: print(self, flush=True) id: str - points: List[float] - """Flat array of [value, r, g, b, ...]""" - maximum: float minimum: float + points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py index 9c6f699d..14239388 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py @@ -1,7 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass from typing import List -from typing import List @dataclass @@ -14,6 +13,3 @@ def __post_init__(self) -> None: minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - - maximum: float - minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py index 51fdc97c..01d1bad8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py @@ -1,7 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass from typing import List -from typing import List @dataclass @@ -14,6 +13,3 @@ def __post_init__(self) -> None: minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - - maximum: float - minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py index 9c6f699d..14239388 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py @@ -1,7 +1,6 @@ from dataclasses_json import DataClassJsonMixin from dataclasses import dataclass from typing import List -from typing import List @dataclass @@ -14,6 +13,3 @@ def __post_init__(self) -> None: minimum: float points: List[float] """Flat array of [value, r, g, b, ...]""" - - maximum: float - minimum: float From dea10d7074b6d3f04aed46c606a2206b80314859 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 30 Jan 2026 18:58:22 +0100 Subject: [PATCH 17/27] removedAllPoints not needed rescale x value --- .../rpc/mesh/mesh_protocols.py | 14 ++++- .../mesh/points/test_mesh_points_protocols.py | 10 ++-- .../polygons/test_mesh_polygons_protocols.py | 16 +++--- .../test_mesh_polyhedra_protocols.py | 52 +++++++++---------- 4 files changed, 51 insertions(+), 41 deletions(-) diff --git a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py index c9d1238b..bd8f2bb9 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py @@ -163,9 +163,19 @@ def setupColorMap( lut = vtkColorTransferFunction() data.mapper.SetLookupTable(lut) - lut.RemoveAllPoints() + x_values = points[::4] + x_min = min(x_values) + x_max = max(x_values) + x_range = x_max - x_min + target_range = maximum - minimum + for x, r, g, b in zip(*[iter(points)] * 4): - lut.AddRGBPoint(x, r, g, b) + new_x = ( + minimum + (x - x_min) / x_range * target_range + if x_range != 0 + else minimum + ) + lut.AddRGBPoint(new_x, r, g, b) data.mapper.SetScalarRange(minimum, maximum) lut.SetRange(minimum, maximum) diff --git a/tests/mesh/points/test_mesh_points_protocols.py b/tests/mesh/points/test_mesh_points_protocols.py index 8c08b6a8..74652c25 100644 --- a/tests/mesh/points/test_mesh_points_protocols.py +++ b/tests/mesh/points/test_mesh_points_protocols.py @@ -133,7 +133,7 @@ def test_points_vertex_color_map( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) @@ -172,7 +172,7 @@ def test_points_vertex_color_map_range_update( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) @@ -238,7 +238,7 @@ def test_points_vertex_color_map_red_shift( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) @@ -263,7 +263,7 @@ def test_points_vertex_color_map_red_shift( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 0.1, } ], ) @@ -326,7 +326,7 @@ def test_points_vertex_color_map_rainbow( 77 / 255, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) diff --git a/tests/mesh/polygons/test_mesh_polygons_protocols.py b/tests/mesh/polygons/test_mesh_polygons_protocols.py index f2f40e72..8d24347e 100644 --- a/tests/mesh/polygons/test_mesh_polygons_protocols.py +++ b/tests/mesh/polygons/test_mesh_polygons_protocols.py @@ -112,7 +112,7 @@ def test_polygons_vertex_color_map( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) @@ -150,7 +150,7 @@ def test_polygons_vertex_color_map_range_update( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) @@ -215,7 +215,7 @@ def test_polygons_vertex_color_map_red_shift( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) @@ -240,7 +240,7 @@ def test_polygons_vertex_color_map_red_shift( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 0.1, } ], ) @@ -302,7 +302,7 @@ def test_polygons_vertex_color_map_rainbow( 77 / 255, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) @@ -398,7 +398,7 @@ def test_polygons_polygon_color_map( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 50.0, } ], ) @@ -442,7 +442,7 @@ def test_polygons_polygon_color_map_range_update( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 50.0, } ], ) @@ -609,7 +609,7 @@ def test_polygons_polygon_color_map_rainbow( 77 / 255, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 50.0, } ], ) diff --git a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py index 7d11c06a..062d3673 100644 --- a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py +++ b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py @@ -120,8 +120,8 @@ def test_polyhedra_vertex_color_map( 0, 0, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 1.0, + "maximum": 11.0, } ], ) @@ -158,8 +158,8 @@ def test_polyhedra_vertex_color_map_range_update( 0, 0, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 1.0, + "maximum": 11.0, } ], ) @@ -183,8 +183,8 @@ def test_polyhedra_vertex_color_map_range_update( 0, 0, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 10.0, + "maximum": 11.0, } ], ) @@ -224,8 +224,8 @@ def test_polyhedra_vertex_color_map_red_shift( 0, 0, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 1.0, + "maximum": 11.0, } ], ) @@ -250,7 +250,7 @@ def test_polyhedra_vertex_color_map_red_shift( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) @@ -313,8 +313,8 @@ def test_polyhedra_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 1.0, + "maximum": 11.0, } ], ) @@ -365,8 +365,8 @@ def test_polyhedra_vertex_color_map_rainbow( 77 / 255, 77 / 255, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 2.0, + "maximum": 8.0, } ], ) @@ -407,8 +407,8 @@ def test_polyhedra_polyhedron_color_map( 0, 0, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 3.0, + "maximum": 6.0, } ], ) @@ -449,8 +449,8 @@ def test_polyhedra_polyhedron_color_map_range_update( 0, 0, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 3.0, + "maximum": 6.0, } ], ) @@ -476,8 +476,8 @@ def test_polyhedra_polyhedron_color_map_range_update( 0, 0, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 5.0, + "maximum": 6.0, } ], ) @@ -521,8 +521,8 @@ def test_polyhedra_polyhedron_color_map_red_shift( 0, 0, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 3.0, + "maximum": 6.0, } ], ) @@ -549,7 +549,7 @@ def test_polyhedra_polyhedron_color_map_red_shift( 0, ], "minimum": 0.0, - "maximum": 58.0, + "maximum": 1.0, } ], ) @@ -617,8 +617,8 @@ def test_polyhedra_polyhedron_color_map_rainbow( 77 / 255, 77 / 255, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 3.0, + "maximum": 6.0, } ], ) @@ -671,8 +671,8 @@ def test_polyhedra_polyhedron_color_map_rainbow( 77 / 255, 77 / 255, ], - "minimum": 0.0, - "maximum": 58.0, + "minimum": 3.5, + "maximum": 5.5, } ], ) From 421fc9204d6ced77985c4c299e5da388cf262de5 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Tue, 3 Feb 2026 17:15:08 +0100 Subject: [PATCH 18/27] new architecture --- .../cell/cells_attribute_cell_protocols.py | 54 ++++++++ .../cells/attribute/cell/schemas/__init__.py | 3 + .../cell/schemas/color_map.json} | 0 .../cell/schemas/color_map.py} | 0 .../cell/schemas/name.json} | 2 +- .../cell/schemas/name.py} | 2 +- .../cell/schemas/scalar_range.json} | 2 +- .../cell/schemas/scalar_range.py} | 0 .../cells_attribute_vertex_protocols.py | 54 ++++++++ .../attribute/vertex/schemas/__init__.py | 3 + .../vertex/schemas/color_map.json} | 0 .../vertex/schemas/color_map.py} | 0 .../cells/attribute/vertex/schemas/name.json | 19 +++ .../vertex/schemas/name.py} | 0 .../vertex/schemas/scalar_range.json} | 2 +- .../vertex/schemas/scalar_range.py} | 0 .../rpc/mesh/cells/schemas/__init__.py | 6 - .../edge/edges_attribute_edge_protocols.py | 34 +++++ .../edges/attribute/edge/schemas/__init__.py | 1 + .../edge/schemas/name.json} | 2 +- .../edge/schemas/name.py} | 0 .../edges_attribute_vertex_protocols.py | 54 ++++++++ .../attribute/vertex/schemas/__init__.py | 3 + .../vertex/schemas/color_map.json} | 0 .../vertex/schemas/color_map.py} | 0 .../attribute/vertex/schemas/name.json} | 0 .../vertex/schemas/name.py} | 0 .../vertex/schemas/scalar_range.json | 22 ++++ .../vertex/schemas/scalar_range.py} | 0 ..._edges_protocols.py => edges_protocols.py} | 42 ------- .../points_attribute_vertex_protocols.py | 54 ++++++++ .../attribute/vertex/schemas/__init__.py | 3 + .../attribute/vertex/schemas/attribute.json | 19 +++ .../attribute/vertex/schemas/attribute.py | 11 ++ .../attribute/vertex/schemas/color_map.json | 26 ++++ .../attribute/vertex/schemas/color_map.py | 15 +++ .../vertex/schemas/scalar_range.json | 22 ++++ .../attribute/vertex/schemas/scalar_range.py | 12 ++ ...oints_protocols.py => points_protocols.py} | 32 ----- .../attribute/polygon/polygons_protocols.py | 54 ++++++++ .../attribute/polygon/schemas/__init__.py | 3 + .../attribute/polygon/schemas/color_map.json | 26 ++++ .../attribute/polygon/schemas/color_map.py | 15 +++ .../attribute/polygon/schemas/name.json | 19 +++ .../attribute/polygon/schemas/name.py | 11 ++ .../polygon/schemas/scalar_range.json | 22 ++++ .../attribute/polygon/schemas/scalar_range.py | 12 ++ .../attribute/vertex/polygons_protocols.py | 117 ++++++++++++++++++ .../attribute/vertex/schemas/__init__.py | 8 ++ .../attribute/vertex/schemas/color.json | 47 +++++++ .../attribute/vertex/schemas/color.py | 23 ++++ .../vertex/schemas/polygon_attribute.json | 19 +++ .../vertex/schemas/polygon_attribute.py | 11 ++ .../vertex/schemas/polygon_color_map.json | 26 ++++ .../vertex/schemas/polygon_color_map.py | 15 +++ .../vertex/schemas/polygon_scalar_range.json | 22 ++++ .../vertex/schemas/polygon_scalar_range.py | 12 ++ .../vertex}/schemas/vertex_attribute.json | 0 .../vertex/schemas/vertex_attribute.py | 11 ++ .../vertex/schemas/vertex_color_map.json | 26 ++++ .../vertex/schemas/vertex_color_map.py | 15 +++ .../vertex}/schemas/vertex_scalar_range.json | 0 .../vertex/schemas/vertex_scalar_range.py | 12 ++ .../attribute/vertex/schemas/visibility.json | 18 +++ .../attribute/vertex/schemas/visibility.py | 11 ++ src/opengeodeweb_viewer/vtkw_server.py | 20 ++- tests/mesh/edges/test_mesh_edges_protocols.py | 2 +- .../mesh/points/test_mesh_points_protocols.py | 2 +- 68 files changed, 989 insertions(+), 89 deletions(-) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/cells_attribute_cell_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/cell_color_map.json => attribute/cell/schemas/color_map.json} (100%) rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/cell_color_map.py => attribute/cell/schemas/color_map.py} (100%) rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/cell_attribute.json => attribute/cell/schemas/name.json} (89%) rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/cell_attribute.py => attribute/cell/schemas/name.py} (82%) rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/cell_scalar_range.json => attribute/cell/schemas/scalar_range.json} (90%) rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/cell_scalar_range.py => attribute/cell/schemas/scalar_range.py} (100%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/cells_attribute_vertex_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/vertex_color_map.json => attribute/vertex/schemas/color_map.json} (100%) rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/vertex_color_map.py => attribute/vertex/schemas/color_map.py} (100%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.json rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/vertex_attribute.py => attribute/vertex/schemas/name.py} (100%) rename src/opengeodeweb_viewer/rpc/mesh/{edges/schemas/vertex_scalar_range.json => cells/attribute/vertex/schemas/scalar_range.json} (90%) rename src/opengeodeweb_viewer/rpc/mesh/cells/{schemas/vertex_scalar_range.py => attribute/vertex/schemas/scalar_range.py} (100%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/edges_attribute_edge_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py rename src/opengeodeweb_viewer/rpc/mesh/edges/{schemas/edge_attribute.json => attribute/edge/schemas/name.json} (90%) rename src/opengeodeweb_viewer/rpc/mesh/edges/{schemas/edge_attribute.py => attribute/edge/schemas/name.py} (100%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/edges_attribute_vertex_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py rename src/opengeodeweb_viewer/rpc/mesh/edges/{schemas/vertex_color_map.json => attribute/vertex/schemas/color_map.json} (100%) rename src/opengeodeweb_viewer/rpc/mesh/edges/{schemas/vertex_color_map.py => attribute/vertex/schemas/color_map.py} (100%) rename src/opengeodeweb_viewer/rpc/mesh/{cells/schemas/vertex_attribute.json => edges/attribute/vertex/schemas/name.json} (100%) rename src/opengeodeweb_viewer/rpc/mesh/edges/{schemas/vertex_attribute.py => attribute/vertex/schemas/name.py} (100%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.json rename src/opengeodeweb_viewer/rpc/mesh/edges/{schemas/vertex_scalar_range.py => attribute/vertex/schemas/scalar_range.py} (100%) rename src/opengeodeweb_viewer/rpc/mesh/edges/{mesh_edges_protocols.py => edges_protocols.py} (50%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/points_attribute_vertex_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/color_map.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/color_map.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.py rename src/opengeodeweb_viewer/rpc/mesh/points/{mesh_points_protocols.py => points_protocols.py} (57%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/__init__.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.py rename src/opengeodeweb_viewer/rpc/mesh/{edges => polygons/attribute/vertex}/schemas/vertex_attribute.json (100%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.py rename src/opengeodeweb_viewer/rpc/mesh/{cells => polygons/attribute/vertex}/schemas/vertex_scalar_range.json (100%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/cells_attribute_cell_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/cells_attribute_cell_protocols.py new file mode 100644 index 00000000..942ba205 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/cells_attribute_cell_protocols.py @@ -0,0 +1,54 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshCellsAttributeCellView(VtkMeshView): + mesh_cells_prefix = "opengeodeweb_viewer.mesh.attribute.cells.cell." + mesh_cells_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["name"]["rpc"]) + def setMeshCellsCellAttribute(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_cells_schemas_dict["name"], + self.mesh_cells_prefix, + ) + params = schemas.Name.from_dict(rpc_params) + self.displayAttributeOnCells(params.id, params.name) + + @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["scalar_range"]["rpc"]) + def setMeshCellsCellScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_cells_schemas_dict["scalar_range"], + self.mesh_cells_prefix, + ) + params = schemas.ScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["color_map"]["rpc"]) + def setMeshCellsCellColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_cells_schemas_dict["color_map"], + self.mesh_cells_prefix, + ) + params = schemas.ColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py new file mode 100644 index 00000000..638c51d7 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py @@ -0,0 +1,3 @@ +from .attribute import * +from .color_map import * +from .scalar_range import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.json similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.json similarity index 89% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_attribute.json rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.json index f5b140ba..e3b91168 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_attribute.json +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.json @@ -1,5 +1,5 @@ { - "rpc": "cell_attribute", + "rpc": "name", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py similarity index 82% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_attribute.py rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py index 16abbb60..00b8cd0d 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_attribute.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class CellAttribute(DataClassJsonMixin): +class CellName(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.json similarity index 90% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_scalar_range.json rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.json index 9efd4c4c..cbc408ae 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_scalar_range.json +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.json @@ -1,5 +1,5 @@ { - "rpc": "cell_scalar_range", + "rpc": "scalar_range", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_scalar_range.py rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/cells_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/cells_attribute_vertex_protocols.py new file mode 100644 index 00000000..773530d2 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/cells_attribute_vertex_protocols.py @@ -0,0 +1,54 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshCellsAttributeVertexView(VtkMeshView): + mesh_cells_prefix = "opengeodeweb_viewer.mesh.attribute.cells.vertex." + mesh_cells_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["name"]["rpc"]) + def setMeshCellsVertexAttribute(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_cells_schemas_dict["name"], + self.mesh_cells_prefix, + ) + params = schemas.Name.from_dict(rpc_params) + self.displayAttributeOnVertices(params.id, params.name) + + @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["scalar_range"]["rpc"]) + def setMeshCellsVertexScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_cells_schemas_dict["scalar_range"], + self.mesh_cells_prefix, + ) + params = schemas.ScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["color_map"]["rpc"]) + def setMeshCellsVertexColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_cells_schemas_dict["color_map"], + self.mesh_cells_prefix, + ) + params = schemas.ColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py new file mode 100644 index 00000000..638c51d7 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py @@ -0,0 +1,3 @@ +from .attribute import * +from .color_map import * +from .scalar_range import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.json similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.json rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.json b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.json new file mode 100644 index 00000000..f0924e71 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.json @@ -0,0 +1,19 @@ +{ + "rpc": "attribute", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_attribute.py rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.json similarity index 90% rename from src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_scalar_range.json rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.json index 68a8cabe..cbc408ae 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_scalar_range.json +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.json @@ -1,5 +1,5 @@ { - "rpc": "vertex_scalar_range", + "rpc": "scalar_range", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_scalar_range.py rename to src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/__init__.py index 1efaec4a..e983533c 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/__init__.py @@ -1,8 +1,2 @@ from .visibility import * -from .vertex_scalar_range import * -from .vertex_color_map import * -from .vertex_attribute import * from .color import * -from .cell_scalar_range import * -from .cell_color_map import * -from .cell_attribute import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/edges_attribute_edge_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/edges_attribute_edge_protocols.py new file mode 100644 index 00000000..1705812c --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/edges_attribute_edge_protocols.py @@ -0,0 +1,34 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshEdgesAttributeEdgeView(VtkMeshView): + mesh_edges_prefix = "opengeodeweb_viewer.mesh.edges." + mesh_edges_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["attribute"]["rpc"]) + def setMeshEdgesEdgeAttribute(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_edges_schemas_dict["attribute"], + self.mesh_edges_prefix, + ) + params = schemas.Attribute.from_dict(rpc_params) + self.displayAttributeOnCells(params.id, params.name) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py new file mode 100644 index 00000000..a563b254 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py @@ -0,0 +1 @@ +from .attribute import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/edge_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.json similarity index 90% rename from src/opengeodeweb_viewer/rpc/mesh/edges/schemas/edge_attribute.json rename to src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.json index db84d17f..ff982081 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/edge_attribute.json +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.json @@ -1,5 +1,5 @@ { - "rpc": "edge_attribute", + "rpc": "name", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/edge_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/edges/schemas/edge_attribute.py rename to src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/edges_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/edges_attribute_vertex_protocols.py new file mode 100644 index 00000000..5978e2c5 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/edges_attribute_vertex_protocols.py @@ -0,0 +1,54 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshEdgesAttributeVertexView(VtkMeshView): + mesh_edges_prefix = "opengeodeweb_viewer.mesh.edges." + mesh_edges_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["attribute"]["rpc"]) + def setMeshEdgesVertexAttribute(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_edges_schemas_dict["attribute"], + self.mesh_edges_prefix, + ) + params = schemas.Attribute.from_dict(rpc_params) + self.displayAttributeOnVertices(params.id, params.name) + + @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["scalar_range"]["rpc"]) + def setMeshEdgesVertexScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_edges_schemas_dict["scalar_range"], + self.mesh_edges_prefix, + ) + params = schemas.ScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["color_map"]["rpc"]) + def setMeshEdgesVertexColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_edges_schemas_dict["color_map"], + self.mesh_edges_prefix, + ) + params = schemas.ColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py new file mode 100644 index 00000000..716d67a4 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py @@ -0,0 +1,3 @@ +from .scalar_range import * +from .color_map import * +from .attribute import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.json similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.json rename to src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_color_map.py rename to src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.json similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_attribute.json rename to src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_attribute.py rename to src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.json new file mode 100644 index 00000000..cbc408ae --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.json @@ -0,0 +1,22 @@ +{ + "rpc": "scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false +} diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_scalar_range.py rename to src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/mesh_edges_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/edges/edges_protocols.py similarity index 50% rename from src/opengeodeweb_viewer/rpc/mesh/edges/mesh_edges_protocols.py rename to src/opengeodeweb_viewer/rpc/mesh/edges/edges_protocols.py index 9321f7bf..1f0f62cf 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/mesh_edges_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/edges_protocols.py @@ -49,45 +49,3 @@ def setMeshEdgesWidth(self, rpc_params: RpcParams) -> None: ) params = schemas.Width.from_dict(rpc_params) self.SetEdgesWidth(params.id, params.width) - - @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["vertex_attribute"]["rpc"]) - def setMeshEdgesVertexAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_edges_schemas_dict["vertex_attribute"], - self.mesh_edges_prefix, - ) - params = schemas.VertexAttribute.from_dict(rpc_params) - self.displayAttributeOnVertices(params.id, params.name) - - @exportRpc( - mesh_edges_prefix + mesh_edges_schemas_dict["vertex_scalar_range"]["rpc"] - ) - def setMeshEdgesVertexScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_edges_schemas_dict["vertex_scalar_range"], - self.mesh_edges_prefix, - ) - params = schemas.VertexScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["vertex_color_map"]["rpc"]) - def setMeshEdgesVertexColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_edges_schemas_dict["vertex_color_map"], - self.mesh_edges_prefix, - ) - params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) - - @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["edge_attribute"]["rpc"]) - def setMeshEdgesEdgeAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_edges_schemas_dict["edge_attribute"], - self.mesh_edges_prefix, - ) - params = schemas.EdgeAttribute.from_dict(rpc_params) - self.displayAttributeOnCells(params.id, params.name) diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/points_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/points_attribute_vertex_protocols.py new file mode 100644 index 00000000..66ef39ee --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/points_attribute_vertex_protocols.py @@ -0,0 +1,54 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshPointsView(VtkMeshView): + mesh_points_prefix = "opengeodeweb_viewer.mesh.points." + mesh_points_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc(mesh_points_prefix + mesh_points_schemas_dict["name"]["rpc"]) + def setMeshPointsVertexAttribute(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_points_schemas_dict["name"], + self.mesh_points_prefix, + ) + params = schemas.Name.from_dict(rpc_params) + self.displayAttributeOnVertices(params.id, params.name) + + @exportRpc(mesh_points_prefix + mesh_points_schemas_dict["scalar_range"]["rpc"]) + def setMeshPointsVertexScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_points_schemas_dict["scalar_range"], + self.mesh_points_prefix, + ) + params = schemas.ScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc(mesh_points_prefix + mesh_points_schemas_dict["color_map"]["rpc"]) + def setMeshPointsVertexColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_points_schemas_dict["color_map"], + self.mesh_points_prefix, + ) + params = schemas.ColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py new file mode 100644 index 00000000..716d67a4 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py @@ -0,0 +1,3 @@ +from .scalar_range import * +from .color_map import * +from .attribute import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.json b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.json new file mode 100644 index 00000000..f0924e71 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.json @@ -0,0 +1,19 @@ +{ + "rpc": "attribute", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.py b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.py new file mode 100644 index 00000000..9bbcb229 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.py @@ -0,0 +1,11 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass + + +@dataclass +class Attribute(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + name: str diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/color_map.json b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/color_map.json new file mode 100644 index 00000000..95737cc6 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/color_map.json @@ -0,0 +1,26 @@ +{ + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": ["id", "points", "minimum", "maximum"], + "additionalProperties": false +} diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/color_map.py new file mode 100644 index 00000000..7fbb9d2a --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/color_map.py @@ -0,0 +1,15 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass +from typing import List + + +@dataclass +class ColorMap(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + maximum: float + minimum: float + points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.json new file mode 100644 index 00000000..cbc408ae --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.json @@ -0,0 +1,22 @@ +{ + "rpc": "scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false +} diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.py new file mode 100644 index 00000000..69d2fae4 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.py @@ -0,0 +1,12 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass + + +@dataclass +class ScalarRange(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + maximum: float + minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/mesh_points_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/points/points_protocols.py similarity index 57% rename from src/opengeodeweb_viewer/rpc/mesh/points/mesh_points_protocols.py rename to src/opengeodeweb_viewer/rpc/mesh/points/points_protocols.py index 28a70c24..96b268f2 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/mesh_points_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/points_protocols.py @@ -49,35 +49,3 @@ def setMeshPointsSize(self, rpc_params: RpcParams) -> None: ) params = schemas.Size.from_dict(rpc_params) self.SetPointsSize(params.id, params.size) - - @exportRpc(mesh_points_prefix + mesh_points_schemas_dict["vertex_attribute"]["rpc"]) - def setMeshPointsVertexAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_points_schemas_dict["vertex_attribute"], - self.mesh_points_prefix, - ) - params = schemas.VertexAttribute.from_dict(rpc_params) - self.displayAttributeOnVertices(params.id, params.name) - - @exportRpc( - mesh_points_prefix + mesh_points_schemas_dict["vertex_scalar_range"]["rpc"] - ) - def setMeshPointsVertexScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_points_schemas_dict["vertex_scalar_range"], - self.mesh_points_prefix, - ) - params = schemas.VertexScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc(mesh_points_prefix + mesh_points_schemas_dict["vertex_color_map"]["rpc"]) - def setMeshPointsVertexColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_points_schemas_dict["vertex_color_map"], - self.mesh_points_prefix, - ) - params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_protocols.py new file mode 100644 index 00000000..8fd9ae25 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_protocols.py @@ -0,0 +1,54 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshPolygonsView(VtkMeshView): + mesh_polygons_prefix = "opengeodeweb_viewer.mesh.polygons." + mesh_polygons_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["name"]["rpc"]) + def setMeshPolygonsPolygonAttribute(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["name"], + self.mesh_polygons_prefix, + ) + params = schemas.PolygonName.from_dict(rpc_params) + self.displayAttributeOnCells(params.id, params.name) + + @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["scalar_range"]["rpc"]) + def setMeshPolygonsPolygonScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["scalar_range"], + self.mesh_polygons_prefix, + ) + params = schemas.PolygonScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["color_map"]["rpc"]) + def setMeshPolygonsPolygonColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["color_map"], + self.mesh_polygons_prefix, + ) + params = schemas.PolygonColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/__init__.py new file mode 100644 index 00000000..a3273df4 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/__init__.py @@ -0,0 +1,3 @@ +from .color_map import * +from .scalar_range import * +from .name import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.json new file mode 100644 index 00000000..95737cc6 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.json @@ -0,0 +1,26 @@ +{ + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": ["id", "points", "minimum", "maximum"], + "additionalProperties": false +} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py new file mode 100644 index 00000000..5841a9c8 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py @@ -0,0 +1,15 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass +from typing import List + + +@dataclass +class PolygonColorMap(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + maximum: float + minimum: float + points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.json new file mode 100644 index 00000000..ceedfa5a --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.json @@ -0,0 +1,19 @@ +{ + "rpc": "name", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py new file mode 100644 index 00000000..efb8a543 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py @@ -0,0 +1,11 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass + + +@dataclass +class PolygonName(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + name: str diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.json new file mode 100644 index 00000000..cbc408ae --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.json @@ -0,0 +1,22 @@ +{ + "rpc": "scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false +} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py new file mode 100644 index 00000000..c90a1489 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py @@ -0,0 +1,12 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass + + +@dataclass +class PolygonScalarRange(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + maximum: float + minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_protocols.py new file mode 100644 index 00000000..fa7932dc --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_protocols.py @@ -0,0 +1,117 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshPolygonsView(VtkMeshView): + mesh_polygons_prefix = "opengeodeweb_viewer.mesh.polygons." + mesh_polygons_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["visibility"]["rpc"]) + def setMeshPolygonsVisibility(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["visibility"], + self.mesh_polygons_prefix, + ) + params = schemas.Visibility.from_dict(rpc_params) + self.SetVisibility(params.id, params.visibility) + + @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["color"]["rpc"]) + def setMeshPolygonsColor(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["color"], + self.mesh_polygons_prefix, + ) + params = schemas.Color.from_dict(rpc_params) + color = params.color + self.SetColor(params.id, color.r, color.g, color.b) + + @exportRpc( + mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_attribute"]["rpc"] + ) + def setMeshPolygonsVertexAttribute(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["vertex_attribute"], + self.mesh_polygons_prefix, + ) + params = schemas.VertexAttribute.from_dict(rpc_params) + self.displayAttributeOnVertices(params.id, params.name) + + @exportRpc( + mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_attribute"]["rpc"] + ) + def setMeshPolygonsPolygonAttribute(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["polygon_attribute"], + self.mesh_polygons_prefix, + ) + params = schemas.PolygonAttribute.from_dict(rpc_params) + self.displayAttributeOnCells(params.id, params.name) + + @exportRpc( + mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"] + ) + def setMeshPolygonsVertexScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["vertex_scalar_range"], + self.mesh_polygons_prefix, + ) + params = schemas.VertexScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc( + mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"] + ) + def setMeshPolygonsPolygonScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["polygon_scalar_range"], + self.mesh_polygons_prefix, + ) + params = schemas.PolygonScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc( + mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_color_map"]["rpc"] + ) + def setMeshPolygonsVertexColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["vertex_color_map"], + self.mesh_polygons_prefix, + ) + params = schemas.VertexColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) + + @exportRpc( + mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_color_map"]["rpc"] + ) + def setMeshPolygonsPolygonColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_schemas_dict["polygon_color_map"], + self.mesh_polygons_prefix, + ) + params = schemas.PolygonColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py new file mode 100644 index 00000000..eb42b95d --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py @@ -0,0 +1,8 @@ +from .visibility import * +from .vertex_scalar_range import * +from .vertex_color_map import * +from .vertex_attribute import * +from .polygon_scalar_range import * +from .polygon_color_map import * +from .polygon_attribute import * +from .color import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.json new file mode 100644 index 00000000..b1c5e726 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.json @@ -0,0 +1,47 @@ +{ + "rpc": "color", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "color": { + "type": "object", + "properties": { + "r": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "g": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "b": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 1 + } + }, + "required": [ + "r", + "g", + "b" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "color" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.py new file mode 100644 index 00000000..01f0222c --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.py @@ -0,0 +1,23 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass +from typing import Optional + + +@dataclass +class ColorClass(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + b: int + g: int + r: int + a: Optional[float] = None + + +@dataclass +class Color(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + color: ColorClass + id: str diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.json new file mode 100644 index 00000000..e301d6ac --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.json @@ -0,0 +1,19 @@ +{ + "rpc": "polygon_attribute", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.py new file mode 100644 index 00000000..ebc20a6b --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.py @@ -0,0 +1,11 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass + + +@dataclass +class PolygonAttribute(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + name: str diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.json new file mode 100644 index 00000000..95737cc6 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.json @@ -0,0 +1,26 @@ +{ + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": ["id", "points", "minimum", "maximum"], + "additionalProperties": false +} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.py new file mode 100644 index 00000000..5841a9c8 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.py @@ -0,0 +1,15 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass +from typing import List + + +@dataclass +class PolygonColorMap(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + maximum: float + minimum: float + points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.json new file mode 100644 index 00000000..75c20f19 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.json @@ -0,0 +1,22 @@ +{ + "rpc": "polygon_scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false +} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.py new file mode 100644 index 00000000..c90a1489 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.py @@ -0,0 +1,12 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass + + +@dataclass +class PolygonScalarRange(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + maximum: float + minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.json similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/edges/schemas/vertex_attribute.json rename to src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.py new file mode 100644 index 00000000..64f7c2d0 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.py @@ -0,0 +1,11 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass + + +@dataclass +class VertexAttribute(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + name: str diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.json new file mode 100644 index 00000000..95737cc6 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.json @@ -0,0 +1,26 @@ +{ + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": ["id", "points", "minimum", "maximum"], + "additionalProperties": false +} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.py new file mode 100644 index 00000000..14239388 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.py @@ -0,0 +1,15 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass +from typing import List + + +@dataclass +class VertexColorMap(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + maximum: float + minimum: float + points: List[float] + """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.json similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_scalar_range.json rename to src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.py new file mode 100644 index 00000000..735ba2a4 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.py @@ -0,0 +1,12 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass + + +@dataclass +class VertexScalarRange(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + maximum: float + minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.json new file mode 100644 index 00000000..e699d92f --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.json @@ -0,0 +1,18 @@ +{ + "rpc": "visibility", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "visibility": { + "type": "boolean" + } + }, + "required": [ + "id", + "visibility" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.py new file mode 100644 index 00000000..56a629d8 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.py @@ -0,0 +1,11 @@ +from dataclasses_json import DataClassJsonMixin +from dataclasses import dataclass + + +@dataclass +class Visibility(DataClassJsonMixin): + def __post_init__(self) -> None: + print(self, flush=True) + + id: str + visibility: bool diff --git a/src/opengeodeweb_viewer/vtkw_server.py b/src/opengeodeweb_viewer/vtkw_server.py index f05b2ab6..e32debbf 100644 --- a/src/opengeodeweb_viewer/vtkw_server.py +++ b/src/opengeodeweb_viewer/vtkw_server.py @@ -17,9 +17,21 @@ from .vtk_protocol import VtkView, VtkTypingMixin from .rpc.viewer.viewer_protocols import VtkViewerView from .rpc.mesh.mesh_protocols import VtkMeshView -from .rpc.mesh.points.mesh_points_protocols import VtkMeshPointsView -from .rpc.mesh.edges.mesh_edges_protocols import VtkMeshEdgesView +from .rpc.mesh.points.points_protocols import VtkMeshPointsView +from .rpc.mesh.edges.edges_protocols import VtkMeshEdgesView from .rpc.mesh.cells.cells_protocols import VtkMeshCellsView +from .rpc.mesh.cells.attribute.vertex.cells_attribute_vertex_protocols import ( + VtkMeshCellsAttributeVertexView, +) +from .rpc.mesh.cells.attribute.cell.cells_attribute_cell_protocols import ( + VtkMeshCellsAttributeCellView, +) +from .rpc.mesh.edges.attribute.vertex.edges_attribute_vertex_protocols import ( + VtkMeshEdgesAttributeVertexView, +) +from .rpc.mesh.edges.attribute.edge.edges_attribute_edge_protocols import ( + VtkMeshEdgesAttributeEdgeView, +) from .rpc.mesh.polygons.polygons_protocols import VtkMeshPolygonsView from .rpc.mesh.polyhedra.polyhedra_protocols import VtkMeshPolyhedraView from .rpc.model.model_protocols import VtkModelView @@ -89,6 +101,10 @@ def initialize(self) -> None: self.registerVtkWebProtocol(VtkMeshPointsView()) self.registerVtkWebProtocol(VtkMeshEdgesView()) self.registerVtkWebProtocol(VtkMeshCellsView()) + self.registerVtkWebProtocol(VtkMeshCellsAttributeVertexView()) + self.registerVtkWebProtocol(VtkMeshCellsAttributeCellView()) + self.registerVtkWebProtocol(VtkMeshEdgesAttributeVertexView()) + self.registerVtkWebProtocol(VtkMeshEdgesAttributeEdgeView()) self.registerVtkWebProtocol(VtkMeshPolygonsView()) self.registerVtkWebProtocol(VtkMeshPolyhedraView()) self.registerVtkWebProtocol(model_protocols) diff --git a/tests/mesh/edges/test_mesh_edges_protocols.py b/tests/mesh/edges/test_mesh_edges_protocols.py index aa9862d9..0aa765af 100644 --- a/tests/mesh/edges/test_mesh_edges_protocols.py +++ b/tests/mesh/edges/test_mesh_edges_protocols.py @@ -3,7 +3,7 @@ # Third party imports from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView -from opengeodeweb_viewer.rpc.mesh.edges.mesh_edges_protocols import VtkMeshEdgesView +from opengeodeweb_viewer.rpc.mesh.edges.edges_protocols import VtkMeshEdgesView # Local application imports from tests.mesh.test_mesh_protocols import test_register_mesh diff --git a/tests/mesh/points/test_mesh_points_protocols.py b/tests/mesh/points/test_mesh_points_protocols.py index 74652c25..3ccf432d 100644 --- a/tests/mesh/points/test_mesh_points_protocols.py +++ b/tests/mesh/points/test_mesh_points_protocols.py @@ -3,7 +3,7 @@ # Third party imports from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView -from opengeodeweb_viewer.rpc.mesh.points.mesh_points_protocols import ( +from opengeodeweb_viewer.rpc.mesh.points.points_protocols import ( VtkMeshPointsView, ) From 04a8862136a3135d54bf4c03f4df8e31bc8a259a Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:17:24 +0000 Subject: [PATCH 19/27] Apply prepare changes --- opengeodeweb_viewer_schemas.json | 883 +++++++++++++----- .../cells/attribute/cell/schemas/__init__.py | 4 +- .../cells/attribute/cell/schemas/color_map.py | 2 +- .../mesh/cells/attribute/cell/schemas/name.py | 2 +- .../attribute/cell/schemas/scalar_range.py | 2 +- .../attribute/vertex/schemas/__init__.py | 4 +- .../attribute/vertex/schemas/color_map.py | 2 +- .../cells/attribute/vertex/schemas/name.py | 2 +- .../attribute/vertex/schemas/scalar_range.py | 2 +- .../edges/attribute/edge/schemas/__init__.py | 2 +- .../mesh/edges/attribute/edge/schemas/name.py | 2 +- .../attribute/vertex/schemas/__init__.py | 2 +- .../attribute/vertex/schemas/color_map.py | 2 +- .../edges/attribute/vertex/schemas/name.py | 2 +- .../attribute/vertex/schemas/scalar_range.py | 2 +- .../rpc/mesh/edges/schemas/__init__.py | 4 - .../attribute/polygon/schemas/__init__.py | 2 +- .../attribute/polygon/schemas/color_map.py | 2 +- .../attribute/polygon/schemas/name.py | 2 +- .../attribute/polygon/schemas/scalar_range.py | 2 +- 20 files changed, 656 insertions(+), 271 deletions(-) diff --git a/opengeodeweb_viewer_schemas.json b/opengeodeweb_viewer_schemas.json index e94ab924..22680231 100644 --- a/opengeodeweb_viewer_schemas.json +++ b/opengeodeweb_viewer_schemas.json @@ -34,97 +34,178 @@ }, "mesh": { "cells": { - "visibility": { - "$id": "opengeodeweb_viewer.mesh.cells.visibility", - "rpc": "visibility", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "visibility": { - "type": "boolean" - } - }, - "required": [ - "id", - "visibility" - ], - "additionalProperties": false - }, - "vertex_scalar_range": { - "$id": "opengeodeweb_viewer.mesh.cells.vertex_scalar_range", - "rpc": "vertex_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 + "attribute": { + "cell": { + "scalar_range": { + "$id": "opengeodeweb_viewer.mesh.cells.attribute.cell.scalar_range", + "rpc": "scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false }, - "minimum": { - "type": "number" + "name": { + "$id": "opengeodeweb_viewer.mesh.cells.attribute.cell.name", + "rpc": "name", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false }, - "maximum": { - "type": "number" + "color_map": { + "$id": "opengeodeweb_viewer.mesh.cells.attribute.cell.color_map", + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "points", + "minimum", + "maximum" + ], + "additionalProperties": false } }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "vertex_color_map": { - "$id": "opengeodeweb_viewer.mesh.cells.color_map", - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" + "vertex": { + "scalar_range": { + "$id": "opengeodeweb_viewer.mesh.cells.attribute.vertex.scalar_range", + "rpc": "scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } }, - "minItems": 8 + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false }, - "minimum": { - "type": "number" + "name": { + "$id": "opengeodeweb_viewer.mesh.cells.attribute.vertex.attribute", + "rpc": "attribute", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false }, - "maximum": { - "type": "number" + "color_map": { + "$id": "opengeodeweb_viewer.mesh.cells.attribute.vertex.color_map", + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "points", + "minimum", + "maximum" + ], + "additionalProperties": false } - }, - "required": [ - "id", - "points", - "minimum", - "maximum" - ], - "additionalProperties": false + } }, - "vertex_attribute": { - "$id": "opengeodeweb_viewer.mesh.cells.vertex_attribute", - "rpc": "vertex_attribute", + "visibility": { + "$id": "opengeodeweb_viewer.mesh.cells.visibility", + "rpc": "visibility", "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, - "name": { - "type": "string", - "minLength": 1 + "visibility": { + "type": "boolean" } }, "required": [ "id", - "name" + "visibility" ], "additionalProperties": false }, @@ -175,214 +256,145 @@ "color" ], "additionalProperties": false - }, - "cell_scalar_range": { - "$id": "opengeodeweb_viewer.mesh.cells.cell_scalar_range", - "rpc": "cell_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "cell_color_map": { - "$id": "opengeodeweb_viewer.mesh.cells.color_map", - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" - }, - "minItems": 8 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "points", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "cell_attribute": { - "$id": "opengeodeweb_viewer.mesh.cells.cell_attribute", - "rpc": "cell_attribute", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false } }, "edges": { - "width": { - "$id": "opengeodeweb_viewer.mesh.edges.width", - "rpc": "width", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "width": { - "type": "number" - } - }, - "required": [ - "id", - "width" - ], - "additionalProperties": false - }, - "visibility": { - "$id": "opengeodeweb_viewer.mesh.edges.visibility", - "rpc": "visibility", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "visibility": { - "type": "boolean" - } - }, - "required": [ - "id", - "visibility" - ], - "additionalProperties": false - }, - "vertex_scalar_range": { - "$id": "opengeodeweb_viewer.mesh.edges.vertex_scalar_range", - "rpc": "vertex_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" + "attribute": { + "edge": { + "name": { + "$id": "opengeodeweb_viewer.mesh.edges.attribute.edge.name", + "rpc": "name", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false } }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "vertex_color_map": { - "$id": "opengeodeweb_viewer.mesh.edges.color_map", - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" + "vertex": { + "scalar_range": { + "$id": "opengeodeweb_viewer.mesh.edges.attribute.vertex.scalar_range", + "rpc": "scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } }, - "minItems": 8 + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false }, - "minimum": { - "type": "number" + "name": { + "$id": "opengeodeweb_viewer.mesh.edges.attribute.vertex.vertex_attribute", + "rpc": "vertex_attribute", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false }, - "maximum": { - "type": "number" + "color_map": { + "$id": "opengeodeweb_viewer.mesh.edges.attribute.vertex.color_map", + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "points", + "minimum", + "maximum" + ], + "additionalProperties": false } - }, - "required": [ - "id", - "points", - "minimum", - "maximum" - ], - "additionalProperties": false + } }, - "vertex_attribute": { - "$id": "opengeodeweb_viewer.mesh.edges.vertex_attribute", - "rpc": "vertex_attribute", + "width": { + "$id": "opengeodeweb_viewer.mesh.edges.width", + "rpc": "width", "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, - "name": { - "type": "string", - "minLength": 1 + "width": { + "type": "number" } }, "required": [ "id", - "name" + "width" ], "additionalProperties": false }, - "edge_attribute": { - "$id": "opengeodeweb_viewer.mesh.edges.edge_attribute", - "rpc": "edge_attribute", + "visibility": { + "$id": "opengeodeweb_viewer.mesh.edges.visibility", + "rpc": "visibility", "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, - "name": { - "type": "string", - "minLength": 1 + "visibility": { + "type": "boolean" } }, "required": [ "id", - "name" + "visibility" ], "additionalProperties": false }, @@ -436,6 +448,85 @@ } }, "points": { + "attribute": { + "vertex": { + "scalar_range": { + "$id": "opengeodeweb_viewer.mesh.points.attribute.vertex.scalar_range", + "rpc": "scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false + }, + "color_map": { + "$id": "opengeodeweb_viewer.mesh.points.attribute.vertex.color_map", + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "points", + "minimum", + "maximum" + ], + "additionalProperties": false + }, + "attribute": { + "$id": "opengeodeweb_viewer.mesh.points.attribute.vertex.attribute", + "rpc": "attribute", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + } + } + }, "visibility": { "$id": "opengeodeweb_viewer.mesh.points.visibility", "rpc": "visibility", @@ -599,6 +690,304 @@ } }, "polygons": { + "attribute": { + "polygon": { + "scalar_range": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.polygon.scalar_range", + "rpc": "scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false + }, + "name": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.polygon.name", + "rpc": "name", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + }, + "color_map": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.polygon.color_map", + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "points", + "minimum", + "maximum" + ], + "additionalProperties": false + } + }, + "vertex": { + "visibility": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.visibility", + "rpc": "visibility", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "visibility": { + "type": "boolean" + } + }, + "required": [ + "id", + "visibility" + ], + "additionalProperties": false + }, + "vertex_scalar_range": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.vertex_scalar_range", + "rpc": "vertex_scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false + }, + "vertex_color_map": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.color_map", + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "points", + "minimum", + "maximum" + ], + "additionalProperties": false + }, + "vertex_attribute": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.vertex_attribute", + "rpc": "vertex_attribute", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + }, + "polygon_scalar_range": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.polygon_scalar_range", + "rpc": "polygon_scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false + }, + "polygon_color_map": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.color_map", + "rpc": "color_map", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" + }, + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "points", + "minimum", + "maximum" + ], + "additionalProperties": false + }, + "polygon_attribute": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.polygon_attribute", + "rpc": "polygon_attribute", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + }, + "color": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.color", + "rpc": "color", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "color": { + "type": "object", + "properties": { + "r": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "g": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "b": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 1 + } + }, + "required": [ + "r", + "g", + "b" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "color" + ], + "additionalProperties": false + } + } + }, "visibility": { "$id": "opengeodeweb_viewer.mesh.polygons.visibility", "rpc": "visibility", diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py index 638c51d7..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py @@ -1,3 +1,3 @@ -from .attribute import * -from .color_map import * from .scalar_range import * +from .name import * +from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py index 609e883a..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class CellColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py index 00b8cd0d..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class CellName(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py index 50137623..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class CellScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py index 638c51d7..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py @@ -1,3 +1,3 @@ -from .attribute import * -from .color_map import * from .scalar_range import * +from .name import * +from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py index 14239388..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class VertexColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py index 64f7c2d0..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class VertexAttribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py index 735ba2a4..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class VertexScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py index a563b254..1faac9b8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py @@ -1 +1 @@ -from .attribute import * +from .name import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py index 083f05d1..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class EdgeAttribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py index 716d67a4..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py @@ -1,3 +1,3 @@ from .scalar_range import * +from .name import * from .color_map import * -from .attribute import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py index 14239388..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class VertexColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py index 64f7c2d0..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class VertexAttribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py index 735ba2a4..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class VertexScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/__init__.py index f6433c75..cfe6b7ea 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/schemas/__init__.py @@ -1,7 +1,3 @@ from .width import * from .visibility import * -from .vertex_scalar_range import * -from .vertex_color_map import * -from .vertex_attribute import * -from .edge_attribute import * from .color import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/__init__.py index a3273df4..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/__init__.py @@ -1,3 +1,3 @@ -from .color_map import * from .scalar_range import * from .name import * +from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py index 5841a9c8..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class PolygonColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py index efb8a543..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class PolygonName(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py index c90a1489..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class PolygonScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) From 66ad44c2cd93c1476644c0be7bef6ec7351abf24 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 4 Feb 2026 10:13:14 +0100 Subject: [PATCH 20/27] new architecture for attributes --- .../cell/cells_attribute_cell_protocols.py | 31 +++-- .../cells/attribute/cell/schemas/__init__.py | 2 +- .../cells/attribute/cell/schemas/color_map.py | 2 +- .../mesh/cells/attribute/cell/schemas/name.py | 2 +- .../attribute/cell/schemas/scalar_range.py | 2 +- .../cells_attribute_vertex_protocols.py | 35 ++++-- .../attribute/vertex/schemas/__init__.py | 2 +- .../attribute/vertex/schemas/color_map.py | 2 +- .../cells/attribute/vertex/schemas/name.json | 2 +- .../cells/attribute/vertex/schemas/name.py | 2 +- .../attribute/vertex/schemas/scalar_range.py | 2 +- .../edge/edges_attribute_edge_protocols.py | 17 +-- .../edges/attribute/edge/schemas/__init__.py | 2 +- .../mesh/edges/attribute/edge/schemas/name.py | 2 +- .../edges_attribute_vertex_protocols.py | 37 ++++-- .../attribute/vertex/schemas/__init__.py | 4 +- .../attribute/vertex/schemas/color_map.py | 2 +- .../edges/attribute/vertex/schemas/name.json | 2 +- .../edges/attribute/vertex/schemas/name.py | 2 +- .../attribute/vertex/schemas/scalar_range.py | 2 +- .../points_attribute_vertex_protocols.py | 37 ++++-- .../attribute/vertex/schemas/__init__.py | 4 +- .../schemas/{attribute.json => name.json} | 2 +- .../vertex/schemas/{attribute.py => name.py} | 2 +- .../polygons_attribute_polygon_protocols.py | 65 ++++++++++ .../attribute/polygon/polygons_protocols.py | 54 -------- .../attribute/polygon/schemas/color_map.py | 2 +- .../attribute/polygon/schemas/name.py | 2 +- .../attribute/polygon/schemas/scalar_range.py | 2 +- .../polygons_attribute_vertex_protocols.py | 65 ++++++++++ .../attribute/vertex/polygons_protocols.py | 117 ------------------ .../attribute/vertex/schemas/__init__.py | 11 +- .../attribute/vertex/schemas/color.json | 47 ------- .../attribute/vertex/schemas/color.py | 23 ---- ...{polygon_color_map.json => color_map.json} | 0 .../attribute/vertex/schemas/color_map.py} | 2 +- .../vertex/schemas/name.json} | 2 +- .../vertex/schemas/name.py} | 2 +- .../vertex/schemas/polygon_attribute.json | 19 --- .../vertex/schemas/polygon_attribute.py | 11 -- .../vertex/schemas/polygon_color_map.py | 15 --- .../vertex/schemas/polygon_scalar_range.json | 22 ---- .../vertex/schemas/polygon_scalar_range.py | 12 -- ...ex_scalar_range.json => scalar_range.json} | 2 +- .../attribute/vertex/schemas/scalar_range.py} | 2 +- .../attribute/vertex/schemas/visibility.json | 18 --- .../attribute/vertex/schemas/visibility.py | 11 -- .../rpc/mesh/polygons/polygons_protocols.py | 72 ----------- .../polygons/schemas/polygon_attribute.json | 19 --- .../polygons/schemas/polygon_attribute.py | 11 -- .../polygons/schemas/polygon_color_map.py | 15 --- .../schemas/polygon_scalar_range.json | 22 ---- .../polygons/schemas/polygon_scalar_range.py | 12 -- .../polygons/schemas/vertex_color_map.json | 26 ---- ...olyhedra_attribute_polyhedron_protocols.py | 65 ++++++++++ .../attribute/polyhedron/schemas/__init__.py | 3 + .../polyhedron/schemas/color_map.json} | 0 .../polyhedron/schemas/color_map.py} | 2 +- .../polyhedron/schemas/name.json} | 2 +- .../polyhedron/schemas/name.py} | 2 +- .../polyhedron/schemas/scalar_range.json} | 2 +- .../polyhedron/schemas/scalar_range.py} | 2 +- .../polyhedra_attribute_vertex_protocols.py | 65 ++++++++++ .../attribute/vertex/schemas/__init__.py | 3 + .../attribute/vertex/schemas/color_map.json} | 0 .../attribute/vertex/schemas/color_map.py} | 2 +- .../attribute/vertex/schemas/name.json} | 2 +- .../attribute/vertex/schemas/name.py} | 2 +- .../vertex/schemas/scalar_range.json} | 2 +- .../attribute/vertex/schemas/scalar_range.py} | 2 +- .../rpc/mesh/polyhedra/polyhedra_protocols.py | 76 ------------ .../schemas/polyhedra_color_map.json | 26 ---- .../polyhedra/schemas/polyhedra_color_map.py | 15 --- .../schemas/polyhedron_attribute.json | 19 --- .../polyhedra/schemas/polyhedron_attribute.py | 11 -- .../schemas/polyhedron_scalar_range.json | 22 ---- .../schemas/polyhedron_scalar_range.py | 12 -- .../polyhedra/schemas/vertex_color_map.json | 26 ---- src/opengeodeweb_viewer/vtkw_server.py | 34 +++-- 79 files changed, 436 insertions(+), 843 deletions(-) rename src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/{attribute.json => name.json} (91%) rename src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/{attribute.py => name.py} (83%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_attribute_polygon_protocols.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_attribute_vertex_protocols.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_protocols.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.json delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.py rename src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/{polygon_color_map.json => color_map.json} (100%) rename src/opengeodeweb_viewer/rpc/mesh/{polyhedra/schemas/vertex_color_map.py => polygons/attribute/vertex/schemas/color_map.py} (88%) rename src/opengeodeweb_viewer/rpc/mesh/polygons/{schemas/vertex_attribute.json => attribute/vertex/schemas/name.json} (89%) rename src/opengeodeweb_viewer/rpc/mesh/polygons/{schemas/vertex_attribute.py => attribute/vertex/schemas/name.py} (81%) delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.json delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.json delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.py rename src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/{vertex_scalar_range.json => scalar_range.json} (90%) rename src/opengeodeweb_viewer/rpc/mesh/{polyhedra/schemas/vertex_scalar_range.py => polygons/attribute/vertex/schemas/scalar_range.py} (82%) delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.json delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_attribute.json delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_attribute.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_scalar_range.json delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_scalar_range.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/polyhedra_attribute_polyhedron_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/__init__.py rename src/opengeodeweb_viewer/rpc/mesh/{polygons/attribute/vertex/schemas/vertex_color_map.json => polyhedra/attribute/polyhedron/schemas/color_map.json} (100%) rename src/opengeodeweb_viewer/rpc/mesh/{polygons/attribute/vertex/schemas/vertex_color_map.py => polyhedra/attribute/polyhedron/schemas/color_map.py} (88%) rename src/opengeodeweb_viewer/rpc/mesh/polyhedra/{schemas/vertex_attribute.json => attribute/polyhedron/schemas/name.json} (89%) rename src/opengeodeweb_viewer/rpc/mesh/polyhedra/{schemas/vertex_attribute.py => attribute/polyhedron/schemas/name.py} (81%) rename src/opengeodeweb_viewer/rpc/mesh/polyhedra/{schemas/vertex_scalar_range.json => attribute/polyhedron/schemas/scalar_range.json} (90%) rename src/opengeodeweb_viewer/rpc/mesh/{polygons/attribute/vertex/schemas/vertex_scalar_range.py => polyhedra/attribute/polyhedron/schemas/scalar_range.py} (82%) create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/polyhedra_attribute_vertex_protocols.py create mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/__init__.py rename src/opengeodeweb_viewer/rpc/mesh/{polygons/schemas/polygon_color_map.json => polyhedra/attribute/vertex/schemas/color_map.json} (100%) rename src/opengeodeweb_viewer/rpc/mesh/{polygons/schemas/vertex_color_map.py => polyhedra/attribute/vertex/schemas/color_map.py} (88%) rename src/opengeodeweb_viewer/rpc/mesh/{polygons/attribute/vertex/schemas/vertex_attribute.json => polyhedra/attribute/vertex/schemas/name.json} (89%) rename src/opengeodeweb_viewer/rpc/mesh/{polygons/attribute/vertex/schemas/vertex_attribute.py => polyhedra/attribute/vertex/schemas/name.py} (81%) rename src/opengeodeweb_viewer/rpc/mesh/{polygons/schemas/vertex_scalar_range.json => polyhedra/attribute/vertex/schemas/scalar_range.json} (90%) rename src/opengeodeweb_viewer/rpc/mesh/{polygons/schemas/vertex_scalar_range.py => polyhedra/attribute/vertex/schemas/scalar_range.py} (82%) delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_attribute.json delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_attribute.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_scalar_range.json delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_scalar_range.py delete mode 100644 src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/cells_attribute_cell_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/cells_attribute_cell_protocols.py index 942ba205..6be9bc8c 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/cells_attribute_cell_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/cells_attribute_cell_protocols.py @@ -15,40 +15,49 @@ class VtkMeshCellsAttributeCellView(VtkMeshView): - mesh_cells_prefix = "opengeodeweb_viewer.mesh.attribute.cells.cell." - mesh_cells_schemas_dict = get_schemas_dict( + mesh_cells_attribute_cell_prefix = "opengeodeweb_viewer.mesh.cells.attribute.cell." + mesh_cells_attribute_cell_schemas_dict = get_schemas_dict( os.path.join(os.path.dirname(__file__), "schemas") ) def __init__(self) -> None: super().__init__() - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["name"]["rpc"]) + @exportRpc( + mesh_cells_attribute_cell_prefix + + mesh_cells_attribute_cell_schemas_dict["name"]["rpc"] + ) def setMeshCellsCellAttribute(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_cells_schemas_dict["name"], - self.mesh_cells_prefix, + self.mesh_cells_attribute_cell_schemas_dict["name"], + self.mesh_cells_attribute_cell_prefix, ) params = schemas.Name.from_dict(rpc_params) self.displayAttributeOnCells(params.id, params.name) - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["scalar_range"]["rpc"]) + @exportRpc( + mesh_cells_attribute_cell_prefix + + mesh_cells_attribute_cell_schemas_dict["scalar_range"]["rpc"] + ) def setMeshCellsCellScalarRange(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_cells_schemas_dict["scalar_range"], - self.mesh_cells_prefix, + self.mesh_cells_attribute_cell_schemas_dict["scalar_range"], + self.mesh_cells_attribute_cell_prefix, ) params = schemas.ScalarRange.from_dict(rpc_params) self.displayScalarRange(params.id, params.minimum, params.maximum) - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["color_map"]["rpc"]) + @exportRpc( + mesh_cells_attribute_cell_prefix + + mesh_cells_attribute_cell_schemas_dict["color_map"]["rpc"] + ) def setMeshCellsCellColorMap(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_cells_schemas_dict["color_map"], - self.mesh_cells_prefix, + self.mesh_cells_attribute_cell_schemas_dict["color_map"], + self.mesh_cells_attribute_cell_prefix, ) params = schemas.ColorMap.from_dict(rpc_params) self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py index 638c51d7..1a24ca7b 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py @@ -1,3 +1,3 @@ -from .attribute import * +from .name import * from .color_map import * from .scalar_range import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py index 609e883a..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class CellColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py index 00b8cd0d..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class CellName(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py index 50137623..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class CellScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/cells_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/cells_attribute_vertex_protocols.py index 773530d2..9388bcb1 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/cells_attribute_vertex_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/cells_attribute_vertex_protocols.py @@ -15,40 +15,51 @@ class VtkMeshCellsAttributeVertexView(VtkMeshView): - mesh_cells_prefix = "opengeodeweb_viewer.mesh.attribute.cells.vertex." - mesh_cells_schemas_dict = get_schemas_dict( + mesh_cells_attribute_vertex_prefix = ( + "opengeodeweb_viewer.mesh.cells.attribute.vertex." + ) + mesh_cells_attribute_vertex_schemas_dict = get_schemas_dict( os.path.join(os.path.dirname(__file__), "schemas") ) def __init__(self) -> None: super().__init__() - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["name"]["rpc"]) - def setMeshCellsVertexAttribute(self, rpc_params: RpcParams) -> None: + @exportRpc( + mesh_cells_attribute_vertex_prefix + + mesh_cells_attribute_vertex_schemas_dict["name"]["rpc"] + ) + def setMeshCellsVertexName(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_cells_schemas_dict["name"], - self.mesh_cells_prefix, + self.mesh_cells_attribute_vertex_schemas_dict["name"], + self.mesh_cells_attribute_vertex_prefix, ) params = schemas.Name.from_dict(rpc_params) self.displayAttributeOnVertices(params.id, params.name) - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["scalar_range"]["rpc"]) + @exportRpc( + mesh_cells_attribute_vertex_prefix + + mesh_cells_attribute_vertex_schemas_dict["scalar_range"]["rpc"] + ) def setMeshCellsVertexScalarRange(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_cells_schemas_dict["scalar_range"], - self.mesh_cells_prefix, + self.mesh_cells_attribute_vertex_schemas_dict["scalar_range"], + self.mesh_cells_attribute_vertex_prefix, ) params = schemas.ScalarRange.from_dict(rpc_params) self.displayScalarRange(params.id, params.minimum, params.maximum) - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["color_map"]["rpc"]) + @exportRpc( + mesh_cells_attribute_vertex_prefix + + mesh_cells_attribute_vertex_schemas_dict["color_map"]["rpc"] + ) def setMeshCellsVertexColorMap(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_cells_schemas_dict["color_map"], - self.mesh_cells_prefix, + self.mesh_cells_attribute_vertex_schemas_dict["color_map"], + self.mesh_cells_attribute_vertex_prefix, ) params = schemas.ColorMap.from_dict(rpc_params) self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py index 638c51d7..1a24ca7b 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py @@ -1,3 +1,3 @@ -from .attribute import * +from .name import * from .color_map import * from .scalar_range import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py index 14239388..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class VertexColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.json b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.json index f0924e71..ceedfa5a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.json +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.json @@ -1,5 +1,5 @@ { - "rpc": "attribute", + "rpc": "name", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py index 64f7c2d0..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class VertexAttribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py index 735ba2a4..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class VertexScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/edges_attribute_edge_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/edges_attribute_edge_protocols.py index 1705812c..30c3ccfc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/edges_attribute_edge_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/edges_attribute_edge_protocols.py @@ -15,20 +15,23 @@ class VtkMeshEdgesAttributeEdgeView(VtkMeshView): - mesh_edges_prefix = "opengeodeweb_viewer.mesh.edges." - mesh_edges_schemas_dict = get_schemas_dict( + mesh_edges_attribute_edge_prefix = "opengeodeweb_viewer.mesh.edges.attribute.edge." + mesh_edges_attribute_edge_schemas_dict = get_schemas_dict( os.path.join(os.path.dirname(__file__), "schemas") ) def __init__(self) -> None: super().__init__() - @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["attribute"]["rpc"]) - def setMeshEdgesEdgeAttribute(self, rpc_params: RpcParams) -> None: + @exportRpc( + mesh_edges_attribute_edge_prefix + + mesh_edges_attribute_edge_schemas_dict["name"]["rpc"] + ) + def setMeshEdgesEdgeName(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_edges_schemas_dict["attribute"], - self.mesh_edges_prefix, + self.mesh_edges_attribute_edge_schemas_dict["name"], + self.mesh_edges_attribute_edge_prefix, ) - params = schemas.Attribute.from_dict(rpc_params) + params = schemas.Name.from_dict(rpc_params) self.displayAttributeOnCells(params.id, params.name) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py index a563b254..1faac9b8 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/__init__.py @@ -1 +1 @@ -from .attribute import * +from .name import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py index 083f05d1..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/edge/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class EdgeAttribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/edges_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/edges_attribute_vertex_protocols.py index 5978e2c5..f633eb46 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/edges_attribute_vertex_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/edges_attribute_vertex_protocols.py @@ -15,40 +15,51 @@ class VtkMeshEdgesAttributeVertexView(VtkMeshView): - mesh_edges_prefix = "opengeodeweb_viewer.mesh.edges." - mesh_edges_schemas_dict = get_schemas_dict( + mesh_edges_attribute_vertex_prefix = ( + "opengeodeweb_viewer.mesh.edges.attribute.vertex." + ) + mesh_edges_attribute_vertex_schemas_dict = get_schemas_dict( os.path.join(os.path.dirname(__file__), "schemas") ) def __init__(self) -> None: super().__init__() - @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["attribute"]["rpc"]) - def setMeshEdgesVertexAttribute(self, rpc_params: RpcParams) -> None: + @exportRpc( + mesh_edges_attribute_vertex_prefix + + mesh_edges_attribute_vertex_schemas_dict["name"]["rpc"] + ) + def setMeshEdgesVertexName(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_edges_schemas_dict["attribute"], - self.mesh_edges_prefix, + self.mesh_edges_attribute_vertex_schemas_dict["name"], + self.mesh_edges_attribute_vertex_prefix, ) - params = schemas.Attribute.from_dict(rpc_params) + params = schemas.Name.from_dict(rpc_params) self.displayAttributeOnVertices(params.id, params.name) - @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["scalar_range"]["rpc"]) + @exportRpc( + mesh_edges_attribute_vertex_prefix + + mesh_edges_attribute_vertex_schemas_dict["scalar_range"]["rpc"] + ) def setMeshEdgesVertexScalarRange(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_edges_schemas_dict["scalar_range"], - self.mesh_edges_prefix, + self.mesh_edges_attribute_vertex_schemas_dict["scalar_range"], + self.mesh_edges_attribute_vertex_prefix, ) params = schemas.ScalarRange.from_dict(rpc_params) self.displayScalarRange(params.id, params.minimum, params.maximum) - @exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["color_map"]["rpc"]) + @exportRpc( + mesh_edges_attribute_vertex_prefix + + mesh_edges_attribute_vertex_schemas_dict["color_map"]["rpc"] + ) def setMeshEdgesVertexColorMap(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_edges_schemas_dict["color_map"], - self.mesh_edges_prefix, + self.mesh_edges_attribute_vertex_schemas_dict["color_map"], + self.mesh_edges_attribute_vertex_prefix, ) params = schemas.ColorMap.from_dict(rpc_params) self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py index 716d67a4..1a24ca7b 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py @@ -1,3 +1,3 @@ -from .scalar_range import * +from .name import * from .color_map import * -from .attribute import * +from .scalar_range import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py index 14239388..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class VertexColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.json b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.json index 9eb5de68..ceedfa5a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.json +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.json @@ -1,5 +1,5 @@ { - "rpc": "vertex_attribute", + "rpc": "name", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py index 64f7c2d0..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class VertexAttribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py index 735ba2a4..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class VertexScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/points_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/points_attribute_vertex_protocols.py index 66ef39ee..1db3ce7a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/points_attribute_vertex_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/points_attribute_vertex_protocols.py @@ -14,41 +14,52 @@ from . import schemas -class VtkMeshPointsView(VtkMeshView): - mesh_points_prefix = "opengeodeweb_viewer.mesh.points." - mesh_points_schemas_dict = get_schemas_dict( +class VtkMeshPointsAttributeVertexView(VtkMeshView): + mesh_points_attribute_vertex_prefix = ( + "opengeodeweb_viewer.mesh.points.attribute.vertex." + ) + mesh_points_attribute_vertex_schemas_dict = get_schemas_dict( os.path.join(os.path.dirname(__file__), "schemas") ) def __init__(self) -> None: super().__init__() - @exportRpc(mesh_points_prefix + mesh_points_schemas_dict["name"]["rpc"]) - def setMeshPointsVertexAttribute(self, rpc_params: RpcParams) -> None: + @exportRpc( + mesh_points_attribute_vertex_prefix + + mesh_points_attribute_vertex_schemas_dict["name"]["rpc"] + ) + def setMeshPointsVertexName(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_points_schemas_dict["name"], - self.mesh_points_prefix, + self.mesh_points_attribute_vertex_schemas_dict["name"], + self.mesh_points_attribute_vertex_prefix, ) params = schemas.Name.from_dict(rpc_params) self.displayAttributeOnVertices(params.id, params.name) - @exportRpc(mesh_points_prefix + mesh_points_schemas_dict["scalar_range"]["rpc"]) + @exportRpc( + mesh_points_attribute_vertex_prefix + + mesh_points_attribute_vertex_schemas_dict["scalar_range"]["rpc"] + ) def setMeshPointsVertexScalarRange(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_points_schemas_dict["scalar_range"], - self.mesh_points_prefix, + self.mesh_points_attribute_vertex_schemas_dict["scalar_range"], + self.mesh_points_attribute_vertex_prefix, ) params = schemas.ScalarRange.from_dict(rpc_params) self.displayScalarRange(params.id, params.minimum, params.maximum) - @exportRpc(mesh_points_prefix + mesh_points_schemas_dict["color_map"]["rpc"]) + @exportRpc( + mesh_points_attribute_vertex_prefix + + mesh_points_attribute_vertex_schemas_dict["color_map"]["rpc"] + ) def setMeshPointsVertexColorMap(self, rpc_params: RpcParams) -> None: validate_schema( rpc_params, - self.mesh_points_schemas_dict["color_map"], - self.mesh_points_prefix, + self.mesh_points_attribute_vertex_schemas_dict["color_map"], + self.mesh_points_attribute_vertex_prefix, ) params = schemas.ColorMap.from_dict(rpc_params) self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py index 716d67a4..1a24ca7b 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py @@ -1,3 +1,3 @@ -from .scalar_range import * +from .name import * from .color_map import * -from .attribute import * +from .scalar_range import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.json b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/name.json similarity index 91% rename from src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.json rename to src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/name.json index f0924e71..ceedfa5a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.json +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/name.json @@ -1,5 +1,5 @@ { - "rpc": "attribute", + "rpc": "name", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.py b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/name.py similarity index 83% rename from src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.py rename to src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/name.py index 9bbcb229..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/attribute.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class Attribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_attribute_polygon_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_attribute_polygon_protocols.py new file mode 100644 index 00000000..df33dfae --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_attribute_polygon_protocols.py @@ -0,0 +1,65 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshPolygonsAttributePolygonView(VtkMeshView): + mesh_polygons_attribute_polygon_prefix = ( + "opengeodeweb_viewer.mesh.polygons.attribute.polygon." + ) + mesh_polygons_attribute_polygon_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc( + mesh_polygons_attribute_polygon_prefix + + mesh_polygons_attribute_polygon_schemas_dict["name"]["rpc"] + ) + def setMeshPolygonsPolygonAttribute(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_attribute_polygon_schemas_dict["name"], + self.mesh_polygons_attribute_polygon_prefix, + ) + params = schemas.Name.from_dict(rpc_params) + self.displayAttributeOnCells(params.id, params.name) + + @exportRpc( + mesh_polygons_attribute_polygon_prefix + + mesh_polygons_attribute_polygon_schemas_dict["scalar_range"]["rpc"] + ) + def setMeshPolygonsPolygonScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_attribute_polygon_schemas_dict["scalar_range"], + self.mesh_polygons_attribute_polygon_prefix, + ) + params = schemas.ScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc( + mesh_polygons_attribute_polygon_prefix + + mesh_polygons_attribute_polygon_schemas_dict["color_map"]["rpc"] + ) + def setMeshPolygonsPolygonColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_attribute_polygon_schemas_dict["color_map"], + self.mesh_polygons_attribute_polygon_prefix, + ) + params = schemas.ColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_protocols.py deleted file mode 100644 index 8fd9ae25..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_protocols.py +++ /dev/null @@ -1,54 +0,0 @@ -# Standard library imports -import os - -# Third party imports -from wslink import register as exportRpc # type: ignore -from opengeodeweb_microservice.schemas import get_schemas_dict - -# Local application imports -from opengeodeweb_viewer.utils_functions import ( - validate_schema, - RpcParams, -) -from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView -from . import schemas - - -class VtkMeshPolygonsView(VtkMeshView): - mesh_polygons_prefix = "opengeodeweb_viewer.mesh.polygons." - mesh_polygons_schemas_dict = get_schemas_dict( - os.path.join(os.path.dirname(__file__), "schemas") - ) - - def __init__(self) -> None: - super().__init__() - - @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["name"]["rpc"]) - def setMeshPolygonsPolygonAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["name"], - self.mesh_polygons_prefix, - ) - params = schemas.PolygonName.from_dict(rpc_params) - self.displayAttributeOnCells(params.id, params.name) - - @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["scalar_range"]["rpc"]) - def setMeshPolygonsPolygonScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["scalar_range"], - self.mesh_polygons_prefix, - ) - params = schemas.PolygonScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["color_map"]["rpc"]) - def setMeshPolygonsPolygonColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["color_map"], - self.mesh_polygons_prefix, - ) - params = schemas.PolygonColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py index 5841a9c8..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class PolygonColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py index efb8a543..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class PolygonName(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py index c90a1489..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class PolygonScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_attribute_vertex_protocols.py new file mode 100644 index 00000000..6892a3da --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_attribute_vertex_protocols.py @@ -0,0 +1,65 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshPolygonsAttributeVertexView(VtkMeshView): + mesh_polygons_attribute_vertex_prefix = ( + "opengeodeweb_viewer.mesh.polygons.attribute.vertex." + ) + mesh_polygons_attribute_vertex_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc( + mesh_polygons_attribute_vertex_prefix + + mesh_polygons_attribute_vertex_schemas_dict["name"]["rpc"] + ) + def setMeshPolygonsVertexName(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_attribute_vertex_schemas_dict["name"], + self.mesh_polygons_attribute_vertex_prefix, + ) + params = schemas.Name.from_dict(rpc_params) + self.displayAttributeOnVertices(params.id, params.name) + + @exportRpc( + mesh_polygons_attribute_vertex_prefix + + mesh_polygons_attribute_vertex_schemas_dict["scalar_range"]["rpc"] + ) + def setMeshPolygonsVertexScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_attribute_vertex_schemas_dict["scalar_range"], + self.mesh_polygons_attribute_vertex_prefix, + ) + params = schemas.ScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc( + mesh_polygons_attribute_vertex_prefix + + mesh_polygons_attribute_vertex_schemas_dict["color_map"]["rpc"] + ) + def setMeshPolygonsVertexColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polygons_attribute_vertex_schemas_dict["color_map"], + self.mesh_polygons_attribute_vertex_prefix, + ) + params = schemas.ColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_protocols.py deleted file mode 100644 index fa7932dc..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_protocols.py +++ /dev/null @@ -1,117 +0,0 @@ -# Standard library imports -import os - -# Third party imports -from wslink import register as exportRpc # type: ignore -from opengeodeweb_microservice.schemas import get_schemas_dict - -# Local application imports -from opengeodeweb_viewer.utils_functions import ( - validate_schema, - RpcParams, -) -from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView -from . import schemas - - -class VtkMeshPolygonsView(VtkMeshView): - mesh_polygons_prefix = "opengeodeweb_viewer.mesh.polygons." - mesh_polygons_schemas_dict = get_schemas_dict( - os.path.join(os.path.dirname(__file__), "schemas") - ) - - def __init__(self) -> None: - super().__init__() - - @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["visibility"]["rpc"]) - def setMeshPolygonsVisibility(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["visibility"], - self.mesh_polygons_prefix, - ) - params = schemas.Visibility.from_dict(rpc_params) - self.SetVisibility(params.id, params.visibility) - - @exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["color"]["rpc"]) - def setMeshPolygonsColor(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["color"], - self.mesh_polygons_prefix, - ) - params = schemas.Color.from_dict(rpc_params) - color = params.color - self.SetColor(params.id, color.r, color.g, color.b) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_attribute"]["rpc"] - ) - def setMeshPolygonsVertexAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["vertex_attribute"], - self.mesh_polygons_prefix, - ) - params = schemas.VertexAttribute.from_dict(rpc_params) - self.displayAttributeOnVertices(params.id, params.name) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_attribute"]["rpc"] - ) - def setMeshPolygonsPolygonAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["polygon_attribute"], - self.mesh_polygons_prefix, - ) - params = schemas.PolygonAttribute.from_dict(rpc_params) - self.displayAttributeOnCells(params.id, params.name) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"] - ) - def setMeshPolygonsVertexScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["vertex_scalar_range"], - self.mesh_polygons_prefix, - ) - params = schemas.VertexScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"] - ) - def setMeshPolygonsPolygonScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["polygon_scalar_range"], - self.mesh_polygons_prefix, - ) - params = schemas.PolygonScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_color_map"]["rpc"] - ) - def setMeshPolygonsVertexColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["vertex_color_map"], - self.mesh_polygons_prefix, - ) - params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_color_map"]["rpc"] - ) - def setMeshPolygonsPolygonColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["polygon_color_map"], - self.mesh_polygons_prefix, - ) - params = schemas.PolygonColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py index eb42b95d..5ad5c230 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py @@ -1,8 +1,3 @@ -from .visibility import * -from .vertex_scalar_range import * -from .vertex_color_map import * -from .vertex_attribute import * -from .polygon_scalar_range import * -from .polygon_color_map import * -from .polygon_attribute import * -from .color import * +from .scalar_range import * +from .color_map import * +from .name import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.json deleted file mode 100644 index b1c5e726..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "rpc": "color", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "color": { - "type": "object", - "properties": { - "r": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "g": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "b": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "a": { - "type": "number", - "minimum": 0, - "maximum": 1, - "default": 1 - } - }, - "required": [ - "r", - "g", - "b" - ], - "additionalProperties": false - } - }, - "required": [ - "id", - "color" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.py deleted file mode 100644 index 01f0222c..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color.py +++ /dev/null @@ -1,23 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass -from typing import Optional - - -@dataclass -class ColorClass(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - b: int - g: int - r: int - a: Optional[float] = None - - -@dataclass -class Color(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - color: ColorClass - id: str diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color_map.json similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.json rename to src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color_map.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color_map.py similarity index 88% rename from src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py rename to src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color_map.py index 14239388..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class VertexColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/name.json similarity index 89% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_attribute.json rename to src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/name.json index 9eb5de68..ceedfa5a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_attribute.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/name.json @@ -1,5 +1,5 @@ { - "rpc": "vertex_attribute", + "rpc": "name", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/name.py similarity index 81% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_attribute.py rename to src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/name.py index 64f7c2d0..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_attribute.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class VertexAttribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.json deleted file mode 100644 index e301d6ac..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "rpc": "polygon_attribute", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.py deleted file mode 100644 index ebc20a6b..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_attribute.py +++ /dev/null @@ -1,11 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass - - -@dataclass -class PolygonAttribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - name: str diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.py deleted file mode 100644 index 5841a9c8..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_color_map.py +++ /dev/null @@ -1,15 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass -from typing import List - - -@dataclass -class PolygonColorMap(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - maximum: float - minimum: float - points: List[float] - """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.json deleted file mode 100644 index 75c20f19..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "rpc": "polygon_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false -} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.py deleted file mode 100644 index c90a1489..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/polygon_scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass - - -@dataclass -class PolygonScalarRange(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - maximum: float - minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.json similarity index 90% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.json rename to src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.json index 68a8cabe..cbc408ae 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.json @@ -1,5 +1,5 @@ { - "rpc": "vertex_scalar_range", + "rpc": "scalar_range", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.py similarity index 82% rename from src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_scalar_range.py rename to src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.py index 735ba2a4..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class VertexScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.json deleted file mode 100644 index e699d92f..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "rpc": "visibility", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "visibility": { - "type": "boolean" - } - }, - "required": [ - "id", - "visibility" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.py deleted file mode 100644 index 56a629d8..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/visibility.py +++ /dev/null @@ -1,11 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass - - -@dataclass -class Visibility(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - visibility: bool diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/polygons_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/polygons_protocols.py index fa7932dc..f157f01d 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/polygons_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/polygons_protocols.py @@ -43,75 +43,3 @@ def setMeshPolygonsColor(self, rpc_params: RpcParams) -> None: params = schemas.Color.from_dict(rpc_params) color = params.color self.SetColor(params.id, color.r, color.g, color.b) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_attribute"]["rpc"] - ) - def setMeshPolygonsVertexAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["vertex_attribute"], - self.mesh_polygons_prefix, - ) - params = schemas.VertexAttribute.from_dict(rpc_params) - self.displayAttributeOnVertices(params.id, params.name) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_attribute"]["rpc"] - ) - def setMeshPolygonsPolygonAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["polygon_attribute"], - self.mesh_polygons_prefix, - ) - params = schemas.PolygonAttribute.from_dict(rpc_params) - self.displayAttributeOnCells(params.id, params.name) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"] - ) - def setMeshPolygonsVertexScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["vertex_scalar_range"], - self.mesh_polygons_prefix, - ) - params = schemas.VertexScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"] - ) - def setMeshPolygonsPolygonScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["polygon_scalar_range"], - self.mesh_polygons_prefix, - ) - params = schemas.PolygonScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_color_map"]["rpc"] - ) - def setMeshPolygonsVertexColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["vertex_color_map"], - self.mesh_polygons_prefix, - ) - params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) - - @exportRpc( - mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_color_map"]["rpc"] - ) - def setMeshPolygonsPolygonColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polygons_schemas_dict["polygon_color_map"], - self.mesh_polygons_prefix, - ) - params = schemas.PolygonColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_attribute.json deleted file mode 100644 index e301d6ac..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_attribute.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "rpc": "polygon_attribute", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_attribute.py deleted file mode 100644 index ebc20a6b..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_attribute.py +++ /dev/null @@ -1,11 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass - - -@dataclass -class PolygonAttribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - name: str diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py deleted file mode 100644 index 5841a9c8..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.py +++ /dev/null @@ -1,15 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass -from typing import List - - -@dataclass -class PolygonColorMap(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - maximum: float - minimum: float - points: List[float] - """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_scalar_range.json deleted file mode 100644 index 75c20f19..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "rpc": "polygon_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false -} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_scalar_range.py deleted file mode 100644 index c90a1489..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass - - -@dataclass -class PolygonScalarRange(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - maximum: float - minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json deleted file mode 100644 index 95737cc6..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" - }, - "minItems": 8 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": ["id", "points", "minimum", "maximum"], - "additionalProperties": false -} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/polyhedra_attribute_polyhedron_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/polyhedra_attribute_polyhedron_protocols.py new file mode 100644 index 00000000..92269def --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/polyhedra_attribute_polyhedron_protocols.py @@ -0,0 +1,65 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshPolyhedraAttributePolyhedronView(VtkMeshView): + mesh_polyhedra_attribute_polyhedron_prefix = ( + "opengeodeweb_viewer.mesh.polyhedra.attribute.polyhedron." + ) + mesh_polyhedra_attribute_polyhedron_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc( + mesh_polyhedra_attribute_polyhedron_prefix + + mesh_polyhedra_attribute_polyhedron_schemas_dict["name"]["rpc"] + ) + def setMeshPolyhedraPolyhedronName(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polyhedra_attribute_polyhedron_schemas_dict["name"], + self.mesh_polyhedra_attribute_polyhedron_prefix, + ) + params = schemas.Name.from_dict(rpc_params) + self.displayAttributeOnCells(params.id, params.name) + + @exportRpc( + mesh_polyhedra_attribute_polyhedron_prefix + + mesh_polyhedra_attribute_polyhedron_schemas_dict["scalar_range"]["rpc"] + ) + def setMeshPolyhedraPolyhedronScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polyhedra_attribute_polyhedron_schemas_dict["scalar_range"], + self.mesh_polyhedra_attribute_polyhedron_prefix, + ) + params = schemas.ScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc( + mesh_polyhedra_attribute_polyhedron_prefix + + mesh_polyhedra_attribute_polyhedron_schemas_dict["color_map"]["rpc"] + ) + def setMeshPolyhedraPolyhedronColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polyhedra_attribute_polyhedron_schemas_dict["color_map"], + self.mesh_polyhedra_attribute_polyhedron_prefix, + ) + params = schemas.ColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/__init__.py new file mode 100644 index 00000000..71a8e055 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/__init__.py @@ -0,0 +1,3 @@ +from .name import * +from .scalar_range import * +from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/color_map.json similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.json rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/color_map.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/color_map.py similarity index 88% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.py rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/color_map.py index 14239388..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class VertexColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/name.json similarity index 89% rename from src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_attribute.json rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/name.json index 9eb5de68..ceedfa5a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_attribute.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/name.json @@ -1,5 +1,5 @@ { - "rpc": "vertex_attribute", + "rpc": "name", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/name.py similarity index 81% rename from src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_attribute.py rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/name.py index 64f7c2d0..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_attribute.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class VertexAttribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.json similarity index 90% rename from src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_scalar_range.json rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.json index 68a8cabe..cbc408ae 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_scalar_range.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.json @@ -1,5 +1,5 @@ { - "rpc": "vertex_scalar_range", + "rpc": "scalar_range", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.py similarity index 82% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.py rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.py index 735ba2a4..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class VertexScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/polyhedra_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/polyhedra_attribute_vertex_protocols.py new file mode 100644 index 00000000..57a08485 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/polyhedra_attribute_vertex_protocols.py @@ -0,0 +1,65 @@ +# Standard library imports +import os + +# Third party imports +from wslink import register as exportRpc # type: ignore +from opengeodeweb_microservice.schemas import get_schemas_dict + +# Local application imports +from opengeodeweb_viewer.utils_functions import ( + validate_schema, + RpcParams, +) +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from . import schemas + + +class VtkMeshPolyhedraAttributeVertexView(VtkMeshView): + mesh_polyhedra_attribute_vertex_prefix = ( + "opengeodeweb_viewer.mesh.polyhedra.attribute.vertex." + ) + mesh_polyhedra_attribute_vertex_schemas_dict = get_schemas_dict( + os.path.join(os.path.dirname(__file__), "schemas") + ) + + def __init__(self) -> None: + super().__init__() + + @exportRpc( + mesh_polyhedra_attribute_vertex_prefix + + mesh_polyhedra_attribute_vertex_schemas_dict["name"]["rpc"] + ) + def setMeshPolyhedraVertexName(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polyhedra_attribute_vertex_schemas_dict["name"], + self.mesh_polyhedra_attribute_vertex_prefix, + ) + params = schemas.Name.from_dict(rpc_params) + self.displayAttributeOnVertices(params.id, params.name) + + @exportRpc( + mesh_polyhedra_attribute_vertex_prefix + + mesh_polyhedra_attribute_vertex_schemas_dict["scalar_range"]["rpc"] + ) + def setMeshPolyhedraVertexScalarRange(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polyhedra_attribute_vertex_schemas_dict["scalar_range"], + self.mesh_polyhedra_attribute_vertex_prefix, + ) + params = schemas.ScalarRange.from_dict(rpc_params) + self.displayScalarRange(params.id, params.minimum, params.maximum) + + @exportRpc( + mesh_polyhedra_attribute_vertex_prefix + + mesh_polyhedra_attribute_vertex_schemas_dict["color_map"]["rpc"] + ) + def setMeshPolyhedraVertexColorMap(self, rpc_params: RpcParams) -> None: + validate_schema( + rpc_params, + self.mesh_polyhedra_attribute_vertex_schemas_dict["color_map"], + self.mesh_polyhedra_attribute_vertex_prefix, + ) + params = schemas.ColorMap.from_dict(rpc_params) + self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/__init__.py new file mode 100644 index 00000000..5ad5c230 --- /dev/null +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/__init__.py @@ -0,0 +1,3 @@ +from .scalar_range import * +from .color_map import * +from .name import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/color_map.json similarity index 100% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/polygon_color_map.json rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/color_map.json diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/color_map.py similarity index 88% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/color_map.py index 14239388..7fbb9d2a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_color_map.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/color_map.py @@ -4,7 +4,7 @@ @dataclass -class VertexColorMap(DataClassJsonMixin): +class ColorMap(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/name.json similarity index 89% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.json rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/name.json index 9eb5de68..ceedfa5a 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/name.json @@ -1,5 +1,5 @@ { - "rpc": "vertex_attribute", + "rpc": "name", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/name.py similarity index 81% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.py rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/name.py index 64f7c2d0..fccf36dc 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/vertex_attribute.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/name.py @@ -3,7 +3,7 @@ @dataclass -class VertexAttribute(DataClassJsonMixin): +class Name(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.json similarity index 90% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_scalar_range.json rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.json index 68a8cabe..cbc408ae 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_scalar_range.json +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.json @@ -1,5 +1,5 @@ { - "rpc": "vertex_scalar_range", + "rpc": "scalar_range", "type": "object", "properties": { "id": { diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.py similarity index 82% rename from src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_scalar_range.py rename to src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.py index 735ba2a4..69d2fae4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/vertex_scalar_range.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.py @@ -3,7 +3,7 @@ @dataclass -class VertexScalarRange(DataClassJsonMixin): +class ScalarRange(DataClassJsonMixin): def __post_init__(self) -> None: print(self, flush=True) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/polyhedra_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/polyhedra_protocols.py index 590845e2..dca898e3 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/polyhedra_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/polyhedra_protocols.py @@ -43,79 +43,3 @@ def setMeshPolyhedraColor(self, rpc_params: RpcParams) -> None: params = schemas.Color.from_dict(rpc_params) color = params.color self.SetColor(params.id, color.r, color.g, color.b) - - @exportRpc( - mesh_polyhedra_prefix + mesh_polyhedra_schemas_dict["vertex_attribute"]["rpc"] - ) - def setMeshPolyhedraVertexAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polyhedra_schemas_dict["vertex_attribute"], - self.mesh_polyhedra_prefix, - ) - params = schemas.VertexAttribute.from_dict(rpc_params) - self.displayAttributeOnVertices(params.id, params.name) - - @exportRpc( - mesh_polyhedra_prefix - + mesh_polyhedra_schemas_dict["polyhedron_attribute"]["rpc"] - ) - def setMeshPolyhedraPolyhedronAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polyhedra_schemas_dict["polyhedron_attribute"], - self.mesh_polyhedra_prefix, - ) - params = schemas.PolyhedronAttribute.from_dict(rpc_params) - self.displayAttributeOnCells(params.id, params.name) - - @exportRpc( - mesh_polyhedra_prefix - + mesh_polyhedra_schemas_dict["vertex_scalar_range"]["rpc"] - ) - def setMeshPolyhedraVertexScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polyhedra_schemas_dict["vertex_scalar_range"], - self.mesh_polyhedra_prefix, - ) - params = schemas.VertexScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc( - mesh_polyhedra_prefix - + mesh_polyhedra_schemas_dict["polyhedron_scalar_range"]["rpc"] - ) - def setMeshPolyhedraPolyhedronScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polyhedra_schemas_dict["polyhedron_scalar_range"], - self.mesh_polyhedra_prefix, - ) - params = schemas.PolyhedronScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc( - mesh_polyhedra_prefix + mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"] - ) - def setMeshPolyhedraVertexColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polyhedra_schemas_dict["vertex_color_map"], - self.mesh_polyhedra_prefix, - ) - params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) - - @exportRpc( - mesh_polyhedra_prefix - + mesh_polyhedra_schemas_dict["polyhedra_color_map"]["rpc"] - ) - def setMeshPolyhedraPolyhedraColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_polyhedra_schemas_dict["polyhedra_color_map"], - self.mesh_polyhedra_prefix, - ) - params = schemas.PolyhedraColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json deleted file mode 100644 index 95737cc6..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" - }, - "minItems": 8 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": ["id", "points", "minimum", "maximum"], - "additionalProperties": false -} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py deleted file mode 100644 index 01d1bad8..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedra_color_map.py +++ /dev/null @@ -1,15 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass -from typing import List - - -@dataclass -class PolyhedraColorMap(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - maximum: float - minimum: float - points: List[float] - """Flat array of [value, r, g, b, ...]""" diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_attribute.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_attribute.json deleted file mode 100644 index 6ee61a64..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_attribute.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "rpc": "polyhedron_attribute", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_attribute.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_attribute.py deleted file mode 100644 index b2cb0ba3..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_attribute.py +++ /dev/null @@ -1,11 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass - - -@dataclass -class PolyhedronAttribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - name: str diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_scalar_range.json deleted file mode 100644 index 31d646dd..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "rpc": "polyhedron_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false -} diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_scalar_range.py deleted file mode 100644 index 16b8dae6..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/polyhedron_scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -from dataclasses_json import DataClassJsonMixin -from dataclasses import dataclass - - -@dataclass -class PolyhedronScalarRange(DataClassJsonMixin): - def __post_init__(self) -> None: - print(self, flush=True) - - id: str - maximum: float - minimum: float diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json deleted file mode 100644 index 95737cc6..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/vertex_color_map.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" - }, - "minItems": 8 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": ["id", "points", "minimum", "maximum"], - "additionalProperties": false -} diff --git a/src/opengeodeweb_viewer/vtkw_server.py b/src/opengeodeweb_viewer/vtkw_server.py index e32debbf..68868476 100644 --- a/src/opengeodeweb_viewer/vtkw_server.py +++ b/src/opengeodeweb_viewer/vtkw_server.py @@ -18,7 +18,16 @@ from .rpc.viewer.viewer_protocols import VtkViewerView from .rpc.mesh.mesh_protocols import VtkMeshView from .rpc.mesh.points.points_protocols import VtkMeshPointsView +from .rpc.mesh.points.attribute.vertex.points_attribute_vertex_protocols import ( + VtkMeshPointsAttributeVertexView, +) from .rpc.mesh.edges.edges_protocols import VtkMeshEdgesView +from .rpc.mesh.edges.attribute.vertex.edges_attribute_vertex_protocols import ( + VtkMeshEdgesAttributeVertexView, +) +from .rpc.mesh.edges.attribute.edge.edges_attribute_edge_protocols import ( + VtkMeshEdgesAttributeEdgeView, +) from .rpc.mesh.cells.cells_protocols import VtkMeshCellsView from .rpc.mesh.cells.attribute.vertex.cells_attribute_vertex_protocols import ( VtkMeshCellsAttributeVertexView, @@ -26,14 +35,20 @@ from .rpc.mesh.cells.attribute.cell.cells_attribute_cell_protocols import ( VtkMeshCellsAttributeCellView, ) -from .rpc.mesh.edges.attribute.vertex.edges_attribute_vertex_protocols import ( - VtkMeshEdgesAttributeVertexView, +from .rpc.mesh.polygons.polygons_protocols import VtkMeshPolygonsView +from .rpc.mesh.polygons.attribute.vertex.polygons_attribute_vertex_protocols import ( + VtkMeshPolygonsAttributeVertexView, ) -from .rpc.mesh.edges.attribute.edge.edges_attribute_edge_protocols import ( - VtkMeshEdgesAttributeEdgeView, +from .rpc.mesh.polygons.attribute.polygon.polygons_attribute_polygon_protocols import ( + VtkMeshPolygonsAttributePolygonView, ) -from .rpc.mesh.polygons.polygons_protocols import VtkMeshPolygonsView from .rpc.mesh.polyhedra.polyhedra_protocols import VtkMeshPolyhedraView +from .rpc.mesh.polyhedra.attribute.vertex.polyhedra_attribute_vertex_protocols import ( + VtkMeshPolyhedraAttributeVertexView, +) +from .rpc.mesh.polyhedra.attribute.polyhedron.polyhedra_attribute_polyhedron_protocols import ( + VtkMeshPolyhedraAttributePolyhedronView, +) from .rpc.model.model_protocols import VtkModelView from .rpc.model.edges.model_edges_protocols import ( VtkModelEdgesView, @@ -99,14 +114,19 @@ def initialize(self) -> None: self.registerVtkWebProtocol(VtkViewerView()) self.registerVtkWebProtocol(mesh_protocols) self.registerVtkWebProtocol(VtkMeshPointsView()) + self.registerVtkWebProtocol(VtkMeshPointsAttributeVertexView()) self.registerVtkWebProtocol(VtkMeshEdgesView()) + self.registerVtkWebProtocol(VtkMeshEdgesAttributeVertexView()) + self.registerVtkWebProtocol(VtkMeshEdgesAttributeEdgeView()) self.registerVtkWebProtocol(VtkMeshCellsView()) self.registerVtkWebProtocol(VtkMeshCellsAttributeVertexView()) self.registerVtkWebProtocol(VtkMeshCellsAttributeCellView()) - self.registerVtkWebProtocol(VtkMeshEdgesAttributeVertexView()) - self.registerVtkWebProtocol(VtkMeshEdgesAttributeEdgeView()) self.registerVtkWebProtocol(VtkMeshPolygonsView()) + self.registerVtkWebProtocol(VtkMeshPolygonsAttributeVertexView()) + self.registerVtkWebProtocol(VtkMeshPolygonsAttributePolygonView()) self.registerVtkWebProtocol(VtkMeshPolyhedraView()) + self.registerVtkWebProtocol(VtkMeshPolyhedraAttributeVertexView()) + self.registerVtkWebProtocol(VtkMeshPolyhedraAttributePolyhedronView()) self.registerVtkWebProtocol(model_protocols) self.registerVtkWebProtocol(VtkModelEdgesView()) self.registerVtkWebProtocol(VtkModelPointsView()) From dfc7831a03aac28e3355167f08753ba24f8d78b5 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Wed, 4 Feb 2026 09:21:47 +0000 Subject: [PATCH 21/27] Apply prepare changes --- opengeodeweb_viewer_schemas.json | 644 +++++------------- .../cells/attribute/cell/schemas/__init__.py | 2 - .../attribute/vertex/schemas/__init__.py | 2 - .../attribute/vertex/schemas/__init__.py | 2 +- .../attribute/vertex/schemas/__init__.py | 2 +- .../attribute/vertex/schemas/__init__.py | 2 +- .../rpc/mesh/polygons/schemas/__init__.py | 6 - .../attribute/polyhedron/schemas/__init__.py | 2 +- .../attribute/vertex/schemas/__init__.py | 2 +- .../rpc/mesh/polyhedra/schemas/__init__.py | 6 - 10 files changed, 184 insertions(+), 486 deletions(-) diff --git a/opengeodeweb_viewer_schemas.json b/opengeodeweb_viewer_schemas.json index 22680231..df7e78d4 100644 --- a/opengeodeweb_viewer_schemas.json +++ b/opengeodeweb_viewer_schemas.json @@ -137,8 +137,8 @@ "additionalProperties": false }, "name": { - "$id": "opengeodeweb_viewer.mesh.cells.attribute.vertex.attribute", - "rpc": "attribute", + "$id": "opengeodeweb_viewer.mesh.cells.attribute.vertex.name", + "rpc": "name", "type": "object", "properties": { "id": { @@ -307,8 +307,8 @@ "additionalProperties": false }, "name": { - "$id": "opengeodeweb_viewer.mesh.edges.attribute.vertex.vertex_attribute", - "rpc": "vertex_attribute", + "$id": "opengeodeweb_viewer.mesh.edges.attribute.vertex.name", + "rpc": "name", "type": "object", "properties": { "id": { @@ -473,6 +473,26 @@ ], "additionalProperties": false }, + "name": { + "$id": "opengeodeweb_viewer.mesh.points.attribute.vertex.name", + "rpc": "name", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + }, "color_map": { "$id": "opengeodeweb_viewer.mesh.points.attribute.vertex.color_map", "rpc": "color_map", @@ -504,26 +524,6 @@ "maximum" ], "additionalProperties": false - }, - "attribute": { - "$id": "opengeodeweb_viewer.mesh.points.attribute.vertex.attribute", - "rpc": "attribute", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false } } }, @@ -769,49 +769,50 @@ } }, "vertex": { - "visibility": { - "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.visibility", - "rpc": "visibility", + "scalar_range": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.scalar_range", + "rpc": "scalar_range", "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, - "visibility": { - "type": "boolean" + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ "id", - "visibility" + "minimum", + "maximum" ], "additionalProperties": false }, - "vertex_scalar_range": { - "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.vertex_scalar_range", - "rpc": "vertex_scalar_range", + "name": { + "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.name", + "rpc": "name", "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" + "name": { + "type": "string", + "minLength": 1 } }, "required": [ "id", - "minimum", - "maximum" + "name" ], "additionalProperties": false }, - "vertex_color_map": { + "color_map": { "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.color_map", "rpc": "color_map", "type": "object", @@ -842,30 +843,83 @@ "maximum" ], "additionalProperties": false + } + } + }, + "visibility": { + "$id": "opengeodeweb_viewer.mesh.polygons.visibility", + "rpc": "visibility", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "visibility": { + "type": "boolean" + } + }, + "required": [ + "id", + "visibility" + ], + "additionalProperties": false + }, + "color": { + "$id": "opengeodeweb_viewer.mesh.polygons.color", + "rpc": "color", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 }, - "vertex_attribute": { - "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.vertex_attribute", - "rpc": "vertex_attribute", + "color": { "type": "object", "properties": { - "id": { - "type": "string", - "minLength": 1 + "r": { + "type": "integer", + "minimum": 0, + "maximum": 255 }, - "name": { - "type": "string", - "minLength": 1 + "g": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "b": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 1 } }, "required": [ - "id", - "name" + "r", + "g", + "b" ], "additionalProperties": false - }, - "polygon_scalar_range": { - "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.polygon_scalar_range", - "rpc": "polygon_scalar_range", + } + }, + "required": [ + "id", + "color" + ], + "additionalProperties": false + } + }, + "polyhedra": { + "attribute": { + "polyhedron": { + "scalar_range": { + "$id": "opengeodeweb_viewer.mesh.polyhedra.attribute.polyhedron.scalar_range", + "rpc": "scalar_range", "type": "object", "properties": { "id": { @@ -886,8 +940,28 @@ ], "additionalProperties": false }, - "polygon_color_map": { - "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.color_map", + "name": { + "$id": "opengeodeweb_viewer.mesh.polyhedra.attribute.polyhedron.name", + "rpc": "name", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + }, + "color_map": { + "$id": "opengeodeweb_viewer.mesh.polyhedra.attribute.polyhedron.color_map", "rpc": "color_map", "type": "object", "properties": { @@ -917,10 +991,35 @@ "maximum" ], "additionalProperties": false + } + }, + "vertex": { + "scalar_range": { + "$id": "opengeodeweb_viewer.mesh.polyhedra.attribute.vertex.scalar_range", + "rpc": "scalar_range", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" + } + }, + "required": [ + "id", + "minimum", + "maximum" + ], + "additionalProperties": false }, - "polygon_attribute": { - "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.polygon_attribute", - "rpc": "polygon_attribute", + "name": { + "$id": "opengeodeweb_viewer.mesh.polyhedra.attribute.vertex.name", + "rpc": "name", "type": "object", "properties": { "id": { @@ -938,58 +1037,42 @@ ], "additionalProperties": false }, - "color": { - "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.color", - "rpc": "color", + "color_map": { + "$id": "opengeodeweb_viewer.mesh.polyhedra.attribute.vertex.color_map", + "rpc": "color_map", "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, - "color": { - "type": "object", - "properties": { - "r": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "g": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "b": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "a": { - "type": "number", - "minimum": 0, - "maximum": 1, - "default": 1 - } + "points": { + "type": "array", + "description": "Flat array of [value, r, g, b, ...]", + "items": { + "type": "number" }, - "required": [ - "r", - "g", - "b" - ], - "additionalProperties": false + "minItems": 8 + }, + "minimum": { + "type": "number" + }, + "maximum": { + "type": "number" } }, "required": [ "id", - "color" + "points", + "minimum", + "maximum" ], "additionalProperties": false } } }, "visibility": { - "$id": "opengeodeweb_viewer.mesh.polygons.visibility", + "$id": "opengeodeweb_viewer.mesh.polyhedra.visibility", "rpc": "visibility", "type": "object", "properties": { @@ -1007,375 +1090,6 @@ ], "additionalProperties": false }, - "vertex_scalar_range": { - "$id": "opengeodeweb_viewer.mesh.polygons.vertex_scalar_range", - "rpc": "vertex_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "vertex_color_map": { - "$id": "opengeodeweb_viewer.mesh.polygons.color_map", - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" - }, - "minItems": 8 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "points", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "vertex_attribute": { - "$id": "opengeodeweb_viewer.mesh.polygons.vertex_attribute", - "rpc": "vertex_attribute", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false - }, - "polygon_scalar_range": { - "$id": "opengeodeweb_viewer.mesh.polygons.polygon_scalar_range", - "rpc": "polygon_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "polygon_color_map": { - "$id": "opengeodeweb_viewer.mesh.polygons.color_map", - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" - }, - "minItems": 8 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "points", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "polygon_attribute": { - "$id": "opengeodeweb_viewer.mesh.polygons.polygon_attribute", - "rpc": "polygon_attribute", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false - }, - "color": { - "$id": "opengeodeweb_viewer.mesh.polygons.color", - "rpc": "color", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "color": { - "type": "object", - "properties": { - "r": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "g": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "b": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "a": { - "type": "number", - "minimum": 0, - "maximum": 1, - "default": 1 - } - }, - "required": [ - "r", - "g", - "b" - ], - "additionalProperties": false - } - }, - "required": [ - "id", - "color" - ], - "additionalProperties": false - } - }, - "polyhedra": { - "visibility": { - "$id": "opengeodeweb_viewer.mesh.polyhedra.visibility", - "rpc": "visibility", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "visibility": { - "type": "boolean" - } - }, - "required": [ - "id", - "visibility" - ], - "additionalProperties": false - }, - "vertex_scalar_range": { - "$id": "opengeodeweb_viewer.mesh.polyhedra.vertex_scalar_range", - "rpc": "vertex_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "vertex_color_map": { - "$id": "opengeodeweb_viewer.mesh.polyhedra.color_map", - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" - }, - "minItems": 8 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "points", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "vertex_attribute": { - "$id": "opengeodeweb_viewer.mesh.polyhedra.vertex_attribute", - "rpc": "vertex_attribute", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false - }, - "polyhedron_scalar_range": { - "$id": "opengeodeweb_viewer.mesh.polyhedra.polyhedron_scalar_range", - "rpc": "polyhedron_scalar_range", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false - }, - "polyhedron_attribute": { - "$id": "opengeodeweb_viewer.mesh.polyhedra.polyhedron_attribute", - "rpc": "polyhedron_attribute", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "id", - "name" - ], - "additionalProperties": false - }, - "polyhedra_color_map": { - "$id": "opengeodeweb_viewer.mesh.polyhedra.color_map", - "rpc": "color_map", - "type": "object", - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "points": { - "type": "array", - "description": "Flat array of [value, r, g, b, ...]", - "items": { - "type": "number" - }, - "minItems": 8 - }, - "minimum": { - "type": "number" - }, - "maximum": { - "type": "number" - } - }, - "required": [ - "id", - "points", - "minimum", - "maximum" - ], - "additionalProperties": false - }, "color": { "$id": "opengeodeweb_viewer.mesh.polyhedra.color", "rpc": "color", diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py index 6773d722..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/__init__.py @@ -1,5 +1,3 @@ -from .name import * -from .color_map import * from .scalar_range import * from .name import * from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py index 6773d722..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/__init__.py @@ -1,5 +1,3 @@ -from .name import * -from .color_map import * from .scalar_range import * from .name import * from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py index 1a24ca7b..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/__init__.py @@ -1,3 +1,3 @@ +from .scalar_range import * from .name import * from .color_map import * -from .scalar_range import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py index 1a24ca7b..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/__init__.py @@ -1,3 +1,3 @@ +from .scalar_range import * from .name import * from .color_map import * -from .scalar_range import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py index 5ad5c230..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/__init__.py @@ -1,3 +1,3 @@ from .scalar_range import * -from .color_map import * from .name import * +from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/__init__.py index eb42b95d..e983533c 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polygons/schemas/__init__.py @@ -1,8 +1,2 @@ from .visibility import * -from .vertex_scalar_range import * -from .vertex_color_map import * -from .vertex_attribute import * -from .polygon_scalar_range import * -from .polygon_color_map import * -from .polygon_attribute import * from .color import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/__init__.py index 71a8e055..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/__init__.py @@ -1,3 +1,3 @@ -from .name import * from .scalar_range import * +from .name import * from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/__init__.py index 5ad5c230..132463ad 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/__init__.py @@ -1,3 +1,3 @@ from .scalar_range import * -from .color_map import * from .name import * +from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/__init__.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/__init__.py index 7646624d..e983533c 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/__init__.py +++ b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/schemas/__init__.py @@ -1,8 +1,2 @@ from .visibility import * -from .vertex_scalar_range import * -from .vertex_color_map import * -from .vertex_attribute import * -from .polyhedron_scalar_range import * -from .polyhedron_attribute import * -from .polyhedra_color_map import * from .color import * From ddf89cb4d6dd08e854ce65c45d84cf86a331e7cb Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 4 Feb 2026 10:23:33 +0100 Subject: [PATCH 22/27] rm this ? --- src/opengeodeweb_viewer/vtk_protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengeodeweb_viewer/vtk_protocol.py b/src/opengeodeweb_viewer/vtk_protocol.py index cda33155..9124cacc 100644 --- a/src/opengeodeweb_viewer/vtk_protocol.py +++ b/src/opengeodeweb_viewer/vtk_protocol.py @@ -40,7 +40,7 @@ class VtkPipeline: mapper: vtkMapper filter: vtkAlgorithm | None = None actor: vtkActor = field(default_factory=vtkActor) - color_map_points: list[list[float]] = field(default_factory=list) + # color_map_points: list[list[float]] = field(default_factory=list) class VtkTypingMixin: From f4273b89575edea45dc49fb3376b6a6d6da61335 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Wed, 4 Feb 2026 09:28:29 +0000 Subject: [PATCH 23/27] Apply prepare changes --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1b40dc8f..e7f9f284 100644 --- a/requirements.txt +++ b/requirements.txt @@ -61,4 +61,3 @@ wslink==1.12.4 yarl>=1 # via aiohttp -opengeodeweb-microservice==1.*,>=1.0.13 From 4619214767f80a8152720ae51827cd9294433fce Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 4 Feb 2026 10:35:04 +0100 Subject: [PATCH 24/27] rm unecessary rpcs from cells_protocols --- .../rpc/mesh/cells/cells_protocols.py | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py index be6dcda1..59d847d4 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py @@ -43,65 +43,3 @@ def setMeshCellsColor(self, rpc_params: RpcParams) -> None: params = schemas.Color.from_dict(rpc_params) color = params.color self.SetColor(params.id, color.r, color.g, color.b) - - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["vertex_attribute"]["rpc"]) - def setMeshCellsVertexAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_cells_schemas_dict["vertex_attribute"], - self.mesh_cells_prefix, - ) - params = schemas.VertexAttribute.from_dict(rpc_params) - self.displayAttributeOnVertices(params.id, params.name) - - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["cell_attribute"]["rpc"]) - def setMeshCellsCellAttribute(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_cells_schemas_dict["cell_attribute"], - self.mesh_cells_prefix, - ) - params = schemas.CellAttribute.from_dict(rpc_params) - self.displayAttributeOnCells(params.id, params.name) - - @exportRpc( - mesh_cells_prefix + mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"] - ) - def setMeshCellsVertexScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_cells_schemas_dict["vertex_scalar_range"], - self.mesh_cells_prefix, - ) - params = schemas.VertexScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["cell_scalar_range"]["rpc"]) - def setMeshCellsCellScalarRange(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_cells_schemas_dict["cell_scalar_range"], - self.mesh_cells_prefix, - ) - params = schemas.CellScalarRange.from_dict(rpc_params) - self.displayScalarRange(params.id, params.minimum, params.maximum) - - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["vertex_color_map"]["rpc"]) - def setMeshCellsVertexColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_cells_schemas_dict["vertex_color_map"], - self.mesh_cells_prefix, - ) - params = schemas.VertexColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) - - @exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["cell_color_map"]["rpc"]) - def setMeshCellsCellColorMap(self, rpc_params: RpcParams) -> None: - validate_schema( - rpc_params, - self.mesh_cells_schemas_dict["cell_color_map"], - self.mesh_cells_prefix, - ) - params = schemas.CellColorMap.from_dict(rpc_params) - self.setupColorMap(params.id, params.points, params.minimum, params.maximum) From 65a335a3751bc827db2519932610552fe16afc4a Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 4 Feb 2026 10:50:30 +0100 Subject: [PATCH 25/27] tests cells --- .../rpc/mesh/mesh_protocols.py | 2 +- .../test_cells_attribute_cell_protocols.py | 361 ++++++++++ .../test_cells_attribute_vertex_protocols.py | 361 ++++++++++ tests/mesh/cells/test_mesh_cells_protocols.py | 616 +----------------- 4 files changed, 724 insertions(+), 616 deletions(-) create mode 100644 tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py create mode 100644 tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py diff --git a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py index c0069646..5304a113 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py @@ -141,7 +141,7 @@ def displayScalarRange(self, data_id: str, minimum: float, maximum: float) -> No def setupColorMap( self, data_id: str, points: list[float], minimum: float, maximum: float ) -> None: - data = self.get_object(data_id) + data = self.get_vtk_pipeline(data_id) lut = vtkColorTransferFunction() data.mapper.SetLookupTable(lut) diff --git a/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py b/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py new file mode 100644 index 00000000..1906075c --- /dev/null +++ b/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py @@ -0,0 +1,361 @@ +# Standard library imports +from typing import Callable + +# Third party imports +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.cells.attribute.cell.cells_attribute_cell_protocols import ( + VtkMeshCellsAttributeCellView, +) + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: + + dataset_factory( + id=mesh_id, viewable_file="regular_grid_2d.vti", viewer_elements_type="cells" + ) + + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + + +def test_cells_cell_attribute( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict["name"][ + "rpc" + ], + [{"id": mesh_id, "name": "RGB_data"}], + ) + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict[ + "scalar_range" + ]["rpc"], + [{"id": mesh_id, "minimum": 0, "maximum": 255}], + ) + assert server.compare_image("mesh/cells/cell_attribute.jpeg") == True + + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict[ + "scalar_range" + ]["rpc"], + [{"id": mesh_id, "minimum": 0, "maximum": 10}], + ) + assert server.compare_image("mesh/cells/cell_scalar_range.jpeg") == True + + +def test_cells_cell_color_map( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict["name"][ + "rpc" + ], + [{"id": mesh_id, "name": "RGB_data"}], + ) + + # Set color map: Blue to Red + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 255.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 255.0, + } + ], + ) + + assert server.compare_image("mesh/cells/cell_color_map.jpeg") == True + + +def test_cells_cell_color_map_range_update( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict["name"][ + "rpc" + ], + [{"id": mesh_id, "name": "RGB_data"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 255.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 255.0, + } + ], + ) + + assert server.compare_image("mesh/cells/cell_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 100.0, + 0, + 0, + 1.0, + 150.0, + 1.0, + 0, + 0, + ], + "minimum": 100.0, + "maximum": 150.0, + } + ], + ) + + assert server.compare_image("mesh/cells/cell_color_map_range_update.jpeg") == True + + +def test_cells_cell_color_map_red_shift( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict["name"][ + "rpc" + ], + [{"id": mesh_id, "name": "RGB_data"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 255.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 255.0, + } + ], + ) + + assert server.compare_image("mesh/cells/cell_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 20.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 20.0, + } + ], + ) + + assert server.compare_image("mesh/cells/cell_color_map_red_shift.jpeg") == True + + +def test_cells_cell_color_map_rainbow( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict["name"][ + "rpc" + ], + [{"id": mesh_id, "name": "RGB_data"}], + ) + + # Rainbow Desaturated Map + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 71 / 255, + 71 / 255, + 219 / 255, + 0.143 * 255, + 0, + 0, + 92 / 255, + 0.285 * 255, + 0, + 255 / 255, + 255 / 255, + 0.429 * 255, + 0, + 128 / 255, + 0, + 0.571 * 255, + 255 / 255, + 255 / 255, + 0, + 0.714 * 255, + 255 / 255, + 97 / 255, + 0, + 0.857 * 255, + 107 / 255, + 0, + 0, + 255.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 0.0, + "maximum": 255.0, + } + ], + ) + + assert ( + server.compare_image("mesh/cells/cell_color_map_rainbow_initial.jpeg") == True + ) + + # Update range via color map + server.call( + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_prefix + + VtkMeshCellsAttributeCellView.mesh_cells_attribute_cell_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 50.0, + 71 / 255, + 71 / 255, + 219 / 255, + 50.0 + 0.143 * 50, + 0, + 0, + 92 / 255, + 50.0 + 0.285 * 50, + 0, + 255 / 255, + 255 / 255, + 50.0 + 0.429 * 50, + 0, + 128 / 255, + 0, + 50.0 + 0.571 * 50, + 255 / 255, + 255 / 255, + 0, + 50.0 + 0.714 * 50, + 255 / 255, + 97 / 255, + 0, + 50.0 + 0.857 * 50, + 107 / 255, + 0, + 0, + 100.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 50.0, + "maximum": 100.0, + } + ], + ) + + assert server.compare_image("mesh/cells/cell_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py b/tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py new file mode 100644 index 00000000..61f3e9d7 --- /dev/null +++ b/tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py @@ -0,0 +1,361 @@ +# Standard library imports +from typing import Callable + +# Third party imports +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.cells.attribute.vertex.cells_attribute_vertex_protocols import ( + VtkMeshCellsAttributeVertexView, +) + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: + + dataset_factory( + id=mesh_id, viewable_file="regular_grid_2d.vti", viewer_elements_type="cells" + ) + + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + + +def test_cells_vertex_attribute( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "points"}], + ) + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "scalar_range" + ]["rpc"], + [{"id": mesh_id, "minimum": 2, "maximum": 498}], + ) + assert server.compare_image("mesh/cells/vertex_attribute.jpeg") == True + + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "scalar_range" + ]["rpc"], + [{"id": mesh_id, "minimum": 0, "maximum": 10}], + ) + assert server.compare_image("mesh/cells/vertex_scalar_range.jpeg") == True + + +def test_cells_vertex_color_map( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "points"}], + ) + + # Set color map: Blue to Red + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 2.0, + 0, + 0, + 1.0, + 498.0, + 1.0, + 0, + 0, + ], + "minimum": 2.0, + "maximum": 498.0, + } + ], + ) + + assert server.compare_image("mesh/cells/vertex_color_map.jpeg") == True + + +def test_cells_vertex_color_map_range_update( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "points"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 2.0, + 0, + 0, + 1.0, + 498.0, + 1.0, + 0, + 0, + ], + "minimum": 2.0, + "maximum": 498.0, + } + ], + ) + + assert server.compare_image("mesh/cells/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 200.0, + 0, + 0, + 1.0, + 300.0, + 1.0, + 0, + 0, + ], + "minimum": 200.0, + "maximum": 300.0, + } + ], + ) + + assert server.compare_image("mesh/cells/vertex_color_map_range_update.jpeg") == True + + +def test_cells_vertex_color_map_red_shift( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "points"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 2.0, + 0, + 0, + 1.0, + 498.0, + 1.0, + 0, + 0, + ], + "minimum": 2.0, + "maximum": 498.0, + } + ], + ) + + assert server.compare_image("mesh/cells/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 50.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 50.0, + } + ], + ) + + assert server.compare_image("mesh/cells/vertex_color_map_red_shift.jpeg") == True + + +def test_cells_vertex_color_map_rainbow( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "points"}], + ) + + # Rainbow Desaturated Map + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 2.0, + 71 / 255, + 71 / 255, + 219 / 255, + 2.0 + 0.143 * 496, + 0, + 0, + 92 / 255, + 2.0 + 0.285 * 496, + 0, + 255 / 255, + 255 / 255, + 2.0 + 0.429 * 496, + 0, + 128 / 255, + 0, + 2.0 + 0.571 * 496, + 255 / 255, + 255 / 255, + 0, + 2.0 + 0.714 * 496, + 255 / 255, + 97 / 255, + 0, + 2.0 + 0.857 * 496, + 107 / 255, + 0, + 0, + 498.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 2.0, + "maximum": 498.0, + } + ], + ) + + assert ( + server.compare_image("mesh/cells/vertex_color_map_rainbow_initial.jpeg") == True + ) + + # Set scalar range via color map + server.call( + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_prefix + + VtkMeshCellsAttributeVertexView.mesh_cells_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 50.0, + 71 / 255, + 71 / 255, + 219 / 255, + 50.0 + 0.143 * 150, + 0, + 0, + 92 / 255, + 50.0 + 0.285 * 150, + 0, + 255 / 255, + 255 / 255, + 50.0 + 0.429 * 150, + 0, + 128 / 255, + 0, + 50.0 + 0.571 * 150, + 255 / 255, + 255 / 255, + 0, + 50.0 + 0.714 * 150, + 255 / 255, + 97 / 255, + 0, + 50.0 + 0.857 * 150, + 107 / 255, + 0, + 0, + 200.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 50.0, + "maximum": 200.0, + } + ], + ) + + assert server.compare_image("mesh/cells/vertex_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/cells/test_mesh_cells_protocols.py b/tests/mesh/cells/test_mesh_cells_protocols.py index d200eb5d..6ac502fb 100644 --- a/tests/mesh/cells/test_mesh_cells_protocols.py +++ b/tests/mesh/cells/test_mesh_cells_protocols.py @@ -16,7 +16,7 @@ def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: dataset_factory( - id=mesh_id, viewable_file="regular_grid_2d.vti", viewer_elements_type="polygons" + id=mesh_id, viewable_file="regular_grid_2d.vti", viewer_elements_type="cells" ) server.call( @@ -52,617 +52,3 @@ def test_cells_visibility( [{"id": mesh_id, "visibility": False}], ) assert server.compare_image("mesh/cells/visibility.jpeg") == True - - -def test_cells_vertex_attribute( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "points"}], - ) - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 2, "maximum": 498}], - ) - assert server.compare_image("mesh/cells/vertex_attribute.jpeg") == True - - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0, "maximum": 10}], - ) - assert server.compare_image("mesh/cells/vertex_scalar_range.jpeg") == True - - -def test_cells_cell_attribute( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_attribute"]["rpc"], - [{"id": mesh_id, "name": "RGB_data"}], - ) - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0, "maximum": 255}], - ) - assert server.compare_image("mesh/cells/cell_attribute.jpeg") == True - - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0, "maximum": 10}], - ) - assert server.compare_image("mesh/cells/cell_scalar_range.jpeg") == True - - -def test_cells_vertex_color_map( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "points"}], - ) - - # Set color map: Blue to Red - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 2.0, - 0, - 0, - 1.0, - 498.0, - 1.0, - 0, - 0, - ], - "minimum": 2.0, - "maximum": 498.0, - } - ], - ) - - assert server.compare_image("mesh/cells/vertex_color_map.jpeg") == True - - -def test_cells_vertex_color_map_range_update( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "points"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 2.0, - 0, - 0, - 1.0, - 498.0, - 1.0, - 0, - 0, - ], - "minimum": 2.0, - "maximum": 498.0, - } - ], - ) - - assert server.compare_image("mesh/cells/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 200.0, - 0, - 0, - 1.0, - 300.0, - 1.0, - 0, - 0, - ], - "minimum": 200.0, - "maximum": 300.0, - } - ], - ) - - assert server.compare_image("mesh/cells/vertex_color_map_range_update.jpeg") == True - - -def test_cells_vertex_color_map_red_shift( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "points"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 2.0, - 0, - 0, - 1.0, - 498.0, - 1.0, - 0, - 0, - ], - "minimum": 2.0, - "maximum": 498.0, - } - ], - ) - - assert server.compare_image("mesh/cells/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 50.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 50.0, - } - ], - ) - - assert server.compare_image("mesh/cells/vertex_color_map_red_shift.jpeg") == True - - -def test_cells_vertex_color_map_rainbow( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "points"}], - ) - - # Rainbow Desaturated Map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 2.0, - 71 / 255, - 71 / 255, - 219 / 255, - 2.0 + 0.143 * 496, - 0, - 0, - 92 / 255, - 2.0 + 0.285 * 496, - 0, - 255 / 255, - 255 / 255, - 2.0 + 0.429 * 496, - 0, - 128 / 255, - 0, - 2.0 + 0.571 * 496, - 255 / 255, - 255 / 255, - 0, - 2.0 + 0.714 * 496, - 255 / 255, - 97 / 255, - 0, - 2.0 + 0.857 * 496, - 107 / 255, - 0, - 0, - 498.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 2.0, - "maximum": 498.0, - } - ], - ) - - assert ( - server.compare_image("mesh/cells/vertex_color_map_rainbow_initial.jpeg") == True - ) - - # Set scalar range via color map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 50.0, - 71 / 255, - 71 / 255, - 219 / 255, - 50.0 + 0.143 * 150, - 0, - 0, - 92 / 255, - 50.0 + 0.285 * 150, - 0, - 255 / 255, - 255 / 255, - 50.0 + 0.429 * 150, - 0, - 128 / 255, - 0, - 50.0 + 0.571 * 150, - 255 / 255, - 255 / 255, - 0, - 50.0 + 0.714 * 150, - 255 / 255, - 97 / 255, - 0, - 50.0 + 0.857 * 150, - 107 / 255, - 0, - 0, - 200.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 50.0, - "maximum": 200.0, - } - ], - ) - - assert server.compare_image("mesh/cells/vertex_color_map_rainbow.jpeg") == True - - -def test_cells_cell_color_map( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_attribute"]["rpc"], - [{"id": mesh_id, "name": "RGB_data"}], - ) - - # Set color map: Blue to Red - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 255.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 255.0, - } - ], - ) - - assert server.compare_image("mesh/cells/cell_color_map.jpeg") == True - - -def test_cells_cell_color_map_range_update( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_attribute"]["rpc"], - [{"id": mesh_id, "name": "RGB_data"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 255.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 255.0, - } - ], - ) - - assert server.compare_image("mesh/cells/cell_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 100.0, - 0, - 0, - 1.0, - 150.0, - 1.0, - 0, - 0, - ], - "minimum": 100.0, - "maximum": 150.0, - } - ], - ) - - assert server.compare_image("mesh/cells/cell_color_map_range_update.jpeg") == True - - -def test_cells_cell_color_map_red_shift( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_attribute"]["rpc"], - [{"id": mesh_id, "name": "RGB_data"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 255.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 255.0, - } - ], - ) - - assert server.compare_image("mesh/cells/cell_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 20.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 20.0, - } - ], - ) - - assert server.compare_image("mesh/cells/cell_color_map_red_shift.jpeg") == True - - -def test_cells_cell_color_map_rainbow( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_attribute"]["rpc"], - [{"id": mesh_id, "name": "RGB_data"}], - ) - - # Rainbow Desaturated Map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 71 / 255, - 71 / 255, - 219 / 255, - 0.143 * 255, - 0, - 0, - 92 / 255, - 0.285 * 255, - 0, - 255 / 255, - 255 / 255, - 0.429 * 255, - 0, - 128 / 255, - 0, - 0.571 * 255, - 255 / 255, - 255 / 255, - 0, - 0.714 * 255, - 255 / 255, - 97 / 255, - 0, - 0.857 * 255, - 107 / 255, - 0, - 0, - 255.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 0.0, - "maximum": 255.0, - } - ], - ) - - assert ( - server.compare_image("mesh/cells/cell_color_map_rainbow_initial.jpeg") == True - ) - - # Update range via color map - server.call( - VtkMeshCellsView.mesh_cells_prefix - + VtkMeshCellsView.mesh_cells_schemas_dict["cell_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 50.0, - 71 / 255, - 71 / 255, - 219 / 255, - 50.0 + 0.143 * 50, - 0, - 0, - 92 / 255, - 50.0 + 0.285 * 50, - 0, - 255 / 255, - 255 / 255, - 50.0 + 0.429 * 50, - 0, - 128 / 255, - 0, - 50.0 + 0.571 * 50, - 255 / 255, - 255 / 255, - 0, - 50.0 + 0.714 * 50, - 255 / 255, - 97 / 255, - 0, - 50.0 + 0.857 * 50, - 107 / 255, - 0, - 0, - 100.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 50.0, - "maximum": 100.0, - } - ], - ) - - assert server.compare_image("mesh/cells/cell_color_map_rainbow.jpeg") == True From 3cc448b7f05912c70c521bef31a664163022170a Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 4 Feb 2026 11:15:51 +0100 Subject: [PATCH 26/27] new architecture for tests --- tests/conftest.py | 4 +- .../data/123456789/attributed_edged_curve.vtp | 22 + tests/data/123456789/edged_curve.vtp | 20 + tests/data/123456789/hat.vtp | 19 + tests/data/123456789/polyhedron_attribute.vtu | 22 + .../data/123456789/triangulated_surface2d.vtp | 21 + .../test_edges_attribute_edge_protocols.py | 28 + .../test_edges_attribute_vertex_protocols.py | 354 ++++++++++ tests/mesh/edges/test_mesh_edges_protocols.py | 345 ---------- .../test_points_attribute_vertex_protocols.py | 350 ++++++++++ .../mesh/points/test_mesh_points_protocols.py | 298 -------- ...st_polygons_attribute_polygon_protocols.py | 386 +++++++++++ ...est_polygons_attribute_vertex_protocols.py | 381 ++++++++++ .../polygons/test_mesh_polygons_protocols.py | 651 ------------------ ...olyhedra_attribute_polyhedron_protocols.py | 389 +++++++++++ ...st_polyhedra_attribute_vertex_protocols.py | 386 +++++++++++ .../test_mesh_polyhedra_protocols.py | 633 ----------------- 17 files changed, 2380 insertions(+), 1929 deletions(-) create mode 100644 tests/data/123456789/attributed_edged_curve.vtp create mode 100644 tests/data/123456789/edged_curve.vtp create mode 100644 tests/data/123456789/hat.vtp create mode 100644 tests/data/123456789/polyhedron_attribute.vtu create mode 100644 tests/data/123456789/triangulated_surface2d.vtp create mode 100644 tests/mesh/edges/attribute/edge/test_edges_attribute_edge_protocols.py create mode 100644 tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py create mode 100644 tests/mesh/points/attribute/vertex/test_points_attribute_vertex_protocols.py create mode 100644 tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py create mode 100644 tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py create mode 100644 tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py create mode 100644 tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py diff --git a/tests/conftest.py b/tests/conftest.py index 04342e60..66a5ecb9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -193,8 +193,8 @@ def server(xprocess: XProcess) -> Generator[ServerMonitor, None, None]: @pytest.fixture(scope="session", autouse=True) def configure_test_environment() -> Generator[None, None, None]: - project_root = Path(__file__).parent.parent.parent.absolute() - os.environ["DATA_FOLDER_PATH"] = str(project_root / "tests" / "data") + project_root = Path(__file__).parent.absolute() + os.environ["DATA_FOLDER_PATH"] = str(project_root / "data") config.test_config() db_path = Path(os.environ["DATA_FOLDER_PATH"]) / "project.db" diff --git a/tests/data/123456789/attributed_edged_curve.vtp b/tests/data/123456789/attributed_edged_curve.vtp new file mode 100644 index 00000000..7aa04b93 --- /dev/null +++ b/tests/data/123456789/attributed_edged_curve.vtp @@ -0,0 +1,22 @@ + + + + + + 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 + 0 0 0 3 0 0 3 3 0 0 3 0 0 0 4 3 0 4 3 3 4 0 3 4 1 1 1 2 1 1 2 2 1 1 2 1 1 1 2 2 1 2 2 2 2 1 2 2 1 1 3 2 1 3 2 2 3 1 2 3 4 1 1 5 1 1 5 2 1 4 2 1 4 1 3 5 1 3 5 2 3 4 2 3 1 1 3.5 1 2 3.5 + + + 0 0 0 3 0 0 3 3 0 0 3 0 0 0 4 3 0 4 3 3 4 0 3 4 1 1 1 2 1 1 2 2 1 1 2 1 1 1 2 2 1 2 2 2 2 1 2 2 1 1 3 2 1 3 2 2 3 1 2 3 4 1 1 5 1 1 5 2 1 4 2 1 4 1 3 5 1 3 5 2 3 4 2 3 1 1 3.5 1 2 3.5 + + + 0 1 1 2 2 3 3 0 0 1 1 5 5 4 4 0 1 2 2 6 6 5 5 1 3 2 2 6 6 7 7 3 4 5 5 6 6 7 7 4 0 3 3 7 7 4 4 0 8 9 9 10 10 11 11 8 12 13 13 14 14 15 15 12 16 17 17 18 18 19 19 16 8 9 9 13 13 12 12 8 12 13 13 17 17 16 16 12 9 10 10 14 14 13 13 9 13 14 14 18 18 17 17 13 11 10 10 14 14 15 15 11 15 14 14 18 18 19 19 15 8 11 11 15 15 12 12 8 12 15 15 19 19 16 16 12 20 21 21 22 22 23 23 20 20 21 21 25 25 24 24 20 21 22 22 26 26 25 25 21 23 22 22 26 26 27 27 23 24 25 25 26 26 27 27 24 20 23 23 27 27 24 24 20 16 19 19 29 29 28 28 16 + 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 + + + 0 1 1 2 2 3 3 0 0 1 1 5 5 4 4 0 1 2 2 6 6 5 5 1 3 2 2 6 6 7 7 3 4 5 5 6 6 7 7 4 0 3 3 7 7 4 4 0 8 9 9 10 10 11 11 8 12 13 13 14 14 15 15 12 16 17 17 18 18 19 19 16 8 9 9 13 13 12 12 8 12 13 13 17 17 16 16 12 9 10 10 14 14 13 13 9 13 14 14 18 18 17 17 13 11 10 10 14 14 15 15 11 15 14 14 18 18 19 19 15 8 11 11 15 15 12 12 8 12 15 15 19 19 16 16 12 20 21 21 22 22 23 23 20 20 21 21 25 25 24 24 20 21 22 22 26 26 25 25 21 23 22 22 26 26 27 27 23 24 25 25 26 26 27 27 24 20 23 23 27 27 24 24 20 16 19 19 29 29 28 28 16 + 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 + + + + diff --git a/tests/data/123456789/edged_curve.vtp b/tests/data/123456789/edged_curve.vtp new file mode 100644 index 00000000..7c212e64 --- /dev/null +++ b/tests/data/123456789/edged_curve.vtp @@ -0,0 +1,20 @@ + + + + + + 0.1 0.2 0.3 2.1 9.4 6.7 7.5 5.2 6.3 8.7 1.4 4.7 + + + 0.1 0.2 0.3 2.1 9.4 6.7 7.5 5.2 6.3 8.7 1.4 4.7 + + + 0 1 0 2 3 2 1 2 + + + 0 1 0 2 3 2 1 2 + 2 4 6 8 + + + + \ No newline at end of file diff --git a/tests/data/123456789/hat.vtp b/tests/data/123456789/hat.vtp new file mode 100644 index 00000000..16c8d186 --- /dev/null +++ b/tests/data/123456789/hat.vtp @@ -0,0 +1,19 @@ + + + + + + -0.0344 3.49326 -2.56294 -0.746606 3.49326 -2.41103 -0.751494 4.69435 -2.59299 -0.0344 4.66004 -2.72529 -1.4469 3.49326 -1.97797 -1.39839 4.74693 -2.20902 -1.79945 3.49326 -1.44466 -1.91178 4.77258 -1.61271 -2.0258 3.49326 -0.795094 -2.24139 4.77258 -0.886411 -2.1038 3.49326 -0.022052 -2.35496 4.77258 -0.022052 -2.0258 3.49326 0.75099 -2.24139 4.77258 0.842307 -1.79945 3.49326 1.40056 -1.91178 4.77258 1.56861 -1.4469 3.49326 1.93387 -1.39839 4.74693 2.16492 -0.769369 3.49326 2.36009 -0.751494 4.69435 2.54888 -0.0344 3.49326 2.51444 -0.0344 4.66004 2.67666 -0.751495 0.130125 -2.59299 -0.0344 0.130125 -2.72529 -0.0344 0.57239 -0.022052 -1.39839 0.228344 -2.20902 -1.91178 0.409344 -1.61271 -2.24139 0.507502 -0.886411 -2.35496 0.577983 -0.022052 -2.24139 0.507502 0.842307 -1.91178 0.409344 1.56861 -1.39839 0.228344 2.16492 -0.751494 0.130125 2.54888 -0.0344 0.130125 2.67666 -0.0344 4.66004 -2.72529 -0.751494 4.69435 -2.59299 -0.0344 4.4761 -0.022052 -1.39839 4.74693 -2.20902 -1.91178 4.77258 -1.61271 -2.24139 4.77258 -0.886411 -2.35496 4.77258 -0.022052 -2.24139 4.77258 0.842307 -1.91178 4.77258 1.56861 -1.39839 4.74693 2.16492 -0.751494 4.69435 2.54888 -0.0344 4.66004 2.67666 -0.0344 1.3315 -2.65285 -0.751495 1.3315 -2.53987 -0.769231 2.52268 -2.42928 -0.0344 2.52268 -2.56294 -1.39839 1.3315 -2.20902 -1.46662 2.52268 -2.03076 -1.91178 1.3315 -1.61271 -1.75379 2.52268 -1.48306 -2.17435 1.3315 -0.886411 -1.93816 2.52268 -0.815959 -2.29561 1.3315 -0.022052 -2.00169 2.52268 -0.022052 -2.19511 1.3315 0.842307 -1.93816 2.52268 0.771855 -1.88773 1.3315 1.53967 -1.75379 2.52268 1.43896 -1.39839 1.3315 2.16492 -1.46662 2.52268 1.98666 -0.751494 1.3315 2.50364 -0.772059 2.52268 2.36009 -0.0344 1.3315 2.59863 -0.0344 2.52268 2.51444 -0.0344 0.282663 -2.8649 -0.823894 0.282663 -2.72047 -0.823894 1.3315 -2.66735 -0.0344 1.3315 -2.79246 -1.52391 0.380882 -2.30754 -1.52391 1.3315 -2.30754 -2.06804 0.561882 -1.67818 -2.06804 1.3315 -1.67818 -2.41302 0.66004 -0.918576 -2.34598 1.3315 -0.918576 -2.53151 0.730521 -0.022052 -2.47216 1.3315 -0.022052 -2.41302 0.66004 0.874472 -2.36674 1.3315 0.874472 -2.06804 0.561882 1.63407 -2.04399 1.3315 1.60513 -1.52391 0.380882 2.26344 -1.52391 1.3315 2.26344 -0.823893 0.282663 2.67636 -0.823893 1.3315 2.63112 -0.0344 0.282663 2.83422 -0.0344 1.3315 2.7562 -0.823894 0.130125 -2.72047 -0.0344 0.130125 -2.8649 -0.751495 1.3315 -2.53987 -0.0344 1.3315 -2.65285 -1.52391 0.228344 -2.30754 -1.39839 1.3315 -2.20902 -2.06804 0.409344 -1.67818 -1.91178 1.3315 -1.61271 -2.41302 0.507502 -0.918576 -2.17435 1.3315 -0.886411 -2.53151 0.577983 -0.022052 -2.29561 1.3315 -0.022052 -2.41302 0.507502 0.874472 -2.19511 1.3315 0.842307 -2.06804 0.409344 1.63407 -1.88773 1.3315 1.53967 -1.52391 0.228344 2.26344 -1.39839 1.3315 2.16492 -0.823893 0.130125 2.67636 -0.751494 1.3315 2.50364 -0.0344 0.130125 2.83422 -0.0344 1.3315 2.59863 -0.781923 0.340472 -3.34805 -0.0344 0.340472 -3.57671 -0.0344 0.537192 -4.00029 -0.865588 0.553411 -3.75283 -0.015451 0.249473 -3.57671 -0.781923 0.249473 -3.34805 -0.865588 0.400873 -3.75283 -0.0344 0.384654 -4.00029 -1.7248 0.399066 -2.74593 -2.05218 0.700237 -3.10557 -1.7248 0.308067 -2.74593 -2.05218 0.547699 -3.10557 -2.34592 0.507044 -2.03123 -2.79495 0.793754 -2.33236 -2.34592 0.466811 -2.03123 -2.79495 0.732266 -2.33236 -2.7394 0.580814 -1.10784 -3.11037 1.07182 -1.23796 -2.7394 0.562605 -1.10784 -3.11037 0.842107 -1.23796 -2.83875 0.669153 -0.022052 -3.23206 1.17795 -0.022052 -2.83875 0.609911 -0.022052 -3.23206 0.948245 -0.022052 -2.7394 0.580814 1.06374 -3.09099 1.10135 1.23241 -2.7394 0.54025 1.06374 -3.09099 0.871645 1.23241 -2.34592 0.507044 1.98712 -2.7773 0.953484 2.28609 -2.34592 0.429825 1.98712 -2.7773 0.800946 2.28609 -1.7248 0.399066 2.70183 -2.05218 0.802252 3.06147 -1.7248 0.308067 2.70183 -2.05218 0.649714 3.06147 -0.78192 0.340472 3.30395 -0.85871 0.57721 3.67978 -0.78192 0.249473 3.30395 -0.85871 0.424672 3.67978 -0.0344 0.340472 3.5326 -0.0344 0.530215 3.84547 -0.0344 0.249473 3.5326 -0.0344 0.402693 3.84547 -0.0344 0.130125 -2.8649 -0.823894 0.130125 -2.72047 -1.52391 0.228344 -2.30754 -2.06804 0.409344 -1.67818 -2.41302 0.507502 -0.918576 -2.53151 0.577983 -0.022052 -2.41302 0.507502 0.874472 -2.06804 0.409344 1.63407 -1.52391 0.228344 2.26344 -0.823893 0.130125 2.67636 -0.0344 0.130125 2.83422 -0.0344 0.282663 2.83422 -0.823893 0.282663 2.67636 -1.52391 0.380882 2.26344 -2.06804 0.561882 1.63407 -2.41302 0.66004 0.874472 -2.53151 0.730521 -0.022052 -2.41302 0.66004 -0.918576 -2.06804 0.561882 -1.67818 -1.52391 0.380882 -2.30754 -0.823894 0.282663 -2.72047 -0.0344 0.282663 -2.8649 -0.0344 0.589297 -4.10777 -0.869538 0.663207 -3.89456 -2.15592 0.846941 -3.20213 -2.88945 0.978742 -2.42408 -3.2188 1.23977 -1.31163 -3.34788 1.34591 -0.022052 -3.20918 1.25444 1.28668 -2.88695 1.08119 2.32146 -2.13806 0.868175 3.12571 -0.887083 0.649851 3.76697 -0.0344 0.586603 3.927 -0.0344 0.459081 3.927 -0.887083 0.497313 3.76697 -2.13806 0.715637 3.12571 -2.88695 0.928653 2.32146 -3.20918 1.02474 1.28668 -3.34788 1.1162 -0.022052 -3.2188 1.01006 -1.31163 -2.88945 0.871431 -2.42408 -2.15592 0.694403 -3.20213 -0.869538 0.510669 -3.89456 -0.0344 0.436759 -4.10777 -0.0344 0.576503 -4.19294 -0.0344 0.545644 -4.21385 -0.823442 0.677094 -4.02919 -0.851438 0.704302 -4.00471 -2.21428 0.898458 -3.28909 -2.20761 0.913142 -3.26968 -0.0344 0.477241 -4.21385 -0.0344 0.446834 -4.1915 -0.879207 0.585849 -3.96306 -0.848911 0.621782 -3.99453 -2.21325 0.781882 -3.28577 -2.21498 0.826447 -3.30575 -2.9287 1.06571 -2.51707 -2.9182 1.07541 -2.49482 -2.94401 0.952947 -2.49611 -2.94938 0.998373 -2.51213 -3.27121 1.30962 -1.38873 -3.25325 1.31278 -1.38906 -3.28384 1.11632 -1.36809 -3.29307 1.16573 -1.37997 -3.40801 1.4161 -0.022052 -3.39036 1.42168 -0.040673 -3.41799 1.22153 -0.039394 -3.42899 1.27153 -0.022052 -3.27125 1.30965 1.34431 -3.25896 1.32204 1.30749 -3.28397 1.11828 1.31821 -3.29304 1.1657 1.33619 -3.25896 1.32204 1.30749 -2.94347 1.11265 2.35161 -2.93753 1.13404 2.32155 -2.94826 0.995344 2.34972 -2.95948 1.04334 2.36112 -2.16903 0.837924 3.18657 -2.18152 0.868241 3.15349 -2.16835 0.765307 3.1478 -2.16456 0.807479 3.17251 -0.846103 0.625209 3.8584 -0.851219 0.652778 3.8302 -0.910606 0.523476 3.82195 -0.896708 0.559322 3.84767 -0.0344 0.562771 4.00852 -0.0344 0.586074 3.98748 -0.0344 0.477578 3.98653 -0.0344 0.505585 4.00852 -0.823442 0.677094 -4.02919 -0.0344 0.545644 -4.21385 -2.21428 0.898458 -3.28909 -2.9287 1.06571 -2.51707 -3.27121 1.30962 -1.38873 -3.40801 1.4161 -0.022052 -3.27125 1.30965 1.34431 -2.94347 1.11265 2.35161 -2.16903 0.837924 3.18657 -0.846103 0.625209 3.8584 -0.0344 0.562771 4.00852 0.682694 4.69435 -2.59299 0.677806 3.49326 -2.41103 1.32959 4.74693 -2.20902 1.3781 3.49326 -1.97797 1.84298 4.77258 -1.61271 1.73065 3.49326 -1.44466 2.17259 4.77258 -0.886411 1.95701 3.49326 -0.795094 2.28616 4.77258 -0.022052 2.035 3.49326 -0.022052 2.17259 4.77258 0.842307 1.95701 3.49326 0.75099 1.95701 3.49326 0.75099 2.17259 4.77258 0.842307 1.84298 4.77258 1.56861 1.73065 3.49326 1.40056 1.32959 4.74693 2.16492 1.3781 3.49326 1.93387 0.682694 4.69435 2.54888 0.700569 3.49326 2.36009 0.682694 0.130125 -2.59299 1.32959 0.228344 -2.20902 1.84298 0.409344 -1.61271 2.17259 0.507502 -0.886411 2.28616 0.577983 -0.022052 2.17259 0.507502 0.842307 1.84298 0.409344 1.56861 1.32959 0.228344 2.16492 0.682694 0.130125 2.54888 0.682694 4.69435 -2.59299 1.32959 4.74693 -2.20902 1.84298 4.77258 -1.61271 2.17259 4.77258 -0.886411 2.28616 4.77258 -0.022052 2.17259 4.77258 0.842307 1.84298 4.77258 1.56861 1.32959 4.74693 2.16492 0.682694 4.69435 2.54888 0.700431 2.52268 -2.42928 0.682694 1.3315 -2.53987 1.39782 2.52268 -2.03076 1.32959 1.3315 -2.20902 1.68499 2.52268 -1.48306 1.84298 1.3315 -1.61271 1.86936 2.52268 -0.815959 2.10555 1.3315 -0.886411 1.93289 2.52268 -0.022052 2.22681 1.3315 -0.022052 1.86936 2.52268 0.771855 2.12631 1.3315 0.842307 2.12631 1.3315 0.842307 1.86936 2.52268 0.771855 1.68499 2.52268 1.43896 1.81893 1.3315 1.53967 1.39782 2.52268 1.98666 1.32959 1.3315 2.16492 0.703259 2.52268 2.36009 0.682694 1.3315 2.50364 0.755094 1.3315 -2.66735 0.755094 0.282663 -2.72047 1.45511 1.3315 -2.30754 1.45511 0.380882 -2.30754 1.99924 1.3315 -1.67818 1.99924 0.561882 -1.67818 2.27718 1.3315 -0.918576 2.34422 0.66004 -0.918576 2.40336 1.3315 -0.022052 2.46271 0.730521 -0.022052 2.29794 1.3315 0.874472 2.34422 0.66004 0.874472 2.34422 0.66004 0.874472 2.29794 1.3315 0.874472 1.9752 1.3315 1.60513 1.99924 0.561882 1.63407 1.45511 1.3315 2.26344 1.45511 0.380882 2.26344 0.755093 1.3315 2.63112 0.755093 0.282663 2.67636 0.755094 0.130125 -2.72047 0.682694 1.3315 -2.53987 1.45511 0.228344 -2.30754 1.32959 1.3315 -2.20902 1.99924 0.409344 -1.67818 1.84298 1.3315 -1.61271 2.34422 0.507502 -0.918576 2.10555 1.3315 -0.886411 2.46271 0.577983 -0.022052 2.22681 1.3315 -0.022052 2.34422 0.507502 0.874472 2.12631 1.3315 0.842307 1.99924 0.409344 1.63407 1.81893 1.3315 1.53967 2.12631 1.3315 0.842307 1.45511 0.228344 2.26344 1.32959 1.3315 2.16492 0.755093 0.130125 2.67636 0.682694 1.3315 2.50364 0.713123 0.340472 -3.34805 0.796788 0.553411 -3.75283 -0.053349 0.249473 -3.57671 0.796788 0.400873 -3.75283 0.713123 0.249473 -3.34805 1.656 0.399066 -2.74593 1.98338 0.700237 -3.10557 1.98338 0.547699 -3.10557 1.656 0.308067 -2.74593 2.27712 0.507044 -2.03123 2.72615 0.793754 -2.33236 2.72615 0.732266 -2.33236 2.27712 0.466811 -2.03123 2.6706 0.580814 -1.10784 3.04157 1.07182 -1.23796 3.04157 0.842107 -1.23796 2.6706 0.562605 -1.10784 2.76995 0.669153 -0.022052 3.16326 1.17795 -0.022052 3.16326 0.948245 -0.022052 2.76995 0.609911 -0.022052 2.6706 0.580814 1.06374 3.02219 1.10135 1.23241 3.02219 0.871645 1.23241 2.6706 0.54025 1.06374 2.27712 0.507044 1.98712 2.7085 0.953484 2.28609 2.7085 0.800946 2.28609 2.27712 0.429825 1.98712 1.656 0.399066 2.70183 1.98338 0.802252 3.06147 1.98338 0.649714 3.06147 1.656 0.308067 2.70183 0.71312 0.340472 3.30395 0.78991 0.57721 3.67978 0.78991 0.424672 3.67978 0.71312 0.249473 3.30395 -0.0344 0.340472 3.5326 -0.0344 0.530215 3.84547 -0.0344 0.402693 3.84547 -0.0344 0.249473 3.5326 0.755094 0.130125 -2.72047 1.45511 0.228344 -2.30754 1.99924 0.409344 -1.67818 2.34422 0.507502 -0.918576 2.46271 0.577983 -0.022052 2.34422 0.507502 0.874472 1.99924 0.409344 1.63407 1.45511 0.228344 2.26344 0.755093 0.130125 2.67636 -0.0344 0.130125 2.83422 -0.0344 0.282663 2.83422 0.755093 0.282663 2.67636 1.45511 0.380882 2.26344 1.99924 0.561882 1.63407 2.34422 0.66004 0.874472 2.46271 0.730521 -0.022052 2.34422 0.66004 -0.918576 1.99924 0.561882 -1.67818 1.45511 0.380882 -2.30754 0.755094 0.282663 -2.72047 0.800738 0.663207 -3.89456 2.08712 0.846941 -3.20213 2.82065 0.978742 -2.42408 3.15 1.23977 -1.31163 3.27908 1.34591 -0.022052 3.14038 1.25444 1.28668 2.81815 1.08119 2.32146 2.06926 0.868175 3.12571 0.818283 0.649851 3.76697 -0.0344 0.586603 3.927 0.818283 0.497313 3.76697 -0.0344 0.459081 3.927 2.06926 0.715637 3.12571 2.81815 0.928653 2.32146 3.14038 1.02474 1.28668 3.27908 1.1162 -0.022052 3.15 1.01006 -1.31163 2.82065 0.871431 -2.42408 2.08712 0.694403 -3.20213 0.800738 0.510669 -3.89456 0.782638 0.704302 -4.00471 0.754642 0.677094 -4.02919 2.13881 0.913142 -3.26968 2.14548 0.898458 -3.28909 0.780111 0.621782 -3.99453 0.810407 0.585849 -3.96306 2.14618 0.826447 -3.30575 2.14445 0.781882 -3.28577 2.8494 1.07541 -2.49482 2.8599 1.06571 -2.51707 2.88058 0.998373 -2.51213 2.87521 0.952947 -2.49611 3.18445 1.31278 -1.38906 3.20241 1.30962 -1.38873 3.22427 1.16573 -1.37997 3.21504 1.11632 -1.36809 3.32156 1.42168 -0.040673 3.33921 1.4161 -0.022052 3.36019 1.27153 -0.022052 3.34919 1.22153 -0.039394 3.19016 1.32204 1.30749 3.20245 1.30965 1.34431 3.22424 1.1657 1.33619 3.21517 1.11828 1.31821 2.86873 1.13404 2.32155 2.87467 1.11265 2.35161 2.89068 1.04334 2.36112 2.87946 0.995344 2.34972 2.11272 0.868241 3.15349 2.10023 0.837924 3.18657 2.09576 0.807479 3.17251 2.09955 0.765307 3.1478 0.782419 0.652778 3.8302 0.777303 0.625209 3.8584 0.827908 0.559322 3.84767 0.841806 0.523476 3.82195 -0.0344 0.586074 3.98748 -0.0344 0.562771 4.00852 -0.0344 0.505585 4.00852 -0.0344 0.477578 3.98653 0.754642 0.677094 -4.02919 2.14548 0.898458 -3.28909 2.8599 1.06571 -2.51707 3.20241 1.30962 -1.38873 3.33921 1.4161 -0.022052 3.20245 1.30965 1.34431 2.87467 1.11265 2.35161 2.10023 0.837924 3.18657 0.777303 0.625209 3.8584 -0.0344 0.562771 4.00852 + 0.094832 0.332542 0.094898 0.376287 0.02427 0.372826 0.026265 0.332319 0.095031 0.425584 0.021479 0.41466 0.09492 0.463978 0.019723 0.458455 0.094834 0.505035 0.019154 0.503036 0.095175 0.551185 0.019303 0.552076 0.09592 0.597323 0.020303 0.601106 0.096959 0.638355 0.02192 0.645665 0.097993 0.676721 0.02472 0.689413 0.09899 0.7246 0.028507 0.731176 0.100089 0.769556 0.031498 0.771601 0.625671 0.131366 0.667361 0.123777 0.667361 0.283352 0.588028 0.154305 0.557903 0.190301 0.538759 0.232921 0.532169 0.283349 0.538757 0.333777 0.5579 0.3764 0.588023 0.412396 0.625667 0.435336 0.667357 0.442667 0.701803 0.665625 0.743838 0.673233 0.701804 0.823361 0.78192 0.695516 0.812079 0.730322 0.831342 0.772815 0.837985 0.823359 0.831343 0.873903 0.81208 0.916398 0.781923 0.951204 0.743839 0.973488 0.701803 0.980834 0.220878 0.33297 0.220898 0.3736 0.151363 0.376972 0.151322 0.332731 0.221058 0.41421 0.151686 0.424532 0.221832 0.457948 0.151551 0.461361 0.22239 0.500896 0.151569 0.502846 0.223411 0.549658 0.151975 0.550518 0.223816 0.598279 0.152719 0.598199 0.223596 0.640559 0.153598 0.639627 0.224294 0.684796 0.154639 0.676477 0.225308 0.725559 0.155475 0.723222 0.226169 0.76593 0.156648 0.767906 0.366621 0.314135 0.370778 0.360637 0.309866 0.366524 0.305702 0.320589 0.36826 0.408194 0.313021 0.411675 0.360451 0.457158 0.315734 0.459358 0.356888 0.505806 0.317555 0.50596 0.353674 0.55835 0.31849 0.55841 0.357077 0.61096 0.317888 0.61057 0.360723 0.659716 0.315919 0.656589 0.368041 0.708813 0.312883 0.704705 0.369917 0.756557 0.309099 0.74987 0.364996 0.803308 0.304237 0.795555 0.621414 0.123954 0.667361 0.115625 0.301453 0.365519 0.29767 0.321443 0.580655 0.148631 0.304052 0.410059 0.548775 0.18652 0.306087 0.458418 0.528748 0.231058 0.307385 0.505593 0.521874 0.283349 0.308262 0.558344 0.528746 0.33564 0.307831 0.611121 0.54877 0.38018 0.306124 0.657551 0.58065 0.41807 0.303914 0.706019 0.621409 0.442748 0.300662 0.750704 0.667357 0.451863 0.295216 0.794401 0.747816 0.522723 0.704318 0.51024 0.704401 0.482888 0.752961 0.496031 0.70126 0.046407 0.65623 0.058699 0.652001 0.03321 0.700256 0.020278 0.805374 0.553052 0.825597 0.526461 0.597832 0.088207 0.579236 0.062532 0.848363 0.588283 0.874439 0.564328 0.552839 0.121926 0.527357 0.097438 0.882337 0.635905 0.91438 0.618698 0.516624 0.168647 0.4928 0.153579 0.907193 0.694808 0.943298 0.683752 0.490956 0.227274 0.462076 0.217513 0.920151 0.757238 0.957798 0.755851 0.475555 0.289288 0.445688 0.288919 0.919629 0.815368 0.959429 0.820361 0.476041 0.348003 0.438819 0.352346 0.904605 0.868256 0.939502 0.879558 0.490663 0.40128 0.457663 0.41161 0.874194 0.925303 0.892717 0.943795 0.520532 0.458895 0.50334 0.47632 0.844202 0.959233 0.856473 0.97688 0.550157 0.493334 0.538514 0.510275 0.700276 0.088498 0.651938 0.095843 0.606187 0.115449 0.564538 0.145731 0.532161 0.184574 0.508161 0.233054 0.497391 0.285863 0.49928 0.335859 0.513434 0.384338 0.537977 0.425952 0.572212 0.458276 0.82299 0.924182 0.857792 0.892443 0.882629 0.851005 0.896502 0.802679 0.898271 0.752898 0.889512 0.700251 0.866733 0.651886 0.836498 0.611867 0.796929 0.579793 0.752066 0.559312 0.704195 0.551877 0.704423 0.475821 0.75396 0.485643 0.833562 0.517538 0.883709 0.555172 0.924344 0.611108 0.954737 0.68027 0.969521 0.755551 0.969325 0.819496 0.946664 0.880731 0.898038 0.94802 0.859918 0.981532 0.534859 0.515004 0.497978 0.480376 0.450453 0.412658 0.428982 0.351334 0.433983 0.288403 0.45064 0.213761 0.483044 0.145785 0.519836 0.089047 0.571495 0.053465 0.651114 0.022736 0.700256 0.013214 0.704437 0.47095 0.704443 0.46875 0.751349 0.476932 0.753008 0.478929 0.837479 0.511086 0.837205 0.51246 0.700256 0.006714 0.700256 0.008695 0.649803 0.017065 0.651023 0.014056 0.567462 0.046878 0.566332 0.044443 0.887629 0.54768 0.887402 0.549177 0.51589 0.083218 0.514241 0.081149 0.928384 0.604863 0.927419 0.605255 0.477268 0.140294 0.474929 0.138515 0.9606 0.678425 0.95926 0.677728 0.443944 0.210482 0.440831 0.210528 0.975932 0.757202 0.974515 0.7553 0.426838 0.287997 0.423945 0.288396 0.974595 0.755269 0.9744 0.819963 0.973243 0.818164 0.423612 0.351215 0.42089 0.351427 0.950079 0.883706 0.949472 0.88108 0.44694 0.413117 0.444738 0.414779 0.898948 0.954398 0.898056 0.952251 0.494831 0.482277 0.493522 0.484396 0.862672 0.986113 0.861739 0.984539 0.532516 0.51795 0.530823 0.519367 0.651708 0.010158 0.700255 0.003125 0.563435 0.041514 0.511656 0.078216 0.467581 0.134407 0.432818 0.207824 0.415625 0.287284 0.416966 0.351371 0.443148 0.415492 0.492025 0.488817 0.528192 0.521526 0.024511 0.2918 0.095175 0.28881 0.021946 0.249934 0.095615 0.239557 0.020389 0.206043 0.095717 0.201264 0.020016 0.161181 0.095849 0.160429 0.020683 0.111413 0.096541 0.114752 0.023509 0.061055 0.098243 0.069425 0.106547 0.940132 0.031679 0.945194 0.02911 0.899236 0.104524 0.899932 0.029164 0.854539 0.103262 0.862064 0.030683 0.812234 0.10152 0.814438 0.709051 0.131368 0.746695 0.154306 0.776819 0.190302 0.795961 0.232925 0.802551 0.283353 0.795958 0.333783 0.776818 0.376404 0.74669 0.4124 0.709047 0.435337 0.659768 0.673233 0.621687 0.695518 0.591531 0.730322 0.572265 0.772815 0.565624 0.823359 0.572265 0.873901 0.591529 0.916395 0.621685 0.951202 0.659767 0.973488 0.151672 0.288502 0.221195 0.292344 0.152334 0.240987 0.221678 0.251729 0.152489 0.204257 0.222839 0.207924 0.152833 0.162999 0.223805 0.164706 0.153454 0.115847 0.224988 0.115156 0.15375 0.069172 0.224018 0.064949 0.232192 0.936509 0.161798 0.935652 0.161069 0.895255 0.231109 0.892603 0.160071 0.858971 0.229405 0.847494 0.158157 0.812511 0.227845 0.80637 0.300283 0.27483 0.361061 0.267729 0.293902 0.230155 0.348583 0.221618 0.28623 0.183238 0.330277 0.175264 0.277297 0.137773 0.31548 0.128366 0.265121 0.087103 0.298994 0.077861 0.250029 0.037095 0.287758 0.026065 0.307443 0.987593 0.269485 0.977286 0.280398 0.932431 0.324303 0.9415 0.289949 0.885442 0.34427 0.895766 0.297635 0.840959 0.35816 0.849878 0.713309 0.123955 0.292271 0.277597 0.754068 0.148632 0.285488 0.233683 0.785946 0.186522 0.277038 0.186353 0.805972 0.231061 0.267523 0.140613 0.812845 0.283353 0.255353 0.089954 0.805971 0.335645 0.240456 0.040862 0.785943 0.380185 0.271318 0.928762 0.260349 0.972473 0.754062 0.418074 0.281626 0.881834 0.713304 0.442748 0.289683 0.838007 0.660749 0.522466 0.655763 0.495743 0.699265 0.046406 0.748519 0.033178 0.744301 0.058667 0.603012 0.552449 0.582947 0.525738 0.821301 0.062455 0.802715 0.088136 0.559814 0.587423 0.533879 0.563312 0.873194 0.097345 0.847715 0.121833 0.525554 0.634839 0.493615 0.617442 0.907749 0.153486 0.883924 0.168548 0.500349 0.693594 0.46431 0.682327 0.938445 0.217433 0.909563 0.227181 0.487031 0.755945 0.449393 0.754341 0.954785 0.28885 0.92492 0.2892 0.48722 0.814076 0.447394 0.818843 0.961603 0.352281 0.924386 0.347912 0.501948 0.867048 0.466986 0.878153 0.942713 0.411529 0.909722 0.401175 0.53204 0.924262 0.513414 0.942649 0.896988 0.476206 0.87981 0.458768 0.561842 0.958361 0.549472 0.975937 0.861791 0.510134 0.850159 0.493184 0.748615 0.095808 0.794371 0.115381 0.83602 0.145639 0.868387 0.184471 0.892356 0.232952 0.903089 0.28576 0.901159 0.33575 0.886964 0.384217 0.862391 0.425811 0.82813 0.458109 0.58325 0.923426 0.548626 0.891496 0.524018 0.849919 0.510419 0.801519 0.508934 0.751729 0.517998 0.699139 0.541063 0.650913 0.571538 0.611078 0.611297 0.57924 0.656282 0.559029 0.654827 0.48535 0.575034 0.51677 0.524664 0.554101 0.483695 0.609793 0.452894 0.678775 0.43767 0.753973 0.437508 0.817925 0.459816 0.879285 0.508068 0.946845 0.546002 0.980568 0.902348 0.480266 0.865442 0.514867 0.949921 0.412583 0.971437 0.351275 0.966488 0.288339 0.949879 0.213686 0.917505 0.145693 0.880714 0.088954 0.829043 0.053388 0.749404 0.022706 0.655817 0.478642 0.657491 0.476653 0.571421 0.511669 0.571158 0.510294 0.749493 0.014026 0.750714 0.017036 0.834203 0.044366 0.833074 0.0468 0.521006 0.548085 0.52079 0.546588 0.886308 0.081057 0.88466 0.083127 0.480654 0.603921 0.479691 0.603524 0.925617 0.138428 0.923279 0.140206 0.448387 0.676205 0.447039 0.676894 0.959685 0.210457 0.956574 0.21041 0.432639 0.753675 0.43125 0.755583 0.976524 0.288337 0.973632 0.287936 0.433598 0.816568 0.432429 0.818362 0.979526 0.351371 0.976807 0.351159 0.457006 0.879622 0.456385 0.882244 0.955633 0.414705 0.953433 0.413043 0.508028 0.951075 0.507124 0.95322 0.9068 0.48429 0.905493 0.482169 0.544164 0.983565 0.543222 0.985137 0.869474 0.519233 0.867782 0.517815 0.748806 0.01013 0.837099 0.041434 0.888893 0.078125 0.932966 0.13432 0.967699 0.207757 0.984845 0.287231 0.98345 0.351318 0.957222 0.41542 0.908294 0.488712 0.872104 0.521395 + + + -0.0344 3.493262 -2.562941 -0.746606 3.493262 -2.41103 -0.751494 4.694354 -2.592987 -0.0344 4.660035 -2.725293 -1.446901 3.493262 -1.977972 -1.398394 4.746935 -2.20902 -1.799453 3.493262 -1.444664 -1.911777 4.772578 -1.612713 -2.025805 3.493262 -0.795094 -2.241389 4.772578 -0.886411 -2.103801 3.493262 -0.022052 -2.354965 4.772578 -0.022052 -2.025805 3.493262 0.75099 -2.241389 4.772578 0.842307 -1.799453 3.493262 1.40056 -1.911777 4.772578 1.568609 -1.4469 3.493262 1.933868 -1.398394 4.746935 2.164915 -0.769369 3.493262 2.360093 -0.751494 4.694354 2.548882 -0.0344 3.493262 2.514439 -0.0344 4.660035 2.676657 -0.751495 0.130125 -2.592987 -0.0344 0.130125 -2.725293 -0.0344 0.57239 -0.022052 -1.398394 0.228344 -2.20902 -1.911777 0.409344 -1.612713 -2.241389 0.507502 -0.886411 -2.354965 0.577983 -0.022052 -2.241389 0.507502 0.842307 -1.911777 0.409344 1.568609 -1.398394 0.228344 2.164915 -0.751494 0.130125 2.548882 -0.0344 0.130125 2.676657 -0.0344 4.660035 -2.725293 -0.751494 4.694354 -2.592987 -0.0344 4.476099 -0.022052 -1.398394 4.746935 -2.20902 -1.911777 4.772578 -1.612713 -2.241389 4.772578 -0.886411 -2.354965 4.772578 -0.022052 -2.241389 4.772578 0.842307 -1.911777 4.772578 1.568609 -1.398394 4.746935 2.164915 -0.751494 4.694354 2.548882 -0.0344 4.660035 2.676657 -0.0344 1.331498 -2.652847 -0.751495 1.331498 -2.539865 -0.769231 2.522677 -2.429281 -0.0344 2.522677 -2.562941 -1.398394 1.331498 -2.20902 -1.466622 2.522677 -2.030764 -1.911777 1.331498 -1.612713 -1.753786 2.522677 -1.483062 -2.174351 1.331498 -0.886411 -1.938156 2.522677 -0.815959 -2.295615 1.331498 -0.022052 -2.001686 2.522677 -0.022052 -2.195112 1.331498 0.842307 -1.938156 2.522677 0.771855 -1.887729 1.331498 1.539671 -1.753786 2.522677 1.438958 -1.398394 1.331498 2.164916 -1.466621 2.522677 1.98666 -0.751494 1.331498 2.503637 -0.772059 2.522677 2.360093 -0.0344 1.331498 2.598635 -0.0344 2.522677 2.514439 -0.0344 0.282663 -2.864904 -0.823894 0.282663 -2.72047 -0.823894 1.331498 -2.667348 -0.0344 1.331498 -2.792458 -1.523911 0.380882 -2.307545 -1.523911 1.331498 -2.307545 -2.068043 0.561882 -1.678178 -2.068043 1.331498 -1.678178 -2.413019 0.66004 -0.918576 -2.345981 1.331498 -0.918576 -2.531511 0.730521 -0.022052 -2.472161 1.331498 -0.022052 -2.413019 0.66004 0.874472 -2.366743 1.331498 0.874472 -2.068043 0.561882 1.634074 -2.043995 1.331498 1.605135 -1.523911 0.380882 2.26344 -1.523911 1.331498 2.263441 -0.823893 0.282663 2.676365 -0.823893 1.331498 2.63112 -0.0344 0.282663 2.83422 -0.0344 1.331498 2.756198 -0.823894 0.130125 -2.72047 -0.0344 0.130125 -2.864904 -0.751495 1.331498 -2.539865 -0.0344 1.331498 -2.652847 -1.523911 0.228344 -2.307545 -1.398394 1.331498 -2.20902 -2.068043 0.409344 -1.678178 -1.911777 1.331498 -1.612713 -2.413019 0.507502 -0.918576 -2.174351 1.331498 -0.886411 -2.531511 0.577983 -0.022052 -2.295615 1.331498 -0.022052 -2.413019 0.507502 0.874472 -2.195112 1.331498 0.842307 -2.068043 0.409344 1.634074 -1.887729 1.331498 1.539671 -1.523911 0.228344 2.26344 -1.398394 1.331498 2.164916 -0.823893 0.130125 2.676365 -0.751494 1.331498 2.503637 -0.0344 0.130125 2.83422 -0.0344 1.331498 2.598635 -0.781923 0.340472 -3.348053 -0.0344 0.340472 -3.57671 -0.0344 0.537192 -4.000288 -0.865588 0.553411 -3.752826 -0.015451 0.249473 -3.57671 -0.781923 0.249473 -3.348053 -0.865588 0.400873 -3.752826 -0.0344 0.384654 -4.000288 -1.724804 0.399066 -2.745932 -2.052179 0.700237 -3.105572 -1.724804 0.308067 -2.745932 -2.052179 0.547699 -3.105572 -2.345921 0.507044 -2.031226 -2.794952 0.793754 -2.332355 -2.345921 0.466811 -2.031226 -2.794952 0.732266 -2.332355 -2.739404 0.580814 -1.10784 -3.110374 1.071816 -1.237957 -2.739404 0.562605 -1.10784 -3.110374 0.842107 -1.237957 -2.838752 0.669153 -0.022052 -3.232058 1.177954 -0.022052 -2.838752 0.609911 -0.022052 -3.232058 0.948245 -0.022052 -2.739404 0.580814 1.063737 -3.090993 1.101355 1.232407 -2.739404 0.54025 1.063737 -3.090993 0.871645 1.232407 -2.345921 0.507044 1.987123 -2.777296 0.953484 2.286094 -2.345921 0.429825 1.987123 -2.777296 0.800946 2.286094 -1.724803 0.399066 2.70183 -2.052179 0.802252 3.061471 -1.724803 0.308067 2.70183 -2.052179 0.649714 3.061471 -0.78192 0.340472 3.303948 -0.85871 0.57721 3.679776 -0.78192 0.249473 3.303948 -0.85871 0.424672 3.679776 -0.0344 0.340472 3.532603 -0.0344 0.530215 3.845471 -0.0344 0.249473 3.532603 -0.0344 0.402693 3.845471 -0.0344 0.130125 -2.864904 -0.823894 0.130125 -2.72047 -1.523911 0.228344 -2.307545 -2.068043 0.409344 -1.678178 -2.413019 0.507502 -0.918576 -2.531511 0.577983 -0.022052 -2.413019 0.507502 0.874472 -2.068043 0.409344 1.634074 -1.523911 0.228344 2.26344 -0.823893 0.130125 2.676365 -0.0344 0.130125 2.83422 -0.0344 0.282663 2.83422 -0.823893 0.282663 2.676365 -1.523911 0.380882 2.26344 -2.068043 0.561882 1.634074 -2.413019 0.66004 0.874472 -2.531511 0.730521 -0.022052 -2.413019 0.66004 -0.918576 -2.068043 0.561882 -1.678178 -1.523911 0.380882 -2.307545 -0.823894 0.282663 -2.72047 -0.0344 0.282663 -2.864904 -0.0344 0.589297 -4.107771 -0.869538 0.663207 -3.894555 -2.155919 0.846941 -3.202126 -2.889453 0.978742 -2.424076 -3.218804 1.239773 -1.311634 -3.347876 1.345911 -0.022052 -3.209177 1.254445 1.286681 -2.886946 1.081191 2.321457 -2.138058 0.868175 3.125713 -0.887083 0.649851 3.766972 -0.0344 0.586603 3.927003 -0.0344 0.459081 3.927003 -0.887083 0.497313 3.766972 -2.138058 0.715637 3.125713 -2.886946 0.928653 2.321457 -3.209177 1.024736 1.286681 -3.347876 1.116202 -0.022052 -3.218804 1.010064 -1.311634 -2.889453 0.871431 -2.424076 -2.155919 0.694403 -3.202126 -0.869538 0.510669 -3.894555 -0.0344 0.436759 -4.107771 -0.0344 0.576503 -4.192942 -0.0344 0.545644 -4.213854 -0.823442 0.677094 -4.029192 -0.851438 0.704302 -4.004708 -2.214278 0.898458 -3.289094 -2.207614 0.913142 -3.269681 -0.0344 0.477241 -4.213854 -0.0344 0.446834 -4.191503 -0.879207 0.585849 -3.963062 -0.848911 0.621782 -3.994534 -2.213251 0.781882 -3.285772 -2.214977 0.826447 -3.30575 -2.928702 1.065706 -2.517072 -2.918196 1.075407 -2.494825 -2.944005 0.952947 -2.496109 -2.949385 0.998373 -2.512132 -3.271213 1.309622 -1.388729 -3.253246 1.312782 -1.389062 -3.283839 1.116323 -1.368089 -3.29307 1.165728 -1.379971 -3.408014 1.416102 -0.022052 -3.390357 1.421677 -0.040673 -3.417988 1.221526 -0.039394 -3.428995 1.271526 -0.022052 -3.271245 1.309647 1.344309 -3.258964 1.322036 1.307493 -3.283968 1.118276 1.318214 -3.293038 1.165704 1.336188 -3.258964 1.322036 1.307493 -2.94347 1.112653 2.351612 -2.937526 1.13404 2.321547 -2.948258 0.995344 2.349723 -2.959483 1.043345 2.361122 -2.169028 0.837924 3.18657 -2.181522 0.868241 3.153493 -2.16835 0.765307 3.147802 -2.164555 0.807479 3.172506 -0.846103 0.625209 3.858396 -0.851219 0.652778 3.830203 -0.910606 0.523476 3.821952 -0.896708 0.559322 3.847669 -0.0344 0.562771 4.008516 -0.0344 0.586074 3.987476 -0.0344 0.477578 3.986532 -0.0344 0.505585 4.008516 -0.823442 0.677094 -4.029192 -0.0344 0.545644 -4.213854 -2.214278 0.898458 -3.289094 -2.928702 1.065706 -2.517072 -3.271213 1.309622 -1.388729 -3.408014 1.416102 -0.022052 -3.271245 1.309647 1.344309 -2.94347 1.112653 2.351612 -2.169028 0.837924 3.18657 -0.846103 0.625209 3.858396 -0.0344 0.562771 4.008516 0.682694 4.694354 -2.592987 0.677806 3.493262 -2.41103 1.329594 4.746935 -2.20902 1.378101 3.493262 -1.977972 1.842977 4.772578 -1.612713 1.730653 3.493262 -1.444664 2.172589 4.772578 -0.886411 1.957005 3.493262 -0.795094 2.286165 4.772578 -0.022052 2.035001 3.493262 -0.022052 2.172589 4.772578 0.842307 1.957005 3.493262 0.75099 1.957005 3.493262 0.75099 2.172589 4.772578 0.842307 1.842977 4.772578 1.568609 1.730652 3.493262 1.40056 1.329594 4.746935 2.164915 1.3781 3.493262 1.933868 0.682694 4.694354 2.548882 0.700569 3.493262 2.360093 0.682694 0.130125 -2.592987 1.329594 0.228344 -2.20902 1.842977 0.409344 -1.612713 2.172589 0.507502 -0.886411 2.286165 0.577983 -0.022052 2.172589 0.507502 0.842307 1.842977 0.409344 1.568609 1.329594 0.228344 2.164915 0.682694 0.130125 2.548882 0.682694 4.694354 -2.592987 1.329594 4.746935 -2.20902 1.842977 4.772578 -1.612713 2.172589 4.772578 -0.886411 2.286165 4.772578 -0.022052 2.172589 4.772578 0.842307 1.842977 4.772578 1.568609 1.329594 4.746935 2.164915 0.682694 4.694354 2.548882 0.700431 2.522677 -2.429281 0.682694 1.331498 -2.539865 1.397821 2.522677 -2.030764 1.329594 1.331498 -2.20902 1.684986 2.522677 -1.483062 1.842977 1.331498 -1.612713 1.869356 2.522677 -0.815959 2.105551 1.331498 -0.886411 1.932886 2.522677 -0.022052 2.226815 1.331498 -0.022052 1.869356 2.522677 0.771855 2.126312 1.331498 0.842307 2.126312 1.331498 0.842307 1.869356 2.522677 0.771855 1.684985 2.522677 1.438958 1.818929 1.331498 1.539671 1.397821 2.522677 1.98666 1.329594 1.331498 2.164916 0.703259 2.522677 2.360093 0.682694 1.331498 2.503637 0.755094 1.331498 -2.667348 0.755094 0.282663 -2.72047 1.455111 1.331498 -2.307545 1.455111 0.380882 -2.307545 1.999243 1.331498 -1.678178 1.999243 0.561882 -1.678178 2.277181 1.331498 -0.918576 2.344219 0.66004 -0.918576 2.403361 1.331498 -0.022052 2.462711 0.730521 -0.022052 2.297943 1.331498 0.874472 2.344219 0.66004 0.874472 2.344219 0.66004 0.874472 2.297943 1.331498 0.874472 1.975195 1.331498 1.605135 1.999243 0.561882 1.634074 1.45511 1.331498 2.263441 1.45511 0.380882 2.26344 0.755093 1.331498 2.63112 0.755093 0.282663 2.676365 0.755094 0.130125 -2.72047 0.682694 1.331498 -2.539865 1.455111 0.228344 -2.307545 1.329594 1.331498 -2.20902 1.999243 0.409344 -1.678178 1.842977 1.331498 -1.612713 2.344219 0.507502 -0.918576 2.105551 1.331498 -0.886411 2.462711 0.577983 -0.022052 2.226815 1.331498 -0.022052 2.344219 0.507502 0.874472 2.126312 1.331498 0.842307 1.999243 0.409344 1.634074 1.818929 1.331498 1.539671 2.126312 1.331498 0.842307 1.45511 0.228344 2.26344 1.329594 1.331498 2.164916 0.755093 0.130125 2.676365 0.682694 1.331498 2.503637 0.713123 0.340472 -3.348053 0.796788 0.553411 -3.752826 -0.053349 0.249473 -3.57671 0.796788 0.400873 -3.752826 0.713123 0.249473 -3.348053 1.656003 0.399066 -2.745932 1.983379 0.700237 -3.105572 1.983379 0.547699 -3.105572 1.656003 0.308067 -2.745932 2.277121 0.507044 -2.031226 2.726152 0.793754 -2.332355 2.726152 0.732266 -2.332355 2.277121 0.466811 -2.031226 2.670604 0.580814 -1.10784 3.041574 1.071816 -1.237957 3.041574 0.842107 -1.237957 2.670604 0.562605 -1.10784 2.769952 0.669153 -0.022052 3.163258 1.177954 -0.022052 3.163258 0.948245 -0.022052 2.769952 0.609911 -0.022052 2.670604 0.580814 1.063737 3.022193 1.101355 1.232407 3.022193 0.871645 1.232407 2.670604 0.54025 1.063737 2.277121 0.507044 1.987123 2.708496 0.953484 2.286094 2.708496 0.800946 2.286094 2.277121 0.429825 1.987123 1.656003 0.399066 2.70183 1.983379 0.802252 3.061471 1.983379 0.649714 3.061471 1.656003 0.308067 2.70183 0.71312 0.340472 3.303948 0.78991 0.57721 3.679776 0.78991 0.424672 3.679776 0.71312 0.249473 3.303948 -0.0344 0.340472 3.532603 -0.0344 0.530215 3.845471 -0.0344 0.402693 3.845471 -0.0344 0.249473 3.532603 0.755094 0.130125 -2.72047 1.455111 0.228344 -2.307545 1.999243 0.409344 -1.678178 2.344219 0.507502 -0.918576 2.462711 0.577983 -0.022052 2.344219 0.507502 0.874472 1.999243 0.409344 1.634074 1.45511 0.228344 2.26344 0.755093 0.130125 2.676365 -0.0344 0.130125 2.83422 -0.0344 0.282663 2.83422 0.755093 0.282663 2.676365 1.45511 0.380882 2.26344 1.999243 0.561882 1.634074 2.344219 0.66004 0.874472 2.462711 0.730521 -0.022052 2.344219 0.66004 -0.918576 1.999243 0.561882 -1.678178 1.455111 0.380882 -2.307545 0.755094 0.282663 -2.72047 0.800738 0.663207 -3.894555 2.087119 0.846941 -3.202126 2.820653 0.978742 -2.424076 3.150004 1.239773 -1.311634 3.279076 1.345911 -0.022052 3.140377 1.254445 1.286681 2.818146 1.081191 2.321457 2.069258 0.868175 3.125713 0.818283 0.649851 3.766972 -0.0344 0.586603 3.927003 0.818283 0.497313 3.766972 -0.0344 0.459081 3.927003 2.069258 0.715637 3.125713 2.818146 0.928653 2.321457 3.140377 1.024736 1.286681 3.279076 1.116202 -0.022052 3.150004 1.010064 -1.311634 2.820653 0.871431 -2.424076 2.087119 0.694403 -3.202126 0.800738 0.510669 -3.894555 0.782638 0.704302 -4.004708 0.754642 0.677094 -4.029192 2.138814 0.913142 -3.269681 2.145478 0.898458 -3.289094 0.780111 0.621782 -3.994534 0.810407 0.585849 -3.963062 2.146177 0.826447 -3.30575 2.144451 0.781882 -3.285772 2.849396 1.075407 -2.494825 2.859902 1.065706 -2.517072 2.880585 0.998373 -2.512132 2.875205 0.952947 -2.496109 3.184446 1.312782 -1.389062 3.202413 1.309622 -1.388729 3.22427 1.165728 -1.379971 3.215039 1.116323 -1.368089 3.321558 1.421677 -0.040673 3.339214 1.416102 -0.022052 3.360195 1.271526 -0.022052 3.349188 1.221526 -0.039394 3.190164 1.322036 1.307493 3.202445 1.309647 1.344309 3.224238 1.165704 1.336188 3.215168 1.118276 1.318214 2.868726 1.13404 2.321547 2.87467 1.112653 2.351612 2.890683 1.043345 2.361122 2.879458 0.995344 2.349723 2.112722 0.868241 3.153493 2.100228 0.837924 3.18657 2.095755 0.807479 3.172506 2.09955 0.765307 3.147802 0.782419 0.652778 3.830203 0.777303 0.625209 3.858396 0.827908 0.559322 3.847669 0.841806 0.523476 3.821952 -0.0344 0.586074 3.987476 -0.0344 0.562771 4.008516 -0.0344 0.505585 4.008516 -0.0344 0.477578 3.986532 0.754642 0.677094 -4.029192 2.145478 0.898458 -3.289094 2.859902 1.065706 -2.517072 3.202413 1.309622 -1.388729 3.339214 1.416102 -0.022052 3.202445 1.309647 1.344309 2.87467 1.112653 2.351612 2.100228 0.837924 3.18657 0.777303 0.625209 3.858396 -0.0344 0.562771 4.008516 + + + + 0 1 2 3 1 4 5 2 4 6 7 5 6 8 9 7 8 10 11 9 10 12 13 11 12 14 15 13 14 16 17 15 16 18 19 17 18 20 21 19 22 23 24 25 22 24 26 25 24 27 26 24 28 27 24 29 28 24 30 29 24 31 30 24 32 31 24 33 32 24 34 35 36 35 37 36 37 38 36 38 39 36 39 40 36 40 41 36 41 42 36 42 43 36 43 44 36 44 45 36 46 47 48 49 47 50 51 48 50 52 53 51 52 54 55 53 54 56 57 55 56 58 59 57 58 60 61 59 60 62 63 61 62 64 65 63 64 66 67 65 49 48 1 0 48 51 4 1 51 53 6 4 53 55 8 6 55 57 10 8 57 59 12 10 59 61 14 12 61 63 16 14 63 65 18 16 65 67 20 18 68 69 70 71 69 72 73 70 72 74 75 73 74 76 77 75 76 78 79 77 78 80 81 79 80 82 83 81 82 84 85 83 84 86 87 85 86 88 89 87 23 22 90 91 92 93 71 70 22 25 94 90 95 92 70 73 25 26 96 94 97 95 73 75 26 27 98 96 99 97 75 77 27 28 100 98 101 99 77 79 28 29 102 100 103 101 79 81 29 30 104 102 105 103 81 83 30 31 106 104 107 105 83 85 31 32 108 106 109 107 85 87 32 33 110 108 111 109 87 89 112 113 114 115 116 117 118 119 120 112 115 121 117 122 123 118 124 120 121 125 122 126 127 123 128 124 125 129 126 130 131 127 132 128 129 133 130 134 135 131 136 132 133 137 134 138 139 135 140 136 137 141 138 142 143 139 144 140 141 145 142 146 147 143 148 144 145 149 146 150 151 147 152 148 149 153 150 154 155 151 156 157 117 116 157 158 122 117 158 159 126 122 159 160 130 126 160 161 134 130 161 162 138 134 162 163 142 138 163 164 146 142 164 165 150 146 165 166 154 150 167 168 148 152 168 169 144 148 169 170 140 144 170 171 136 140 171 172 132 136 172 173 128 132 173 174 124 128 174 175 120 124 175 176 112 120 176 177 113 112 115 114 178 179 121 115 179 180 125 121 180 181 129 125 181 182 133 129 182 183 137 133 183 184 141 137 184 185 145 141 185 186 149 145 186 187 153 149 187 188 151 155 189 190 147 151 190 191 143 147 191 192 139 143 192 193 135 139 193 194 131 135 194 195 127 131 195 196 123 127 196 197 118 123 197 198 119 118 198 199 200 201 202 203 203 202 204 205 206 207 208 209 209 208 210 211 205 204 212 213 211 210 214 215 213 212 216 217 215 214 218 219 217 216 220 221 219 218 222 223 221 220 224 225 223 222 226 227 228 224 229 230 227 226 231 232 230 229 233 234 232 231 235 236 234 233 237 238 236 235 239 240 238 237 241 242 240 239 243 244 245 246 206 209 247 245 209 211 248 247 211 215 249 248 215 219 250 249 219 223 251 250 223 227 252 251 227 232 253 252 232 236 254 253 236 240 255 254 240 244 179 178 200 203 180 179 203 205 181 180 205 213 182 181 213 217 183 182 217 221 184 183 221 225 185 184 228 230 186 185 230 234 187 186 234 238 188 187 238 242 190 189 243 239 191 190 239 235 192 191 235 231 193 192 231 226 194 193 226 222 195 194 222 218 196 195 218 214 197 196 214 210 198 197 210 208 199 198 208 207 0 3 256 257 257 256 258 259 259 258 260 261 261 260 262 263 263 262 264 265 265 264 266 267 268 269 270 271 271 270 272 273 273 272 274 275 275 274 21 20 276 24 23 277 24 276 278 24 277 279 24 278 280 24 279 281 24 280 282 24 281 283 24 282 284 24 283 33 24 284 34 36 285 285 36 286 286 36 287 287 36 288 288 36 289 289 36 290 290 36 291 291 36 292 292 36 293 293 36 45 46 49 294 295 295 294 296 297 297 296 298 299 299 298 300 301 301 300 302 303 303 302 304 305 306 307 308 309 309 308 310 311 311 310 312 313 313 312 67 66 49 0 257 294 294 257 259 296 296 259 261 298 298 261 263 300 300 263 265 302 302 265 267 304 307 268 271 308 308 271 273 310 310 273 275 312 312 275 20 67 68 71 314 315 315 314 316 317 317 316 318 319 319 318 320 321 321 320 322 323 323 322 324 325 326 327 328 329 329 328 330 331 331 330 332 333 333 332 89 88 23 91 334 276 335 314 71 93 276 334 336 277 337 316 314 335 277 336 338 278 339 318 316 337 278 338 340 279 341 320 318 339 279 340 342 280 343 322 320 341 280 342 344 281 345 324 322 343 281 344 346 282 347 328 327 348 282 346 349 283 350 330 328 347 283 349 351 284 352 332 330 350 284 351 110 33 111 89 332 352 353 354 114 113 355 119 356 357 358 359 354 353 357 356 360 361 362 363 359 358 361 360 364 365 366 367 363 362 365 364 368 369 370 371 367 366 369 368 372 373 374 375 371 370 373 372 376 377 378 379 375 374 377 376 380 381 382 383 379 378 381 380 384 385 386 387 383 382 385 384 388 389 390 391 387 386 389 388 392 393 156 355 357 394 394 357 361 395 395 361 365 396 396 365 369 397 397 369 373 398 398 373 377 399 399 377 381 400 400 381 385 401 401 385 389 402 402 389 393 403 404 390 386 405 405 386 382 406 406 382 378 407 407 378 374 408 408 374 370 409 409 370 366 410 410 366 362 411 411 362 358 412 412 358 353 413 413 353 113 177 354 414 178 114 359 415 414 354 363 416 415 359 367 417 416 363 371 418 417 367 375 419 418 371 379 420 419 375 383 421 420 379 387 422 421 383 391 423 422 387 388 424 425 392 384 426 424 388 380 427 426 384 376 428 427 380 372 429 428 376 368 430 429 372 364 431 430 368 360 432 431 364 356 433 432 360 119 199 433 356 200 434 435 201 434 436 437 435 206 438 439 207 438 440 441 439 436 442 443 437 440 444 445 441 442 446 447 443 444 448 449 445 446 450 451 447 448 452 453 449 450 454 455 451 452 456 457 453 454 458 459 455 456 460 461 457 458 462 463 459 460 464 465 461 462 466 467 463 464 468 469 465 466 470 471 467 468 472 473 469 474 438 206 246 475 440 438 474 476 444 440 475 477 448 444 476 478 452 448 477 479 456 452 478 480 460 456 479 481 464 460 480 482 468 464 481 483 472 468 482 414 434 200 178 415 436 434 414 416 442 436 415 417 446 442 416 418 450 446 417 419 454 450 418 420 458 454 419 421 462 458 420 422 466 462 421 423 470 466 422 424 469 473 425 426 465 469 424 427 461 465 426 428 457 461 427 429 453 457 428 430 449 453 429 431 445 449 430 432 441 445 431 433 439 441 432 199 207 439 433 + 4 8 12 16 20 24 28 32 36 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 256 260 264 268 272 276 280 284 288 292 296 300 304 308 312 316 320 324 328 332 336 340 344 348 352 356 360 364 368 372 376 380 384 388 392 396 400 404 408 412 416 420 424 428 432 436 440 444 448 452 456 460 464 468 472 476 480 484 488 492 496 500 504 508 512 516 520 524 528 532 536 540 544 548 552 556 560 564 568 572 576 580 584 588 592 596 600 604 608 612 616 620 624 628 632 636 640 644 648 652 656 660 664 668 672 676 680 684 688 692 696 700 704 708 712 716 720 724 728 732 736 740 744 748 752 756 760 764 768 772 776 780 783 786 789 792 795 798 801 804 807 810 813 816 819 822 825 828 831 834 837 840 844 848 852 856 860 864 868 872 876 880 884 888 892 896 900 904 908 912 916 920 924 928 932 936 940 944 948 952 956 960 964 968 972 976 980 984 988 992 996 1000 1004 1008 1012 1016 1020 1024 1028 1032 1036 1040 1044 1048 1052 1056 1060 1064 1068 1072 1076 1080 1084 1088 1092 1096 1100 1104 1108 1112 1116 1120 1124 1128 1132 1136 1140 1144 1148 1152 1156 1160 1164 1168 1172 1176 1180 1184 1188 1192 1196 1200 1204 1208 1212 1216 1220 1224 1228 1232 1236 1240 1244 1248 1252 1256 1260 1264 1268 1272 1276 1280 1284 1288 1292 1296 1300 1304 1308 1312 1316 1320 1324 1328 1332 1336 1340 1344 1348 1352 1356 1360 1364 1368 1372 1376 1380 1384 1388 1392 1396 1400 1404 1408 1412 1416 1420 1424 1428 1432 1436 1440 1444 1448 1452 1456 1460 1464 1468 1472 1476 1480 + + + + diff --git a/tests/data/123456789/polyhedron_attribute.vtu b/tests/data/123456789/polyhedron_attribute.vtu new file mode 100644 index 00000000..7c86fa9c --- /dev/null +++ b/tests/data/123456789/polyhedron_attribute.vtu @@ -0,0 +1,22 @@ + + + + + + 1 2 3 4 5 6 7 8 9 10 11 + 0 0 0 1 0 0 2 1 0 1 2 0 0 2 0 0 0 1 1 0 1 2 1 1 1 2 1 0 2 1 1 1 2 + + + 0 0 0 1 0 0 2 1 0 1 2 0 0 2 0 0 0 1 1 0 1 2 1 1 1 2 1 0 2 1 1 1 2 + + + 3 4 5 6 + + + 0 1 3 4 5 6 8 9 1 2 3 6 7 8 5 6 8 9 10 6 7 8 10 + 8 14 19 23 + 12 13 14 10 + + + + diff --git a/tests/data/123456789/triangulated_surface2d.vtp b/tests/data/123456789/triangulated_surface2d.vtp new file mode 100644 index 00000000..bb34ba34 --- /dev/null +++ b/tests/data/123456789/triangulated_surface2d.vtp @@ -0,0 +1,21 @@ + + + + + + -61.7244 14.6963 -60.8099 -0.979751 -56.2378 27.1065 -43.1744 -5.29066 -38.8635 22.1424 -16.3945 -4.63749 -15.0882 19.791 16.5252 22.7956 20.1829 -4.76813 35.9895 -5.4213 40.3005 24.8857 41.3455 4.11496 42.6519 13.1287 33.7787 9.14871 41.0601 23.4894 41.9389 13.273 37.3251 -4.85291 42.2685 4.15511 51.0568 24.4781 54.682 -5.95145 68.5236 23.3796 71.0502 14.7011 71.4896 -6.94013 73.9064 1.62847 58.4724 7.35799 59.7405 17.2398 50.9449 17.0185 -60.8195 -1.62315 -59.9003 -12.2605 -56.4858 -21.5847 -41.7773 -5.69425 -33.1098 -28.0196 -20.3712 -4.9063 -1.46031 -27.757 0.640906 -5.16895 14.1675 -27.8883 16.9253 -5.03762 36.2302 -5.69425 40.4326 -27.1003 49.1001 -5.82558 67.6171 -30.6461 71.1628 -7.53281 74.446 -15.5437 76.1532 -25.2618 65.4426 -17.0775 52.7354 -17.3143 + + + -61.724365234375 14.6962766647339 0 -60.8099250793457 -0.979751348495483 0 -56.2377586364746 27.1064682006836 0 -43.1743965148926 -5.29066038131714 0 -38.8634872436523 22.142391204834 0 -16.3945140838623 -4.63749170303345 0 -15.0881767272949 19.7909870147705 0 16.5251502990723 22.7955627441406 0 20.18288230896 -4.76812744140625 0 35.9895477294922 -5.42129564285278 0 40.3004531860352 24.8856983184814 0 41.3455276489258 4.11495876312256 0 42.65185546875 13.1286745071411 0 33.7787322998047 9.14871406555176 0 41.0600929260254 23.4894065856934 0 41.9389266967773 13.2729911804199 0 37.325065612793 -4.8529109954834 0 42.2684898376465 4.15511226654053 0 51.0568084716797 24.4780941009521 0 54.6819877624512 -5.95145130157471 0 68.5235900878906 23.3795547485352 0 71.0502166748047 14.7010917663574 0 71.4896469116211 -6.94013404846191 0 73.9064254760742 1.62847137451172 0 58.4723815917969 7.35799360275269 0 59.7404937744141 17.2398090362549 0 50.9449157714844 17.0184726715088 0 -60.8195457458496 -1.62315285205841 0 -59.9002723693848 -12.2605400085449 0 -56.4857978820801 -21.5846691131592 0 -41.7773132324219 -5.694251537323 0 -33.1098175048828 -28.0196323394775 0 -20.3712139129639 -4.90629720687866 0 -1.46030735969543 -27.7569789886475 0 0.640906095504761 -5.16894960403442 0 14.1674613952637 -27.8883056640625 0 16.9253005981445 -5.03762483596802 0 36.2301902770996 -5.694251537323 0 40.4326171875 -27.1003494262695 0 49.1001129150391 -5.8255763053894 0 67.6170501708984 -30.6461448669434 0 71.162841796875 -7.53281211853027 0 74.4459838867188 -15.5436840057373 0 76.1532211303711 -25.261791229248 0 65.4426422119141 -17.0774612426758 0 52.7353782653809 -17.3142528533936 0 + + + 6 5 4 4 0 2 3 1 0 8 6 7 5 3 4 13 9 8 4 3 0 13 8 7 8 5 6 13 7 10 13 11 9 13 12 11 13 10 12 24 19 17 24 22 19 24 17 15 26 24 15 26 14 18 24 21 23 25 21 24 25 18 20 19 16 17 25 20 21 26 25 24 24 23 22 26 15 14 26 18 25 32 31 30 44 42 43 36 35 34 44 39 41 45 44 40 31 29 30 37 35 36 30 28 27 30 29 28 45 38 37 44 43 40 45 39 44 44 41 42 45 40 38 45 37 39 35 33 34 33 31 32 34 33 32 38 35 37 + 8 4 4.29497e+09 6 4.29497e+09 4.29497e+09 4.29497e+09 4.29497e+09 6 8 4.29497e+09 7 4.29497e+09 6 0 10 4.29497e+09 7 4 2 1 5 3 9 4.29497e+09 0 3 7 4.29497e+09 12 11 4.29497e+09 5 12 4.29497e+09 10 9 4.29497e+09 11 14 21 15 24 4.29497e+09 13 13 4.29497e+09 16 23 15 25 25 4.29497e+09 26 19 4.29497e+09 24 22 18 23 26 4.29497e+09 22 4.29497e+09 4.29497e+09 13 20 4.29497e+09 19 26 19 16 18 4.29497e+09 14 16 4.29497e+09 17 17 20 23 43 32 4.29497e+09 39 4.29497e+09 37 33 42 4.29497e+09 38 4.29497e+09 39 38 37 40 4.29497e+09 35 27 45 29 4.29497e+09 35 4.29497e+09 4.29497e+09 32 4.29497e+09 34 40 45 41 28 4.29497e+09 31 41 30 31 30 4.29497e+09 28 31 4.29497e+09 36 36 4.29497e+09 38 4.29497e+09 44 29 4.29497e+09 27 44 42 43 4.29497e+09 4.29497e+09 33 36 + + + 6 5 4 4 0 2 3 1 0 8 6 7 5 3 4 13 9 8 4 3 0 13 8 7 8 5 6 13 7 10 13 11 9 13 12 11 13 10 12 24 19 17 24 22 19 24 17 15 26 24 15 26 14 18 24 21 23 25 21 24 25 18 20 19 16 17 25 20 21 26 25 24 24 23 22 26 15 14 26 18 25 32 31 30 44 42 43 36 35 34 44 39 41 45 44 40 31 29 30 37 35 36 30 28 27 30 29 28 45 38 37 44 43 40 45 39 44 44 41 42 45 40 38 45 37 39 35 33 34 33 31 32 34 33 32 38 35 37 + 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 + + + + diff --git a/tests/mesh/edges/attribute/edge/test_edges_attribute_edge_protocols.py b/tests/mesh/edges/attribute/edge/test_edges_attribute_edge_protocols.py new file mode 100644 index 00000000..6fd6c973 --- /dev/null +++ b/tests/mesh/edges/attribute/edge/test_edges_attribute_edge_protocols.py @@ -0,0 +1,28 @@ +# Standard library imports +from typing import Callable + +# Third party imports +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.edges.attribute.edge.edges_attribute_edge_protocols import ( + VtkMeshEdgesAttributeEdgeView, +) + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: + + dataset_factory( + id=mesh_id, + viewable_file="attributed_edged_curve.vtp", + viewer_elements_type="edges", + ) + + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) diff --git a/tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py b/tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py new file mode 100644 index 00000000..b8534683 --- /dev/null +++ b/tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py @@ -0,0 +1,354 @@ +# Standard library imports +from typing import Callable + +# Third party imports +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.edges.attribute.vertex.edges_attribute_vertex_protocols import ( + VtkMeshEdgesAttributeVertexView, +) + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: + + dataset_factory( + id=mesh_id, + viewable_file="attributed_edged_curve.vtp", + viewer_elements_type="edges", + ) + + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + + +def test_edges_vertex_attribute( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "vertex_attribute"}], + ) + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "scalar_range" + ]["rpc"], + [{"id": mesh_id, "minimum": 0, "maximum": 58}], + ) + assert server.compare_image("mesh/edges/vertex_attribute.jpeg") == True + + +def test_edges_vertex_color_map( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "vertex_attribute"}], + ) + + # Set color map: Blue to Red + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 58.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 58.0, + } + ], + ) + + assert server.compare_image("mesh/edges/vertex_color_map.jpeg") == True + + +def test_edges_vertex_color_map_range_update( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "vertex_attribute"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 58.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 58.0, + } + ], + ) + + assert server.compare_image("mesh/edges/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 50.0, + 0, + 0, + 1.0, + 58.0, + 1.0, + 0, + 0, + ], + "minimum": 50.0, + "maximum": 58.0, + } + ], + ) + + assert server.compare_image("mesh/edges/vertex_color_map_range_update.jpeg") == True + + +def test_edges_vertex_color_map_red_shift( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "vertex_attribute"}], + ) + + # Set Blue to Red Map on [0, 58] + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 58.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 58.0, + } + ], + ) + + assert server.compare_image("mesh/edges/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert server.compare_image("mesh/edges/vertex_color_map_red_shift.jpeg") == True + + +def test_edges_vertex_color_map_rainbow( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "vertex_attribute"}], + ) + + # Rainbow Desaturated Map + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 71 / 255, + 71 / 255, + 219 / 255, + 0.143 * 58, + 0, + 0, + 92 / 255, + 0.285 * 58, + 0, + 255 / 255, + 255 / 255, + 0.429 * 58, + 0, + 128 / 255, + 0, + 0.571 * 58, + 255 / 255, + 255 / 255, + 0, + 0.714 * 58, + 255 / 255, + 97 / 255, + 0, + 0.857 * 58, + 107 / 255, + 0, + 0, + 58.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 0.0, + "maximum": 58.0, + } + ], + ) + + assert ( + server.compare_image("mesh/edges/vertex_color_map_rainbow_initial.jpeg") == True + ) + + # Update rainbow range via color map + server.call( + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_prefix + + VtkMeshEdgesAttributeVertexView.mesh_edges_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 10.0, + 71 / 255, + 71 / 255, + 219 / 255, + 10.0 + 0.143 * 10, + 0, + 0, + 92 / 255, + 10.0 + 0.285 * 10, + 0, + 255 / 255, + 255 / 255, + 10.0 + 0.429 * 10, + 0, + 128 / 255, + 0, + 10.0 + 0.571 * 10, + 255 / 255, + 255 / 255, + 0, + 10.0 + 0.714 * 10, + 255 / 255, + 97 / 255, + 0, + 10.0 + 0.857 * 10, + 107 / 255, + 0, + 0, + 20.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 10.0, + "maximum": 20.0, + } + ], + ) + + assert server.compare_image("mesh/edges/vertex_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/edges/test_mesh_edges_protocols.py b/tests/mesh/edges/test_mesh_edges_protocols.py index 5ef83d1e..a7d1aa35 100644 --- a/tests/mesh/edges/test_mesh_edges_protocols.py +++ b/tests/mesh/edges/test_mesh_edges_protocols.py @@ -62,348 +62,3 @@ def test_edges_with_edged_curve( [{"id": "123456789", "visibility": False}], ) assert server.compare_image("mesh/edges/edged_curve_visibility.jpeg") == True - - -def test_edges_vertex_attribute( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - dataset_factory( - id=mesh_id, - viewable_file="attributed_edged_curve.vtp", - viewer_elements_type="edges", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "vertex_attribute"}], - ) - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": mesh_id, "minimum": 0, "maximum": 58}], - ) - assert server.compare_image("mesh/edges/vertex_attribute.jpeg") == True - - -def test_edges_vertex_color_map( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - dataset_factory( - id=mesh_id, - viewable_file="attributed_edged_curve.vtp", - viewer_elements_type="edges", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - - # Set active attribute - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "vertex_attribute"}], - ) - - # Set color map: Blue to Red - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 58.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 58.0, - } - ], - ) - - assert server.compare_image("mesh/edges/vertex_color_map.jpeg") == True - - -def test_edges_vertex_color_map_range_update( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - dataset_factory( - id=mesh_id, - viewable_file="attributed_edged_curve.vtp", - viewer_elements_type="edges", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - - # Set active attribute - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "vertex_attribute"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 58.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 58.0, - } - ], - ) - - assert server.compare_image("mesh/edges/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 50.0, - 0, - 0, - 1.0, - 58.0, - 1.0, - 0, - 0, - ], - "minimum": 50.0, - "maximum": 58.0, - } - ], - ) - - assert server.compare_image("mesh/edges/vertex_color_map_range_update.jpeg") == True - - -def test_edges_vertex_color_map_red_shift( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - dataset_factory( - id=mesh_id, - viewable_file="attributed_edged_curve.vtp", - viewer_elements_type="edges", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - - # Set active attribute - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "vertex_attribute"}], - ) - - # Set Blue to Red Map on [0, 58] - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 58.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 58.0, - } - ], - ) - - assert server.compare_image("mesh/edges/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert server.compare_image("mesh/edges/vertex_color_map_red_shift.jpeg") == True - - -def test_edges_vertex_color_map_rainbow( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - dataset_factory( - id=mesh_id, - viewable_file="attributed_edged_curve.vtp", - viewer_elements_type="edges", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - - # Set active attribute - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "vertex_attribute"}], - ) - - # Rainbow Desaturated Map - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 71 / 255, - 71 / 255, - 219 / 255, - 0.143 * 58, - 0, - 0, - 92 / 255, - 0.285 * 58, - 0, - 255 / 255, - 255 / 255, - 0.429 * 58, - 0, - 128 / 255, - 0, - 0.571 * 58, - 255 / 255, - 255 / 255, - 0, - 0.714 * 58, - 255 / 255, - 97 / 255, - 0, - 0.857 * 58, - 107 / 255, - 0, - 0, - 58.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 0.0, - "maximum": 58.0, - } - ], - ) - - assert ( - server.compare_image("mesh/edges/vertex_color_map_rainbow_initial.jpeg") == True - ) - - # Update rainbow range via color map - server.call( - VtkMeshEdgesView.mesh_edges_prefix - + VtkMeshEdgesView.mesh_edges_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 10.0, - 71 / 255, - 71 / 255, - 219 / 255, - 10.0 + 0.143 * 10, - 0, - 0, - 92 / 255, - 10.0 + 0.285 * 10, - 0, - 255 / 255, - 255 / 255, - 10.0 + 0.429 * 10, - 0, - 128 / 255, - 0, - 10.0 + 0.571 * 10, - 255 / 255, - 255 / 255, - 0, - 10.0 + 0.714 * 10, - 255 / 255, - 97 / 255, - 0, - 10.0 + 0.857 * 10, - 107 / 255, - 0, - 0, - 20.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 10.0, - "maximum": 20.0, - } - ], - ) - - assert server.compare_image("mesh/edges/vertex_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/points/attribute/vertex/test_points_attribute_vertex_protocols.py b/tests/mesh/points/attribute/vertex/test_points_attribute_vertex_protocols.py new file mode 100644 index 00000000..3f5e618b --- /dev/null +++ b/tests/mesh/points/attribute/vertex/test_points_attribute_vertex_protocols.py @@ -0,0 +1,350 @@ +# Standard library imports +from typing import Callable + +# Third party imports +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.points.attribute.vertex.points_attribute_vertex_protocols import ( + VtkMeshPointsAttributeVertexView, +) + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: + + dataset_factory( + id=mesh_id, + viewable_file="hat.vtp", + viewer_elements_type="points", + ) + + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + + +def test_points_vertex_attribute( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + assert server.compare_image("mesh/points/vertex_attribute.jpeg") == True + + +def test_points_vertex_color_map( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + + # Set color map: Blue to Red + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert server.compare_image("mesh/points/vertex_color_map.jpeg") == True + + +def test_points_vertex_color_map_range_update( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert server.compare_image("mesh/points/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.8, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.8, + "maximum": 1.0, + } + ], + ) + + assert ( + server.compare_image("mesh/points/vertex_color_map_range_update.jpeg") == True + ) + + +def test_points_vertex_color_map_red_shift( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert server.compare_image("mesh/points/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 0.1, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 0.1, + } + ], + ) + + assert server.compare_image("mesh/points/vertex_color_map_red_shift.jpeg") == True + + +def test_points_vertex_color_map_rainbow( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "name" + ]["rpc"], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + + # Rainbow Desaturated Map + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 71 / 255, + 71 / 255, + 219 / 255, + 0.143, + 0, + 0, + 92 / 255, + 0.285, + 0, + 255 / 255, + 255 / 255, + 0.429, + 0, + 128 / 255, + 0, + 0.571, + 255 / 255, + 255 / 255, + 0, + 0.714, + 255 / 255, + 97 / 255, + 0, + 0.857, + 107 / 255, + 0, + 0, + 1.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert ( + server.compare_image("mesh/points/vertex_color_map_rainbow_initial.jpeg") + == True + ) + + # Update rainbow range via color map + server.call( + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_prefix + + VtkMeshPointsAttributeVertexView.mesh_points_attribute_vertex_schemas_dict[ + "color_map" + ]["rpc"], + [ + { + "id": mesh_id, + "points": [ + 0.1, + 71 / 255, + 71 / 255, + 219 / 255, + 0.1 + 0.143 * 0.3, + 0, + 0, + 92 / 255, + 0.1 + 0.285 * 0.3, + 0, + 255 / 255, + 255 / 255, + 0.1 + 0.429 * 0.3, + 0, + 128 / 255, + 0, + 0.1 + 0.571 * 0.3, + 255 / 255, + 255 / 255, + 0, + 0.1 + 0.714 * 0.3, + 255 / 255, + 97 / 255, + 0, + 0.1 + 0.857 * 0.3, + 107 / 255, + 0, + 0, + 0.4, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 0.1, + "maximum": 0.4, + } + ], + ) + + assert server.compare_image("mesh/points/vertex_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/points/test_mesh_points_protocols.py b/tests/mesh/points/test_mesh_points_protocols.py index fe19166a..bd8cc958 100644 --- a/tests/mesh/points/test_mesh_points_protocols.py +++ b/tests/mesh/points/test_mesh_points_protocols.py @@ -88,301 +88,3 @@ def test_points_with_point_set( [{"id": mesh_id, "visibility": False}], ) assert server.compare_image("mesh/points/point_set_visibility.jpeg") == True - - -def test_points_vertex_attribute( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - test_register_mesh(server, dataset_factory) - - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "lambert2SG"}], - ) - assert server.compare_image("mesh/points/vertex_attribute.jpeg") == True - - -def test_points_vertex_color_map( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "lambert2SG"}], - ) - - # Set color map: Blue to Red - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert server.compare_image("mesh/points/vertex_color_map.jpeg") == True - - -def test_points_vertex_color_map_range_update( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "lambert2SG"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert server.compare_image("mesh/points/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.8, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.8, - "maximum": 1.0, - } - ], - ) - - assert ( - server.compare_image("mesh/points/vertex_color_map_range_update.jpeg") == True - ) - - -def test_points_vertex_color_map_red_shift( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "lambert2SG"}], - ) - - # Set Blue to Red Map on [0, 1] - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert server.compare_image("mesh/points/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 0.1, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 0.1, - } - ], - ) - - assert server.compare_image("mesh/points/vertex_color_map_red_shift.jpeg") == True - - -def test_points_vertex_color_map_rainbow( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_attribute"]["rpc"], - [{"id": mesh_id, "name": "lambert2SG"}], - ) - - # Rainbow Desaturated Map - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 71 / 255, - 71 / 255, - 219 / 255, - 0.143, - 0, - 0, - 92 / 255, - 0.285, - 0, - 255 / 255, - 255 / 255, - 0.429, - 0, - 128 / 255, - 0, - 0.571, - 255 / 255, - 255 / 255, - 0, - 0.714, - 255 / 255, - 97 / 255, - 0, - 0.857, - 107 / 255, - 0, - 0, - 1.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert ( - server.compare_image("mesh/points/vertex_color_map_rainbow_initial.jpeg") - == True - ) - - # Update rainbow range via color map - server.call( - VtkMeshPointsView.mesh_points_prefix - + VtkMeshPointsView.mesh_points_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.1, - 71 / 255, - 71 / 255, - 219 / 255, - 0.1 + 0.143 * 0.3, - 0, - 0, - 92 / 255, - 0.1 + 0.285 * 0.3, - 0, - 255 / 255, - 255 / 255, - 0.1 + 0.429 * 0.3, - 0, - 128 / 255, - 0, - 0.1 + 0.571 * 0.3, - 255 / 255, - 255 / 255, - 0, - 0.1 + 0.714 * 0.3, - 255 / 255, - 97 / 255, - 0, - 0.1 + 0.857 * 0.3, - 107 / 255, - 0, - 0, - 0.4, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 0.1, - "maximum": 0.4, - } - ], - ) - - assert server.compare_image("mesh/points/vertex_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py b/tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py new file mode 100644 index 00000000..6a9bd183 --- /dev/null +++ b/tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py @@ -0,0 +1,386 @@ +# Standard library imports +from typing import Callable + +# Third party imports +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.polygons.attribute.polygon.polygons_attribute_polygon_protocols import ( + VtkMeshPolygonsAttributePolygonView, +) + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: + + dataset_factory( + id=mesh_id, + viewable_file="triangulated_surface2d.vtp", + viewer_elements_type="polygons", + ) + + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + + +def test_polygons_polygon_attribute( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "triangle_vertices"}], + ) + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "scalar_range" + ][ + "rpc" + ], + [{"id": mesh_id, "minimum": 3, "maximum": 45}], + ) + assert server.compare_image("mesh/polygons/polygon_attribute.jpeg") == True + + +def test_polygons_polygon_color_map( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "triangle_vertices"}], + ) + + # Set color map: Blue to Red + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 50.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 50.0, + } + ], + ) + + assert server.compare_image("mesh/polygons/polygon_color_map.jpeg") == True + + +def test_polygons_polygon_color_map_range_update( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "triangle_vertices"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 50.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 50.0, + } + ], + ) + + assert server.compare_image("mesh/polygons/polygon_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 40.0, + 0, + 0, + 1.0, + 45.0, + 1.0, + 0, + 0, + ], + "minimum": 40.0, + "maximum": 45.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polygons/polygon_color_map_range_update.jpeg") + == True + ) + + +def test_polygons_polygon_color_map_red_shift( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "triangle_vertices"}], + ) + + # Set Blue to Red Map on [0, 50] + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 50.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 50.0, + } + ], + ) + + assert server.compare_image("mesh/polygons/polygon_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 3.0, + 0, + 0, + 1.0, + 4.0, + 1.0, + 0, + 0, + ], + "minimum": 3.0, + "maximum": 4.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polygons/polygon_color_map_red_shift.jpeg") == True + ) + + +def test_polygons_polygon_color_map_rainbow( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "triangle_vertices"}], + ) + + # Rainbow Desaturated Map + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 71 / 255, + 71 / 255, + 219 / 255, + 0.143 * 50, + 0, + 0, + 92 / 255, + 0.285 * 50, + 0, + 255 / 255, + 255 / 255, + 0.429 * 50, + 0, + 128 / 255, + 0, + 0.571 * 50, + 255 / 255, + 255 / 255, + 0, + 0.714 * 50, + 255 / 255, + 97 / 255, + 0, + 0.857 * 50, + 107 / 255, + 0, + 0, + 50.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 0.0, + "maximum": 50.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polygons/polygon_color_map_rainbow_initial.jpeg") + == True + ) + + # Update rainbow range via color map + server.call( + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_prefix + + VtkMeshPolygonsAttributePolygonView.mesh_polygons_attribute_polygon_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 5.0, + 71 / 255, + 71 / 255, + 219 / 255, + 5.0 + 0.143 * 10, + 0, + 0, + 92 / 255, + 5.0 + 0.285 * 10, + 0, + 255 / 255, + 255 / 255, + 5.0 + 0.429 * 10, + 0, + 128 / 255, + 0, + 5.0 + 0.571 * 10, + 255 / 255, + 255 / 255, + 0, + 5.0 + 0.714 * 10, + 255 / 255, + 97 / 255, + 0, + 5.0 + 0.857 * 10, + 107 / 255, + 0, + 0, + 15.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 5.0, + "maximum": 15.0, + } + ], + ) + + assert server.compare_image("mesh/polygons/polygon_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py b/tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py new file mode 100644 index 00000000..69189375 --- /dev/null +++ b/tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py @@ -0,0 +1,381 @@ +# Standard library imports +from typing import Callable + +# Third party imports +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.polygons.attribute.vertex.polygons_attribute_vertex_protocols import ( + VtkMeshPolygonsAttributeVertexView, +) + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: + + dataset_factory( + id=mesh_id, viewable_file="hat.vtp", viewer_elements_type="polygons" + ) + + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + + +def test_polygons_vertex_attribute( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "scalar_range" + ][ + "rpc" + ], + [{"id": mesh_id, "minimum": 0, "maximum": 1}], + ) + assert server.compare_image("mesh/polygons/vertex_attribute.jpeg") == True + + +def test_polygons_vertex_color_map( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + + # Set color map: Blue to Red + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert server.compare_image("mesh/polygons/vertex_color_map.jpeg") == True + + +def test_polygons_vertex_color_map_range_update( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert server.compare_image("mesh/polygons/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.8, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.8, + "maximum": 1.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polygons/vertex_color_map_range_update.jpeg") == True + ) + + +def test_polygons_vertex_color_map_red_shift( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + + # Set Blue to Red Map on [0, 1] + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert server.compare_image("mesh/polygons/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 0.1, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 0.1, + } + ], + ) + + assert server.compare_image("mesh/polygons/vertex_color_map_red_shift.jpeg") == True + + +def test_polygons_vertex_color_map_rainbow( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "lambert2SG"}], + ) + + # Rainbow Desaturated Map + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 71 / 255, + 71 / 255, + 219 / 255, + 0.143, + 0, + 0, + 92 / 255, + 0.285, + 0, + 255 / 255, + 255 / 255, + 0.429, + 0, + 128 / 255, + 0, + 0.571, + 255 / 255, + 255 / 255, + 0, + 0.714, + 255 / 255, + 97 / 255, + 0, + 0.857, + 107 / 255, + 0, + 0, + 1.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polygons/vertex_color_map_rainbow_initial.jpeg") + == True + ) + + # Update rainbow range via color map + server.call( + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_prefix + + VtkMeshPolygonsAttributeVertexView.mesh_polygons_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.1, + 71 / 255, + 71 / 255, + 219 / 255, + 0.1 + 0.143 * 0.3, + 0, + 0, + 92 / 255, + 0.1 + 0.285 * 0.3, + 0, + 255 / 255, + 255 / 255, + 0.1 + 0.429 * 0.3, + 0, + 128 / 255, + 0, + 0.1 + 0.571 * 0.3, + 255 / 255, + 255 / 255, + 0, + 0.1 + 0.714 * 0.3, + 255 / 255, + 97 / 255, + 0, + 0.1 + 0.857 * 0.3, + 107 / 255, + 0, + 0, + 0.4, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 0.1, + "maximum": 0.4, + } + ], + ) + + assert server.compare_image("mesh/polygons/vertex_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/polygons/test_mesh_polygons_protocols.py b/tests/mesh/polygons/test_mesh_polygons_protocols.py index de3561f1..fd8ecf82 100644 --- a/tests/mesh/polygons/test_mesh_polygons_protocols.py +++ b/tests/mesh/polygons/test_mesh_polygons_protocols.py @@ -36,654 +36,3 @@ def test_polygons_visibility( [{"id": "123456789", "visibility": False}], ) assert server.compare_image("mesh/polygons/visibility.jpeg") == True - - -def test_polygons_vertex_attribute( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - test_register_mesh(server, dataset_factory) - - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "lambert2SG"}], - ) - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_scalar_range"]["rpc"], - [{"id": "123456789", "minimum": 0, "maximum": 1}], - ) - assert server.compare_image("mesh/polygons/vertex_attribute.jpeg") == True - - -def test_polygons_polygon_attribute( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - - dataset_factory( - id="123456789", - viewable_file="triangulated_surface2d.vtp", - viewer_elements_type="polygons", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": "123456789"}], - ) - assert server.compare_image("mesh/polygons/register.jpeg") == True - - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_attribute"]["rpc"], - [{"id": "123456789", "name": "triangle_vertices"}], - ) - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_scalar_range"]["rpc"], - [{"id": "123456789", "minimum": 3, "maximum": 45}], - ) - assert server.compare_image("mesh/polygons/polygon_attribute.jpeg") == True - - -def test_polygons_vertex_color_map( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "lambert2SG"}], - ) - - # Set color map: Blue to Red - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 0.0, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert server.compare_image("mesh/polygons/vertex_color_map.jpeg") == True - - -def test_polygons_vertex_color_map_range_update( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "lambert2SG"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 0.0, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert server.compare_image("mesh/polygons/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 0.8, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.8, - "maximum": 1.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polygons/vertex_color_map_range_update.jpeg") == True - ) - - -def test_polygons_vertex_color_map_red_shift( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "lambert2SG"}], - ) - - # Set Blue to Red Map on [0, 1] - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 0.0, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert server.compare_image("mesh/polygons/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 0.0, - 0, - 0, - 1.0, - 0.1, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 0.1, - } - ], - ) - - assert server.compare_image("mesh/polygons/vertex_color_map_red_shift.jpeg") == True - - -def test_polygons_vertex_color_map_rainbow( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "lambert2SG"}], - ) - - # Rainbow Desaturated Map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 0.0, - 71 / 255, - 71 / 255, - 219 / 255, - 0.143, - 0, - 0, - 92 / 255, - 0.285, - 0, - 255 / 255, - 255 / 255, - 0.429, - 0, - 128 / 255, - 0, - 0.571, - 255 / 255, - 255 / 255, - 0, - 0.714, - 255 / 255, - 97 / 255, - 0, - 0.857, - 107 / 255, - 0, - 0, - 1.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polygons/vertex_color_map_rainbow_initial.jpeg") - == True - ) - - # Update rainbow range via color map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 0.1, - 71 / 255, - 71 / 255, - 219 / 255, - 0.1 + 0.143 * 0.3, - 0, - 0, - 92 / 255, - 0.1 + 0.285 * 0.3, - 0, - 255 / 255, - 255 / 255, - 0.1 + 0.429 * 0.3, - 0, - 128 / 255, - 0, - 0.1 + 0.571 * 0.3, - 255 / 255, - 255 / 255, - 0, - 0.1 + 0.714 * 0.3, - 255 / 255, - 97 / 255, - 0, - 0.1 + 0.857 * 0.3, - 107 / 255, - 0, - 0, - 0.4, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 0.1, - "maximum": 0.4, - } - ], - ) - - assert server.compare_image("mesh/polygons/vertex_color_map_rainbow.jpeg") == True - - -def test_polygons_polygon_color_map( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - dataset_factory( - id=mesh_id, - viewable_file="triangulated_surface2d.vtp", - viewer_elements_type="polygons", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - - # Set active attribute - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_attribute"]["rpc"], - [{"id": mesh_id, "name": "triangle_vertices"}], - ) - - # Set color map: Blue to Red - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 50.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 50.0, - } - ], - ) - - assert server.compare_image("mesh/polygons/polygon_color_map.jpeg") == True - - -def test_polygons_polygon_color_map_range_update( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - dataset_factory( - id=mesh_id, - viewable_file="triangulated_surface2d.vtp", - viewer_elements_type="polygons", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - - # Set active attribute - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_attribute"]["rpc"], - [{"id": mesh_id, "name": "triangle_vertices"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 50.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 50.0, - } - ], - ) - - assert server.compare_image("mesh/polygons/polygon_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 40.0, - 0, - 0, - 1.0, - 45.0, - 1.0, - 0, - 0, - ], - "minimum": 40.0, - "maximum": 45.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polygons/polygon_color_map_range_update.jpeg") - == True - ) - - -def test_polygons_polygon_color_map_red_shift( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - dataset_factory( - id=mesh_id, - viewable_file="triangulated_surface2d.vtp", - viewer_elements_type="polygons", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - - # Set active attribute - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_attribute"]["rpc"], - [{"id": mesh_id, "name": "triangle_vertices"}], - ) - - # Set Blue to Red Map on [0, 50] - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 0, - 0, - 1.0, - 50.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 50.0, - } - ], - ) - - assert server.compare_image("mesh/polygons/polygon_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 3.0, - 0, - 0, - 1.0, - 4.0, - 1.0, - 0, - 0, - ], - "minimum": 3.0, - "maximum": 4.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polygons/polygon_color_map_red_shift.jpeg") == True - ) - - -def test_polygons_polygon_color_map_rainbow( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - mesh_id = "123456789" - dataset_factory( - id=mesh_id, - viewable_file="triangulated_surface2d.vtp", - viewer_elements_type="polygons", - ) - - server.call( - VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], - [{"id": mesh_id}], - ) - - # Set active attribute - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_attribute"]["rpc"], - [{"id": mesh_id, "name": "triangle_vertices"}], - ) - - # Rainbow Desaturated Map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 0.0, - 71 / 255, - 71 / 255, - 219 / 255, - 0.143 * 50, - 0, - 0, - 92 / 255, - 0.285 * 50, - 0, - 255 / 255, - 255 / 255, - 0.429 * 50, - 0, - 128 / 255, - 0, - 0.571 * 50, - 255 / 255, - 255 / 255, - 0, - 0.714 * 50, - 255 / 255, - 97 / 255, - 0, - 0.857 * 50, - 107 / 255, - 0, - 0, - 50.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 0.0, - "maximum": 50.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polygons/polygon_color_map_rainbow_initial.jpeg") - == True - ) - - # Update rainbow range via color map - server.call( - VtkMeshPolygonsView.mesh_polygons_prefix - + VtkMeshPolygonsView.mesh_polygons_schemas_dict["polygon_color_map"]["rpc"], - [ - { - "id": mesh_id, - "points": [ - 5.0, - 71 / 255, - 71 / 255, - 219 / 255, - 5.0 + 0.143 * 10, - 0, - 0, - 92 / 255, - 5.0 + 0.285 * 10, - 0, - 255 / 255, - 255 / 255, - 5.0 + 0.429 * 10, - 0, - 128 / 255, - 0, - 5.0 + 0.571 * 10, - 255 / 255, - 255 / 255, - 0, - 5.0 + 0.714 * 10, - 255 / 255, - 97 / 255, - 0, - 5.0 + 0.857 * 10, - 107 / 255, - 0, - 0, - 15.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 5.0, - "maximum": 15.0, - } - ], - ) - - assert server.compare_image("mesh/polygons/polygon_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py b/tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py new file mode 100644 index 00000000..82fcf8b8 --- /dev/null +++ b/tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py @@ -0,0 +1,389 @@ +# Standard library imports +from typing import Callable + +# Third party imports +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.polyhedra.attribute.polyhedron.polyhedra_attribute_polyhedron_protocols import ( + VtkMeshPolyhedraAttributePolyhedronView, +) + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: + + dataset_factory( + id=mesh_id, + viewable_file="polyhedron_attribute.vtu", + viewer_elements_type="polyhedra", + ) + + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + + +def test_polyhedra_polyhedron_attribute( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_polyhedra"}], + ) + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "scalar_range" + ][ + "rpc" + ], + [{"id": mesh_id, "minimum": 3, "maximum": 6}], + ) + assert server.compare_image("mesh/polyhedra/polyhedron_attribute.jpeg") == True + + +def test_polyhedra_polyhedron_color_map( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_polyhedra"}], + ) + + # Set color map: Blue to Red + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 3.0, + 0, + 0, + 1.0, + 6.0, + 1.0, + 0, + 0, + ], + "minimum": 3.0, + "maximum": 6.0, + } + ], + ) + + assert server.compare_image("mesh/polyhedra/polyhedron_color_map.jpeg") == True + + +def test_polyhedra_polyhedron_color_map_range_update( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_polyhedra"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 3.0, + 0, + 0, + 1.0, + 6.0, + 1.0, + 0, + 0, + ], + "minimum": 3.0, + "maximum": 6.0, + } + ], + ) + + assert server.compare_image("mesh/polyhedra/polyhedron_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 5.0, + 0, + 0, + 1.0, + 6.0, + 1.0, + 0, + 0, + ], + "minimum": 5.0, + "maximum": 6.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polyhedra/polyhedron_color_map_range_update.jpeg") + == True + ) + + +def test_polyhedra_polyhedron_color_map_red_shift( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_polyhedra"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 3.0, + 0, + 0, + 1.0, + 6.0, + 1.0, + 0, + 0, + ], + "minimum": 3.0, + "maximum": 6.0, + } + ], + ) + + assert server.compare_image("mesh/polyhedra/polyhedron_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polyhedra/polyhedron_color_map_red_shift.jpeg") + == True + ) + + +def test_polyhedra_polyhedron_color_map_rainbow( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_polyhedra"}], + ) + + # Rainbow Desaturated Map + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 3.0, + 71 / 255, + 71 / 255, + 219 / 255, + 3.0 + 0.143 * 3, + 0, + 0, + 92 / 255, + 3.0 + 0.285 * 3, + 0, + 255 / 255, + 255 / 255, + 3.0 + 0.429 * 3, + 0, + 128 / 255, + 0, + 3.0 + 0.571 * 3, + 255 / 255, + 255 / 255, + 0, + 3.0 + 0.714 * 3, + 255 / 255, + 97 / 255, + 0, + 3.0 + 0.857 * 3, + 107 / 255, + 0, + 0, + 6.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 3.0, + "maximum": 6.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polyhedra/polyhedron_color_map_rainbow_initial.jpeg") + == True + ) + + # Update rainbow range via color map + server.call( + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_prefix + + VtkMeshPolyhedraAttributePolyhedronView.mesh_polyhedra_attribute_polyhedron_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 3.5, + 71 / 255, + 71 / 255, + 219 / 255, + 3.5 + 0.143 * 2, + 0, + 0, + 92 / 255, + 3.5 + 0.285 * 2, + 0, + 255 / 255, + 255 / 255, + 3.5 + 0.429 * 2, + 0, + 128 / 255, + 0, + 3.5 + 0.571 * 2, + 255 / 255, + 255 / 255, + 0, + 3.5 + 0.714 * 2, + 255 / 255, + 97 / 255, + 0, + 3.5 + 0.857 * 2, + 107 / 255, + 0, + 0, + 5.5, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 3.5, + "maximum": 5.5, + } + ], + ) + + assert ( + server.compare_image("mesh/polyhedra/polyhedron_color_map_rainbow.jpeg") == True + ) diff --git a/tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py b/tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py new file mode 100644 index 00000000..3c4c5b74 --- /dev/null +++ b/tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py @@ -0,0 +1,386 @@ +# Standard library imports +from typing import Callable + +# Third party imports +from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView +from opengeodeweb_viewer.rpc.mesh.polyhedra.attribute.vertex.polyhedra_attribute_vertex_protocols import ( + VtkMeshPolyhedraAttributeVertexView, +) + +# Local application imports +from tests.conftest import ServerMonitor + +# Local constants +mesh_id = "123456789" + + +def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> None: + + dataset_factory( + id=mesh_id, + viewable_file="polyhedron_attribute.vtu", + viewer_elements_type="polyhedra", + ) + + server.call( + VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"], + [{"id": mesh_id}], + ) + + +def test_polyhedra_vertex_attribute( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_vertices"}], + ) + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "scalar_range" + ][ + "rpc" + ], + [{"id": mesh_id, "minimum": 1, "maximum": 11}], + ) + assert server.compare_image("mesh/polyhedra/vertex_attribute.jpeg") == True + + +def test_polyhedra_vertex_color_map( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_vertices"}], + ) + + # Set color map: Blue to Red + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 1.0, + 0, + 0, + 1.0, + 11.0, + 1.0, + 0, + 0, + ], + "minimum": 1.0, + "maximum": 11.0, + } + ], + ) + + assert server.compare_image("mesh/polyhedra/vertex_color_map.jpeg") == True + + +def test_polyhedra_vertex_color_map_range_update( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_vertices"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 1.0, + 0, + 0, + 1.0, + 11.0, + 1.0, + 0, + 0, + ], + "minimum": 1.0, + "maximum": 11.0, + } + ], + ) + + assert server.compare_image("mesh/polyhedra/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 10.0, + 0, + 0, + 1.0, + 11.0, + 1.0, + 0, + 0, + ], + "minimum": 10.0, + "maximum": 11.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polyhedra/vertex_color_map_range_update.jpeg") + == True + ) + + +def test_polyhedra_vertex_color_map_red_shift( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_vertices"}], + ) + + # Set Blue to Red Map + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 1.0, + 0, + 0, + 1.0, + 11.0, + 1.0, + 0, + 0, + ], + "minimum": 1.0, + "maximum": 11.0, + } + ], + ) + + assert server.compare_image("mesh/polyhedra/vertex_color_map.jpeg") == True + + # Update range via color map + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 0.0, + 0, + 0, + 1.0, + 1.0, + 1.0, + 0, + 0, + ], + "minimum": 0.0, + "maximum": 1.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polyhedra/vertex_color_map_red_shift.jpeg") == True + ) + + +def test_polyhedra_vertex_color_map_rainbow( + server: ServerMonitor, dataset_factory: Callable[..., str] +) -> None: + + test_register(server, dataset_factory) + + # Set active attribute + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "name" + ][ + "rpc" + ], + [{"id": mesh_id, "name": "toto_on_vertices"}], + ) + + # Rainbow Desaturated Map + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 1.0, + 71 / 255, + 71 / 255, + 219 / 255, + 1.0 + 0.143 * 10, + 0, + 0, + 92 / 255, + 1.0 + 0.285 * 10, + 0, + 255 / 255, + 255 / 255, + 1.0 + 0.429 * 10, + 0, + 128 / 255, + 0, + 1.0 + 0.571 * 10, + 255 / 255, + 255 / 255, + 0, + 1.0 + 0.714 * 10, + 255 / 255, + 97 / 255, + 0, + 1.0 + 0.857 * 10, + 107 / 255, + 0, + 0, + 11.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 1.0, + "maximum": 11.0, + } + ], + ) + + assert ( + server.compare_image("mesh/polyhedra/vertex_color_map_rainbow_initial.jpeg") + == True + ) + + # Update rainbow range via color map + server.call( + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_prefix + + VtkMeshPolyhedraAttributeVertexView.mesh_polyhedra_attribute_vertex_schemas_dict[ + "color_map" + ][ + "rpc" + ], + [ + { + "id": mesh_id, + "points": [ + 2.0, + 71 / 255, + 71 / 255, + 219 / 255, + 2.0 + 0.143 * 6, + 0, + 0, + 92 / 255, + 2.0 + 0.285 * 6, + 0, + 255 / 255, + 255 / 255, + 2.0 + 0.429 * 6, + 0, + 128 / 255, + 0, + 2.0 + 0.571 * 6, + 255 / 255, + 255 / 255, + 0, + 2.0 + 0.714 * 6, + 255 / 255, + 97 / 255, + 0, + 2.0 + 0.857 * 6, + 107 / 255, + 0, + 0, + 8.0, + 224 / 255, + 77 / 255, + 77 / 255, + ], + "minimum": 2.0, + "maximum": 8.0, + } + ], + ) + + assert server.compare_image("mesh/polyhedra/vertex_color_map_rainbow.jpeg") == True diff --git a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py index 0f377053..c58c4591 100644 --- a/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py +++ b/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py @@ -51,636 +51,3 @@ def test_polyhedra_visibility( [{"id": "123456789", "visibility": False}], ) assert server.compare_image("mesh/polyhedra/visibility.jpeg") == True - - -def test_vertex_attribute( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "toto_on_vertices"}], - ) - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 1, "maximum": 11}], - ) - assert server.compare_image("mesh/polyhedra/vertex_attribute.jpeg") == True - - -def test_polyhedron_attribute( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_attribute"][ - "rpc" - ], - [{"id": "123456789", "name": "toto_on_polyhedra"}], - ) - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_scalar_range"][ - "rpc" - ], - [{"id": "123456789", "minimum": 3, "maximum": 6}], - ) - assert server.compare_image("mesh/polyhedra/polyhedron_attribute.jpeg") == True - - -def test_polyhedra_vertex_color_map( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "toto_on_vertices"}], - ) - - # Set color map: Blue to Red - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 1.0, - 0, - 0, - 1.0, - 11.0, - 1.0, - 0, - 0, - ], - "minimum": 1.0, - "maximum": 11.0, - } - ], - ) - - assert server.compare_image("mesh/polyhedra/vertex_color_map.jpeg") == True - - -def test_polyhedra_vertex_color_map_range_update( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "toto_on_vertices"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 1.0, - 0, - 0, - 1.0, - 11.0, - 1.0, - 0, - 0, - ], - "minimum": 1.0, - "maximum": 11.0, - } - ], - ) - - assert server.compare_image("mesh/polyhedra/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 10.0, - 0, - 0, - 1.0, - 11.0, - 1.0, - 0, - 0, - ], - "minimum": 10.0, - "maximum": 11.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polyhedra/vertex_color_map_range_update.jpeg") - == True - ) - - -def test_polyhedra_vertex_color_map_red_shift( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "toto_on_vertices"}], - ) - - # Set Blue to Red Map on [1, 11] - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 1.0, - 0, - 0, - 1.0, - 11.0, - 1.0, - 0, - 0, - ], - "minimum": 1.0, - "maximum": 11.0, - } - ], - ) - - assert server.compare_image("mesh/polyhedra/vertex_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 0.0, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polyhedra/vertex_color_map_red_shift.jpeg") == True - ) - - -def test_polyhedra_vertex_color_map_rainbow( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_attribute"]["rpc"], - [{"id": "123456789", "name": "toto_on_vertices"}], - ) - - # Rainbow Desaturated Map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 1.0, - 71 / 255, - 71 / 255, - 219 / 255, - 1.0 + 0.143 * 10, - 0, - 0, - 92 / 255, - 1.0 + 0.285 * 10, - 0, - 255 / 255, - 255 / 255, - 1.0 + 0.429 * 10, - 0, - 128 / 255, - 0, - 1.0 + 0.571 * 10, - 255 / 255, - 255 / 255, - 0, - 1.0 + 0.714 * 10, - 255 / 255, - 97 / 255, - 0, - 1.0 + 0.857 * 10, - 107 / 255, - 0, - 0, - 11.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 1.0, - "maximum": 11.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polyhedra/vertex_color_map_rainbow_initial.jpeg") - == True - ) - - # Update rainbow range via color map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_color_map"]["rpc"], - [ - { - "id": "123456789", - "points": [ - 2.0, - 71 / 255, - 71 / 255, - 219 / 255, - 2.0 + 0.143 * 6, - 0, - 0, - 92 / 255, - 2.0 + 0.285 * 6, - 0, - 255 / 255, - 255 / 255, - 2.0 + 0.429 * 6, - 0, - 128 / 255, - 0, - 2.0 + 0.571 * 6, - 255 / 255, - 255 / 255, - 0, - 2.0 + 0.714 * 6, - 255 / 255, - 97 / 255, - 0, - 2.0 + 0.857 * 6, - 107 / 255, - 0, - 0, - 8.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 2.0, - "maximum": 8.0, - } - ], - ) - - assert server.compare_image("mesh/polyhedra/vertex_color_map_rainbow.jpeg") == True - - -def test_polyhedra_polyhedron_color_map( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_attribute"][ - "rpc" - ], - [{"id": "123456789", "name": "toto_on_polyhedra"}], - ) - - # Set color map: Blue to Red - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ - "rpc" - ], - [ - { - "id": "123456789", - "points": [ - 3.0, - 0, - 0, - 1.0, - 6.0, - 1.0, - 0, - 0, - ], - "minimum": 3.0, - "maximum": 6.0, - } - ], - ) - - assert server.compare_image("mesh/polyhedra/polyhedron_color_map.jpeg") == True - - -def test_polyhedra_polyhedron_color_map_range_update( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_attribute"][ - "rpc" - ], - [{"id": "123456789", "name": "toto_on_polyhedra"}], - ) - - # Set Blue to Red Map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ - "rpc" - ], - [ - { - "id": "123456789", - "points": [ - 3.0, - 0, - 0, - 1.0, - 6.0, - 1.0, - 0, - 0, - ], - "minimum": 3.0, - "maximum": 6.0, - } - ], - ) - - assert server.compare_image("mesh/polyhedra/polyhedron_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ - "rpc" - ], - [ - { - "id": "123456789", - "points": [ - 5.0, - 0, - 0, - 1.0, - 6.0, - 1.0, - 0, - 0, - ], - "minimum": 5.0, - "maximum": 6.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polyhedra/polyhedron_color_map_range_update.jpeg") - == True - ) - - -def test_polyhedra_polyhedron_color_map_red_shift( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_attribute"][ - "rpc" - ], - [{"id": "123456789", "name": "toto_on_polyhedra"}], - ) - - # Set Blue to Red Map on [3, 6] - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ - "rpc" - ], - [ - { - "id": "123456789", - "points": [ - 3.0, - 0, - 0, - 1.0, - 6.0, - 1.0, - 0, - 0, - ], - "minimum": 3.0, - "maximum": 6.0, - } - ], - ) - - assert server.compare_image("mesh/polyhedra/polyhedron_color_map.jpeg") == True - - # Update range via color map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ - "rpc" - ], - [ - { - "id": "123456789", - "points": [ - 0.0, - 0, - 0, - 1.0, - 1.0, - 1.0, - 0, - 0, - ], - "minimum": 0.0, - "maximum": 1.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polyhedra/polyhedron_color_map_red_shift.jpeg") - == True - ) - - -def test_polyhedra_polyhedron_color_map_rainbow( - server: ServerMonitor, dataset_factory: Callable[..., str] -) -> None: - test_register_mesh(server, dataset_factory) - - # Set active attribute - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_attribute"][ - "rpc" - ], - [{"id": "123456789", "name": "toto_on_polyhedra"}], - ) - - # Rainbow Desaturated Map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ - "rpc" - ], - [ - { - "id": "123456789", - "points": [ - 3.0, - 71 / 255, - 71 / 255, - 219 / 255, - 3.0 + 0.143 * 3, - 0, - 0, - 92 / 255, - 3.0 + 0.285 * 3, - 0, - 255 / 255, - 255 / 255, - 3.0 + 0.429 * 3, - 0, - 128 / 255, - 0, - 3.0 + 0.571 * 3, - 255 / 255, - 255 / 255, - 0, - 3.0 + 0.714 * 3, - 255 / 255, - 97 / 255, - 0, - 3.0 + 0.857 * 3, - 107 / 255, - 0, - 0, - 6.0, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 3.0, - "maximum": 6.0, - } - ], - ) - - assert ( - server.compare_image("mesh/polyhedra/polyhedron_color_map_rainbow_initial.jpeg") - == True - ) - - # Update rainbow range via color map - server.call( - VtkMeshPolyhedraView.mesh_polyhedra_prefix - + VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedra_color_map"][ - "rpc" - ], - [ - { - "id": "123456789", - "points": [ - 3.5, - 71 / 255, - 71 / 255, - 219 / 255, - 3.5 + 0.143 * 2, - 0, - 0, - 92 / 255, - 3.5 + 0.285 * 2, - 0, - 255 / 255, - 255 / 255, - 3.5 + 0.429 * 2, - 0, - 128 / 255, - 0, - 3.5 + 0.571 * 2, - 255 / 255, - 255 / 255, - 0, - 3.5 + 0.714 * 2, - 255 / 255, - 97 / 255, - 0, - 3.5 + 0.857 * 2, - 107 / 255, - 0, - 0, - 5.5, - 224 / 255, - 77 / 255, - 77 / 255, - ], - "minimum": 3.5, - "maximum": 5.5, - } - ], - ) - - assert ( - server.compare_image("mesh/polyhedra/polyhedron_color_map_rainbow.jpeg") == True - ) From aeddd924ca3239bdc7372849a6e715c793a0443e Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 4 Feb 2026 11:28:06 +0100 Subject: [PATCH 27/27] pyproject.toml --- pyproject.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e1edfd02..100bfa96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,10 +35,19 @@ where = ["src"] "opengeodeweb_viewer.rpc.generic.schemas" = ["*.json"] "opengeodeweb_viewer.rpc.mesh.schemas" = ["*.json"] "opengeodeweb_viewer.rpc.mesh.points.schemas" = ["*.json"] +"opengeodeweb_viewer.rpc.mesh.points.attribute.vertex.schemas" = ["*.json"] "opengeodeweb_viewer.rpc.mesh.edges.schemas" = ["*.json"] +"opengeodeweb_viewer.rpc.mesh.edges.attribute.edge.schemas" = ["*.json"] +"opengeodeweb_viewer.rpc.mesh.edges.attribute.vertex.schemas" = ["*.json"] "opengeodeweb_viewer.rpc.mesh.cells.schemas" = ["*.json"] +"opengeodeweb_viewer.rpc.mesh.cells.attribute.cell.schemas" = ["*.json"] +"opengeodeweb_viewer.rpc.mesh.cells.attribute.vertex.schemas" = ["*.json"] "opengeodeweb_viewer.rpc.mesh.polygons.schemas" = ["*.json"] +"opengeodeweb_viewer.rpc.mesh.polygons.attribute.polygon.schemas" = ["*.json"] +"opengeodeweb_viewer.rpc.mesh.polygons.attribute.vertex.schemas" = ["*.json"] "opengeodeweb_viewer.rpc.mesh.polyhedra.schemas" = ["*.json"] +"opengeodeweb_viewer.rpc.mesh.polyhedra.attribute.polyhedron.schemas" = ["*.json"] +"opengeodeweb_viewer.rpc.mesh.polyhedra.attribute.vertex.schemas" = ["*.json"] "opengeodeweb_viewer.rpc.model.schemas" = ["*.json"] "opengeodeweb_viewer.rpc.model.edges.schemas" = ["*.json"] "opengeodeweb_viewer.rpc.model.points.schemas" = ["*.json"]