You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/user_guide/index.rst
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Use with PyAnsys custom objects
46
46
47
47
You can also use the default plotter to visualize PyAnsys custom objects. The only requirement is that the
48
48
custom object must have a method that returns a PyVista mesh a method that exposes a ``name`` or
49
-
``id`` attribute of your object. To expose a custom object, you use a ``MeshObjectPlot`` instance. This class
49
+
``id`` attribute of your object. To expose a custom object, you use a :class:`~ansys.tools.visualization_interface.types.mesh_object_plot.MeshObjectPlot` instance. This class
50
50
relates PyVista meshes with any object.
51
51
52
52
The following code shows how to use the default plotter to visualize a PyAnsys custom object:
@@ -100,7 +100,7 @@ class. After that, see these main use cases for customizing the plotter:
100
100
* The most common use case is to customize the way that the objects you represent are shown in the plotter.
101
101
To this end, you can override the ``plot`` and ``plot_iter`` methods. These methods are called every time
102
102
a new object is added to the plotter. The default implementation of this method is to add a PyVista mesh
103
-
or a ``MeshObjectPlot`` instance to the plotter. You can override this method to add your own meshes or
103
+
or a :class:`~ansys.tools.visualization_interface.types.mesh_object_plot.MeshObjectPlot` instance to the plotter. You can override this method to add your own meshes or
104
104
objects to the plotter in a manner that fits the way that you want to represent the meshes.
105
105
106
106
* Another use case is the need to have custom button functionalities for your library. For example, you may
@@ -116,11 +116,11 @@ For comprehensive migration information with code examples, see :ref:`ref_migrat
116
116
Customizing the picker and hover callbacks
117
117
==========================================
118
118
119
-
The Visualization Interface Tool provides a base class, ``AbstractPicker``, for customizing the picker and hover
119
+
The Visualization Interface Tool provides a base class, :class:`~ansys.tools.visualization_interface.backends.pyvista.picker.AbstractPicker`, for customizing the picker and hover
120
120
callbacks of the plotter. This class provides a set of methods that can be overridden so that you can adapt the
121
121
picker and hover functionalities to the specific need of your PyAnsys library.
122
122
123
-
The first thing you must do is to create a class that inherits from the ``AbstractPicker`` class. After that, see
123
+
The first thing you must do is to create a class that inherits from the :class:`~ansys.tools.visualization_interface.backends.pyvista.picker.AbstractPicker` class. After that, see
124
124
these main use cases for customizing the picker and hover callbacks:
125
125
126
126
* You may want to change the way that objects are picked in the plotter. To do this, you can override the
@@ -131,4 +131,4 @@ these main use cases for customizing the picker and hover callbacks:
131
131
override the ``hover_select_object`` and ``hover_unselect_object`` methods. These methods are called when an
132
132
object is hovered over or unhovered, respectively.
133
133
134
-
A practical example of how to use the ``AbstractPicker`` class are included in the examples section of the documentation.
134
+
A practical example of how to use the :class:`~ansys.tools.visualization_interface.backends.pyvista.picker.AbstractPicker` class is included in :ref:`sphx_glr_examples_00-basic-pyvista-examples_custom_picker.py`.
Copy file name to clipboardExpand all lines: doc/source/user_guide/migration.rst
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,11 @@
3
3
Migration
4
4
#########
5
5
6
-
In this section two guides are provided to help you migrate from PyVista plotters to the Ansys Tools Visualization Interface plotters.
6
+
This section helps you migrate from PyVista plotters to the Ansys Tools Visualization Interface plotters.
7
+
It consists of two major topics:
8
+
9
+
- `Code migration`_
10
+
- `Documentation configuration migration`_
7
11
8
12
Code migration
9
13
==============
@@ -73,7 +77,7 @@ Your custom object must have a method that returns a PyVista mesh and a method t
73
77
returnself.name
74
78
75
79
76
-
You then need to create a ``MeshObjectPlot`` instance that relates the PyVista mesh with your custom object:
80
+
You then need to create a :class:`~ansys.tools.visualization_interface.types.mesh_object_plot.MeshObjectPlot` instance that relates the PyVista mesh with your custom object:
77
81
78
82
.. code-block:: python
79
83
@@ -109,7 +113,7 @@ You can customize the backend of the Ansys Tools Visualization Interface plotter
109
113
# Show the plotter
110
114
pl.show()
111
115
112
-
If you want to customize the backend even more, you can create your own backend by inheriting from the ``PyVistaBackendInterface`` class
116
+
If you want to customize the backend even more, you can create your own backend by inheriting from the :class:`~ansys.tools.visualization_interface.backends.pyvista.PyVistaBackendInterface` class
113
117
and implementing the required methods:
114
118
115
119
.. code-block:: python
@@ -150,14 +154,15 @@ and implementing the required methods:
150
154
pass
151
155
152
156
153
-
The rest of the methods are implemented for you. This ensures that while you can customize what you need for plotting, the rest of the functionalities still work as expected.
154
-
If you need to even go further, you can create your own plotter by inheriting from the ``BaseBackend`` class and implementing the required methods,
155
-
although this may break existing features. You can find more information about this in the plotter documentation.
157
+
The rest of the methods are implemented for you. This ensures that while you can customize what you need for plotting,
158
+
the rest of the functionalities still work as expected. For more information, see the backend documentation. If you
159
+
need to even go further, you can create your own plotter by inheriting from the :class:`~ansys.tools.visualization_interface.backends._base.BaseBackend` class and implementing the required methods,
160
+
although this may break existing features.
156
161
157
162
Customize the picker or hover behavior
158
163
--------------------------------------
159
164
You can customize the picker of the Ansys Tools Visualization Interface plotter to decide what happens when you pick or hover over an object.
160
-
For example, if you want to print the name of the picked object, you can do it as described in the custom picker example.
165
+
For example, if you want to print the name of the picked object, you can do it as described in the :ref:`sphx_glr_examples_00-basic-pyvista-examples_custom_picker.py` example.
0 commit comments