Skip to content

Commit bc5c35c

Browse files
committed
texture_filename => id_texture
1 parent b8d8464 commit bc5c35c

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

src/opengeodeweb_viewer/object/object_methods.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,12 @@ def applyTextures(self, data_id, textures):
5252

5353
for index, value in enumerate(textures):
5454
texture_name = value["texture_name"]
55-
texture_file_name = value["texture_file_name"]
56-
print(f"{texture_name=} {texture_file_name=}", flush=True)
55+
id_texture = value["id"]
56+
print(f"{texture_name=} {id_texture=}", flush=True)
5757

5858
new_texture = vtk.vtkTexture()
5959
image_reader = vtk.vtkXMLImageDataReader()
60-
texture_path = os.path.join(
61-
self.DATA_FOLDER_PATH, data_id, texture_file_name
62-
)
60+
texture_path = os.path.join(self.DATA_FOLDER_PATH, data_id, id_texture)
6361
image_reader.SetFileName(texture_path)
6462

6563
shader_texture_name = f"VTK_TEXTURE_UNIT_{index}"

src/opengeodeweb_viewer/rpc/mesh/schemas/apply_textures.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "string",
1616
"minLength": 1
1717
},
18-
"texture_file_name": {
18+
"id": {
1919
"type": "string",
2020
"minLength": 1
2121
}

src/tests/mesh/polyhedra/test_mesh_polyhedra_protocols.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111

1212
def test_register_mesh(server, dataset_factory):
13-
dataset_factory(id="11223344", viewable_file_name="polyhedron_attribute.vtu")
13+
dataset_factory(id="123456789", viewable_file_name="polyhedron_attribute.vtu")
1414

1515
server.call(
1616
VtkMeshView.mesh_prefix + VtkMeshView.mesh_schemas_dict["register"]["rpc"],
17-
[{"id": "11223344"}],
17+
[{"id": "123456789"}],
1818
)
1919
assert server.compare_image(3, "mesh/polyhedra/register.jpeg") == True
2020

@@ -25,7 +25,7 @@ def test_polyhedra_color(server, dataset_factory):
2525
server.call(
2626
VtkMeshPolyhedraView.mesh_polyhedra_prefix
2727
+ VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["color"]["rpc"],
28-
[{"id": "11223344", "color": {"r": 255, "g": 0, "b": 0}}],
28+
[{"id": "123456789", "color": {"r": 255, "g": 0, "b": 0}}],
2929
)
3030
assert server.compare_image(3, "mesh/polyhedra/color.jpeg") == True
3131

@@ -36,7 +36,7 @@ def test_polyhedra_visibility(server, dataset_factory):
3636
server.call(
3737
VtkMeshPolyhedraView.mesh_polyhedra_prefix
3838
+ VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["visibility"]["rpc"],
39-
[{"id": "11223344", "visibility": False}],
39+
[{"id": "123456789", "visibility": False}],
4040
)
4141
assert server.compare_image(3, "mesh/polyhedra/visibility.jpeg") == True
4242

@@ -47,7 +47,7 @@ def test_vertex_attribute(server, dataset_factory):
4747
server.call(
4848
VtkMeshPolyhedraView.mesh_polyhedra_prefix
4949
+ VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["vertex_attribute"]["rpc"],
50-
[{"id": "11223344", "name": "toto_on_vertices"}],
50+
[{"id": "123456789", "name": "toto_on_vertices"}],
5151
)
5252
assert server.compare_image(3, "mesh/polyhedra/vertex_attribute.jpeg") == True
5353

@@ -60,6 +60,6 @@ def test_polyhedron_attribute(server, dataset_factory):
6060
+ VtkMeshPolyhedraView.mesh_polyhedra_schemas_dict["polyhedron_attribute"][
6161
"rpc"
6262
],
63-
[{"id": "11223344", "name": "toto_on_polyhedra"}],
63+
[{"id": "123456789", "name": "toto_on_polyhedra"}],
6464
)
6565
assert server.compare_image(3, "mesh/polyhedra/polyhedron_attribute.jpeg") == True

src/tests/mesh/test_mesh_protocols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_apply_textures(server, dataset_factory):
6666
"textures": [
6767
{
6868
"texture_name": "lambert2SG",
69-
"texture_file_name": "hat_lambert2SG.vti",
69+
"id": "987654321",
7070
}
7171
],
7272
}

0 commit comments

Comments
 (0)