Skip to content

Commit 6c93d9b

Browse files
Merge pull request #49 from Geode-solutions/next
No commit message
2 parents b8a5ec7 + 66c4dc3 commit 6c93d9b

24 files changed

+263
-35
lines changed

.github/workflows/CICD.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Upload PYPI
4141
if: steps.semantic-release.outputs.released == 'true'
4242
run: |
43-
python3 -m pip install twine
43+
python3 -m pip install twine==6.0.1
4444
python3 -m twine upload --repository pypi dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
4545
- name: Setup NODE
4646
uses: actions/setup-node@v3

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ __pycache__/
99
latest_logs
1010
schemas.json
1111
build
12-
src/tests/tests_output/
12+
/src/tests/tests_output/
1313
*.egg-info

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# CHANGELOG
22

33

4+
## v1.3.0-rc.2 (2025-02-13)
5+
6+
### Bug Fixes
7+
8+
- **CICD**: Twine 6.0.1
9+
([`430f5c8`](https://github.com/Geode-solutions/OpenGeodeWeb-Viewer/commit/430f5c818a7b2af89f79ab47b81885f2a4f9924d))
10+
11+
12+
## v1.3.0-rc.1 (2025-02-13)
13+
14+
### Features
15+
16+
- **polyhedrons**: Color protocol
17+
([`15b35fc`](https://github.com/Geode-solutions/OpenGeodeWeb-Viewer/commit/15b35fcfdda1afc66f4eb4942d9f54006bbc9a0f))
18+
19+
420
## v1.2.1 (2025-01-16)
521

622

@@ -128,7 +144,7 @@
128144

129145
BREAKING CHANGE: change some rpc names in schemas
130146

131-
### BREAKING CHANGES
147+
### Breaking Changes
132148

133149
- **new rpcs**: Change some rpc names in schemas
134150

pyproject.toml

Lines changed: 2 additions & 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.2.1"
8+
version = "1.3.0-rc.2"
99
dynamic = ["dependencies"]
1010
authors = [
1111
{ name="Geode-solutions", email="team-web@geode-solutions.com" },
@@ -41,6 +41,7 @@ where = ["src"]
4141
"opengeodeweb_viewer.rpc.mesh.points.schemas" = ["*.json"]
4242
"opengeodeweb_viewer.rpc.mesh.edges.schemas" = ["*.json"]
4343
"opengeodeweb_viewer.rpc.mesh.polygons.schemas" = ["*.json"]
44+
"opengeodeweb_viewer.rpc.mesh.polyhedrons.schemas" = ["*.json"]
4445
"opengeodeweb_viewer.rpc.model.schemas" = ["*.json"]
4546
"opengeodeweb_viewer.rpc.viewer.schemas" = ["*.json"]
4647

src/opengeodeweb_viewer/object/object_methods.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ def applyTextures(self, id, textures):
8888

8989
self.render()
9090

91-
9291
def SetVisibility(self, id, visibility):
9392
actor = self.get_object(id)["actor"]
9493
actor.SetVisibility(visibility)
@@ -103,7 +102,7 @@ def SetColor(self, id, red, green, blue):
103102
mapper = self.get_object(id)["mapper"]
104103
mapper.ScalarVisibilityOff()
105104
actor = self.get_object(id)["actor"]
106-
actor.GetProperty().SetColor([red, green, blue])
105+
actor.GetProperty().SetColor([red/255, green/255, blue/255])
107106
self.render()
108107

109108
def SetEdgesVisibility(self, id, visibility):
@@ -116,10 +115,11 @@ def SetEdgesSize(self, id, size):
116115
actor.GetProperty().SetEdgeWidth(size)
117116
self.render()
118117

119-
def SetEdgesColor(self, id, color):
118+
def SetEdgesColor(self, id, red, green, blue):
120119
actor = self.get_object(id)["actor"]
121-
actor.GetProperty().SetEdgeColor(color)
120+
actor.GetProperty().SetEdgeColor([red/255, green/255, blue/255])
122121
self.render()
122+
123123
def SetPointsVisibility(self, id, visibility):
124124
actor = self.get_object(id)["actor"]
125125
actor.GetProperty().SetVertexVisibility(visibility)
@@ -131,19 +131,9 @@ def SetPointsSize(self, id, size):
131131
actor.GetProperty().SetPointSize(size)
132132
self.render()
133133

134-
def SetPointsColor(self, id, color):
135-
actor = self.get_object(id)["actor"]
136-
actor.GetProperty().SetVertexColor(color)
137-
self.render()
138-
139-
def SetPolygonsVisibility(self, id, visibility):
140-
actor = self.get_object(id)["actor"]
141-
actor.SetVisibility(visibility)
142-
self.render()
143-
144-
def SetPolygonsColor(self, id, color):
134+
def SetPointsColor(self, id, red, green, blue):
145135
actor = self.get_object(id)["actor"]
146-
actor.GetProperty().SetColor(color)
136+
actor.GetProperty().SetVertexColor([red/255, green/255, blue/255])
147137
self.render()
148138

149139
def clearColors(self, id):

src/opengeodeweb_viewer/rpc/mesh/edges/edges_protocols.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def setMeshEdgesColor(self, params):
2828
print(self.mesh_edges_prefix + self.mesh_edges_schemas_dict["color"]["rpc"], f"{params=}", flush=True)
2929
validate_schema(params, self.mesh_edges_schemas_dict["color"])
3030
id = params["id"]
31-
red, green, blue = params["color"]["r"]/255, params["color"]["g"]/255, params["color"]["b"]/255
32-
self.SetEdgesColor(id, [red, green, blue])
31+
red, green, blue = params["color"]["r"], params["color"]["g"], params["color"]["b"]
32+
self.SetEdgesColor(id, red, green, blue)
3333

3434
@exportRpc(mesh_edges_prefix + mesh_edges_schemas_dict["size"]["rpc"])
3535
def setMeshEdgesSize(self, params):

src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ def setMeshColor(self, params):
5959
print(self.mesh_prefix + self.mesh_schemas_dict["color"]["rpc"], f"{params=}", flush=True)
6060
validate_schema(params, self.mesh_schemas_dict["color"])
6161
id = params["id"]
62-
red, green, blue = params["color"]["r"]/255, params["color"]["g"]/255, params["color"]["b"]/255
62+
red, green, blue = params["color"]["r"], params["color"]["g"], params["color"]["b"]
6363
self.SetColor(id, red, green, blue)
6464

65-
def setMeshVertexAttribute(self, id, name):
65+
def displayAttributeOnVertices(self, id, name):
6666
reader = self.get_object(id)["reader"]
6767
points = reader.GetOutput().GetPointData()
6868
points.SetActiveScalars(name)
@@ -72,7 +72,8 @@ def setMeshVertexAttribute(self, id, name):
7272
mapper.SetScalarRange(points.GetScalars().GetRange())
7373
self.render()
7474

75-
def setMeshPolygonAttribute(self, id, name):
75+
76+
def displayAttributeOnCells(self, id, name):
7677
reader = self.get_object(id)["reader"]
7778
cells = reader.GetOutput().GetCellData()
7879
cells.SetActiveScalars(name)

src/opengeodeweb_viewer/rpc/mesh/points/points_protocols.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def setMeshPointsColor(self, params):
2828
print(self.mesh_points_prefix + self.mesh_points_schemas_dict["color"]["rpc"], f"{params=}", flush=True)
2929
validate_schema(params, self.mesh_points_schemas_dict["color"])
3030
id = str(params["id"])
31-
red, green, blue = params["color"]["r"]/255, params["color"]["g"]/255, params["color"]["b"]/255
32-
self.SetPointsColor(id, [red, green, blue])
31+
red, green, blue = params["color"]["r"], params["color"]["g"], params["color"]["b"]
32+
self.SetPointsColor(id, red, green, blue)
3333

3434
@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["size"]["rpc"])
3535
def setMeshPointsSize(self, params):
@@ -45,5 +45,5 @@ def setMeshPointsVertexAttribute(self, params):
4545
validate_schema(params, self.mesh_points_schemas_dict["vertex_attribute"])
4646
id = str(params["id"])
4747
name = str(params["name"])
48-
self.setMeshVertexAttribute(id, name)
48+
self.displayAttributeOnVertices(id, name)
4949

src/opengeodeweb_viewer/rpc/mesh/polygons/polygons_protocols.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,28 @@ def setMeshPolygonsVisibility(self, params):
2121
validate_schema(params, self.mesh_polygons_schemas_dict["visibility"])
2222
id = params["id"]
2323
visibility = bool(params["visibility"])
24-
self.SetPolygonsVisibility(id, visibility)
25-
24+
self.SetVisibility(id, visibility)
25+
2626
@exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["color"]["rpc"])
2727
def setMeshPolygonsColor(self, params):
2828
print(self.mesh_polygons_prefix + self.mesh_polygons_schemas_dict["color"]["rpc"], f"{params=}", flush=True)
2929
validate_schema(params, self.mesh_polygons_schemas_dict["color"])
3030
id = params["id"]
31-
red, green, blue = params["color"]["r"]/255, params["color"]["g"]/255, params["color"]["b"]/255
32-
self.SetPolygonsColor(id, [red, green, blue])
31+
red, green, blue = params["color"]["r"], params["color"]["g"], params["color"]["b"]
32+
self.SetColor(id, red, green, blue)
3333

3434
@exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["vertex_attribute"]["rpc"])
3535
def setMeshPolygonsVertexAttribute(self, params):
3636
print(self.mesh_polygons_prefix + self.mesh_polygons_schemas_dict["vertex_attribute"]["rpc"], f"{params=}", flush=True)
3737
validate_schema(params, self.mesh_polygons_schemas_dict["vertex_attribute"])
3838
id = params["id"]
3939
name = str(params["name"])
40-
self.setMeshVertexAttribute(id, name)
40+
self.displayAttributeOnVertices(id, name)
4141

4242
@exportRpc(mesh_polygons_prefix + mesh_polygons_schemas_dict["polygon_attribute"]["rpc"])
4343
def setMeshPolygonsPolygonAttribute(self, params):
4444
print(self.mesh_polygons_prefix + self.mesh_polygons_schemas_dict["polygon_attribute"]["rpc"], f"{params=}", flush=True)
4545
validate_schema(params, self.mesh_polygons_schemas_dict["polygon_attribute"])
4646
id = params["id"]
4747
name = str(params["name"])
48-
self.setMeshPolygonAttribute(id, name)
48+
self.displayAttributeOnCells(id, name)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Standard library imports
2+
import os
3+
4+
# Third party imports
5+
from wslink import register as exportRpc
6+
7+
# Local application imports
8+
from opengeodeweb_viewer.utils_functions import get_schemas_dict, validate_schema
9+
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView
10+
11+
class VtkMeshPolyhedronsView(VtkMeshView):
12+
mesh_polyhedrons_prefix = "opengeodeweb_viewer.mesh.polyhedrons."
13+
mesh_polyhedrons_schemas_dict = get_schemas_dict(os.path.join(os.path.dirname(__file__), "schemas"))
14+
15+
def __init__(self):
16+
super().__init__()
17+
18+
@exportRpc(mesh_polyhedrons_prefix + mesh_polyhedrons_schemas_dict["visibility"]["rpc"])
19+
def setMeshPolyhedronsVisibility(self, params):
20+
print(self.mesh_polyhedrons_prefix + self.mesh_polyhedrons_schemas_dict["visibility"]["rpc"], f"{params=}", flush=True)
21+
validate_schema(params, self.mesh_polyhedrons_schemas_dict["visibility"])
22+
id = params["id"]
23+
visibility = bool(params["visibility"])
24+
self.SetVisibility(id, visibility)
25+
26+
@exportRpc(mesh_polyhedrons_prefix + mesh_polyhedrons_schemas_dict["color"]["rpc"])
27+
def setMeshPolyhedronsColor(self, params):
28+
print(self.mesh_polyhedrons_prefix + self.mesh_polyhedrons_schemas_dict["color"]["rpc"], f"{params=}", flush=True)
29+
validate_schema(params, self.mesh_polyhedrons_schemas_dict["color"])
30+
id = params["id"]
31+
red, green, blue = params["color"]["r"], params["color"]["g"], params["color"]["b"]
32+
self.SetColor(id, red, green, blue)
33+
34+
@exportRpc(mesh_polyhedrons_prefix + mesh_polyhedrons_schemas_dict["vertex_attribute"]["rpc"])
35+
def setMeshPolyhedronsVertexAttribute(self, params):
36+
print(self.mesh_polyhedrons_prefix + self.mesh_polyhedrons_schemas_dict["vertex_attribute"]["rpc"], f"{params=}", flush=True)
37+
validate_schema(params, self.mesh_polyhedrons_schemas_dict["vertex_attribute"])
38+
id = params["id"]
39+
name = str(params["name"])
40+
self.displayAttributeOnVertices(id, name)
41+
42+
@exportRpc(mesh_polyhedrons_prefix + mesh_polyhedrons_schemas_dict["polyhedron_attribute"]["rpc"])
43+
def setMeshPolyhedronsPolyhedronAttribute(self, params):
44+
print(self.mesh_polyhedrons_prefix + self.mesh_polyhedrons_schemas_dict["vertex_attribute"]["rpc"], f"{params=}", flush=True)
45+
validate_schema(params, self.mesh_polyhedrons_schemas_dict["vertex_attribute"])
46+
id = params["id"]
47+
name = str(params["name"])
48+
self.displayAttributeOnCells(id, name)
49+

0 commit comments

Comments
 (0)