1 |
\chapter{The module \pyvisi} |
\chapter{The module \pyvisi} |
2 |
\label{PYVISI CHAP} |
\label{PYVISI CHAP} |
3 |
|
\declaremodule{extension}{esys.pyvisi} |
4 |
|
\modulesynopsis{Python Visualization Interface} |
5 |
|
|
6 |
\section{Introduction} |
\section{Introduction} |
7 |
|
\pyvisi is a Python module that is used to generate 2D and 3D visualization |
8 |
\pyvisi provides an easy to use interface to the \VTK visualization |
for escript and its PDE solvers: finley and bruce. This module provides |
9 |
tool. |
an easy to use interface to the \VTK library (\VTKUrl). |
10 |
|
|
11 |
\section{Rendering} |
The general rule of thumb when using \pyvisi is to perform the following |
12 |
same word on rendering, off-line, on-line, how to rotate, zoom, close the window, ... |
in sequence: |
13 |
|
|
14 |
\section{How to Make a Movie} |
\begin{enumerate} |
15 |
|
\item Create a scene instance, in which objects are to be rendered on. |
16 |
|
\item Create an input instance, which deals with the source of data for |
17 |
|
the visualization. |
18 |
|
\item Create a data visualization instance (i.e. Map, Velocity, Ellipsoid, |
19 |
|
etc), which extracts and manipulates the data accordingly. |
20 |
|
\item Create a camera instance, which controls the lighting |
21 |
|
source and view angle. |
22 |
|
\item Finally, render the object. |
23 |
|
\end{enumerate} |
24 |
|
\begin{center} |
25 |
|
\begin{math} |
26 |
|
scene \rightarrow input \rightarrow visualization \rightarrow |
27 |
|
camera \rightarrow render |
28 |
|
\end{math} |
29 |
|
\end{center} |
30 |
|
|
31 |
|
The sequence in which instances are created is very important due to |
32 |
|
to the dependencies among them. For example, an input instance must |
33 |
|
always be created BEFORE a data visualisation instance is created. |
34 |
|
If the sequence is switched, the program will throw an error because a |
35 |
|
source data needs to be specified before the data can be |
36 |
|
manipulated. Similarly, a camera instance must always be created |
37 |
|
AFTER an input instance has been created. Otherwise, the program will throw |
38 |
|
an error because the camera instance needs to calculate its |
39 |
|
default position (automatically carried out in the background) based on |
40 |
|
the source data. |
41 |
|
|
42 |
\section{\pyvisi Classes} |
\section{\pyvisi Classes} |
43 |
\declaremodule{extension}{esys.pyvisi} |
This section gives a brief overview of the important classes and their |
44 |
\modulesynopsis{A simple Python visualization interface for \VTK} |
corresponding methods. Please refer to \ReferenceGuide for full details. |
|
|
|
|
In this section we give a brief overview over the important classes and their methods. Please |
|
|
check the \ReferenceGuide on details. |
|
45 |
%===================================================================================== |
%===================================================================================== |
46 |
\subsection{Scene Classes} |
\subsection{Scene Classes} |
47 |
\begin{classdesc}{Scene}{} |
\begin{classdesc}{Scene}{renderer = Renderer.ONLINE, num_viewport = 1, |
48 |
|
x_size = 1152, y_size = 864} |
49 |
Displays a scene in which objects are to be rendered on. |
Displays a scene in which objects are to be rendered on. |
50 |
\end{classdesc} |
\end{classdesc} |
51 |
|
|
184 |
\begin{classdesc}{RedToBlue}{} |
\begin{classdesc}{RedToBlue}{} |
185 |
Defines a map spectrum from red to blue. |
Defines a map spectrum from red to blue. |
186 |
\end{classdesc} |
\end{classdesc} |
187 |
|
%=========================================== |
188 |
|
|
189 |
|
\section{Rendering} |
190 |
|
same word on rendering, off-line, on-line, how to rotate, zoom, close the window, ... |
191 |
|
|
192 |
|
%============================================== |
193 |
|
\section{How to Make a Movie} |