Skip to content

Commit 9abe9fb

Browse files
authored
Merge pull request #83 from Geode-solutions/next
Next
2 parents 3406900 + f719a2a commit 9abe9fb

12 files changed

+89
-45
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55

66
[project]
77
name = "OpenGeodeWeb-Viewer"
8-
version = "1.9.1"
8+
version = "1.10.0-rc.1"
99
dynamic = ["dependencies"]
1010
authors = [
1111
{ name="Geode-solutions", email="team-web@geode-solutions.com" },

requirements.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
jsonschema
2-
wslink
1+
wslink<2
2+
fastjsonschema
33
websocket-client

requirements.txt

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,42 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.9
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile requirements.in
66
#
7-
aiohttp==3.9.3
7+
aiohappyeyeballs==2.6.1
8+
# via aiohttp
9+
aiohttp==3.12.14
810
# via wslink
9-
aiosignal==1.3.1
11+
aiosignal==1.4.0
1012
# via aiohttp
11-
async-timeout==4.0.3
13+
async-timeout==5.0.1
1214
# via aiohttp
13-
attrs==23.2.0
14-
# via
15-
# aiohttp
16-
# jsonschema
17-
# referencing
18-
frozenlist==1.4.1
15+
attrs==25.3.0
16+
# via aiohttp
17+
fastjsonschema==2.21.1
18+
# via -r requirements.in
19+
frozenlist==1.7.0
1920
# via
2021
# aiohttp
2122
# aiosignal
22-
idna==3.6
23+
idna==3.10
2324
# via yarl
24-
jsonschema==4.21.1
25-
# via -r requirements.in
26-
jsonschema-specifications==2023.12.1
27-
# via jsonschema
28-
multidict==6.0.5
25+
multidict==6.6.3
2926
# via
3027
# aiohttp
3128
# yarl
32-
python-dotenv==1.0.1
33-
# via -r requirements.in
34-
referencing==0.33.0
29+
propcache==0.3.2
3530
# via
36-
# jsonschema
37-
# jsonschema-specifications
38-
rpds-py==0.18.0
31+
# aiohttp
32+
# yarl
33+
typing-extensions==4.14.1
3934
# via
40-
# jsonschema
41-
# referencing
42-
websocket-client==1.7.0
35+
# aiosignal
36+
# multidict
37+
websocket-client==1.8.0
4338
# via -r requirements.in
4439
wslink==1.12.4
4540
# via -r requirements.in
46-
yarl==1.9.4
41+
yarl==1.20.1
4742
# via aiohttp

src/opengeodeweb_viewer/rpc/viewer/schemas/set_z_scaling.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"type": "object",
44
"properties": {
55
"z_scale": {
6-
"type": "number"
6+
"type": "number",
7+
"minimum": 1
78
}
89
},
910
"required": [

src/opengeodeweb_viewer/rpc/viewer/viewer_protocols.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,9 @@ def toggleGridScale(self, params):
238238
params, self.viewer_schemas_dict["grid_scale"], self.viewer_prefix
239239
)
240240
id, visibility = "grid_scale", params["visibility"]
241-
actor = self.get_object(id)["actor"]
242-
actor.SetVisibility(visibility)
241+
if "grid_scale" in self.get_data_base():
242+
actor = self.get_object(id)["actor"]
243+
actor.SetVisibility(visibility)
243244
self.render()
244245

245246
@exportRpc(viewer_prefix + viewer_schemas_dict["axes"]["rpc"])
@@ -281,19 +282,18 @@ def renderNow(self, params):
281282

282283
@exportRpc(viewer_prefix + viewer_schemas_dict["set_z_scaling"]["rpc"])
283284
def setZScaling(self, params):
284-
285285
validate_schema(
286286
params, self.viewer_schemas_dict["set_z_scaling"], self.viewer_prefix
287287
)
288288
z_scale = params["z_scale"]
289-
290289
renderWindow = self.getView("-1")
291290
renderer = renderWindow.GetRenderers().GetFirstRenderer()
292-
293-
actors = renderer.GetActors()
294-
295-
for actor in actors:
296-
transform = vtkTransform()
297-
transform.Scale(1, 1, z_scale)
298-
actor.SetUserTransform(transform)
291+
cam = renderer.GetActiveCamera()
292+
transform = vtk.vtkTransform()
293+
transform.Scale(1, 1, z_scale)
294+
cam.SetModelTransformMatrix(transform.GetMatrix())
295+
296+
if "grid_scale" in self.get_data_base():
297+
cube_axes_actor = self.get_object("grid_scale")["actor"]
298+
cube_axes_actor.SetUse2DMode(1)
299299
self.render()

src/opengeodeweb_viewer/utils_functions.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import json
44

55
# Third party imports
6-
from jsonschema import validate
7-
from jsonschema.exceptions import ValidationError
6+
import fastjsonschema
7+
from fastjsonschema import JsonSchemaException
88

99
# Local application imports
1010

@@ -24,8 +24,9 @@ def get_schemas_dict(path):
2424
def validate_schema(params, schema, prefix=""):
2525
print(f"{prefix}{schema['rpc']}", f"{params=}", flush=True)
2626
try:
27-
validate(instance=params, schema=schema)
28-
except ValidationError as e:
27+
validate = fastjsonschema.compile(schema)
28+
validate(params)
29+
except fastjsonschema.JsonSchemaException as e:
2930
print(f"Validation error: {e.message}", flush=True)
3031
raise Exception(
3132
{
Loading
Loading
-197 Bytes
Loading
891 Bytes
Loading

0 commit comments

Comments
 (0)