Commit 592400a7 authored by Cory Quammen's avatar Cory Quammen

Change formatting when refering to VTK objects

Change from \ui to \texttt to avoid adding references to the UI index
at the end.
parent e8c30d67
......@@ -38,7 +38,7 @@ This example prints out the following in the output window.
The importance lies in the last three lines. In particular, note how we used a different API to
access the \py{PointData} and the \py{Elevation} array in the last two lines. Also note
that, when we printed the Elevation array, the output didn't look like one from a
\ui{vtkDataArray}. In fact:
\texttt{vtkDataArray}. In fact:
\begin{python}
elevation = data.PointData['Elevation']
......@@ -136,8 +136,8 @@ object that wraps the VTK data object itself. The \ui{Programmable Filter} does
this by manually calling the \py{WrapDataObject} function from the
\py{vtk.numpy\_interface.dataset\_adapter} module on the VTK data object.
Note that the \py{WrapDataObject} function will return an appropriate wrapper class
for all \ui{vtkDataSet} subclasses, \ui{vtkTable}, and all \ui{vtkCompositeData} subclasses.
Other \ui{vtkDataObject} subclasses are not currently supported.
for all \texttt{vtkDataSet} subclasses, \texttt{vtkTable}, and all \texttt{vtkCompositeData} subclasses.
Other \texttt{vtkDataObject} subclasses are not currently supported.
\py{VTKObjectWrapper} forwards VTK methods to its VTKObject so the VTK API can
be accessed directy as follows:
......@@ -208,8 +208,8 @@ Note that this works with composite datasets as well:
\end{python}
It is possible to access \py{PointData}, \py{CellData}, \py{FieldData},
\py{Points} (subclasses of \ui{vtkPointSet} only), and \py{Polygons}
(\ui{vtkPolyData} only) this way. We will continue to add accessors to more
\py{Points} (subclasses of \texttt{vtkPointSet} only), and \py{Polygons}
(\texttt{vtkPolyData} only) this way. We will continue to add accessors to more
types of arrays through this API.
\section{Working with arrays}
......@@ -237,16 +237,16 @@ rtdata2 = ugrid.PointData['RTData']
\end{python}
Here, we created two datasets: an image data (\ui{vtkImageData}) and an unstructured
grid (\ui{vtkUnstructuredGrid}). They essentially represent the same data but the
Here, we created two datasets: an image data (\texttt{vtkImageData}) and an unstructured
grid (\texttt{vtkUnstructuredGrid}). They essentially represent the same data but the
unstructured grid is created by tetrahedralizing the image data. So, we expect
the unstructured grid to have the same points but more cells (tetrahedra).
\subsection{The array API}
\py{numpy\_interface} array objects behave very similar to NumPy arrays. In
fact, arrays from \ui{vtkDataSet} subclasses are instances of VTKArray, which is a
subclass of \py{numpy.ndarray}. Arrays from \ui{vtkCompositeDataSet} and subclasses are
fact, arrays from \texttt{vtkDataSet} subclasses are instances of VTKArray, which is a
subclass of \py{numpy.ndarray}. Arrays from \texttt{vtkCompositeDataSet} and subclasses are
not NumPy arrays, but they behave very similarly. We will outline the differences in a
separate section. Let's start with the basics. All of the following work as
expected.
......@@ -540,7 +540,7 @@ VTKArray([[ 0.00000000e+00, 0.00000000e+00, 1.00000000e+00],
>>> print `normals.Arrays[1]`
<vtk.numpy_interface.dataset_adapter.VTKNoneArray at 0x1189e7790>
\end{python}
Notice how the second array is a VTKNoneArray. This is because \ui{vtkConeSource}
Notice how the second array is a VTKNoneArray. This is because \texttt{vtkConeSource}
does not produce normals. Where an array does not exist, we use a VTKNoneArray
as placeholder. This allows us to maintain a one-to-one mapping between datasets
of a composite dataset and the arrays in the VTKCompositeDataArray. It also
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment