diff --git a/doc/changelog.d/375.miscellaneous.md b/doc/changelog.d/375.miscellaneous.md new file mode 100644 index 00000000..447faeef --- /dev/null +++ b/doc/changelog.d/375.miscellaneous.md @@ -0,0 +1 @@ +Fix: Uninitialized variable in PyVistaBackendInterface diff --git a/src/ansys/tools/visualization_interface/backends/pyvista/pyvista.py b/src/ansys/tools/visualization_interface/backends/pyvista/pyvista.py index 1154d3d5..13640b5d 100644 --- a/src/ansys/tools/visualization_interface/backends/pyvista/pyvista.py +++ b/src/ansys/tools/visualization_interface/backends/pyvista/pyvista.py @@ -131,6 +131,8 @@ def __init__( # Map that relates PyVista actors with PyAnsys objects self._object_to_actors_map = {} + self._edge_actors_map: Dict[pv.Actor, EdgePlot] = {} + # PyVista plotter self._pl = None diff --git a/tests/test_generic_plotter.py b/tests/test_generic_plotter.py index 6e50b64e..1377321c 100644 --- a/tests/test_generic_plotter.py +++ b/tests/test_generic_plotter.py @@ -27,7 +27,7 @@ import pytest import pyvista as pv -from ansys.tools.visualization_interface import ClipPlane, MeshObjectPlot, Plotter +from ansys.tools.visualization_interface import ClipPlane, EdgePlot, MeshObjectPlot, Plotter from ansys.tools.visualization_interface.backends.pyvista import PyVistaBackend from ansys.tools.visualization_interface.backends.pyvista.picker import Picker @@ -93,7 +93,9 @@ def test_plotter_add_structured_grid(): def test_plotter_add_custom(): """Adds a MeshObjectPlot object to the plotter.""" sphere = pv.Sphere() - custom = MeshObjectPlot(CustomTestClass("myname"), sphere) + edge = pv.Cube((0, 1, 0)) + custom_edge = EdgePlot(CustomTestClass("myname_edge"), edge) + custom = MeshObjectPlot(CustomTestClass("myname"), sphere, edges=[custom_edge]) pl = Plotter() pl.plot(custom) pl.show()