Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 232 additions & 0 deletions opengeodeweb_viewer_schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,35 @@
],
"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",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": [
"id",
"points"
],
"additionalProperties": false
},
"vertex_attribute": {
"$id": "opengeodeweb_viewer.mesh.cells.vertex_attribute",
"rpc": "vertex_attribute",
Expand Down Expand Up @@ -167,6 +196,35 @@
],
"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",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": [
"id",
"points"
],
"additionalProperties": false
},
"cell_attribute": {
"$id": "opengeodeweb_viewer.mesh.cells.cell_attribute",
"rpc": "cell_attribute",
Expand Down Expand Up @@ -250,6 +308,35 @@
],
"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",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": [
"id",
"points"
],
"additionalProperties": false
},
"vertex_attribute": {
"$id": "opengeodeweb_viewer.mesh.edges.vertex_attribute",
"rpc": "vertex_attribute",
Expand Down Expand Up @@ -381,6 +468,35 @@
],
"additionalProperties": false
},
"vertex_color_map": {
"$id": "opengeodeweb_viewer.mesh.points.color_map",
"rpc": "color_map",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"points": {
"type": "array",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": [
"id",
"points"
],
"additionalProperties": false
},
"vertex_attribute": {
"$id": "opengeodeweb_viewer.mesh.points.vertex_attribute",
"rpc": "vertex_attribute",
Expand Down Expand Up @@ -512,6 +628,35 @@
],
"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",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": [
"id",
"points"
],
"additionalProperties": false
},
"vertex_attribute": {
"$id": "opengeodeweb_viewer.mesh.polygons.vertex_attribute",
"rpc": "vertex_attribute",
Expand Down Expand Up @@ -555,6 +700,35 @@
],
"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",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": [
"id",
"points"
],
"additionalProperties": false
},
"polygon_attribute": {
"$id": "opengeodeweb_viewer.mesh.polygons.polygon_attribute",
"rpc": "polygon_attribute",
Expand Down Expand Up @@ -667,6 +841,35 @@
],
"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",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": [
"id",
"points"
],
"additionalProperties": false
},
"vertex_attribute": {
"$id": "opengeodeweb_viewer.mesh.polyhedra.vertex_attribute",
"rpc": "vertex_attribute",
Expand Down Expand Up @@ -730,6 +933,35 @@
],
"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",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": [
"id",
"points"
],
"additionalProperties": false
},
"color": {
"$id": "opengeodeweb_viewer.mesh.polyhedra.color",
"rpc": "color",
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ wslink==1.12.4
yarl>=1
# via aiohttp

opengeodeweb-microservice==1.*,>=1.0.12
20 changes: 20 additions & 0 deletions src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,23 @@ def setMeshCellsCellScalarRange(self, rpc_params: RpcParams) -> None:
)
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)

@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)
2 changes: 2 additions & 0 deletions src/opengeodeweb_viewer/rpc/mesh/cells/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
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 *
25 changes: 25 additions & 0 deletions src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"rpc": "color_map",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"points": {
"type": "array",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": ["id", "points"],
"additionalProperties": false
}
12 changes: 12 additions & 0 deletions src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from dataclasses_json import DataClassJsonMixin
from dataclasses import dataclass
from typing import List


@dataclass
class CellColorMap(DataClassJsonMixin):
def __post_init__(self) -> None:
print(self, flush=True)

id: str
points: List[List[float]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"rpc": "color_map",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"points": {
"type": "array",
"items": {
"type": "array",
"description": "[value, r, g, b]",
"items": {
"type": "number"
},
"minItems": 4,
"maxItems": 4
},
"minLength": 2
}
},
"required": ["id", "points"],
"additionalProperties": false
}
Loading