/[escript]/trunk/doc/user/pyvisi.tex
ViewVC logotype

Diff of /trunk/doc/user/pyvisi.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 885 by jongui, Fri Oct 27 08:15:33 2006 UTC revision 886 by jongui, Thu Nov 2 01:34:58 2006 UTC
# Line 5  Line 5 
5  \modulesynopsis{Python visualization interface}  \modulesynopsis{Python visualization interface}
6    
7  \pyvisi provides an easy to use interface to the \VTK visualization  \pyvisi provides an easy to use interface to the \VTK visualization
8  tool. The module provides the following features:  tool. \pyvisi provides the following modules:
9    
10  \begin{itemize}  \begin{itemize}
11  \item \Scene: Shows a scene in which components are to be displayed.  \item \Scene: Shows a scene in which components are to be displayed.
12    \item \Image: Shows an image.
13    \item \Text: Shows some 2D text.
14  \item \DataCollector: Deals with data for visualization.  \item \DataCollector: Deals with data for visualization.
15  \item \Camera: Controls the camera manipulation.  \item \Camera: Controls the camera manipulation.
16    \item \Light: Controls the light manipulation.
17  \item \Map: Shows a scalar field by color on the domain surface.  \item \Map: Shows a scalar field by color on the domain surface.
18  \item \MapOnPlane: Shows a scalar field by color on a given plane.  \item \MapOnPlane: Shows a scalar field by color on a given plane.
19  \item \MapOnClip: Shows a scalar field by color on a given clip.  \item \MapOnClip: Shows a scalar field by color on a given clip.
20    \item \MapOnScalarClip: Shows a scalar field by color on a give scalar clip.
21  \item \Arrows: Shows a vector field by arrows.  \item \Arrows: Shows a vector field by arrows.
22  \item \ArrowsOnPlane: Shows a vector field by arrows on a given plane.  \item \ArrowsOnPlane: Shows a vector field by arrows on a given plane.
23  \item \ArrowsOnClip: Shows a vector field by arrows on a given clip.  \item \ArrowsOnClip: Shows a vector field by arrows on a given clip.
# Line 35  a given plane. Line 39  a given plane.
39  \item \StreamLines: Shows the path of particles in a vector field.  \item \StreamLines: Shows the path of particles in a vector field.
40  \item \Carpet: Shows a scalar field as plane deformated along  \item \Carpet: Shows a scalar field as plane deformated along
41  the plane normal.  the plane normal.
 \item \Image: Shows an image.  
 \item \Text: Shows some 2D text.  
42  \item \Position: Defines the x,y and z coordinates rendered object.  \item \Position: Defines the x,y and z coordinates rendered object.
43  \item \Transform: Defines the orientation of rendered object.  \item \Transform: Defines the orientation of rendered object.
44  \item \Style: Defines the style of text.  \item \Style: Defines the style of text.
45  \item \BlueToRed: Defines a map spectrum from blue to red.  \item \BlueToRed: Defines a map spectrum from blue to red.
46  \item \RedToBlue: Defines a map spectrum from red to blue.  \item \RedToBlue: Defines a map spectrum from red to blue.
47    \item \Plane: Defines the cutting/clipping of rendered objects.
48  \end{itemize}  \end{itemize}
49    
50  \section{\Scene class}  \section{\Scene class}
# Line 61  Render the object on-screen. Line 64  Render the object on-screen.
64  The following is a sample code using the \Scene class:  The following is a sample code using the \Scene class:
65  \verbatiminput{../examples/driverscene.py}  \verbatiminput{../examples/driverscene.py}
66    
67    \section{\Image class}
68    \begin{classdesc}{Image}{scene, format}
69    An \Image object shows an image.
70    \end{classdesc}
71    
72    The following is the method available:
73    \begin{methoddesc}[Image]{setFileName}{file_name}
74    Set the file name.
75    \end{methoddesc}
76    
77    The following is a sample code using the \Image class.
78    \fig{fig:image.1} shows the corresponding output.
79    \verbatiminput{../examples/driverimage.py}
80    
81    \begin{figure}[ht]
82    \begin{center}
83    \includegraphics[width=40mm]{figures/Image}
84    \end{center}
85    \caption{Image}
86    \label{fig:image.1}
87    \end{figure}
88    
89    \section{\Text class}
90    \begin{classdesc}{Text}{scene}
91    A \Text object shows 2D text.
92    \end{classdesc}
93    
94    The following are the methods available:
95    \begin{methoddesc}[Text]{setText}{text}
96    Set the text.
97    \end{methoddesc}
98    
99    \begin{methoddesc}[Text]{setPosition}{x_coor, y_coor}
100    Set the display position of the text.
101    \end{methoddesc}
102    
103    \begin{methoddesc}[Text]{setStyle}{style}
104    Set the style of the text.
105    \end{methoddesc}
106    
107    The following is a sample code using the \Text class.
108    \fig{fig:text.1} shows the corresponding output.
109    \verbatiminput{../examples/drivertext.py}
110    
111    \begin{figure}[ht]
112    \begin{center}
113    \includegraphics[width=40mm]{figures/Text}
114    \end{center}
115    \caption{2D text}
116    \label{fig:text.1}
117    \end{figure}
118    
119  \section{\DataCollector class}  \section{\DataCollector class}
120  \begin{classdesc}{DataCollector}{scene, outline = True, cube_axes = False}  \begin{classdesc}{DataCollector}{scene, outline = True, cube_axes = False}
121  A \DataCollector object deals with the data for visualization.  A \DataCollector object deals with the data for visualization.
# Line 145  The following is a sample code using the Line 200  The following is a sample code using the
200  \label{fig:camera.1}  \label{fig:camera.1}
201  \end{figure}  \end{figure}
202    
203    \section{\Light class}
204    \begin{classdesc}{Light}{scene, data_collector}
205    A \Light object controls the light's settings.
206    \end{classdesc}
207    
208    The following are the methods available:
209    \begin{methoddesc}[Light]{setColor}{color}
210    Set the color of the light.
211    \end{methoddesc}
212    
213    \begin{methoddesc}[Light]{setFocalPoint}{position}
214    Set the focal point of the light.
215    \end{methoddesc}
216    
217    \begin{methoddesc}[Light]{setPosition}{position}
218    Set the position of the light.
219    \end{methoddesc}
220    
221    \begin{methoddesc}[Light]{setIntensity}{intesity}
222    Set the intensity (brightness) of the light.
223    \end{methoddesc}
224    
225    The following is a sample code using the \Light class.
226    \fig{fig:light.1} shows the corresponding output.
227    \verbatiminput{../examples/driverlight.py}
228    
229    \begin{figure}[ht]
230    \begin{center}
231    \includegraphics[width=40mm]{figures/Light}
232    \end{center}
233    \caption{Light}
234    \label{fig:light.1}
235    \end{figure}
236    
237  \section{\Map class}  \section{\Map class}
238  \begin{classdesc}{Map}{scene, data_collector, lut = None}  \begin{classdesc}{Map}{scene, data_collector, lut = None}
239  A \Map object shows a scalar field by color on the domain surface.  A \Map object shows a scalar field by color on the domain surface.
# Line 196  The following is a sample code using the Line 285  The following is a sample code using the
285  \label{fig:maponclip.1}  \label{fig:maponclip.1}
286  \end{figure}  \end{figure}
287    
288    \section{\MapOnScalarClip class}
289    \begin{classdesc}{MapOnScalarClip}{scene, data_collector, lut = None}
290    A \MapOnScalarClip object show a scalar field by color on a given scalar clip.
291    \end{classdesc}
292    
293    The following is a sample code using the \MapOnScalarClip class.
294    \fig{fig:maponscalarclip.1} shows the corresponding output.
295    \verbatiminput{../examples/drivermaponscalarclip.py}
296    
297    \begin{figure}[ht]
298    \begin{center}
299    \includegraphics[width=40mm]{figures/MapOnScalarClip}
300    \end{center}
301    \caption{Surface map on a scalar clip}
302    \label{fig:maponscalarclip.1}
303    \end{figure}
304    
305  \section{\Arrows class}  \section{\Arrows class}
306  \begin{classdesc}{Arrows}{scene, data_collector, lut = None}  \begin{classdesc}{Arrows}{scene, data_collector, lut = None}
307  A \Arrows object shows a vector field by arrows.  A \Arrows object shows a vector field by arrows.
# Line 513  The following is a sample code using the Line 619  The following is a sample code using the
619  \section{\Carpet class}  \section{\Carpet class}
620  \begin{classdesc}{Carpet}{scene, data_collector, transform, lut = None,  \begin{classdesc}{Carpet}{scene, data_collector, transform, lut = None,
621  deform = None}  deform = None}
622  A \Carpet object shows a scalar field as a plane deformated along the plane  A \Carpet object shows a scalar/vector field as a plane deformated along
623  normal.  the plane normal.
624  \end{classdesc}  \end{classdesc}
625    
626  The following is the method available:  The following is the method available:
# Line 534  The following is a sample code using the Line 640  The following is a sample code using the
640  \label{fig:carpet.1}  \label{fig:carpet.1}
641  \end{figure}  \end{figure}
642    
 \section{\Image class}  
 \begin{classdesc}{Image}{scene, format}  
 An \Image object shows an image.  
 \end{classdesc}  
   
 The following is the method available:  
 \begin{methoddesc}[Image]{setFileName}{file_name}  
 Set the file name.  
 \end{methoddesc}  
   
 The following is a sample code using the \Image class.  
 \fig{fig:image.1} shows the corresponding output.  
 \verbatiminput{../examples/driverimage.py}  
   
 \begin{figure}[ht]  
 \begin{center}  
 \includegraphics[width=40mm]{figures/Image}  
 \end{center}  
 \caption{Image}  
 \label{fig:image.1}  
 \end{figure}  
   
 \section{\Text class}  
 \begin{classdesc}{Text}{scene}  
 A \Text object shows 2D text.  
 \end{classdesc}  
   
 The following are the methods available:  
 \begin{methoddesc}[Text]{setText}{text}  
 Set the text.  
 \end{methoddesc}  
   
 \begin{methoddesc}[Text]{setPosition}{x_coor, y_coor}  
 Set the display position of the text.  
 \end{methoddesc}  
   
 \begin{methoddesc}[Text]{setStyle}{style}  
 Set the style of the text.  
 \end{methoddesc}  
   
 The following is a sample code using the \Text class.  
 \fig{fig:text.1} shows the corresponding output.  
 \verbatiminput{../examples/drivertext.py}  
   
 \begin{figure}[ht]  
 \begin{center}  
 \includegraphics[width=40mm]{figures/Text}  
 \end{center}  
 \caption{2D text}  
 \label{fig:text.1}  
 \end{figure}  
643    
644  \section{\Position class}  \section{\Position class}
645  \begin{classdesc}{Position}{x_coor, y_coor, z_coor}  \begin{classdesc}{Position}{x_coor, y_coor, z_coor}
# Line 661  A \BlueToRed object defines a map spectr Line 716  A \BlueToRed object defines a map spectr
716  A \RedToBlue object defines a map spectrum from red to blue.  A \RedToBlue object defines a map spectrum from red to blue.
717  \end{classdesc}  \end{classdesc}
718    
719    \section{\Plane class}
720    The following are the methods available:
721    \begin{methoddesc}[Plane]{setPlaneOrigin}{position}
722    Set the plane origin
723    \end{methoddesc}
724    
725    \begin{methoddesc}[Plane]{setPlaneNormal}{position}
726    Set the plane normal
727    \end{methoddesc}
728    
729    \begin{methoddesc}[Plane]{setValue}{clipping_value}
730    Set the clipping value
731    \end{methoddesc}
732    
733    \begin{methoddesc}[Plane]{setInsideOutOn}{}
734    Set the clipping to inside out
735    \end{methoddesc}
736    
737    \begin{methoddesc}[Plane]{setInsideOutOff}{}
738    Disable the inside out clipping
739    \end{methoddesc}
740    
741    \section{Additional Notes}
742    The following is a sample code rendering multiple planes.
743    \fig{fig:multipleplanes.1} shows the corresponding output.
744    \verbatiminput{../examples/drivermultipleplanes.py}
745    
746    \begin{figure}[ht]
747    \begin{center}
748    \includegraphics[width=60mm]{figures/MultiplePlanes}
749    \end{center}
750    \caption{Multiple planes}
751    \label{fig:multipleplanes.1}
752    \end{figure}
753    
754    The following is a sample code rendering multiple cuts.
755    \verbatiminput{../examples/drivermultiplecuts.py}
756    
757    
758    The following is a sample code rendering multiple reads from multiple files.
759    \verbatiminput{../examples/drivermultiplereads.py}
760    

Legend:
Removed from v.885  
changed lines
  Added in v.886

  ViewVC Help
Powered by ViewVC 1.1.26