\chapter{Basic Usage}
\label{chap:BasicUsage}

Let us get started using ParaView.  In order to follow along, you will need
your own installation of ParaView.  Specifically, this document is based
off of ParaView version \pvversion.  If you do not already have ParaView
\pvversion, you can download a copy from
\href{http://www.paraview.org}{www.paraview.org} (click on the download
link).  ParaView launches like most other applications.  On Windows, the
launcher is located in the start menu.  On Macintosh, open the application
bundle that you installed.  On Linux, execute \progname{paraview} from a
command prompt (you may need to set your path).

The examples in this tutorial also rely on some data that is available at
\href{http://www.paraview.org/Wiki/The_ParaView_Tutorial}{http://www.paraview.org/Wiki/The\_ParaView\_Tutorial}.
You may install this data into any directory that you like, but make sure
that you can find that directory easily.  Any time the tutorial asks you to
load a file it will be from the directory you installed this data in.


\section{User Interface}

\begin{inlinefig}
  \includegraphics[width=\linewidth]{images/UserInterface}
\end{inlinefig}

The ParaView GUI conforms to the platform on which it is running, but on
all platforms it behaves basically the same.  The layout shown here is the
default layout given when ParaView is first started.  The GUI comprises the
following components.

\begin{description}
\item[Menu Bar] \index{menu bar} As with just about any other program, the
  menu bar allows you to access the majority of features.
\item[Toolbars] \index{toolbars} The toolbars provide quick access to the
  most commonly used features within ParaView.
\item[Pipeline Browser] \index{pipeline browser} ParaView manages the
  reading and filtering of data with a pipeline.  The pipeline browser
  allows you to view the pipeline structure and select pipeline objects.
  The pipeline browser provides a convenient list of pipeline objects with
  an indentation style that shows the pipeline structure.
\item[Properties Panel] \index{properties panel} The properties panel
  allows you to view and change the parameters of the current pipeline
  object. On the properties panel is an advanced properties
  toggle~\icon{pqAdvanced} that shows and hides advanced controls.  The
  properties are by default coupled with an \keyterm{Information} tab that
  shows a basic summary of the data produced by the pipeline object.
\item[3D View] \index{3D View} The remainder of the GUI is used to present
  data so that you may view, interact with, and explore your data.  This
  area is initially populated with a 3D view that will provide a geometric
  representation of the data.
\end{description}

Note that the GUI layout is highly configurable, so that it is easy to
change the look of the window.  The toolbars can be moved around and even
hidden from view.  To toggle the use of a toolbar, use the \gui{View} \ra
\gui{Toolbars} submenu.  The pipeline browser and properties panel are both
\keyterm{dockable} windows.  This means that these components can be moved
around in the GUI, torn off as their own floating windows, or hidden
altogether.  These two windows are important to the operation of ParaView,
so if you hide them and then need them again, you can get them back with
the \gui{View} menu.


\section{Sources}

\index{sources|(}

\index{sources menu}
\index{menu!sources}
There are two ways to get data into ParaView: read data from a file or
generate data with a \keyterm{source} object.  All sources are located in
the \gui{Sources} menu.  Sources can be used to add annotation to a view,
but they are also very handy when exploring ParaView's features.

\begin{exercise}{Creating a Source}
  \label{ex:CreatingASource}%
  Let us start with a simple one.
  Go to the \gui{Sources} menu, open the \gui{Geometric Shapes} submenu, and select \gui{Cylinder}.
  Once you select the \gui{Cylinder} item you will notice that an item named \gui{Cylinder1} is added to and selected in the pipeline browser.
  You will also notice that the properties panel is filled with the properties for the cylinder source.
  \index{apply~button} Click the \gui{Apply} button \apply to accept the default parameters.

  Once you click \gui{Apply}, the cylinder object will be displayed in the
  3D view window on the right.
\end{exercise}

\index{sources|)}

\section{Basic 3D Interaction}

Now that we have created our first simple visualization, we want to
interact with it. There are many ways to interact with a visualization in
ParaView. We start by exploring the data in the 3D view.

\begin{exercise}{Interacting with a 3D View}
  \label{ex:InteractingWithA3DView}%
  This exercise is a continuation of Exercise~\ref{ex:CreatingASource}.
  You will need to finish that exercise before beginning this one.

  You can manipulate the cylinder in the 3D view by dragging the mouse over the 3D view.
  Experiment with dragging different mouse buttons---left, middle, and right---to perform different rotate, pan, and zoom operations.
  Also try using the buttons in conjunction with the shift and ctrl modifier keys.
  Additionally you can hold down the x, y, or z key while you drag the mouse to constrain movement along the x, y, or z axis.

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/ToolbarCamera}
  \end{inlinefig}

  \index{camera~controls~toolbar|see{toolbar, camera controls}}
  \index{toolbar!camera~controls}

  ParaView contains a couple of toolbars to help with camera manipulations.
  The first toolbar, the \gui{Camera Controls} toolbar, shown here, provides
  quick access to particular camera views.  The leftmost button
  \resetCamera performs a \keyterm{reset camera} such that it
  maintains the same view direction but repositions the camera such that
  the entire object can be seen.  The second button \icon{pqZoomToData}
  performs a \keyterm{zoom to data}.  It behaves very much like reset
  camera except that instead of positioning the camera to see all data, the
  camera is placed to look specifically at the data currently selected in
  the pipeline browser. The third button \icon{pqResetCameraClosest}
  performs a \keyterm{reset camera closest} such that it maximizes the occupation,
  in the screen, of the whole scene bounding box. The fourth button \icon{pqZoomClosestToData}
  performs a \keyterm{zoom closest to data}. It behaves very much like
  reset camera closest except that instead of positioning the camera to see all data, the
  camera is placed to look specifically at the data currently selected in
  the pipeline browser.  You currently only have one object in the pipeline
  browser, so right now reset camera and zoom to data, and reset camera closest and
  zoom closest to data will perform the same operation.

  The next button in the camera controls toolbar \icon{pqZoomToSelection} allows you to select a rectangular region of the screen to zoom to (a \keyterm{rubber-band zoom}).
  The following six buttons, starting with \xPlus, reposition the camera to view the scene straight down one of the global coordinate's axes in either the positive or negative direction.
  The rightmost two buttons \icon{pqRotateCameraCW} \icon{pqRotateCameraCCW} rotate the view either clockwise or counterclockwise.
  Try playing with these controls now.

  \begin{inlinefig}
    \includegraphics[width=.415\scw]{images/ToolbarCenterAxis}
  \end{inlinefig}

  \index{center~axes~toolbar|see{toolbar, center axes}}
  \index{toolbar!center~axes}

  The second toolbar controls the location of the center of rotation and
  the visibility of the orientation axes.  \index{center of rotation!pick}
  The rightmost button \icon{pqPickCenter} allows you to pick the
  \keyterm{center of rotation}.  Try clicking that button then clicking
  somewhere on the cylinder.  If you then drag the left button in the 3D
  view, you will notice that the cylinder now rotates around this new
  point.  \index{center of rotation!reset} The next button to the left
  \icon{pqResetCenter} replaces the center of rotation to the center of
  the object.  \index{center of rotation!show}\index{axes!center of
    rotation} The next button to the left \icon{pqShowCenterAxes} shows
  or hides axes drawn at the center of rotation.  (You probably will
  not notice the effects when the center of rotation is at the center of
  the cylinder because the axes will be hidden by the cylinder.  Use the
  pick center of rotation \icon{pqPickCenter} again and you should be
  able to see the effects.)  The final leftmost button
  \icon{pqShowOrientationAxes} toggles showing the
  \index{axes!orientation|see{orientation axes}}\keyterm{orientation axes},
  the always-viewable axes in the lower left corner of the 3D view.
\end{exercise}

\section{Modifying Visualization Parameters}

\index{parameters|(}
\index{visualization~parameters|see{parameters}}

Although interactive 3D controls are a vital part of visualization, an
equally important ability is to modify the parameters of the data
processing and display. ParaView contains many GUI components for modifying
visualization parameters, which we will begin to explore in the next
exercise.

\begin{exercise}{Modifying Visualization Parameters}
  \label{ex:ModifyingVisualizationParameters}%
  This exercise is a continuation of
  Exercise~\ref{ex:InteractingWithA3DView}. You will need to finish that
  exercise before beginning this one.

  You surely noticed that ParaView creates not a real cylinder but
  rather an approximation of a cylinder using polygonal \keyterm{facets}.
  The default parameters for the cylinder source provide a very coarse
  approximation of only six facets. (In fact, this object looks more like a
  prism than a cylinder.) If we want a better representation of a cylinder,
  we can create one by increasing the \gui{Resolution} parameter.
  The \gui{Resolution} parameters, like all other parameters for the cylinder object, are located in the properties panel under the \apply button when the cylinder object is selected in the pipeline browser.

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/ResolutionParameter}
  \end{inlinefig}

  Using either the slider or text edit, increase the resolution to 50 or
  more. Notice that the \gui{Apply} button \apply become colored again.
  This is because changes you make to the object properties are not
  immediately enacted. The highlighted button is a reminder that the
  parameters of one or more pipeline objects are ``out of sync'' with the
  data that you are viewing. Hitting the \gui{Apply} button will accept
  these changes whereas hitting the
  \index{reset~button}\index{parameters!reset}\gui{Reset} button \reset
  will revert the options back to the last time they were applied. Hit the
  \gui{Apply} button now. The resolution is changed so that it is virtually
  indistinguishable from a true cylinder.

  If your work has you creating cylinder sources frequently and you find
  yourself modifying \gui{Resolution} or other parameters to some value
  other than the default each time, you can save your preferred default
  parameters by hitting the
  \index{save~parameters}\index{parameters!save}save parameters
  \icon{FloppyDisk} button. Once you hit the \icon{FloppyDisk} button,
  ParaView will remember your preferences for objects of that type and use
  those parameters when you create future objects. Conversely, if you have
  changed the parameters and want to reset them to the ``factory default,''
  you can click the
  \index{restore~parameters}\index{parameters!restore}restore parameters
  \icon{Reload} button. As we will see in future exercises, we can have
  multiple visualization objects open at once. To copy parameters from one
  object to another, use the
  \index{copy~parameters}\index{parameters!copy}copy \icon{pqCopy} and
  paste \icon{pqPaste} parameters buttons.

  \begin{inlinefig}
    \includegraphics[width=0.53\scw]{images/DisplayProperties}
  \end{inlinefig}

  If you scroll down the properties panel, you will notice a set of \gui{Display} properties\index{display properties}.
  Try these options now by clicking on the \gui{Edit}~\icon{pqEditColor} button under \gui{Coloring} to select a new color for the cylinder.
  (This button is also replicated in the toolbar.)
  You may notice that you do not need to hit \gui{Apply} for display properties.

  \begin{inlinefig}
    \includegraphics[width=0.53\scw]{images/RenderViewOptions}
  \end{inlinefig}

  If you scroll down further yet to the bottom of the properties panel, you will notice a set of \gui{View} properties\index{view properties}.
  Use the view properties to turn on the \gui{Axes Grid}\index{axes grid}.

  By default many of the lesser used display properties are hidden.  The
  \keyterm{advanced properties} toggle~\icon{pqAdvanced} can be used to
  show or hide these extra parameters. There is also a search box at the
  top of the properties panel\index{properties panel!search} that can be
  used to quickly find a property. Try typing \gui{specular} into this
  search box now. Under the display properties you should see an option
  named \gui{Specular}. This controls the intensity of the specular
  highlight seen on shiny objects. \index{shiny} \index{specular highlight}
  Set this parameter to \gui{1} to make the cylinder shiny.

  Most objects have similar display and view properties. Here are some
  other common tricks you can do with most objects using parameters
  available in the properties panel and that you can try now.

  \begin{itemize}
  \item \index{cube axes} \index{axes!cube|see{cube axes}}
    Show 3D axes at the borders of the object containing rulers showing the physical distance in each direction by clicking the \gui{Axes Grid} checkbox under the \gui{View} options.
  \item \index{transparency} \index{opacity} Make objects transparent by
    changing their \gui{Opacity} parameter. An opacity parameter of 1 is
    completely opaque, a parameter of 0 is completely invisible, and values
    in between are varying degrees of see through.
  %% \item \index{lighting} The default configuration of lights in a 3D
  %%   rendering are positioned to provide a natural shading to best show the
  %%   structure of objects. If you want to change the lighting (for example,
  %%   to brightly show a flat surface facing the camera), you can click the
  %%   \gui{Edit} button under the \gui{Lights} option (an advanced
  %%   property).
  \end{itemize}
\end{exercise}

\index{parameters|)}

\index{auto apply|(}

From the previous exercises you have noted that some visualization operations (but not all) require pressing the \gui{Apply} button before seeing the effect of the change.
This apply button serves an important function.
When visualizing large data, which ParaView is designed to do, simple actions like creating an object or changing a parameter can take a long time.
Thus this two phased approach allows you to establish all the visualization parameters for a particular action before enacting an operation (by hitting \gui{Apply}).
However, when dealing with small data, operations complete near instantaneously, so the process of hitting \gui{Apply} becomes redundant.
In these cases, you may wish to turn on auto apply.

\begin{exercise}{Toggle Auto Apply}
  \label{ex:ToggleAutoApply}
  Find the auto apply button \icon{pqAutoApply} in the top toolbar.
  This is a toggle button.
  Click it now and note that it stays depressed.

  While auto apply is on, it is no longer necessary to hit the \gui{Apply} button.
  Try changing the \gui{Resolution} of the cylinder source as you did in Exercise~\ref{ex:ModifyingVisualizationParameters} (or create a new source if your cylinder is no longer available).
  Note that as soon as you make the change, the visualization is updated.

  You can turn off auto apply by clicking the toolbar button \icon{pqAutoApply} again.
  You can complete the rest of these exercises with auto apply either on or off.
  The instructions will assume that auto apply is off and prompt you to hit the \gui{Apply} button.
  If you have auto apply on, ignore these instructions.
\end{exercise}

\index{auto apply|}

\index{color~palette|(}
\index{palette|(}

As you would expect, ParaView allows you to control the color of many elements.
In many cases the changing the color of one element necessitates the changing of another.
For example, if changing the background to a light color, it is important to change text on that background to a dark color.
Otherwise the text will be unreadable.
To help manage sets of interdependent colors, ParaView supports the idea of color palettes.
You can easily change the view's color palette using the load color palette button \icon{pqPalette} in the toolbar.

\begin{exercise}{Changing the Color Palette}
  \label{ex:ChangingTheColorPalette}%
  Make sure the orientation axes is shown in the lower left corner. This is
  toggled with the \icon{pqShowOrientationAxes} button as described in
  Exercise~\ref{ex:InteractingWithA3DView}. Note that the orientation axis
  has the labels ``X,'' ``Y,'' and ``Z.''

  Find the load color palette button \icon{pqPalette} in the top toolbar.
  Click that button to get a pull down menu of available palettes.
  Experiment with different palettes. Observe that both the background
  color and the labels in the orientation axes change.
\end{exercise}

The colors used for the color palettes are part of ParaView's settings.
You can see and set all of these colors in the \gui{Edit} \ra \gui{Settings} (\gui{ParaView} \ra \gui{Preferences} on the Mac) under the \gui{Color Palette} tab.
\index{color~palette} \index{palette}
You can also get to the color palette settings by clicking on the color palette button \icon{pqPalette} and selecting the \gui{Edit Current Palette...} button.
\begin{inlinefig}
  \includegraphics[width=\scw]{images/SettingsColors}
\end{inlinefig}

\index{palette|)}
\index{color~palette|)}

\index{undo|(}
\index{redo|(}

Now is a good time to note the undo~\icon{pqUndo} and
redo~\icon{pqRedo} buttons in the toolbar.  Visualizing your data is
often an exploratory process, and it is often helpful to revert back to a
previous state.  You can even undo back to the point before your data were
created and redo again.

\begin{exercise}{Undo and Redo}
  \label{ex:UndoAndRedo}%
  Experiment with the undo~\icon{pqUndo} and redo~\icon{pqRedo}
  buttons.  If you have not done so, create and modify a pipeline object
  like what is done in Exercise~\ref{ex:CreatingASource}.  Watch how
  parameter changes can be reverted and restored.  Also notice how whole
  pipeline objects can be destroyed and recreated.

  \index{undo camera}
  \index{redo camera}
  There are also undo camera~\icon{pqUndoCamera} and redo
  camera~\icon{pqRedoCamera} buttons at the view's toolbar.  These allow you to go back and
  forth between camera angles that you have made so that you do not have
  to worry about errant mouse movements ruining that perfect view.  Move
  the camera around and then use these buttons to revert and restore the
  camera angle.
\end{exercise}

\index{redo|)}
\index{undo|)}

We are done with the cylinder source now.  We can delete the pipeline
object by making sure the cylinder is selected in the pipeline browser and
hitting \index{delete~button} delete \delete in the properties panel.


\section{Loading Data}

\index{file menu}
\index{menu!file}

Now that we have had some practice using the ParaView GUI, let us load in some real data.
As you would expect, the \index{open} \gui{Open} command is the first one off of the \gui{File} menu, and there is also toolbar button~\icon{pqOpen} for opening a file.
ParaView currently supports about 220 distinct file formats, and the list grows as more types get added.
% Right now the easiest way I have to count the number of readers is to search for all instances of "ReaderFactory" in .xml files in the ParaView source.
% The following shell command searches through all the .xml files and counts all the instaces of ReaderFactory.
% It also filters out filters in Plugins that are not loaded by default.
%
% find . -name '*.xml' | xargs fgrep ReaderFactory | fgrep -v Plugins | wc
To see the current list of supported files, invoke the Open command and look at the list of files in the \gui{Files of type} chooser box.

\begin{inlinefig}
  \includegraphics[width=\scw]{images/OpenFileTypes}
\end{inlinefig}

ParaView's modular design allows for easy integration of new VTK readers
into ParaView.  Thus, check back often for new file formats.  If you are
looking for a file reader that does not seem to be included with ParaView,
check in with the ParaView mailing list
(\href{mailto:paraview@paraview.org}{paraview@paraview.org}).  There are
many file readers included with VTK but not exposed within ParaView that
could easily be added.  There are also many readers created that can plug
into the VTK framework but have not been committed back to VTK; someone may
have a reader readily available that you can use.

\begin{exercise}{Opening a File}
  \label{ex:OpeningAFile}%
  Let us open our first file now.
  Click the \index{open} \gui{Open} toolbar button (or menu item)~\icon{pqOpen}.
  Note that ParaView uses a custom file browser, which provides several convenience features.
  On the left side of the file browser dialog are a pair of boxes containing lists of directories, which provide quick access to files in common directories.
  The top left list contains a list of common data directories on your system.
  The bottom left list, which is initially empty, is filled with directories from which you have recently loaded files.
  Double click on the \gui{Examples} directory listed in the top left box.
  This is a directory created by the ParaView installation that contains the files we use in this tutorial.

  \begin{inlinefig}
    \includegraphics[scale=\bbscale]{images/ExamplesDirectory}
  \end{inlinefig}

  Open the file \index{disk\_out\_ref} \gui{disk\_out\_ref.ex2}.
  Note that opening a file is a two step process, so you do not see any data yet.
  Instead, you see that the properties panel is populated with several options about how we want to read the data.

  \begin{inlinefig}
    \includegraphics[scale=\bbscale]{images/Block_properties_disk_out_ref}
  \end{inlinefig}

  Click the checkbox in the header of the block arrays list to turn on the
  loading of all the block arrays.  This is a small data set, so we do not
  have to worry about loading too much into memory.  Once all of the
  variables are selected, click \apply to load all of the data.  When the
  data are loaded you will see that the geometry looks like a cylinder with
  a hollowed out portion in one end.  These data are the output of a
  simulation for the flow of air around a heated and spinning disk.  The
  mesh you are seeing is the air around the disk (with the cylinder shape
  being the boundary of the simulation).  The hollow area in the middle is
  where the heated disk would be were it meshed for the simulation.
\end{exercise}

Most of the time ParaView will be able to determine the appropriate method
to read your file based on the file extension and underlying data, as was
the case in Exercise~\ref{ex:OpeningAFile}. However, with so many file
formats supported by ParaView there are some files that cannot be fully
determined. In this case, ParaView will present a dialog box asking what
type of file is being loaded. The following image is an example from
opening a \index{netCDF}netCDF file, which is a generic file format for
which ParaView has many readers for different conventions.

\begin{inlinefig}
  \includegraphics[width=.75\scw]{images/ChooseFileType}
\end{inlinefig}

Before we continue on to filtering the data, let us take a quick look at
some of the ways to represent the data.  The most common parameters for
representing data are located in a pair of toolbars. (They can also be
found in the \gui{Display} group of the properties panel.)

\index{color legend}
\index{edit colors} \index{colors!edit}
\index{scalar range}

\begin{inlinefig}
  \includegraphics[width=\linewidth]{images/DataRepresentationToolbars}
  %\includegraphics[scale=\bbscale]{images/DataRepresentationControls}
\end{inlinefig}

\index{representation|(}

\begin{exercise}{Representation and Field Coloring}
  \label{ex:RepresentationAndFieldColoring}%
  Play with the data representation a bit. Make sure
  \gui{disk\_out\_ref.ex2} is selected in the pipeline browser. (If you do
  not have the data loaded, repeat Exercise~\ref{ex:OpeningAFile}.) Use the
  variable chooser to color the surface by the \gui{pres} variable. To see
  the structure of the mesh, change the representation to \gui{Surface With
    Edges}. You can view both the cell structure and the interior of the
  mesh with the \gui{Wireframe} representation.

  \begin{inlinefig}
    \includegraphics[width=.42\linewidth]{images/DataRepresentation1}
    \includegraphics[width=.42\linewidth]{images/DataRepresentation2} \\
    \includegraphics[width=.42\linewidth]{images/DataRepresentation3}
    \includegraphics[width=.42\linewidth]{images/DataRepresentation4}
  \end{inlinefig}
\end{exercise}

\index{representation|)}


\section{Filters}

\index{filters|(}

We have now successfully read in some data and gleaned some information
about it.  We can see the basic structure of the mesh and map some data
onto the surface of the mesh.  However, as we will soon see, there are many
interesting features about these data that we cannot determine by simply
looking at the surface of these data.  There are many variables associated
with the mesh of different types (scalars and vectors).  And remember that
the mesh is a solid model.  Most of the interesting information is on the
inside.

We can discover much more about our data by applying \keyterm{filters}.
Filters are functional units that process the data to generate, extract, or
derive features from the data.  Filters are attached to readers, sources,
or other filters to modify its data in some way.  These filter connections
form a \keyterm{visualization pipeline}.  There is a great amount of filters
available in ParaView.  Here are the most common, which are all available
by clicking on the respective icon in the filters toolbar.

\index{toolbar!common filters}
\index{common filters|(}
\index{filters!common|(}

\begin{description}
\item[\calculator Calculator] \index{calculator} Evaluates a user-defined
  expression on a per-point or per-cell basis.
\item[\contour Contour] \index{contour} Extracts the points, curves, or
  surfaces where a scalar field is equal to a user-defined value.  This
  surface is often also called an \keyterm{isosurface}.
\item[\clip Clip] \index{clip} Intersects the geometry with a half space.
  The effect is to remove all the geometry on one side of a user-defined
  plane.
\item[\slice Slice] \index{slice} \index{cut|see{slice}} Intersects the
  geometry with a plane.  The effect is similar to clipping except that all
  that remains is the geometry where the plane is located.
\item[\threshold Threshold] \index{threshold} Extracts cells that lie
  within a specified range of a scalar field.
\item[\extractSubset Extract Subset] \index{extract subset} Extracts a
  subset of a grid by defining either a volume of interest or a sampling
  rate.
\item[\glyph Glyph] Places a \keyterm{glyph}, a simple shape, on each point
  in a mesh.  The glyphs may be oriented by a vector and scaled by a vector
  or scalar.
\item[\streamTracer Stream Tracer] \index{stream tracer} Seeds a vector
  field with points and then traces those seed points through the (steady
  state) vector field.
\item[\warp Warp (vector)] \index{warp!vector} Displaces each point in a
  mesh by a given vector field.
\item[\group Group Datasets] \index{group datasets} Combines the output of
  several pipeline objects into a single multi block data set.
\item[\extractGroup Extract Level] \index{extract level} Extract one or
  more items from a multi block data set.
\end{description}

\index{filters!common|)}
\index{common filters|)}

\index{filters menu|(}
\index{menu!filters|(}

These eleven filters are a small sampling of what is available in ParaView.
In the \gui{Filters} menu are a great many more filters that you can use to process your data.
ParaView currently exposes more than one hundred filters, so to make them easier to find the \gui{Filters} menu is organized into submenus.
\begin{inlinefig}
  \includegraphics[width=0.5\scw]{images/FiltersMenu}
\end{inlinefig}
These submenus are organized as follows.

\begin{description}
\item[Recent] The list of most recently used filters sorted with the most
  recently used filters on top. \index{filters!recent}
\item[Favorites] The list includes your favorites filters.
  \index{filters!favorites}
\item[Alphabetical] An alphabetical listing of all the filters available.
  If you are not sure where to find a particular filter, this list is
  guaranteed to have it.  There are also many filters that are not listed
  anywhere but in this list. \index{filters!Alphabetical}
\item[AMR] A set of filters designed specifically for data in an adaptive
  mesh refinement (AMR) \index{AMR} structure. \index{filters!AMR}
\item[Annotation] Filters that add annotation (such as text information) to
  the visualization. \index{filters!annotation}
\item[CTH] Filters used to process results from a CTH \index{CTH} simulation.
\item[Chemisty] This contains filters for chemistry related datasets.
  \index{filters!chemisty}
\item[Common] The most common filters.  This is the same list of filters
  available in the filters toolbar and listed previously.
  \index{filters!common}
\item[CosmoTools] This contains filters developed at LANL for cosmology
  research. \index{filters!cosmoTools}
\item[Data Analysis] The filters designed to retrieve quantitative values
  from the data.  These filters compute data on the mesh, extract elements
  from the mesh, or plot data. \index{filters!data analysis}
\item[Hyper Tree Grid] This contains filters for hyper-tree grid datasets.
 \index{filters!hyper tree grid}
\item[Material Analysis] Filters for processing data from volume fractions
  of materials. \index{filters!material analysis}
\item[Point Interpolation] \index{filters!point interpolation}
  Filters that take an unstructured collection of points in space without cells connecting them and estimate the field interpolation between them.
\item[Quadrature Points] Filters to support simulation data given as
  integration points that can be used for numerical integration with
  Gaussian quadrature. \index{filters!quadrature points}
\item[Statistics] This contains filters that provide descriptive
  statistics of data, primarily in tabular form. \index{filters!statistics}
\item[Temporal] Filters that analyze or modify data that changes over time.
  All filters can work on data that changes over time because they are
  executed on each time snapshot.  However, filters in this category will
  retrieve the available time extents and examine how data changes over
  time. \index{filters!temporal}
\end{description}

\index{menu!filters|)}
\index{filters menu|)}

\index{quick launch}

Searching through these lists of filters, particularly the full alphabetical list, can be cumbersome.
To speed up the selection of filters, you should use the \keyterm{quick launch} dialog.
Pressing the ctrl and space keys together on Windows or Linux or the alt and space keys together on Macintosh, ParaView brings up a small, lightweight dialog box like the one shown here.
\begin{inlinefig}
  \includegraphics[width=\scw]{images/QuickLaunch}
\end{inlinefig}
Type in words or word fragments that are contained in the filter name, and the box will list only those sources and filters that match the terms.
Hit enter to add the object to the pipeline browser.
Press Esc a couple of times to cancel the dialog.

You have probably noticed that some of the filters are grayed out.  Many
filters only work on a specific types of data and therefore cannot always
be used.  ParaView disables these filters from the menu and toolbars to
indicate (and enforce) that you cannot use these filters.

Throughout this tutorial we will explore many filters.  However, we cannot
explore all the filters in this forum.  Consult the Filters Menu chapter of
ParaView's on-line or built-in help for more information on each filter.

\begin{exercise}{Apply a Filter}
  \label{ex:ApplyAFilter}%
  Let us apply our first filter.
  If you do not have the disk\_out\_ref.ex2 data loaded, do so know (Exercise~\ref{ex:OpeningAFile}).
  Make sure that \gui{disk\_out\_ref.ex2} is selected in the pipeline browser and then select the contour filter~\contour from the filter toolbar or \gui{Filters} menu.
  Notice that a new item is added to the pipeline filter underneath the reader and that the properties panel updates to the parameters of the new filter.
  As with reading a file, applying a filter is a two step process (unless auto apply is enabled).
  After creating the filter you get a chance to modify the parameters (which you will almost always do) before applying the filter.

  \index{contour|(}

  \begin{inlinefig}
    \includegraphics[scale=\bbscale]{images/ContourOptions}
  \end{inlinefig}

  We will use the contour filter to create an isosurface where the
  temperature is equal to 400 K.  First, change the \gui{Contour By}
  parameter to the \gui{temp} variable.  Then, change the isosurface value
  to \gui{400}.  Finally, hit \apply.  You will see the isosurface appear
  inside of the volume.  If \gui{disk\_out\_ref.ex2} was still colored by
  pressure from Exercise~\ref{ex:RepresentationAndFieldColoring}, then the
  surface is colored by pressure to match.

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/ContourResults}
  \end{inlinefig}

  \index{contour|)}
\end{exercise}

In the preceding exercise, we applied a filter that processed the data and
gave us the results we needed.  For most common operations, a single filter
operation is sufficient to get the information we need.  However, filters
are of the same class as readers.  That is, the general operations we apply
to readers can also be applied to filters.  Thus, you can apply one filter
to the data that is generated by another filter.  These readers and filters
connected together form what we call a \keyterm{visualization pipeline}.
The ability to form visualization pipelines provides a powerful mechanism
for customizing the visualization to your needs.

Let us play with some more filters.  Rather than show the mesh surface in
wireframe, which often interferes with the view of what is inside it, we
will replace it with a cutaway of the surface.  We need two filters to
perform this task.  The first filter will extract the surface, and the
second filter will cut some away.

\begin{exercise}{Creating a Visualization Pipeline}
  \label{ex:CreatingAVisualizationPipeline}%
  The images and some of the discussion in this exercise assume you are
  starting with the state right after finishing
  Exercise~\ref{ex:ApplyAFilter}. Finish that exercise before beginning
  this one.

  Start by adding a filter that will extract the surfaces.  We do that with
  the following steps.

  \begin{enumerate}
  \item Select \gui{disk\_out\_ref.ex2} in the pipeline browser.
  \item From the menu bar, select \gui{Filters} \ra \gui{Alphabetical} \ra
    \gui{Extract Surface}. \filterindex{extract surface} Or bring up the
    quick launch (ctrl+space Win/Linux, alt+space Mac), type extract
    surface, and select that filter.
  \item Hit the \apply button.
    \savecounter
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/CutSurface1}
  \end{inlinefig}

  When you apply the \gui{Extract Surface} filter, you will once again see
  the surface of the mesh.  Although it looks like the original mesh, it is
  different in that this mesh is hollow whereas the original mesh was solid
  throughout.

  If you were showing the results of the contour filter, you cannot see the
  contour anymore, but do not worry.  It is still in there hidden by the
  surface.  If you are showing the contour but you did not see any effect
  after applying the filter, you may have forgotten step one and applied
  the filter to the wrong object.  If the \gui{ExtractSurface1} object is
  not connected directly to the \gui{disk\_out\_ref.ex2}, then this is what
  went wrong.  If so, you can delete the filter and try again.

  Now we will cut away the external surface to expose the internal
  structure and isosurface underneath (if you have one).

  \begin{enumerate}
    \restorecounter
  \item Verify that \gui{ExtractSurface1} is selected in the pipeline
    browser.
  \item Create a clip filter \clip from the toolbar or \gui{Filters} menu.
  \item Uncheck the \gui{Show Plane} checkbox
    \includeinlinegraphics{images/ShowPlaneCheckbox} in the properties panel.
  \item Click the \apply button.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/CutSurface2}
  \end{inlinefig}

  If you have a contour, you should now see the isosurface contour within a
  cutaway of the mesh surface.  You will probably have to rotate the mesh
  to see the contour clearly.
\end{exercise}

\index{pipeline browser|(}

\begin{inlinefig}
  \includegraphics[width=\linewidth]{images/PipelineBrowserStructure}
\end{inlinefig}

Now that we have added several filters to our pipeline, let us take a look
at the layout of these filters in the pipeline browser.  The pipeline
browser provides a convenient list of pipeline objects that we have created.
This makes it easy to select pipeline objects and change their
\keyterm{visibility} by clicking on the eyeball icons~\eyeballopen next to
them.  But also notice the indentation of the entries in the list and the
connecting lines toward the left.  These features reveal the
\keyterm{connectivity} of the pipeline.  It shows the same information as
the traditional graph layout on the right, but in a much more compact
space.  The trouble with the traditional layout of pipeline objects is that
it takes a lot of space, and even moderately sized pipelines require a
significant portion of the GUI to see fully.  The pipeline browser,
however, is complete and compact.

\index{pipeline browser|)}

\index{filters|)}


\section{Multiview}
\label{sec:Multiview}

Occasionally in the pursuit of science we can narrow our focus down to one
variable.  However, most interesting physical phenomena rely on not one but
many variables interacting in certain ways.  It can be very challenging to
present many variables in the same view.  To help you explore complicated
visualization data, ParaView contains the ability to present multiple views
of data and correlate them together.

So far in our visualization we are looking at two variables: We are
coloring with pressure and have extracted an isosurface with temperature.
Although we are starting to get the feel for the layout of these variables,
it is still difficult to make correlations between them.  To make this
correlation easier, we can use multiple views.  Each view can show an
independent aspect of the data and together they may yield a more complete
understanding.

On top of each view is a small toolbar, and the buttons controlling the
creating and deletion of views are located on the right side of this tool
bar.  There are four buttons in all.  You can create a new view by
splitting an existing view horizontally or vertically with the \splitViewH
and \splitViewV buttons, respectively.  The \deleteView button deletes a
view, whose space is consumed by an adjacent view.  The \maximizeView
temporarily fills view space with the selected view until \restoreView is
pressed.

\begin{exercise}{Using Multiple Views}
  \label{ex:UsingMultipleViews}%
  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \gui{Edit} \ra \gui{Reset Session}\index{reset session} from the menu or hit \resetsession on the toolbar.
  This option deletes all of your current work and resets ParaView back to its initial state.
  It is roughly the equivalent of restarting ParaView.

  First, we will look at one variable.  We need to see the variable through
  the middle of the mesh, so we are going to clip the mesh in half.

  \begin{enumerate}
  \item Open the file disk\_out\_ref.ex2, load all variables, \apply (see
    Exercise~\ref{ex:OpeningAFile}).
  \item Add the Clip filter~\clip to \gui{disk\_out\_ref.ex2}.
  \item Uncheck the \gui{Show Plane} checkbox
    \includeinlinegraphics{images/ShowPlaneCheckbox} in the properties panel.
  \item Click the \apply button.
  \item Color the surface by pressure by changing the variable chooser (in
    the toolbar) from \gui{vtkBlockColors} to \gui{pres}.
    \savecounter
  \end{enumerate}

  Now we can see the pressure in a plane through the middle of the mesh.
  We want to compare that to the temperature on the same plane.  To do
  that, we create a new view to build another visualization.

  \begin{enumerate}
    \restorecounter
  \item Press the \splitViewH button.
    \savecounter
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/SplitView1}
  \end{inlinefig}

  The current view is split in half and the right side is blank, ready to
  be filled with a new visualization.  Notice that the view in the right
  has a blue border around it.  This means that it is the \keyterm{active
    view}.  Widgets that give information about and controls for a single
  view, including the pipeline browser and properties panel, follow the
  active view.  In this new view we will visualize the temperature of the
  mesh.

  \begin{enumerate}
    \restorecounter
  \item Make sure the blue border is still around the new, blank view (to
    the right).  You can make any view the active view by simply clicking
    on it.
  \item Turn on the visibility of the clipped data by clicking the
    eyeball~\eyeballclosed next to \gui{Clip1} in the pipeline browser.
  \item Color the surface by temperature by selecting \gui{Clip1} in the
    pipeline browser and changing the variable chooser (in the toolbar)
    from \gui{Solid Color} to \gui{temp}.
    \savecounter
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/SplitView2}
  \end{inlinefig}

  We now have two views: one showing information about pressure and the
  other information about temperature.  We would like to compare these, but
  it is difficult to do because the orientations are different.  How are we
  to know how a location in one correlates to a location in the other?  We
  can solve this problem by adding a \keyterm{camera link} so that the two
  views will always be drawn from the same viewpoint.  Linking cameras is
  easy.

  \begin{enumerate}
    \restorecounter
  \item Right click on one of the views and select \gui{Link Camera...}
    from the pop up menu. (If you are on a Mac with no right mouse button,
    you can perform the same operation with the menu option \gui{Tools} \ra
    \gui{Add Camera Link...}.)
  \item Click in the second view.
  \item Try moving the camera in each view.
  \end{enumerate}

  \emph{Voil\`{a}}!  The two cameras are linked; each will follow the other.
  With the cameras linked, we can make some comparisons between the two
  views.  Click the~\xMinus button to get a straight-on view of the cross
  section and zoom in a bit.

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/CameraLink}
  \end{inlinefig}

  Notice that the temperature is highest at the interface with the heated
  disk.  That alone is not surprising.  We expect the air temperature to be
  greatest near the heat source and drop off away from it.  But notice that
  at the same position the pressure is not maximal.  The air pressure is
  maximal at a position above the disk.  Based on this information we can
  draw some interesting hypotheses about the physical phenomenon.  We can
  expect that there are two forces contributing to air pressure.  The first
  force is that of gravity causing the upper air to press down on the lower
  air.  The second force is that of the heated air becoming less dense and
  therefore rising.  We can see based on the maximal pressure where these
  two forces are equal.  Such an observation cannot be drawn without
  looking at both the temperature and pressure in this way.
\end{exercise}

Multiview in ParaView is of course not limited to simply two windows.  Note
that each of the views has its own set of multiview buttons.  You can
create more views by using the split view buttons \splitViewH \splitViewV
to arbitrarily divide up the working space.  And you can delete views
\deleteView at any time.

The location of each view is also not fixed.  You are also able to swap two
views by clicking on one of the view toolbars (somewhere outside of where
the buttons are), holding down the mouse button, and dragging onto one of
the other view toolbars.  This will immediately swap the two views.

\begin{inlinefig}
  \includegraphics[width=\linewidth]{images/SwapViews}
\end{inlinefig}

You can also change the size of the views by clicking on the space in
between views, holding down the mouse button, and dragging in the direction
of either one of the views.  The divider will follow the mouse and adjust
the size of the views as it moves.

\begin{inlinefig}
  \includegraphics[width=\linewidth]{images/ResizeViews}
\end{inlinefig}


\section{Vector Visualization}

Let us see what else we can learn about this simulation.  The simulation
has also outputted a velocity field describing the movement of the air over
the heated rotating disk.  We will use ParaView to determine the currents
in the air.

A common and effective way to characterize a vector field is with
\keyterm{streamlines}.  A streamline is a curve through space that at every
point is tangent to the vector field.  It represents the path a weightless
particle will take through the vector field (assuming steady-state flow).
Streamlines are generated by providing a set of
\index{stream tracer!seed points} \keyterm{seed points}.

\begin{exercise}{Streamlines}
  \label{ex:Streamlines}%
  We are going to start a fresh visualization, so if you have been
  following along with the exercises so far, now is a good time to select reset session \resetsession from the toolbar.

  \begin{enumerate}
  \item Open the file disk\_out\_ref.ex2, load all variables, \apply (see
    Exercise~\ref{ex:OpeningAFile}).
  \item Add the stream tracer filter \streamTracer to
    \gui{disk\_out\_ref.ex2}.
  \item
    Change the \gui{Seed Type} parameter in the properties panel to \gui{Point Cloud}.
  \item
    Uncheck the \gui{Show Sphere} checkbox \includeinlinegraphics{images/ShowSphereCheckbox} in the properties panel under the seed type.
  \item Click the \apply button to accept these parameters.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/StreamTracer0}
  \end{inlinefig}

  The surface of the mesh is replaced with some swirling lines.  These
  lines represent the flow through the volume.  Notice that there is a
  spinning motion around the center line of the cylinder.  There is also a
  vertical motion in the center and near the edges.

  The new geometry is off-center from the previous geometry.  We can
  quickly center the view on the new geometry with the \keyterm{reset
    camera}~\resetCamera command.  This command centers and fits the
  visible geometry within the current view and also resets the center of
  rotation to the middle of the visible geometry.
\end{exercise}

One issue with the streamlines as they stand now is that the lines are
difficult to distinguish because there are many close together and they
have no shading.  Lines are a 1D structure and shading requires a 2D
surface.  Another issue with the streamlines is that we cannot be sure in which
direction the flow is.

In the next exercise, we will modify the streamlines we created in
Exercise~\ref{ex:Streamlines} to correct these problems.  We can create a
2D surface around our stream traces with the tube filter.  This surface
adds shading and depth cues to the lines.  We can also add glyphs to the
lines that point in the direction of the flow.

\begin{exercise}{Making Streamlines Fancy}
  \label{ex:MakingStreamlinesFancy}%
  This exercise is a continuation of Exercise~\ref{ex:Streamlines}.
  You will need to finish that exercise before beginning this one.

  \begin{enumerate}
  \item Use the quick launch (ctrl+space Win/Linux, alt+space Mac) to add
    the \gui{Tube}\filterindex{tube} filter to the streamlines.
  \item Hit the \apply button.
    \savecounter
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/StreamTracer1}
  \end{inlinefig}

  You can now see the streamlines much more clearly.  As you look at the
  streamlines from the side, you should be able to see circular convection
  as air heats, rises, cools, and falls.  If you rotate the streams to look
  down the Z axis at the bottom near where the heated plate should be, you
  will also see that the air is moving in a circular pattern due to the
  friction of the rotating disk.

  (Note that as an alternative to adding the \gui{Tube} filter, you can instead directly render lines as tubes.
  This applies a special rendering mode that renders wide lines with tube-like shading.
  To do this, \emph{instead} of creating the \gui{Tube} filter set \gui{Line Width} display parameter to some value larger than 1 (say 5) and click on the \gui{Render Lines As Tubes} display parameter.)

  Now we can get a little fancier.  We can add glyphs to the streamlines to
  show the orientation and magnitude.

  \begin{enumerate}
    \restorecounter
  \item Select \gui{StreamTracer1} in the pipeline browser.
  \item Add the glyph filter~\glyph to \gui{StreamTracer1}.
  \item In the properties panel, change the \gui{Glyph Type} option to
    \gui{Cone}.
  \item In the properties panel, change the \gui{Orientation Array} to \gui{v}.
  \item In the properties panel, change the \gui{Scale Array} to \gui{v}.
  \item Click the reset~\icon{Reload} button to the right of \gui{Scale Factor}.
  \item Hit the \apply button.
  \item Color the glyphs with the \gui{temp} variable.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/StreamTracer2}
  \end{inlinefig}

  Now the streamlines are augmented with little pointers.  The pointers
  face in the direction of the velocity, and their size is proportional to
  the magnitude of the velocity.  Try using this new information to answer
  the following questions.

  \begin{itemize}
  \item Where is the air moving the fastest?  Near the disk or away from it?
    At the center of the disk or near its edges?
  \item Which way is the plate spinning?
  \item At the surface of the disk, is air moving toward the center or away
    from it?
  \end{itemize}
\end{exercise}


\section{Plotting}
\label{sec:Plotting}

ParaView's plotting capabilities provide a mechanism to drill down into
your data to allow quantitative analysis.  Plots are usually created with
filters, and all of the plotting filters can be found in the \gui{Data
  Analysis} submenu of \gui{Filters}.  There is also a data analysis
toolbar containing the most common data analysis filters, some of which are
used to generate plots.

\index{toolbar!data analysis}
\index{data analysis|(}
\index{filters!data analysis|(}

\begin{description}
\item[\quartiles Compute Quartiles]
  Computes the quartiles for each field in the data set and then shows a box chart depicting the quartiles.
\item[\extractSelection Extract Selection] Extracts any data selected into
  its own object.  Selections are described in Section~\ref{sec:Selection}.
\item[\histogram Histogram] Allows you to generate the histogram of a data array
  from a dataset.
\item[\plotGlobal Plot Global Variables Over Time] Data sets sometimes
  capture information in ``global'' variables that apply to an entire
  dataset rather than a single point or cell.  This filter plots the global
  information over time.  ParaView's handling of time is described in
  Section~\ref{sec:Time}.
\item[\plotOverLine Plot Over Line] Allows you to define a line segment
  in 3D space and then plot field information over this line.
\item[\plotSelectionOverTime Plot Selection Over Time] Takes the fields in
  selected points or cells and plots their values over time.  Selections
  are described in Section~\ref{sec:Selection} and time is described in
  Section~\ref{sec:Time}.
\item[\probe Probe] Provides the field values in a particular location in
  space.
\item[\programmableFilter Programmable Filter] Allows you to program a user-defined filter.
  To use the filter you define a function that retrieves input of the correct
  type, creates data, and then manipulates the output of the filter.
\end{description}

\index{filters!data analysis|)}
\index{data analysis|)}

In the next exercise, we create a filter that will plot the values of the
mesh's fields over a line in space.

\begin{exercise}{Plot Over a Line in Space}
  \label{ex:PlotOverLine}%
  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \resetsession from the toolbar.

  \begin{enumerate}
  \item Open the file disk\_out\_ref.ex2, load all variables, \apply (see
    Exercise~\ref{ex:OpeningAFile}).
  \item
    Add the Clip filter~\clip to \gui{disk\_out\_ref.ex2}, Uncheck the \gui{Show Plane} \includeinlinegraphics{images/ShowPlaneCheckbox} and the \gui{Invert} checkboxes in the properties panel, and click \apply (like in Exercise~\ref{ex:UsingMultipleViews}).  This will make it easier to see and manipulate the line we are plotting over.
  \item Click on \gui{disk\_out\_ref.ex2} in the pipeline browser to make
    that the active object.
  \item From the toolbars, select the plot over line~\plotOverLine
    filter. \savecounter
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/LinePlot1}
  \end{inlinefig}

  In the active view you will see a line through your data with a ball at each end.
  If you move your mouse over either of these balls, you can drag the balls through the 3D view to place them.
  If you hold down the x, y, or z key while you drag one of these balls, the movement will be constrained to that axis.
  Notice that each time you move the balls some of the fields in the properties panel also change.
  You can also place the balls by hovering your mouse over the target location and hitting the 1, 2, or p key.
  The 1 key will place the first ball at the surface underneath the mouse cursor.
  The 2 key will likewise place the second ball.
  The p key will alternate between placing the first and second balls.
  If you hold down the Ctrl modifier while hitting any of these keys, then the ball will be placed at the nearest point of the underlying mesh rather than directly under the mouse.
  This was the purpose of adding the clip filter: It allows us to easily add the endpoints to this plane.
  Note that placing the endpoints in this manner only works when rendering solid surfaces.
  It will not work with a volume rendered image or transparent surfaces.

  This representation is called a \keyterm{3D widget} because it is a GUI
  component that is manipulated in 3D space.  There are many examples of 3D
  widgets in ParaView.  This particular widget, the line widget, allows you
  to specify a line segment in space.  Other widgets allow you to specify
  points or planes.

  \begin{enumerate}
    \restorecounter
  \item
    Adjust the line so that it goes from the base of the disk straight up
    to the top of the mesh using the 3D widget manipulators, the p key
    shortcut, or the properties panel parameters.
    The plot works best with \gui{Point 1} around $(0,0,0)$ and \gui{Point 2} around $(0,0,10)$.
  \item
    Once you have your line satisfactorily located, click the \apply button.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/LinePlot2}
  \end{inlinefig}

  There are several interactions you can do with the plot.  Roll the mouse 
  wheel up and down to zoom in and out.  Drag with the middle button
  to do a rubber band zoom.  Drag with the left button to scroll the plot
  around.  You can also use the reset camera command~\resetCamera to restore
  the view to the full domain and range of the plot.
\end{exercise}

Plots, like 3D renderings, are considered views.  Both provide a
representation for your data; they just do it in different ways.  Because
plots are views, you interact with them in much the same ways as with a 3D
view.  If you look in the \gui{Display} section of the properties panel, you
will see many options on the representation for each line of the plot
including colors, line styles, vector components, and legend names.
\begin{inlinefig}
  \includegraphics[width=.5\scw]{images/PlotDisplayTab}
\end{inlinefig}

If you scroll down further to the \gui{View} section of the properties
panel, you to change plot-wide options such as labels, legends, and axes
ranges.
\begin{inlinefig}
  \includegraphics[width=.5\scw]{images/PlotViewOptions}
\end{inlinefig}

\index{save screenshot}
\index{screenshot}
\index{export scene}
Like any other views, you can capture the plot with the \gui{File} \ra
\icon{pqCaptureScreenshot}~\gui{Save Screenshot}. Additionally, if you
choose \gui{File} \ra \gui{Export Scene...} you can export a file with
vector graphics that will scale properly for paper-quality images.  We will
discuss these image capture features later in
Section~\ref{sec:SaveScreenshot}.  You can also resize and swap plots in
the GUI like you can other views.

In the next exercise, we modify the display to get more information out of
our plot.  Specifically, we use the plot to compare the pressure and
temperature variables.

\begin{exercise}{Plot Series Display Options}
  \label{ex:PlotSeriesDisplayOptions}%
  This exercise is a continuation of Exercise~\ref{ex:PlotOverLine}.  You
  will need to finish that exercise before beginning this one.

  \begin{enumerate}
  \item Choose a place in your GUI that you would like the plot to go and
    try using the split, delete, resize, and swap view features to move it
    there.
  \item Make the plot view active, go to the \gui{Display} section of the
    properties panel, and turn off all variables except \gui{temp} and
    \gui{pres}.
    \savecounter
  \end{enumerate}

  The \gui{temp} and \gui{pres} variables have different units.  Putting
  them on the same scale is not useful.  We can still compare them in the
  same plot by placing each variable on its own scale.  The line plot in
  ParaView allows for a different scale on the left and right axis, and you
  can scale each variable individually on each axis.

  \begin{enumerate}
    \restorecounter
  \item Select the \gui{pres} variable in the \gui{Display} options.
  \item Change the \gui{Chart Axis} to \gui{Bottom - Right}
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/LinePlot3}
  \end{inlinefig}

  From this plot we can verify some of the observations we made in
  Section~\ref{sec:Multiview}.  We can see that the temperature is maximal
  at the plate surface and falls as we move away from the plate, but the
  pressure goes up and then back down.  In addition, we can observe that
  the maximal pressure (and hence the location where the forces on the air
  are equalized) is about 3 units away from the disk.
\end{exercise}

The ParaView framework is designed to accommodate any number of different
types of views.  This is to provide researchers and developers a way to
deliver new ways of looking at data.  To see another example of view,
select \gui{disk\_out\_ref.ex2} in the pipeline browser, and then select
\gui{Filters} \ra \gui{Data Analysis} \ra \gui{Histogram}~\histogram.  Make
the histogram for the \gui{temp} variable, and then hit the \apply button.

\begin{inlinefig}
  \includegraphics[width=\scw]{images/HistogramPlot}
\end{inlinefig}


\section{Volume Rendering}

ParaView has several ways to represent data.  We have already seen some
examples: surfaces, wireframe, and a combination of both.  ParaView can
also render the points on the surface or simply draw a bounding box of the
data.

\begin{inlinefig}
  \begin{tabular}{c@{\;}c@{\;}c@{\;}c@{\;}c}
    \includegraphics[width=.18\linewidth]{images/RepresentationPoints} &
    \includegraphics[width=.18\linewidth]{images/RepresentationWireframe} &
    \includegraphics[width=.18\linewidth]{images/RepresentationSurface} &
    \includegraphics[width=.18\linewidth]{images/RepresentationSurfaceEdges} &
    \includegraphics[width=.18\linewidth]{images/RepresentationVolume}
    \\
    Points &
    Wireframe &
    Surface &
    \parbox[t]{.18\linewidth}{\centering{}Surface with Edges} &
    Volume
  \end{tabular}
\end{inlinefig}

A powerful way that ParaView lets you represent your data is with a
technique called \keyterm{volume rendering}.  With volume rendering, a
solid mesh is rendered as a translucent cloud with the scalar field
determining the color and density at every point in the cloud.  Unlike with
surface rendering, volume rendering allows you to see features all the way
through a volume.

Volume rendering is enabled by simply changing the representation of the
object.  Let us try an example of that now.

\begin{exercise}{Turning On Volume Rendering}
  \label{ex:VolumeRendering}%
  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \resetsession from the toolbar.

  \begin{enumerate}
  \item Open the file disk\_out\_ref.ex2, load all variables, \apply (see
    Exercise~\ref{ex:OpeningAFile}).
  \item Make sure \gui{disk\_out\_ref.ex2} is selected in the pipeline
    browser.  Change the variable viewed to \gui{temp} and change the
    representation to \gui{Volume}.
  \item
    If you get an \gui{Are you sure?} dialog box warning you about the change to the volume representation, click \gui{Yes} to enact the change.
  \item \gui{Show Center} \icon{pqShowCenterAxes} of rotation.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/VolumeRender1}
  \end{inlinefig}

  The solid opaque mesh is replaced with a translucent volume. You may
  notice that when rotating your object that the rendering is temporarily
  replaced with a simpler transparent surface for performance reasons. We
  discuss this behavior in more detail later in
  Chapter~\ref{chap:VisualizingLargeModels}.
\end{exercise}

A useful feature of ParaView's volume rendering is that it can be mixed
with the surface rendering of other objects.  This allows you to add
context to the volume rendering or to mix visualizations for a more
information-rich view.  For example, we can combine this volume rendering
with a streamline vector visualization like we did in
Exercise~\ref{ex:Streamlines}.

\begin{exercise}{Combining Volume Rendering and Surface-Based Visualization}
  \label{ex:CombiningVolumeAndSurfaceRendering}%
  This exercise is a continuation of Exercise~\ref{ex:VolumeRendering}.
  You will need to finish that exercise before beginning this one.

  \begin{enumerate}
  \item Add the stream tracer filter \streamTracer to
    \gui{disk\_out\_ref.ex2}.
  \item
    Change the \gui{Seed Type} parameter in the properties panel to \gui{Point Cloud}.
  \item
    Uncheck the \gui{Show Sphere} checkbox \includeinlinegraphics{images/ShowSphereCheckbox} in the properties panel under the seed type.
  \item Click the \apply button to accept these parameters.
    \savecounter
  \end{enumerate}

  You should now be seeing the streamlines embedded within the volume
  rendering.  The following additional steps add geometry to make the
  streamlines easier to see much like in
  Exercise~\ref{ex:MakingStreamlinesFancy}.  They are optional, so you can
  skip them if you wish.

  \begin{enumerate}
    \restorecounter
  \item Use the quick launch (ctrl+space Win/Linux, alt+space Mac) to apply
    the \gui{Tube}\filterindex{tube} filter and hit \apply.
  \item If the streamlines are colored by \gui{temp}, change that to
    \gui{Solid Color}.
  \item Select \gui{StreamTracer1} in the pipeline browser.
  \item Add the glyph filter~\glyph to \gui{StreamTracer1}.
  \item In the properties panel, change the \gui{Glyph Type} option to
    \gui{Cone}.
  \item In the properties panel, change the \gui{Orientation Array} to \gui{v}.
  \item In the properties panel, change the \gui{Scale Array} to \gui{v}.
  \item Click the reset~\icon{Reload} button to the right of \gui{Scale Factor}.
  \item Hit the \apply button.
  \item Color the glyphs with the \gui{temp} variable.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/VolumeRender2}
  \end{inlinefig}

  The streamlines are now shown in context with the temperature throughout
  the volume.
\end{exercise}

By default, ParaView will render the volume with the same colors as used on
the surface with the transparency set to 0 for the low end of the range and
1 for the high end of the range.  ParaView also provides an easy way to
change the \keyterm{transfer function}, how scalar values are mapped to
color and transparency.  You can access the transfer function editor by
selecting the volume rendered-pipeline object (in this case
\gui{disk\_out\_ref.ex2}) and clicking on the edit color
map~\icon{pqEditColor} button.  \index{edit colors} \index{colors!edit}

\begin{inlinefig}
  \includegraphics[width=0.8\scw]{images/ColorMapEditor}
\end{inlinefig}

The first time you bring up the color map editor, it should appear at the
right side of the ParaView GUI window. Like most of the panels in ParaView,
this is a dockable window that you can move around the GUI or pull off and
place elsewhere on your desktop. Like the properties panel, some of the
advanced options are hidden to simplify the interface. To access these
hidden features, toggle the \icon{pqAdvanced} button in the upper right
or type a search string.

The two colorful boxes at the top represent the transfer function. The
first box with a function plot with colors underneath represents the
transparency whereas the long box at the bottom represents the
colors.\footnote{For surface rendering, the transparency controls have no
  effect unless ``Enable opacity mapping for surfaces'' is enabled.} The
dots on the transfer functions represent the \keyterm{control points}. The
control points are the specific color and opacity\index{opacity} you set at
particular scalar values, and the colors and transparency are interpolated
between them. Clicking on a blank spot in either bar will create a new
control point. Clicking on an existing control point will select it. The
selected control point can be dragged throughout the box to change its
scalar value and transparency (if applicable). Double clicking on a color
control point will allow you to change the color. The selected control
point will be deleted when you hit the backspace or delete key.

Directly below the color and transparency bars is a text entry widget to
numerically specify the \gui{Data} Value of the selected control
point. Below this are checkbox options to \gui{Use log scale when mapping
  data to colors}\index{logarithmic scale}, to \gui{Enable opacity mapping
  for surfaces}\index{opacity}, and to \gui{Automatically rescale transfer
  functions to fit data}. (Note that this last option causes the data range
to be resized under most operations that change data, but not when the time
value changes. See Section~\ref{sec:Time} for more details.)

The following \gui{Color Space}\index{color space} parameter changes how
colors are interpolated. This parameter has no effect on the color at the
control points, but can drastically affect the colors between the control
points. Finally, the \gui{Nan Color}\index{NaN} allows you to select a
color for ``invalid'' values. A \keyterm{NaN} is a special floating point
value used to represent something that is not a number (such as the result
of $0/0$).

Setting up a transfer function can be tedious, so you can save it by
clicking the \gui{Save to preset}~\icon{pqSave} button.  The \gui{Choose
  preset}~\icon{pqFavorites} button brings up a dialog that allows you to
manage and apply the color maps that you have created as well as many
provided by ParaView.

\begin{exercise}{Modifying Volume Rendering Transfer Functions}
  \label{ex:ModifyingVolumeRenderingTransferFunctions}%
  This exercise is a continuation of
  Exercise~\ref{ex:CombiningVolumeAndSurfaceRendering}.  You will need to
  finish that exercise (or minimally Exercise~\ref{ex:VolumeRendering})
  before beginning this one.

  \begin{enumerate}
  \item Click on \gui{disk\_out\_ref.ex2} in the pipeline browser to make
    that the active object.
  \item Click on the edit color map~\icon{pqEditColor} button.
  \item Change the volume rendering to be more representative of heat.
    Press \gui{Choose preset}~\icon{pqFavorites}, select \gui{Black-Body
      Radiation} in the dialog box, and then click \gui{Apply} followed by
    \gui{Close}.
  \item Try adding and changing control points and observe their effect on
    the volume rendering. By default as you make changes the render views
    update. If this interactive update is too slow, you can turn off this
    feature by toggling the \icon{pqAutoApply} button. When automatic
    updates are off, transfer function changes are not applied until the
    \gui{\icon{pqAutoApply} Render Views} is clicked.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/VolumeRender3}
  \end{inlinefig}

  Notice that not only did the color mapping in the volume rendering
  change, but all the color mapping for \gui{temp} changed including the
  cone glyphs if you created them.  This ensures consistency between the
  views and avoids any confusion from mapping the same variable with
  different colors or different ranges.
\end{exercise}

\index{colors!rainbow}
While looking through the color map presents~\icon{pqFavorites}, you probably noticed one or more entries with \keyterm{Rainbow} as part of the title that incorporate the colors of the a rainbow into the color map.
You may also recognize this set of colors from other visualizations you have seen in the past.
\begin{inlinefig}
  \includegraphics[width=\scw]{images/RainbowBar}
\end{inlinefig}
Rainbow colors are certainly a popular choice.
However, we recommend that you \keyterm{never use rainbow color maps} in your visualizations.

The problem with rainbow colors is that they have numerous perceptual properties that serve to obfuscate the data.
Although we will not go into detail into the many perceptual studies that provide evidence that rainbow colors are bad for data display, we provide a brief synopsis of the problems.

The first problem is that the colors do not follow any natural perceived ordering.
Some color groups lead to a natural perception of order (with relative brightness being the strongest perceptual cue).
The hues of the rainbow, however, have no real ordered meaning in our visual system.
Rather, we have to learn an ordering, which can lead to visual confusion.
Consider the following two example images.
In the left image, the rainbow hues make it difficult to ascertain the relative high and low values that are more clear in the right image.

\begin{inlinefig}
  \includegraphics[width=.45\linewidth]{images/ColorOrderExampleRainbow}
  \includegraphics[width=.45\linewidth]{images/ColorOrderExampleCoolWarm}
\end{inlinefig}

The second problem with the perception of rainbow colors is that the perceptual changes in the colors are not uniform.
The colors appear to change faster in the cyan and yellow regions, which can introduce artifacts in those regions that do not exist in the data.
The colors appear to change more slowly in the blue, green, and red regions, which creates larger bands of color that hide artifacts in the data.
We can see this effect in the following two images of a spatial contrast sensitivity function.
The grayscale on the left faithfully reproduces the function.
However, the rainbow colors on the right hides the variation in low contrast regions and appears less smooth in the high-contrast regions.

\begin{inlinefig}
  \includegraphics[width=.5\scw]{images/GrayscaleSpatialContrast}
  \includegraphics[width=.5\scw]{images/RainbowSpatialContrast}
\end{inlinefig}

A third problem with the rainbow color map is that it is sensitive to deficiencies in vision.
Roughly 5\% of the population cannot distinguish between the red and green colors.
Viewers with color deficiencies cannot distinguish many colors considered ``far apart'' in the rainbow color map.

We provide this description of the problems with rainbow colors in the hopes that you do not use these color maps.
Despite the well know problems with rainbow colors, they remain a popular choice.
Relying on rainbow hues obfuscates data, which circumvents the entire process of data analysis that ParaView provides.
Multiple perceptual studies have shown that subjects overestimate the effectiveness of rainbow colors.
That is, people think they do better with rainbow colors when in fact they do worse.
Don't fall into this trap.

\section{Time}
\label{sec:Time}

Now that we have thoroughly analyzed the disk\_out\_ref simulation, we will
move to a new simulation to see how ParaView handles time.  In this section
we will use a new data set from another simple simulation, this time with
data that changes over time.

\begin{exercise}{Loading Temporal Data}
  \label{ex:LoadingTemporalData}%
  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \resetsession from the toolbar.

  \begin{enumerate}
  \item \index{can} \gui{Open} the file \gui{can.ex2}.
    \begin{inlinefig}
      \includegraphics[scale=\bbscale]{images/Block_properties_can}
    \end{inlinefig}
  \item As before, click the checkbox in the header of the block arrays list
  to turn on the loading of all the block arrays and hit the \apply button.
  \item Press the~\yPlus button to orient the camera to the mesh.
  \item Press the play button~\vcrPlay in the toolbars and watch ParaView
    animate the mesh to crush the can with the falling brick.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=.32\linewidth]{images/AnimateCan1}
    \includegraphics[width=.32\linewidth]{images/AnimateCan2}
    \includegraphics[width=.32\linewidth]{images/AnimateCan3}
  \end{inlinefig}
\end{exercise}

That is really all there is to dealing with data that is defined over time.
ParaView has an internal concept of time and automatically links in the
time defined by your data.  Become familiar with the toolbars that can be
used to control time.

\begin{inlinefig}
  \includegraphics[width=\linewidth]{images/AnimationToolbar}
\end{inlinefig}

Saving an animation is equally as easy.  From the menu, select \gui{File}
\ra \gui{Save Animation}.  ParaView provides dialogs specifying how you
want to save the animation, and then automatically iterates and saves the
animation.

\begin{exercise}{Temporal Data Pitfall}
  \label{ex:TemporalDataPitfall}%
  The biggest pitfall users run into is that with mapping a set of colors
  whose range changes over time.  To demonstrate this, do the following.

  \begin{enumerate}
  \item If you are not continuing from
    Exercise~\ref{ex:LoadingTemporalData}, open the file \gui{can.ex2},
    load all variables, \apply.
  \item Go to the first time step~\vcrFirst.
  \item Color by the \gui{EQPS} variable.
  %\item Turn on the color legend~\icon{pqScalarBar}.
  \item Play~\vcrPlay through the animation (or skip to the last time
    step~\vcrLast).
    \savecounter
  \end{enumerate}
  The coloring is not very useful.  To quickly fix the problem:
  \begin{enumerate}
    \restorecounter
  \item While at the last time step, click the Rescale to Data
    Range~\icon{pqResetRange} button.
  \item Play~\vcrPlay the animation again.
  \end{enumerate}

  The colors are more useful now.
\end{exercise}

Although this behavior seems like a bug, it is not.  It is the consequence
of two unavoidable behaviors.  First, when you turn on the visibility of a
scalar field, the range of the field is set to the range of values in the
current time step.  Ideally, the range would be set to the max and min over
all time steps in the data.

However, this requires ParaView to load
in all of the data on the initial read, and that is prohibitively
slow for large data.  Second, when you animate over time, it is important
to hold the color range fixed even if the range in the data changes.
Changing the scale of the data as an animation plays causes a
misrepresentation of the data.  It is far better to let the scalars go out
of the original color map's range than to imply that they have not.  There
are several workarounds to this problem:

\index{colors!rescale}
\index{rescale colors}
\begin{itemize}
\item If for whatever reason your animation gets stuck on a poor color
  range, simply go to a representative time step and
  hit~\icon{pqResetRange}.  This is what we did in the previous exercise.
\item Open the settings dialog box accessed in the menu from \gui{Edit} \ra
  \gui{Settings} (\gui{ParaView} \ra \gui{Preferences} on the Mac). Under
  the \gui{General} tab, find the option labeled \gui{Default Time Step}
  and change it to \gui{Go to last timestep}. (If you have trouble finding
  this option, try typing \gui{timestep} into the setting's search box.)
  When this is selected, ParaView will automatically go to the last time
  step when loading any data set with time. For many data (such as in can),
  the field ranges are more representative at the last time step than at
  the beginning. Thus, as long as you color by a field before changing the
  time, the color range will be adequate.
\item \index{colors!custom range} \index{custom data range} Click the
  \gui{Rescale to Custom Data Range}~\icon{pqResetRangeCustom} toolbar
  button. This is a good choice if you cannot find, or do not know, a
  ``representative'' time step or if you already know a good range to
  use.
\item
  If you are willing to wait or have small data, you can use the \gui{Rescale to data range over all timesteps}~\icon{pqResetRangeTemporal} toolbar button and ParaView will compute this overall temporal range automatically.
  Keep in mind that this option will require ParaView to load your entire data set over all time steps.
  Although ParaView will not hold more than one time step in memory at a time, it will take a long time to pull all that memory off of disk for large data sets.
\end{itemize}

ParaView has many powerful options for controlling time and animation.  The
majority of these are accessed through the \keyterm{animation view}.  From
the menu, click on \gui{View} \ra \gui{Animation View}.

\begin{inlinefig}
  \includegraphics[width=\scw]{images/AnimationView}
\end{inlinefig}

\index{animation mode|(}

\label{AnimationMode}

For now we will examine the controls at the top of the animation view. (We
will examine the use of the tracks in the rest of the animation view later
in Section~\ref{sec:Animations}.) The \keyterm{animation mode} parameter
determines how ParaView will step through time during playback.  There are
three modes available.

\begin{description}
\item[Sequence] \index{sequence (animation mode)} Given a start and end
  time, break the animation into a specified number of frames spaced
  equally apart.
\item[Real Time] \index{real time (animation mode)} ParaView will play back
  the animation such that it lasts the specified number of seconds.  The
  actual number of frames created depends on the update time between
  frames.
\item[Snap To TimeSteps] \index{Snap To TimeSteps (animation mode)}
  ParaView will play back exactly those time steps that are defined by your
  data.
\end{description}

Whenever you load a file that contains time, ParaView will automatically
change the animation mode to \gui{Snap To TimeSteps}.  Thus, by default you
can load in your data, hit play~\vcrPlay, and see each time step as defined
in your data.  This is by far the most common use case.

A counter use case can occur when a simulation writes data at variable time
intervals.  Perhaps you would like the animation to play back relative to
the simulation time rather than the time index.  No problem.  We can switch
to one of the other two animation modes.  Another use case is the desire to
change the playback rate.  Perhaps you would like to speed up or slow down
the animation.  The other two animation modes allow us to do that.

\begin{exercise}{Slowing Down an Animation with the Animation Mode}%
  \label{ex:SlowingDownAnAnimation}%
  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \resetsession from the toolbar.

  \begin{enumerate}
  \item Open the file \gui{can.ex2}, load all variables, \apply (see
    Exercise~\ref{ex:LoadingTemporalData}).
  \item Press the~\yPlus button to orient the camera to the mesh.
  \item Press the play button~\vcrPlay in the toolbars.
    \savecounter
  \end{enumerate}

  During this animation, ParaView is visiting each time step in the
  original data file exactly once.  Note the speed at which the animation
  plays.

  \begin{enumerate}
    \restorecounter
  \item If you have not done so yet, make the animation view visible:
    \gui{View} \ra \gui{Animation View}.
  \item Change the animation mode to \gui{Real Time}.  By default the
    animation is set up with the time range specified by the data and a
    duration of 10 seconds.
  \item Play~\vcrPlay the animation again.
    \savecounter
  \end{enumerate}

  The result looks similar to the previous \gui{Snap To TimeSteps}
  animation, but the animation is now a linear scaling of the simulation
  time and will complete in 10 seconds.

  \begin{enumerate}
    \restorecounter
  \item Change the \gui{Duration} to 60 seconds.
  \item Play~\vcrPlay the animation again.
  \end{enumerate}

  The animation is clearly playing back more slowly.  Unless your computer
  is updating slowly, you will also notice that the animation appears
  jerkier than before.  This is because we have exceeded the temporal
  resolution of the data set.
\end{exercise}

\index{animation mode|)}

Often showing the jerky time steps from the original data is the desired
behavior; it is showing you exactly what is present in the data.  However,
if you wanted to make an animation for a presentation, you may want a
smoother animation.

There is a filter in ParaView designed for this purpose.  It is called
the \keyterm{temporal interpolator}.  This filter will interpolate the
positional and field data in between the time steps defined in the original
data set.

\begin{exercise}{Temporal Interpolation}
  \label{ex:TemporalInterpolation}%
  This exercise is a continuation of
  Exercise~\ref{ex:SlowingDownAnAnimation}. You will need to finish that
  exercise before beginning this one.

  \begin{enumerate}
  \item Make sure \gui{can.ex2} is highlighted in the pipeline browser.
  \item \filterindex{temporal interpolator} Select \gui{Filters} \ra
    \gui{Temporal} \ra \gui{Temporal Interpolator} or apply the
    \gui{Temporal Interpolator} filter using the quick launch (ctrl+space
    Win/Linux, alt+space Mac).
  \item \apply.
  %% \item Change back to \gui{Real Time} mode in the \gui{Animation View} if
  %%   necessary.
  \item Split the view~\splitViewH, show the \gui{TemporalInterpolator1} in
    one, show \gui{can.ex2} in the other, and link the cameras.
  \item Play~\vcrPlay the animation.
  \end{enumerate}

  You should notice that the output from the temporal interpolator animates
  much more smoothly than the original data.
\end{exercise}

It is worth noting that the temporal interpolator can (and often does)
introduce artifacts in the data.  It is because of this that ParaView will
never apply this type of interpolation automatically; you will have to
explicitly add the \gui{Temporal Interpolator}.  In general, mesh
deformations often interpolate well but moving fields through a static mesh
do not.  Also be aware that the \gui{Temporal Interpolator} only works if
the topology remains consistent.  If you have an adaptive mesh that changes
from one time step to the next, the \gui{Temporal Interpolator} will give
errors.


\section{Text Annotation}

\sourceindex{text}

When using ParaView as a communication tool it is often helpful to annotate
the images you create with text.  With ParaView it is very easy to create
text annotation wherever you want in a 3D view.  There is a special
\keyterm{text source} that simply places some text in the view.

\begin{exercise}{Adding Text Annotation}
  \label{ex:AddingTextAnnotation}%
  If you are continuing this exercise after finishing
  Exercise~\ref{ex:TemporalInterpolation}, feel free to simply continue.
  If you have had to restart ParaView since or your state does not match up
  well enough, it is also fine to start with a fresh state.

  \begin{enumerate}
  \item
    Use the quick launch (ctrl+space Win/Linux, alt+space Mac) to create the \gui{Text}\filterindex{text} source (or from the menu bar \gui{Sources} \ra \gui{Annotation} \ra \gui{Text}) and hit \apply.
  \item In the text edit box of the properties panel, type a message.
  \item Hit the \apply button.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/TextSource}
  \end{inlinefig}

  The text you entered appears in the 3D view.
  If you scroll down to the \gui{Display} options in the properties panel, you will see six buttons that allow you to quickly place the text in each of the four corners of the view as well as centered at the top and bottom.

  \begin{inlinefig}
    \includegraphics[width=.75\scw]{images/TextPosition}
  \end{inlinefig}

  You can place this text at an arbitrary position by clicking the \gui{Lower Left Corner} checkbox.
  With the \gui{Lower Left Corner} option checked, you can use the mouse to drag the text to any position within the view.
\end{exercise}

Often times you will need to put the current time value into the text
annotation.  Typing the correct time value can be tedious and error prone
with the standard text source and impossible when making an animation.
Therefore, there is a special \keyterm{annotate time source} that will
insert the current animation time into the string.

\sourceindex{annotate time}

\begin{exercise}{Adding Time Annotation}
  \label{ex:AddingTimeAnnotation}%
  \begin{enumerate}
  \item If you do not already have it loaded from a previous exercise, open
    the file \gui{can.ex2}, \apply.
  \item
    Add an \gui{Annotate Time} source (\gui{Sources} \ra \gui{Annotate} \ra
    \gui{Annotate Time} or use the quick launch: ctrl+space Win/Linux,
    alt+space Mac).
    \apply.
  \item Move the annotation around as necessary.
  \item Play~\vcrPlay and observe how the time annotation changes.
    \savecounter
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/AnnotateTimeSource}
  \end{inlinefig}

  There are instances when the current animation time is not the same as
  the time step read from a data file.  Often it is important to know what
  the time stored in the data file is, and there is a special version of
  annotate time that acts as a filter.


  \begin{enumerate}
    \restorecounter
  \item Select \gui{can.ex2} in the pipeline browser.
  \item Use the quick launch (ctrl+space Win/Linux, alt+space Mac) to apply
    the \gui{Annotate Time Filter}. \filterindex{annotate time filter}
  \item \apply.
  \item Move the annotation around as necessary.
  \item Check the animation mode in the \gui{Animation View}.  If it is set
    to \gui{Snap to TimeSteps}, change it to \gui{Real Time}.
  \item Play~\vcrPlay and observe how the time annotation changes.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/AnnotateTimeFilter}
  \end{inlinefig}
\end{exercise}

You can close the animation view. We are done with it for now, but we will
revisit it again in Section~\ref{sec:Animations}.


\section{Save Screenshot and Save Animation}
\label{sec:SaveScreenshot}

One of the most important products of any visualization is screenshots and 
movies that can be used in presentations and reports.  In this section we 
save a screenshot (picture) and animation (movie). Once again, we
will use the \gui{can.ex2} dataset.

\index{save screenshot|(}
\index{screenshot|(}

\begin{exercise}{Save Screenshot}
  \label{ex:SaveScreenshot}%
  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \resetsession from the toolbar.

  \begin{enumerate}
  \item Open the file \gui{can.ex2}, load all variables, \apply (see
    Exercise~\ref{ex:LoadingTemporalData}).
  \item Press the~\yPlus button to orient the camera to the mesh.
  \item Color by points' \gui{ids}.  We use points' \gui{ids} so that the
    3D object has some color.
  %% \item Select the \gui{Rescale to color range}~\icon{pqResetRange} button.
  \item Select \gui{File} \ra \gui{Save
    Screenshot}~\icon{pqCaptureScreenshot}.

  \savecounter
  \end{enumerate}

  This brings us to the file selection screen.  If you pull down the menu
  \gui{Files of type:} at the bottom of the dialog box, you will see
  several file types supported including
  \index{portable~network~graphics}\index{PNG}portable network graphics
  (PNG), and \index{joint~photographic~experts~group}\index{JPEG}joint
  photographic experts group (JPEG).

  Select a \gui{File name} for your file, and place it somewhere you can
  later find and delete.  We usually recommend saving images as PNG
  files.  The lossy compression of JPEG often creates noticeable artifacts
  in the images generated by ParaView, and the compression of PNG is
  better than most other raster formats.

  \begin{enumerate}
    \restorecounter
  \item Press the \gui{OK} button.
    \savecounter
  \end{enumerate}

  After you select a file, you will be presented with a dialog box for more screenshot options.

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/SaveScreenshot1}
  \end{inlinefig}

  The \gui{Save Screenshot Options} dialog box includes numerous important controls.

  At the top of the dialog box are \gui{Size and Scaling} options.
  The \gui{Image Resolution} options allow you to create an image that is larger (or smaller) than the current size of the 3D view.
  You can directly enter a resolution or use the \gui{x2} and \gui{/2} buttons to double or halve the resolution.
  The \icon{pqLock} button toggles locking the aspect ratio when selecting an image resolution.
  The \icon{Reload} button restores the resolution to that of the view in the GUI.
  If you have multiple views open, there is also a \gui{Save All Views} checkbox that toggles between saving only the active view and saving all views in one image.

  The \gui{Coloring} controls modify how some elements, such as the background, get colored.
  \index{color~palette}\index{palette} The \gui{Override Color Palette} pulldown menu allows a user to use the default color scheme, one with a white color motif for printing, or other defined palettes.
  These are the same palettes described in Exercise~\ref{ex:ChangingTheColorPalette} on page~\pageref{ex:ChangingTheColorPalette}.
  There is also a \gui{Transparent Background} checkbox that adds an alpha channel to the written image (in formats that support it).

  There are also many advanced options that, as always are accessible via the \icon{pqAdvanced} button or the search bar.

  \begin{enumerate}
    \restorecounter
    \item Press the \gui{OK} button.
  \end{enumerate}

  Using your favorite image viewer, find and load the image you created.
  If you have no image viewer, ParaView itself is capable of loading PNG
  files.
\end{exercise}

\index{save screenshot|)}
\index{screenshot|)}

%% \index{screenshot|(}
%% \index{save screenshot|(}
%% \index{export scene|(}

%% The save screenshot function saves the image as a \keyterm{raster graphic}.
%% This means that the image is represented by a rectangular grid of pixels
%% with a corresponding color for each pixel. This is natural for rendered
%% images and very efficient for images from large data sets. However,
%% elements like text and other labels often become disfigured, especially if
%% the image is resized. These elements are better represented as
%% \keyterm{vector graphics}, which use geometrical primitives to draw the
%% shapes. This geometry allows these elements to remain smooth after image
%% transformations and tend to look much nicer when used in paper
%% publications.

%% Images with vector graphics are created using the \keyterm{export scene}
%% function, which is similar but separate to the save screenshot function.

%% \begin{exercise}{Export Scene}
%%   \label{ex:ExportScene}
%%   \begin{enumerate}
%%   \item If you do not already have it loaded from the previous exercise,
%%     open the file \gui{can.ex2}, load all variables, and \apply (see
%%     Exercise~\ref{ex:LoadingTemporalData}).
%%   \item Press the~\yPlus button to orient the camera to the mesh.
%%   \item Color by \gui{GlobalNodeId}.  We use \gui{GlobalNodeId} so that the
%%     3D object has some color.
%%   %% \item Select the \gui{Rescale to color range}~\icon{pqResetRange}
%%   %%   button.
%%   \item Turn on the \gui{Axes Grid} around the can. (The checkbox is in the
%%     properties panel under the display options. You can type \gui{axes} in
%%     the search box to quickly find it.) This will add some vector graphics
%%     to the scene.
%%   \item Select \gui{File} \ra \gui{Export Scene}.
%%     \savecounter
%%   \end{enumerate}

%%   This brings us to the file selection screen. If you pull down the menu
%%   \gui{Files of type:} at the bottom of the dialog box, you will see
%%   several file types supported including
%%   \index{portable~document~format}\index{PDF}portable document format
%%   (PDF), \index{postscript}\index{PS}postscript (PS),
%%   \index{encapsulated~postscript}\index{EPS}encapsulated postscript (EPS),
%%   and \index{scalable~vector~graphics}\index{SVG}scalable vector graphics
%%   (SVG).

%%   \begin{enumerate}
%%     \restorecounter
%%   \item Select PDF as the file format (unless you have a convenient reader
%%     for a different format) and enter a \gui{File name} for your file. Then
%%     press \gui{OK}.
%%     \savecounter
%%   \end{enumerate}

%%   One final dialog box is presented to allow you to set options on how the
%%   data is saved in the particular format. The default values are usually
%%   sufficient. Although it may be tempting to turn off the option to
%%   rasterize the 3D geometry (thereby vectorizing everything in the image),
%%   we usually discourage using this option. The vector graphics for 3D
%%   geometry tend to have non-portable elements, and large geometry can cause
%%   lots of problems.

%%   \begin{enumerate}
%%     \restorecounter
%%   \item Press the \gui{Save} button.
%%   \end{enumerate}

%%   Open the saved file in your favorite PDF viewer. Zoom in on the cube axes
%%   labels and the color legend. Note that the lines and text remain crisp
%%   and readable no matter how far you zoom in.
%% \end{exercise}

%% The export scene feature is particularly useful for saving charts like
%% those described in Section~\ref{sec:Plotting}.

%% \index{export scene|)}
%% \index{save screenshot|)}
%% \index{screenshot|)}

\index{save animation|(}
\index{animation save|(}
\index{movie|(}

Next, we will save an animation.

\begin{exercise}{Save Animation}
  \label{ex:SaveAnimation}%
  \begin{enumerate}
  \item If you do not already have it loaded from the previous exercise,
    open the file \gui{can.ex2}, load all variables, and \apply (see
    Exercise~\ref{ex:LoadingTemporalData}).

  \item Select \gui{File} \ra \gui{Save Animation}~\icon{pqSaveAnimation}.

  %% \begin{inlinefig}
  %%   \includegraphics[width=0.8\scw]{images/SaveAnimation1}
  %% \end{inlinefig}

  \savecounter
  \end{enumerate}


  This brings us to the file selection screen.  If you pull down the menu
  \gui{Files of type:} at the bottom of the dialog box, you will see the
  several file types including \index{Ogg/Theora}Ogg/Theora,
  \index{AVI}AVI, \index{JPEG}JPEG, and
  \index{portable~network~graphics}\index{PNG}PNG.

  Select a \gui{File name} for your file, and place it somewhere you can
  later find and delete.  \gui{AVI} will create a movie format that
  can be used on windows, and with some open source viewers.
  \index{Ogg/Theora}Ogg/Theora is used in many open source viewers.  Otherwise,
  you can create a \keyterm{flipbook}, or series of images.  These images
  can be stitched together to form a movie using numerous open source
  tools.  For now, try creating an AVI.

  \begin{enumerate}
    \restorecounter
  \item Press the \gui{OK} button.
    \savecounter
  \end{enumerate}

  The \gui{Save Animation Options} dialog box looks essentially the same as the \gui{Save Screenshot Options} dialog for screenshots.
  If you look at the advanced options \icon{pqAdvanced}, you may note that there are some added \gui{Animation Options} that allow you to control the frame rate and narrow the time steps that will be animated.

  \begin{enumerate}
    \restorecounter
  \item Press the \gui{OK} button.
    \savecounter
  \end{enumerate}

  Using your favorite movie viewer, find and load the image you created.
\end{exercise}

\index{save animation|)}
\index{animation save|)}
\index{movie|)}


\section{Selection}
\label{sec:Selection}

The goal of visualization is often to find the important details within a
large body of information. ParaView's selection abstraction is an
important simplification of this process. Selection is the act of
identifying a subset of some dataset. There are a variety of ways that
this selection can be made, most of which are intuitive to end users,
and a variety of ways to display and process the specific qualities of
the subset once it is identified.

More specifically the subset identifies particular select points, cells, or
blocks within any single data set.  There are multiple ways of
specifying which elements to include in the selection including Id
lists of multiple varieties, spatial locations, and scalar values and
scalar ranges.

In ParaView, selection can take place at any time, and the program
maintains a current selected set that is linked between all views.
That is, if you select something in one view, that selection is also
shown in all other views that display the same object.

The most direct means to create a selection is via the \gui{Find
Data}~\findData dialog. Launch this dialog from the toolbar or the
\gui{Edit} menu.  From this dialog you can enter characteristics of the
data that you are seraching for.  For example, you could look for points
whose velocity magnitude is near terminal velocity.  Or you could look for
cells whose strain exceeds the failure of the material.  The following
exercise provides a quick example of using the \gui{Find Data}~\findData
dialog box.

\begin{exercise}{Performing Query-Based Selections}
  \label{ex:PerformingQueryBasedSelections}%
  In this exercise we will find all cells with a large equivalent plastic
  strain (EQPS).

  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \resetsession from the toolbar.

  \begin{enumerate}
  \item Open the file \gui{can.ex2}, load all variables, \apply (see
    Exercise~\ref{ex:LoadingTemporalData}).
  \item Go to the last time step~\vcrLast.
  \item Open the find data dialog~\findData.
  \item From the top combo box, choose to find \gui{Cell}s.
  \item In the third row of widgets, choose \gui{EQPS} from the first combo
    box, \gui{is~$>=$} from the second combo box, and enter \gui{1.5} in the
    final text box.
  \item Click the \gui{Find Data} button.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/FindData}
  \end{inlinefig}

  Observe the spreadsheet below the \gui{Find Data} button that
  gets populated with the results of your query.  Each row represents a
  cell and each column represents a field value or property (such as an
  identifier).

  You may also notice that several cells are highlighted in the 3D view of
  the main ParaView window.  These highlights represent the selection that
  your query created.  Close the \gui{Find Data} dialog and note that the
  selection remains.
\end{exercise}

Another way of creating a selection is to pick elements right
inside the 3D view.  Most of the 3D view selections are performed with a
\keyterm{rubber-band selection}.  That is, by clicking and dragging the
mouse in the 3D view, you will create a boxed region that will select
elements underneath it.  There are also some 3D view selections that allow
you to select within a polygonal region drawn on the screen.  There are
several types of interactive selections that can be performed, and you
initiate one by selecting one of the icons in the small toolbar over the 3D
view or using one of the shortcut keys.  The following 3D selections are
possible.

\begin{description}
\item[\selectCellsOn Select Cells On (Surface)] Selects cells that are
  visible in the view under a rubber band. (Shortcut: s)
\item[\selectPointsOn Select Points On (Surface)] Selects points that are
  visible in the view under a rubber band. (Shortcut: d)
\item[\selectCellsThrough Select Cells Through (Frustum)] Selects all cells
  that exist under a rubber band. (Shortcut: f)
\item[\selectPointsThrough Select Points Through (Frustum)] Selects all
  points that exist under a rubber band. (Shortcut: g)
\item[\selectCellsPolygon Select Cells With Polygon] Like \gui{Select Cells
  On} except that you draw a polygon by dragging the mouse rather than
  making a rubber-band selection.
\item[\selectPointsPolygon Select Points With Polygon] Like \gui{Select
  Points On} except that you draw a polygon by dragging the mouse rather
  than making a rubber-band selection.
\item[\selectBlocks Select Blocks] Selects blocks in a
  multiblock data set.  (Shortcut: b)
\item[\selectCellsInteractive Interactively Select Cells] Enter an
  interactive selection mode where cells are highlighted as the mouse
  hovers over them and selected when clicked.
\item[\selectPointsInteractive Interactively Select Points] Enter an
  interactive selection mode where points are highlighted as the mouse
  hovers near them and selected when clicked.
\end{description}

In addition to these selection modes, there are a hover point \hoverPoint query mode and a hover cell \hoverCell query mode that allow you to quickly inspect the field values at a visible point by hovering the mouse over it.
There is also a clear selection button that will remove the current selection.

Several of the selection modes have shortcut keys that allow you to make
selections more quickly. Use them by placing the mouse cursor somewhere in
the currently selected 3D view and hitting the appropriate key. Then click
on the cell or block you want selected (or drag a rubber band over multiple
elements).

Feel free to experiment with the selections now.

You can manage your selection with the \gui{Find Data}~\findData dialog
even if the selection was created with one of these 3D interactions rather
than directly with a find data query. The find data dialog allows you to
view all the points and cells in the selection as well as perform simple
operations on the selection. These include inverting the selection (a
checkbox just over the spreadsheet), adding labels
(Exercise~\ref{ex:LabelingSelections}), freezing selections
(Exercise~\ref{ex:DataElementSelectionsVsSpatialSelections}), and shortcuts
for the \gui{Plot Selection Over Time}~\plotSelectionOverTime and
\gui{Extract Selection}~\extractSelection filters (Exercises
\ref{ex:PlotOverTime} and \ref{ex:ExtractingASelection}, respectively).

Experiment with selections in \gui{Find Data}~\findData a bit.  Open the
\gui{Find Data}~\findData dialog box.  Then make selections using the
rubber-band selection and see the results in the \gui{Find Data} dialog
box.  Also experiment with altering the selection by inverting selections
with the \gui{Invert selection} checkbox.

It should be noted that selections can be internally represented in
different ways. Some are recorded as a list of data element ids. Others are
specified as a region in space or by query parameters. Although the
selections all look the same, they can behave differently, especially with
respect to changes in time. The following exercise demonstrates how these
different selection mechanisms can behave differently.

\begin{exercise}{Data Element Selections vs. Spatial Selections}
  \label{ex:DataElementSelectionsVsSpatialSelections}%
  \begin{enumerate}
  \item If you do not already have it loaded from the previous exercise,
    open the file \gui{can.ex2}, load all variables, \apply (see
    Exercise~\ref{ex:LoadingTemporalData}).
  \item Make a selection using the \gui{Select Cells
    Through}~\selectCellsThrough tool.
  \item If it is not already visible, show the \gui{Find Data}~\findData
    dialog box.
  \item Click on the \gui{Show Frustum}~\selectCellsThrough checkbox in the
    \gui{Find Data} dialog and rotate the 3D view. (Yes, the \gui{Show
      Frustum} button has the same icon as the \gui{Select Cells Through}
    button.)

    \begin{inlinefig}
      \includegraphics[width=\scw]{images/SelectionFrustum}
    \end{inlinefig}

  \item Play~\vcrPlay the animation a bit.  Notice that the region remains
    fixed and the selection changes based on what cells move in or out of
    the region.
  \item Go to a timestep where some data are selected. In the \gui{Find
    Data} dialog box, click the \gui{Freeze Selection} button.
  \item Play~\vcrPlay again.  Notice that the cells selected are fixed
    regardless of position.
  \end{enumerate}

  In summary, a spatial selection (created with one of the select through
  tools) will re-perform the selection at each time step as elements move
  in and out of the selected region.  Likewise, other queries such as field
  range queries will also re-execute as the data changes. However, when you
  select the \gui{Freeze Selection} button, ParaView captures the
  identifiers of the currently selected elements so that they will remain
  the same throughout the animation.
\end{exercise}

% The spreadsheet view seems very unimportant for selections now that there
% is a mini-spreadsheet in the find data dialog. Thus, suppress this
% exercise and make sure the others do not depend on the spreadsheet.

%% The \keyterm{spreadsheet view} is an important tool to use for quantitative
%% drill down. The spreadsheet view allows you to read the actual values of
%% scalar fields throughout the data and the selection mechanism will help you
%% identify the values of interest.

%% \begin{exercise}{The Spreadsheet View and Selection}
%%   \label{ex:TheSpreadsheetViewAndSelection}%
%%   \begin{enumerate}
%%   \item If you do not already have it loaded from the previous exercise,
%%     open the file \gui{can.ex2}, load all variables, \apply (see
%%     Exercise~\ref{ex:LoadingTemporalData}).
%%   \item Split the view vertically~\splitViewV.
%%   \item In the new view, click the \gui{Spreadsheet View} button.
%%   \item Make \gui{can.ex2} visible (by clicking the appropriate \eyeballclosed)
%%     if not already visible.
%%     \savecounter
%%   \end{enumerate}

%%   As you can see, the spreadsheet view is fairly simple.  It shows the
%%   field data in tabular form for one field type (e.g. point or cell data)
%%   of one block of one data set.  This constraint is enforced to ensure that
%%   every row has the same column data.

%%   You can sort the rows of the spreadsheet by clicking on a variable 
%%   name at the top of each column.  The spreadsheet will sort the 
%%   spreadsheet even if the data is spread across multiple remote ParaView 
%%   servers.
 
%%   Note the widgets at the top of the spreadsheet view.  These let you
%%   quickly select the pipeline object, choose the type of field to show,
%%   choose the precision shown for floating point numbers, and hide
%%   everything but the selection.  As with any view, the spreadsheet view has
%%   its own \gui{Display} panels.

%%   \begin{inlinefig}
%%     \includegraphics[scale=\bbscale]{images/SpreadsheetViewLabeled}
%%   \end{inlinefig}

%%   \begin{enumerate}
%%     \restorecounter
%%   \item In the \gui{Attribute} combo box, select \gui{Cell Data}.
%%   \item Scroll around the spreadsheet view and find some highlighted rows.
%%     (You may have to select a different block in the \gui{Display} panel.)
%%     \savecounter
%%   \end{enumerate}

%%   \begin{inlinefig}
%%     \includegraphics[width=\scw]{images/SpreadsheetViewExample}
%%   \end{inlinefig}

%%   Those highlighted rows are the ones that are part of the current
%%   selection.  This coordination of selection between views is an important
%%   mechanism to link views.  In this example, it can be difficult to identify
%%   the selected items in the spreadsheet view.  Often, you just want to see
%%   the data in the selection.

%%   \begin{enumerate}
%%     \restorecounter
%%   \item Click on the \gui{Show only selected elements}~\icon{pqSelect}
%%     button at the top of the spreadsheet view.
%%     \savecounter
%%   \end{enumerate}

%%   We have now seen a selection made in the 3D view show up in the
%%   spreadsheet view.  The linking works in reverse as well.  We can make
%%   selections in the spreadsheet and they will be displayed in the 3D view.

%%   \begin{enumerate}
%%   \item Uncheck \gui{Show only selected elements}.
%%   \item Select a few rows in the spreadsheet view.
%%   \item Find the resulting selection in the 3D view.
%%   \end{enumerate}
%% \end{exercise}

%% The spreadsheet provides the most readable way to inspect field data.
%% However, sometimes it is helpful to place the field data directly in the 3D
%% view.  The next exercise describes how we can do that.

\index{labels|(}

The spreadsheet in the find dialog provides a readable way to inspect field
data. However, sometimes it is helpful to place the field data directly in
the 3D view. The next exercise describes how we can do that.

\begin{exercise}{Labeling Selections}
  \label{ex:LabelingSelections}%
  \begin{enumerate}
  \item If you do not already have it loaded from the previous exercise,
    open the file \gui{can.ex2}, load all variables, \apply (see
    Exercise~\ref{ex:LoadingTemporalData}).
  \item Go to the last time step~\vcrLast.
  \item If it is not already visible, show the \gui{Find Data}~\findData
    dialog box.
  \item Using the controls at the top of the find data dialog box, create a
    selection where cells' \gui{ids} \gui{is min}. Click \gui{Find Data}.
  \item In the \gui{Cell Labels} chooser, select \gui{EQPS}.
    \savecounter
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/SelectionLabels}
  \end{inlinefig}

  ParaView places the values for the \gui{EQPS} field near the selected
  cell that contains that value. You should be able to see it in the 3D
  view. It is also possible to change the look of the font with respect to
  type, size, and color by clicking the \icon{pqAdvanced} button to the
  right of the label choosers.

  \begin{enumerate}
    \restorecounter
  \item
    When you are done, turn off the labels by unchecking the entry in the \gui{Cell Labels} chooser.
  \end{enumerate}
\end{exercise}

\index{labels|)}

ParaView provides the ability to plot field data over time.
These plots can work on a selection, and to make this easier the \gui{Find Data}~\findData dialog box contains convenience controls to create them.

\begin{exercise}{Plot Over Time}
  \label{ex:PlotOverTime}
  \begin{enumerate}
  \item If you do not already have it loaded from the previous exercise,
    open the file \gui{can.ex2}, load all variables, \apply (see
    Exercise~\ref{ex:LoadingTemporalData}).
  \item If it is not already visible, show the \gui{Find Data}~\findData
    dialog box.
  \item Using the controls at the top of the find data dialog box, create a
    selection where \gui{EQPS} \gui{is max}. Click \gui{Find Data}.
  \item Click the \gui{Plot Selection Over Time} button at the bottom of
    the find data dialog box to add that filter. This filter is also easily
    accessible by the \plotSelectionOverTime toolbar button in the main
    ParaView window.
  \item In the properties panel in the main ParaView window, click \apply.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/PlotSelectionOverTime}
  \end{inlinefig}

  Note that the selection you had was automatically added as the selection
  to use in the \gui{Properties} panel when the \gui{Plot Selection Over
    Time}~\plotSelectionOverTime filter was created.  If you want to change
  the selection, simply make a new one and click \gui{Copy Active
    Selection} in the \gui{Properties} panel.

  Also note that the plot was for the maximum EQPS value at each timestep,
  which could potentially be from a different cell at every timestep. If
  the desire is to identify a cell with a maximum value at some timestep
  and then plot that cell's value at every timestep, then use the
  \gui{Freeze Selection} feature demonstrated in
  Exercise~\ref{ex:DataElementSelectionsVsSpatialSelections}.
\end{exercise}

You can also extract a selection in order to view the selected points or
cells separately or perform some independent processing on them.  This is
done through the \gui{Extract Selection}~\extractSelection filter.

\begin{exercise}{Extracting a Selection}
  \label{ex:ExtractingASelection}%
  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \resetsession from the toolbar.

  \begin{enumerate}
  \item Open the file \gui{can.ex2}, load all variables, \apply (see
    Exercise~\ref{ex:LoadingTemporalData}).
  \item Make a sizable cell selection for example, with Select Cells
    Through~\selectCellsThrough.
  \item Create an \gui{Extract Selection}~\extractSelection filter
    (available on the toolbar and from the find data dialog box).
  \item \apply.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=\scw]{images/ExtractSelection}
  \end{inlinefig}

  The object in the view is replaced with the cells that you just
  selected. (Note that in this image I added a translucent surface and a
  second view with the original selection to show the extracted cells in
  relation to the full data.) You can perform computations on the extracted
  cells by simply adding filters to the extract selection pipeline object.
\end{exercise}


\section{Animations}
\label{sec:Animations}

We have already seen how to animate a data set with time in it
(hit~\vcrPlay) and other ways to manipulate temporal data in
Section~\ref{sec:Time}.  However, ParaView's animation capabilities go far
beyond that.  With ParaView you can animate nearly any property of any
pipeline object.

\begin{exercise}{Animating Properties}
  \label{ex:AnimatingProperties}%
  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \resetsession from the toolbar.

  \begin{enumerate}
  \item
    Use the quick launch (ctrl+space Win/Linux, alt+space Mac) to create the \gui{Sphere} source and \apply it.
  \item
    If the animation view is not visible, make it so: \gui{View} \ra \gui{Animation View}.
  \item Change the \gui{No. Frames} option to 50 (10 will go far too quickly).
  \item Find the property selection widgets at the bottom of the animation
    view and select \gui{Sphere1} in the first box and \gui{Start Theta} in
    the second box.
    \begin{inlinefig}
      \includegraphics[height=1.5\baselineskip]{images/AddStartThetaTrack}
    \end{inlinefig}
    Hit the \icon{Plus} button.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=.9\linewidth]{images/BuildAnimation1}
  \end{inlinefig}

  If you play~\vcrPlay the animation, you will see the sphere open up then
  eventually wrap around itself and disappear.

  \begin{inlinefig}
    \includegraphics[width=.2\linewidth]{images/AnimateSphere0}
    \includegraphics[width=.2\linewidth]{images/AnimateSphere1}
    \includegraphics[width=.2\linewidth]{images/AnimateSphere2}
    \includegraphics[width=.2\linewidth]{images/AnimateSphere3}
  \end{inlinefig}
\end{exercise}

What you have done is created a \keyterm{track} for the \gui{Start Theta}
property of the \gui{Sphere1} object.  A track is represented as horizontal
bars in the animation view.  They hold \keyterm{key frames} that specify
values for the property at a specific time instance.  The value for the
property is interpolated between the key frames.  When you created a track
two key frames were created automatically: a key frame at the start time
with the minimal value and a key frame at the end time with the maximal
value.  The property you set here defines the start range of the sphere.

You can modify a track by double clicking on it.  That will bring up a
dialog box that you can use to add, delete, and modify key frames.

\begin{inlinefig}
  \includegraphics[width=\scw]{images/AnimationKeyframesDialog}
\end{inlinefig}

We use this feature to create a new key frame in the animation in the next
exercise.

\begin{exercise}{Modifying Animation Track Keyframes}
  \label{ex:ModifyingAnimationTrackKeyframes}%
  This exercise is a continuation of Exercise~\ref{ex:AnimatingProperties}.
  You will need to finish that exercise before beginning this one.

  \begin{enumerate}
  \item Double-click on the \gui{Sphere1 -- Start Theta} track.
  \item In the \gui{Animation Keyframes} dialog, click the \gui{New}
    button.  This will create a new key frame.
  \item Modify the first key frame value to be 360.
  \item Modify the second key frame time to be 0.5 and value to be 0.
  \item Click \gui{OK}.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=.9\linewidth]{images/BuildAnimation2}
  \end{inlinefig}

  When you play the animation, the sphere will first get bigger and then get
  smaller again.
\end{exercise}

You are not limited to animating just one property.  You can animate any
number of properties you wish.  Now we will create an animation that
depends on modifying two properties.

\begin{exercise}{Multiple Animation Tracks}
  \label{ex:MultipleAnimationTracks}%
  This exercise is a continuation of Exercises \ref{ex:AnimatingProperties}
  and \ref{ex:ModifyingAnimationTrackKeyframes}.  You will need to finish
  those exercises before beginning this one.

  \begin{enumerate}
  \item Double-click on the \gui{Sphere1 -- Start Theta} track.
  \item In the \gui{Animation Keyframes} dialog, \gui{Delete} the first
    track (at time step 0).
  \item Click \gui{OK}.
  \item In the animation view, create a track for the \gui{Sphere1} object,
    \gui{End Theta} property.
  \item Double-click on the \gui{Sphere1 -- End Theta} track.
  \item Change the time for the second key frame to be 0.5.
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=.9\linewidth]{images/BuildAnimation3}
  \end{inlinefig}

  The animation will show the sphere creating and destroying itself, but this
  time the range front rotates in the same direction.  It makes for a very
  satisfying animation when you loop~\vcrLoop the animation.
\end{exercise}

In addition to animating properties for pipeline objects, you can animate
the camera.  ParaView provides methods for animating the camera along
curves that you specify.  The most common animation is to rotate the camera
around an object, always facing the object, and ParaView provides a means
to automatically generate such an animation.

\begin{exercise}{Camera Orbit Animations}
  \label{ex:CameraOrbitAnimations}%
  For this exercise, we will orbit the camera around whatever data you have
  loaded.  If you are continuing from the previous exercise, you are set
  up.  If not, simply load or create some data.  To see the effects, it is
  best to have asymmetry in the geometry you load.  \gui{can.ex2} is a good
  data set to load for this exercise.

  \begin{enumerate}
  \item Place the camera where you want the orbit to start.  The camera
    will move to the right around the viewpoint.
  \item Make sure the animation view panel is visible (\gui{View} \ra
    \gui{Animation View} if it is not).
  \item In the property selection widgets, select \gui{Camera} in the first
    box and \gui{Orbit} in the second box.
    \begin{inlinefig}
      \includegraphics[height=1.5\baselineskip]{images/AddCameraOrbit}
    \end{inlinefig}
    Hit the \icon{Plus} button.
    \savecounter
  \end{enumerate}

  \begin{inlinefig}
    \includegraphics[width=.66\scw]{images/CreateOrbitDialog}
  \end{inlinefig}

  Before the new track is created, you will be presented with a dialog box
  that specifies the parameters of the orbit.  The default values come from
  the current camera position, which is usually what you want.

  \begin{enumerate}
    \restorecounter
  \item Click \gui{OK}.
  \item Play~\vcrPlay.
  \end{enumerate}

  The camera will now animate around the object.
\end{exercise}

Another common camera annotation is to follow an object as it moves
through space. Imagine a simulation of a traveling bullet or vehicle. If we
hold the camera steady, then the object will quickly move out of view. To
help with this situation, ParaView provides a special track that allows the
camera to follow the data in the scene.

\begin{exercise}{Following Data in an Animation}%
  \label{ex:FollowingDataInAnAnimation}%
  We are going to start a fresh visualization, so if you have been following along with the exercises so far, now is a good time to reset ParaView.
  The easiest way to do this is to select \resetsession from the toolbar.

  \begin{enumerate}
  \item Open the file \gui{can.ex2}, load all variables, \apply (see
    Exercise~\ref{ex:LoadingTemporalData}).
  \item Press the~\yPlus button to orient the camera to the mesh.
  \item Make sure the animation view panel is visible (\gui{View} \ra
    \gui{Animation View} if it is not).
  \item In the property selection widgets, select \gui{Camera} in the first
    box and \gui{Follow Data} in the second box.
    \begin{inlinefig}
      \includegraphics[height=1.5\baselineskip]{images/AddCameraFollowData}
    \end{inlinefig}
    Hit the \icon{Plus} button.
  \item Play~\vcrPlay.
  \end{enumerate}

  Note that instead of the can crushing to the bottom of the view, the
  animation shows the can lifted up to be continually centered in the
  image. This is because the camera is following the can down as it is
  crushed.
\end{exercise}

% Chapter Basic Usage
