diff --git a/opengeodeweb_viewer_schemas.json b/opengeodeweb_viewer_schemas.json index df7e78d4..0c3aa9b3 100644 --- a/opengeodeweb_viewer_schemas.json +++ b/opengeodeweb_viewer_schemas.json @@ -36,29 +36,6 @@ "cells": { "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 - }, "name": { "$id": "opengeodeweb_viewer.mesh.cells.attribute.cell.name", "rpc": "name", @@ -113,29 +90,6 @@ } }, "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" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false - }, "name": { "$id": "opengeodeweb_viewer.mesh.cells.attribute.vertex.name", "rpc": "name", @@ -283,29 +237,6 @@ } }, "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" - } - }, - "required": [ - "id", - "minimum", - "maximum" - ], - "additionalProperties": false - }, "name": { "$id": "opengeodeweb_viewer.mesh.edges.attribute.vertex.name", "rpc": "name", @@ -450,29 +381,6 @@ "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 - }, "name": { "$id": "opengeodeweb_viewer.mesh.points.attribute.vertex.name", "rpc": "name", @@ -692,29 +600,6 @@ "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", @@ -769,29 +654,6 @@ } }, "vertex": { - "scalar_range": { - "$id": "opengeodeweb_viewer.mesh.polygons.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 - }, "name": { "$id": "opengeodeweb_viewer.mesh.polygons.attribute.vertex.name", "rpc": "name", @@ -917,29 +779,6 @@ "polyhedra": { "attribute": { "polyhedron": { - "scalar_range": { - "$id": "opengeodeweb_viewer.mesh.polyhedra.attribute.polyhedron.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.polyhedra.attribute.polyhedron.name", "rpc": "name", @@ -994,29 +833,6 @@ } }, "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 - }, "name": { "$id": "opengeodeweb_viewer.mesh.polyhedra.attribute.vertex.name", "rpc": "name", diff --git a/requirements.txt b/requirements.txt index 67bd0416..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.14 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 6be9bc8c..5502f1d2 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 @@ -36,19 +36,6 @@ def setMeshCellsCellAttribute(self, rpc_params: RpcParams) -> None: params = schemas.Name.from_dict(rpc_params) self.displayAttributeOnCells(params.id, params.name) - @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_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_attribute_cell_prefix + mesh_cells_attribute_cell_schemas_dict["color_map"]["rpc"] 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 132463ad..ef745855 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,2 @@ -from .scalar_range import * from .name import * from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.json deleted file mode 100644 index cbc408ae..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/cells/attribute/cell/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py deleted file mode 100644 index 69d2fae4..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/cell/schemas/scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -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/cells/attribute/vertex/cells_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/cells_attribute_vertex_protocols.py index 9388bcb1..6692a5ac 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 @@ -38,19 +38,6 @@ def setMeshCellsVertexName(self, rpc_params: RpcParams) -> None: params = schemas.Name.from_dict(rpc_params) self.displayAttributeOnVertices(params.id, params.name) - @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_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_attribute_vertex_prefix + mesh_cells_attribute_vertex_schemas_dict["color_map"]["rpc"] 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 132463ad..ef745855 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,2 @@ -from .scalar_range import * from .name import * from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.json deleted file mode 100644 index cbc408ae..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/cells/attribute/vertex/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py deleted file mode 100644 index 69d2fae4..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/cells/attribute/vertex/schemas/scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -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/edges/attribute/vertex/edges_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/edges_attribute_vertex_protocols.py index f633eb46..d74ba7b6 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 @@ -38,19 +38,6 @@ def setMeshEdgesVertexName(self, rpc_params: RpcParams) -> None: params = schemas.Name.from_dict(rpc_params) self.displayAttributeOnVertices(params.id, params.name) - @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_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_attribute_vertex_prefix + mesh_edges_attribute_vertex_schemas_dict["color_map"]["rpc"] 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 132463ad..ef745855 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,2 @@ -from .scalar_range import * from .name import * from .color_map import * 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 deleted file mode 100644 index cbc408ae..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/attribute/vertex/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py deleted file mode 100644 index 69d2fae4..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/edges/attribute/vertex/schemas/scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -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/mesh_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py index 9f02ef71..8a3e924f 100644 --- a/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py +++ b/src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py @@ -148,19 +148,22 @@ def setupColorMap( lut = vtkColorTransferFunction() data.mapper.SetLookupTable(lut) - 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): - new_x = ( - minimum + (x - x_min) / x_range * target_range - if x_range != 0 - else minimum - ) - lut.AddRGBPoint(new_x, r, g, b) + if not points: + lut.AddRGBPoint(minimum, 0, 0, 0) + lut.AddRGBPoint(maximum, 1, 1, 1) + else: + 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): + if x_range != 0: + new_x = minimum + (x - x_min) / x_range * target_range + else: + new_x = minimum + lut.AddRGBPoint(new_x, r, g, b) data.mapper.SetScalarRange(minimum, maximum) lut.SetRange(minimum, maximum) 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 1db3ce7a..f8a9e707 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 @@ -38,19 +38,6 @@ def setMeshPointsVertexName(self, rpc_params: RpcParams) -> None: params = schemas.Name.from_dict(rpc_params) self.displayAttributeOnVertices(params.id, params.name) - @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_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_attribute_vertex_prefix + mesh_points_attribute_vertex_schemas_dict["color_map"]["rpc"] 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 132463ad..ef745855 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,2 @@ -from .scalar_range import * from .name import * from .color_map import * 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 deleted file mode 100644 index cbc408ae..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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 deleted file mode 100644 index 69d2fae4..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/points/attribute/vertex/schemas/scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -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/polygons/attribute/polygon/polygons_attribute_polygon_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/polygons_attribute_polygon_protocols.py index df33dfae..7a9ae4e0 100644 --- 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 @@ -38,19 +38,6 @@ def setMeshPolygonsPolygonAttribute(self, rpc_params: RpcParams) -> None: 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"] 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 132463ad..ef745855 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,2 @@ -from .scalar_range import * from .name import * from .color_map import * 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 deleted file mode 100644 index cbc408ae..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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 deleted file mode 100644 index 69d2fae4..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/polygon/schemas/scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -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/polygons/attribute/vertex/polygons_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/polygons_attribute_vertex_protocols.py index 6892a3da..8ab17779 100644 --- 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 @@ -38,19 +38,6 @@ def setMeshPolygonsVertexName(self, rpc_params: RpcParams) -> None: 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"] 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 132463ad..ef745855 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,2 @@ -from .scalar_range import * from .name import * from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.json deleted file mode 100644 index cbc408ae..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/vertex/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.py deleted file mode 100644 index 69d2fae4..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polygons/attribute/vertex/schemas/scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -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/polyhedra/attribute/polyhedron/polyhedra_attribute_polyhedron_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/polyhedra_attribute_polyhedron_protocols.py index 92269def..7805a1b6 100644 --- 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 @@ -38,19 +38,6 @@ def setMeshPolyhedraPolyhedronName(self, rpc_params: RpcParams) -> None: 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"] 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 132463ad..ef745855 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,2 @@ -from .scalar_range import * from .name import * from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.json deleted file mode 100644 index cbc408ae..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/polyhedra/attribute/polyhedron/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.py deleted file mode 100644 index 69d2fae4..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/polyhedron/schemas/scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -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/polyhedra/attribute/vertex/polyhedra_attribute_vertex_protocols.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/polyhedra_attribute_vertex_protocols.py index 57a08485..55781908 100644 --- 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 @@ -38,19 +38,6 @@ def setMeshPolyhedraVertexName(self, rpc_params: RpcParams) -> None: 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"] 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 132463ad..ef745855 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,2 @@ -from .scalar_range import * from .name import * from .color_map import * diff --git a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.json b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.json deleted file mode 100644 index cbc408ae..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/polyhedra/attribute/vertex/schemas/scalar_range.py b/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.py deleted file mode 100644 index 69d2fae4..00000000 --- a/src/opengeodeweb_viewer/rpc/mesh/polyhedra/attribute/vertex/schemas/scalar_range.py +++ /dev/null @@ -1,12 +0,0 @@ -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/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py b/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py index 1906075c..fd475602 100644 --- a/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py +++ b/tests/mesh/cells/attribute/cell/test_cells_attribute_cell_protocols.py @@ -26,38 +26,6 @@ def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> ) -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: 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 index 61f3e9d7..a59efda0 100644 --- a/tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py +++ b/tests/mesh/cells/attribute/vertex/test_cells_attribute_vertex_protocols.py @@ -26,38 +26,6 @@ def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> ) -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: 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 index b8534683..6709ba19 100644 --- a/tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py +++ b/tests/mesh/edges/attribute/vertex/test_edges_attribute_vertex_protocols.py @@ -28,29 +28,6 @@ def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> ) -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: 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 index 6a9bd183..51594f85 100644 --- a/tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py +++ b/tests/mesh/polygons/attribute/polygon/test_polygons_attribute_polygon_protocols.py @@ -28,33 +28,6 @@ def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> ) -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: 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 index 69189375..d8eeb517 100644 --- a/tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py +++ b/tests/mesh/polygons/attribute/vertex/test_polygons_attribute_vertex_protocols.py @@ -26,33 +26,6 @@ def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> ) -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: 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 index 82fcf8b8..4697eb4d 100644 --- a/tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py +++ b/tests/mesh/polyhedra/attribute/polyhedron/test_polyhedra_attribute_polyhedron_protocols.py @@ -28,33 +28,6 @@ def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> ) -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: 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 index 3c4c5b74..34371da5 100644 --- a/tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py +++ b/tests/mesh/polyhedra/attribute/vertex/test_polyhedra_attribute_vertex_protocols.py @@ -28,33 +28,6 @@ def test_register(server: ServerMonitor, dataset_factory: Callable[..., str]) -> ) -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: