/[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 606 by gross, Mon Mar 20 23:34:00 2006 UTC revision 1002 by jongui, Wed Feb 28 06:51:33 2007 UTC
# Line 1  Line 1 
1  \chapter{The module \pyvisi}  \chapter{The module \pyvisi}
2                                                                                                                                                                                                        \label{PYVISI CHAP}
3  \declaremodule{extension}{pyvisi}  \declaremodule{extension}{esys.pyvisi}
4  \modulesynopsis{visualization interface}  \modulesynopsis{Python Visualization Interface}
5    
6  The idea behind is to provide an easy to use interface and unified to a variety of  \section{Introduction}
7  visualization tools like \VTK, \OpenDX and \GnuPlot.  \pyvisi is a Python module that is used to generate 2D and 3D visualization
8    for escript and its PDE solvers: finley and bruce. This module provides
9  The following script illustartes the usage of \pyvisi together with the  an easy to use interface to the \VTK library (\VTKUrl).  
10  \VTK library:  
11  \begin{python}  The general rule of thumb when using \pyvisi is to perform the following
12  from esys.pyvisi import *                # base level visualisation stuff  in sequence:
13  from esys.pyvisi.renderers.vtk import *  # vtk renderer module  
14  from esys.escript import *  \begin{enumerate}
15  from esys.finley import Brick  \item Create a scene instance, in which objects are to be rendered on.
16  # now make some data of some kind  \item Create an input instance, which deals with the source of data for
17  domain = Brick(3,5,7)  # a Finley domain  the visualization.
18  vectorData = domain.getX()  # get vector data from the domain nodes  \item Create a data visualization instance (i.e. Map, Velocity, Ellipsoid,
19  # define the scene object  etc), which extracts and manipulates the data accordingly.
20  scene = Scene()  \item Create a camera instance, which controls the lighting
21  # create an ArrowPlot object  source and view angle.
22  plot = ArrowPlot(scene)  \item Finally, render the object.
23  # add the plot to the scene  \end{enumerate}
24  scene.add(plot)  \begin{center}
25  # assign some data to the plot  \begin{math}
26  plot.setData(vectorData)  scene \rightarrow input \rightarrow visualization \rightarrow
27  # render the scene  camera \rightarrow render
28  scene.render()  \end{math}
29  # saving a scene  \end{center}
30  scene.save(file="example.jpg", format="jpeg")  
31  \begin{python}  The sequence in which instances are created is very important due to
32  A \Scene is a container for all of the kinds of things you want to put into your plot,  to the dependencies among them. For example, an input instance must
33  for instance, images, domaines, arrow plots, contour plots, spheres etc.  always be created BEFORE a data visualisation instance is created.
34  The renderer is specified in the scene initialisation. In fact the  If the sequence is switched, the program will throw an error because a
35  \code{from esys.pyvisi.renderers.vtk import *} provides the specific implementation for  source data needs to be specified before the data can be
36  \VTK  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  \begin{verbose}  default position (automatically carried out in the background) based on
40  class ArrowPlot3D(Plot):  the source data.
41      """  
42      Arrow field plot in three dimensions  \section{\pyvisi Classes}
43      """  This section gives a brief overview of the important classes and their
44      def __init__(self, scene):  corresponding methods. Please refer to \ReferenceGuide for full details.
45          """  %=====================================================================================
46          Initialisation of the ArrowPlot3D class  \subsection{Scene Classes}
47            \begin{classdesc}{Scene}{renderer = Renderer.ONLINE, num_viewport = 1,
48          @param scene: The Scene to render the plot in  x_size = 1152, y_size = 864}
49          @type scene: Scene object  Displays a scene in which objects are to be rendered on.
50      def setData(self, *dataList, **options):  \end{classdesc}
51          """  
52          Set data to the plot  \begin{classdesc}{Camera}{}
53     Controls the camera manipulation.
54          @param dataList: List of data to set to the plot  \end{classdesc}
55          @type dataList: tuple  
56    \begin{classdesc}{Light}{}
57          @param options: Dictionary of extra options   Controls the light manipulation.
58          @type options: dict  \end{classdesc}
59    
60          @param fname: Filename of the input vtk file  %============================================================================================================
61          @type fname: string  \subsection{Input Classes}
62    
63          @param format: Format of the input vtk file ('vtk' or 'vtk-xml')  \begin{classdesc}{Image}{}
64          @type format: string   Displays an image.
65    \end{classdesc}
66      @param vectors: the name of the vector data in the vtk file to use  
67      @type vectors: string  \begin{classdesc}{Text}{}
68          """   Shows some 2D text.
69  class ArrowPlot(Plot):  \end{classdesc}
70      """  
71      Arrow field plot  \begin{classdesc}{DataCollector}{}
72      """  Deals with the source of data for visualization.
73      def __init__(self, scene):  \end{classdesc}
74          """  
75          Initialisation of the ArrowPlot class  %============================================================================================================
76            \subsection{Data Visualization}
77          @param scene: The Scene to render the plot in  \begin{classdesc}{Map}{}
78          @type scene: Scene object   Displays a scalar field using a domain surface.
79          """  \end{classdesc}
80      def setData(self, *dataList, **options):  
81          """  \begin{classdesc}{MapOnPlaneCut}{}
82          Set data to the plot   Displays a scalar field using a domain surface cut on a plane.
83    \end{classdesc}
84          @param dataList: List of data to set to the plot  
85          @type dataList: tuple  \begin{classdesc}{MapOnPlaneClip}{}
86     Displays a scalar field using a domain surface clipped
87      @param options: Dictionary of extra options          on a plane.
88      @type options: dict  \end{classdesc}
89    
90      @param fname: the name of the input vtk file  \begin{classdesc}{MapOnScalarClip}{}
91      @type fname: string   Displays a scalar field using a domain surface clipped
92            using a scalar value.
93      @param format: the format of the input vtk file ('vtk' or 'vtk-xml')  \end{classdesc}
94      @type format: string  
95    \begin{classdesc}{Velocity}{}
96      @param vectors: the name of the vector data in the vtk file to use   Displays a vector field using arrows.
97      @type vectors: string  \end{classdesc}
98          """  
99  class Axes(Plot):  \begin{classdesc}{VelocityOnPlaneCut}{}
100      """   Displays a vector field using arrows cut on a plane.
101      Axes class  \end{classdesc}
102      """  
103      def __init__(self):  \begin{classdesc}{VelocityOnPlaneClip}{}
104          """   Displays a vector field using arrows clipped on a
105          Initialisation of Axes object          plane.
106          """  \end{classdesc}
107          debugMsg("Called Axes.__init__()")  
108          Plot.__init__(self)  \begin{classdesc}{Ellipsoid}{}
109     Displays a tensor field using spheres.
110  class BallPlot(Plot):  \end{classdesc}
111      """  
112      Ball plot  \begin{classdesc}{EllipsoidOnPlaneCut}{}
113      """   Displays a tensor field using spheres cut on a
114      def __init__(self, scene):          plane.
115    \end{classdesc}
116      def setData(self, points=None,  
117              fname=None, format=None,  \begin{classdesc}{EllipsoidOnPlaneClip}{}
118              radii=None, colors=None, tags=None):   Displays a tensor field using spheres clipped
119          """          on a plane.
120          Set data to the plot  \end{classdesc}
121          @param points: the array to use for the points of the sphere  
122          locations in space          
123          @type points: float array  \begin{classdesc}{Contour}{}
124     Shows a scalar field by contour surfaces.
125          @param fname: the name of the input vtk file  \end{classdesc}
126          @type fname: string  
127    \begin{classdesc}{ContourOnPlane}{}
128          @param format: the format of the input vtk file ('vtk' or 'vtk-xml')   Shows a scalar field by contour surfaces on
129          @type format: string  a given plane.
130    \end{classdesc}
131          @param radii: the name of the scalar array in the vtk unstructured  
132          grid to use as the radii of the balls  \begin{classdesc}{ContourOnClip}{}
133          @type radii: float array   Shows a scalar field by contour surfaces on
134    a given clip.
135          @param colors: the name of the scalar array in the vtk unstructured  \end{classdesc}
136          grid to use as the colour tags of the balls  
137          @type colors: string  \begin{classdesc}{IsoSurface}{}
138     Shows a scalar field for a given value by
139          @param tags: the name of the scalar array in the vtk unstructured  an isosurface.
140          grid to use as the colour of the tags of the balls  \end{classdesc}
141          @type tags: integer array  
142          """  \begin{classdesc}{IsoSurfaceOnPlane}{}
143     Shows a scalar field for a given value by
144  class Box(Item):  an isosurfaceon a given plane.
145      """  \end{classdesc}
146      Generic class for Box objects  
147    \begin{classdesc}{IsoSurfaceOnClip}{}
148      To define a box one specify one of three groups of things:   Shows a scalar field for a given vlaue by
149        - The bounds of the box: xmin, xmax, ymin, ymax, zmin, zmax  an isosurface on a given clip.
150        - The dimensions and origin: width, height, depth and origin  \end{classdesc}
151        - The bottom left front and top right back corners: blf, trb  
152      """  \begin{classdesc}{StreamLines}{}
153     Shows the path of particles in a vector field.
154      def __init__(self):  \end{classdesc}
155          """  
156          Initialisation of the Box object  \begin{classdesc}{Carpet}{}
157          """   Shows a scalar field as plane deformated along
158          debugMsg("Called Box.__init__()")  the plane normal.
159          Item.__init__(self)  \end{classdesc}
160    
161          # define a box in many ways, either by its centre and width, height  \section{Geometry}
162          # and depth, or by its bounds, xmin, xmax, ymin, ymax, zmin, zmax,  \begin{classdesc}{Position}{}
163          # or by its bottom left front and top right back points.   Defines the x,y and z coordinates rendered object.
164    \end{classdesc}
165          # set the default bounds  
166          self.xmin = -0.5  \begin{classdesc}{Transform}{}
167          self.xmax = 0.5  Defines the orientation of rendered object.
168          self.ymin = -0.5  \end{classdesc}
169          self.ymax = 0.5  
170          self.zmin = -0.5  \begin{classdesc}{Plane}{}
171          self.zmax = 0.5  Defines the cutting/clipping of rendered objects.
172    \end{classdesc}
173          # set the default origin (the centre of the box)  
174          self.origin = ((self.xmin + self.xmax)/2.0,  
175                  (self.ymin + self.ymax)/2.0,  \subsection{Beautification}
176                  (self.zmin + self.zmax)/2.0)  \begin{classdesc}{Style}{}
177    Defines the style of text.
178          # set the default dimensions  \end{classdesc}
179          self.width = self.xmax - self.xmin  
180          self.height = self.ymax - self.ymin  \begin{classdesc}{BlueToRed}{}
181          self.depth = self.zmax - self.zmin   Defines a map spectrum from blue to red.
182    \end{classdesc}
183          # set the default blf and trb points  
184          self.blf = (self.xmin, self.ymin, self.zmin)  \begin{classdesc}{RedToBlue}{}
185          self.trb = (self.xmax, self.ymax, self.zmax)   Defines a map spectrum from red to blue.
186    \end{classdesc}
187          # tolerance for calculated variables checking purposes  %===========================================
         self.tolerance = 1e-8  
   
     def setBounds(self, xmin, xmax, ymin, ymax, zmin, zmax):  
         """  
         Set the bounds of the box  
         """  
     def getBounds(self):  
         """  
         Get the current bounds of the box  
         """  
   
     def setOrigin(self, xo, yo, zo):  
         """  
         Set the origin of the box  
         """  
     def getOrigin(self):  
         """  
         Get the current origin of the box  
         """  
         debugMsg("Called Box.getOrigin()")  
         return self.origin  
   
     def setWidth(self, width):  
         """  
         Set the width of the box  
         """  
     def getWidth(self):  
         """  
         Get the current box width  
         """  
         debugMsg("Called Box.getWidth()")  
         return self.width  
   
     def setHeight(self, height):  
         """  
         Set the box height  
         """  
   
     def getHeight(self):  
         """  
         Get the current box height  
         """  
         debugMsg("Called Box.getHeight()")  
         return self.height  
   
     def setDepth(self, depth):  
         """  
         Set the box depth  
         """  
   
     def getDepth(self):  
         """  
         Get the current box depth  
         """  
         debugMsg("Called Box.getDepth()")  
         return self.depth  
   
     def setBLF(self, bottom, left, front):  
         """  
         Set the position of the bottom, left, front corner  
         """  
   
     def getBLF(self):  
         """  
         Get the current position of the bottom, left, front corner  
         """  
         debugMsg("Called Box.getBLF()")  
         return self.blf  
   
     def setTRB(self, top, right, back):  
         """  
         Set the position of the top, right, back corner  
         """  
   
     def getTRB(self):  
         """  
         Get the current position of the top, right, back corner  
         """  
         debugMsg("Called Box.getTRB()")  
         return self.trb  
   
   
 class ClipBox(Box):  
     """  
     Clip box class: used to clip data sets with a box  
   
     A box in this sense means three planes at right angles to one another  
     """  
   
     def __init__(self, plot):  
         """  
         Intialisation of the ClipBox object  
         """  
   
     def setInsideOut(self, insideOut):  
         """  
         Set the inside out flag  
         """  
   
     def getInsideOut(self):  
         """  
         Get the current value of the inside out flag  
         """  
   
 class Camera(Item):  
     """  
     Camera class  
     """  
     def __init__(self, scene):  
         """  
         Initialisation of the Camera object  
   
         @param scene: The Scene object to add the Camera object to  
         @type scene: Scene object  
         """  
     def setPosition(self, *pos):  
         """  
         Set position of camera within scene  
   
         @param pos: Position to set camera in terms of x,y,z coordinates  
         @type pos: tuple  
         """  
   
     def getPosition(self):  
         """  
         Get the position of Camera within Scene  
   
         Returns the position in a tuple of form (xPos, yPos, zPos)  
         """  
         debugMsg("Called Camera.getPosition()")  
   
         return (self.xPos, self.yPos, self.zPos)  
   
     def setFocalPoint(self, *pos):  
         """  
         Sets the focal point of the Camera with the Scene  
   
         @param pos: Position to set the focal point  
         @type pos: tuple  
         """  
   
     def getFocalPoint(self):  
         """  
         Get the position of the focal point of the Camera  
   
         Returns the position of the focal point in a tuple of form  
         (xPos, yPos, zPos)  
         """  
   
     def setElevation(self, elevation):  
         """  
         Set the elevation angle (in degrees) of the Camera  
   
         @param elevation: The elevation angle (in degrees) of the Camera  
         @type elevation: float  
         """  
   
         return  
   
     def getElevation(self):  
         """  
         Gets the elevation angle (in degrees) of the Camera  
         """  
   
     def setAzimuth(self, azimuth):  
         """  
         Set the azimuthal angle (in degrees) of the Camera  
   
         @param azimuth: The azimuthal angle (in degrees) of the Camera  
         @type azimuth: float  
         """  
   
     def getAzimuth(self):  
         """  
         Get the azimuthal angle (in degrees) of the Camera  
         """  
 class ContourPlot(Plot):  
     """  
     Contour plot  
     """  
     def __init__(self, scene):  
         """  
         Initialisation of the ContourPlot class  
           
         @param scene: The Scene to render the plot in  
         @type scene: Scene object  
         """  
     def setData(self, *dataList, **options):  
         """  
         Set data to the plot  
   
         @param dataList: List of data to set to the plot  
         @type dataList: tuple  
   
         @param options: Dictionary of extra options  
         @type options: dict  
   
         @param fname: the name of the input vtk file  
         @type fname: string  
   
         @param format: the format of the input vtk file ('vtk' or 'vtk-xml')  
         @type format: string  
   
         @param scalars: the scalar data in the vtk file to use  
         @type scalars: string  
         """  
   
 class EllipsoidPlot(Plot):  
     """  
     Ellipsoid plot  
     """  
     def __init__(self, scene):  
         """  
         Initialisation of the EllipsoidPlot class  
   
         @param scene: The Scene to render the plot in  
         @type scene: Scene object  
         """  
         debugMsg("Called EllipsoidPlot.__init__()")  
         Plot.__init__(self, scene)  
   
         self.renderer = scene.renderer  
         self.renderer.addToInitStack("# EllipsoidPlot.__init__()")  
   
         # labels and stuff  
         self.title = None  
         self.xlabel = None  
         self.ylabel = None  
         self.zlabel = None  
           
         # default values for fname, format and tensors  
         self.fname = None  
         self.format = None  
     self.tensors = None  
   
     # default values for shared info  
     self.escriptData = False  
     self.otherData = False  
   
         # add the plot to the scene  
         scene.add(self)  
   
     def setData(self, *dataList, **options):  
         """  
         Set data to the plot  
   
         @param dataList: List of data to set to the plot  
         @type dataList: tuple  
   
         @param options: Dictionary of keyword options to the method  
         @type options: dict  
   
     @param fname: the name of the input vtk file  
     @type fname: string  
   
     @param format: the format of the input vtk file ('vtk' or 'vtk-xml')  
     @type format: string  
   
     @param tensors: the name of the tensor data in the vtk file to use  
     @type tensors: string  
         """  
   
 class Image(Item):  
     """  
     Image class.  Generic class to handle image data.  
     """  
     def __init__(self, scene=None):  
         """  
         Initialises the Image class object  
           
         @param scene: The Scene object to add to  
         @type scene: Scene object  
         """  
         debugMsg("Called Image.__init__()")  
         Item.__init__(self)  
   
         if scene is not None:  
             self.renderer = scene.renderer  
           
     def load(self, fname):  
         """  
         Loads image data from file.  
   
         @param fname: The filename from which to load image data  
         @type fname: string  
         """  
         debugMsg("Called Image.load()")  
   
         fileCheck(fname)  
   
         return  
   
 class JpegImage(Image):  
     """  
     Subclass of Image class to explicitly handle jpeg images  
     """  
     def __init__(self, scene=None):  
         """  
         Initialises the JpegImage class object  
   
         @param scene: The Scene object to add to  
         @type scene: Scene object  
         """  
   
     def load(self, fname):  
         """  
         Loads jpeg image data from file.  
   
         @param fname: The filename from which to load jpeg image data  
         @type fname: string  
         """  
   
 class PngImage(Image):  
     """  
     Subclass of Image class to explicitly handle png images  
     """  
     def __init__(self, scene=None):  
         """  
         Initialises the PngImage class object  
   
         @param scene: The Scene object to add to  
         @type scene: Scene object  
         """  
   
     def load(self, fname):  
         """  
         Loads png image data from file.  
   
         @param fname: The filename from which to load png image data  
         @type fname: string  
         """  
 class BmpImage(Image):  
     """  
     Subclass of Image class to explicitly handle bmp images  
     """  
     def __init__(self, scene=None):  
         """  
         Initialises the BmpImage class object  
   
         @param scene: The Scene object to add to  
         @type scene: Scene object  
         """  
     def load(self, fname):  
         """  
         Loads bmp image data from file.  
   
         @param fname: The filename from which to load bmp image data  
         @type fname: string  
         """  
   
 class TiffImage(Image):  
     """  
     Subclass of Image class to explicitly handle tiff images  
     """  
     def __init__(self, scene=None):  
         """  
         Initialises the TiffImage class object  
   
         @param scene: The Scene object to add to  
         @type scene: Scene object  
         """  
     def load(self, fname):  
         """  
         Loads tiff image data from file.  
   
         @param fname: The filename from which to load tiff image data  
         @type fname: string  
         """  
 class PnmImage(Image):  
     """  
     Subclass of Image class to explicitly handle pnm (ppm, pgm, pbm) images  
     """  
     def __init__(self, scene=None):  
         """  
         Initialises the PnmImage class object  
   
         @param scene: The Scene object to add to  
         @type scene: Scene object  
         """  
           
     def load(self, fname):  
         """  
         Loads pnm (ppm, pgm, pbm) image data from file.  
   
         @param fname: The filename from which to load pnm image data  
         @type fname: string  
         """  
   
 class PsImage(Image):  
     """  
     Subclass of Image class to explicitly handle ps images  
     """  
     def __init__(self, scene=None):  
         """  
         Initialises the PsImage class object  
   
         This object is B{only} used for generating postscript output  
   
         @param scene: The Scene object to add to  
         @type scene: Scene object  
         """  
   
     def load(self, fname):  
         """  
         Loads ps image data from file.  
   
         B{NOT} supported by this renderer module  
   
         @param fname: The filename from which to load ps image data  
         @type fname: string  
         """  
         debugMsg("Called PsImage.load()")  
   
         # need to check if the file exists  
         fileCheck(fname)  
188    
189          # this ability not handled by this renderer module  \section{Rendering}
190          unsupportedError()  same word on rendering, off-line, on-line, how to rotate, zoom, close the window, ...
           
         return  
191    
192      def render(self):  %==============================================
193          """  \section{How to Make a Movie}
         Does PsImage object specific (pre)rendering stuff  
         """  
         debugMsg("Called PsImage.render()")  
   
         return  
   
 class PdfImage(Image):  
     """  
     Subclass of Image class to explicitly handle pdf images  
     """  
     def __init__(self, scene=None):  
         """  
         Initialises the PdfImage class object  
   
         This object is B{only} used for generating pdf output  
   
         @param scene: The Scene object to add to  
         @type scene: Scene object  
         """  
   
     def load(self, fname):  
         """  
         Loads pdf image data from file.  
   
         B{NOT} supported by this renderer module  
   
         @param fname: The filename from which to load pdf image data  
         @type fname: string  
         """  
   
 class IsosurfacePlot(Plot):  
     """  
     Isosurface plot  
     """  
     def __init__(self, scene):  
         """  
         Initialisation of the IsosurfacePlot class  
           
         @param scene: The Scene to render the plot in  
         @type scene: Scene object  
         """  
     def setData(self, *dataList, **options):  
         """  
         Set data to the plot  
   
         @param dataList: List of data to set to the plot  
         @type dataList: tuple  
   
         @param options: Dictionary of keyword options to the method  
         @type options: dict  
   
     @param fname: the name of the input vtk file  
     @type fname: string  
   
     @param format: the format of the input vtk file ('vtk' or 'vtk-xml')  
     @type format: string  
   
     @param scalars: the name of the scalar data in the vtk file to use  
     @type scalars: string  
         """  
   
 class LinePlot(Plot):  
     """  
     Line plot  
     """  
     def __init__(self, scene):  
         """  
         Initialisation of the LinePlot class  
           
         @param scene: The Scene to render the plot in  
         @type scene: Scene object  
         """  
   
     def setData(self, *dataList, **options):  
         """  
         Set data to the plot  
   
         @param dataList: List of data to set to the plot  
         @type dataList: tuple  
   
     @param options: Dictionary of extra options  
     @type options: dict  
   
     @param offset: whether or not to offset the lines from one another  
     @type offset: boolean  
   
     @param fname: Filename of the input vtk file  
     @type fname: string  
   
     @param format: format of the input vtk file ('vtk' or 'vtk-xml')  
     @type format: string  
   
     @param scalars: the name of the scalar data in the vtk file to use  
     @type scalars: string  
         """  
   
 class OffsetPlot(Plot):  
     """  
     Offset plot  
     """  
     def __init__(self, scene):  
         """  
         Initialisation of the OffsetPlot class  
           
         @param scene: The Scene to render the plot in  
         @type scene: Scene object  
         """  
   
     def setData(self, *dataList, **options):  
         """  
         Set data to the plot  
   
         @param dataList: List of data to set to the plot  
         @type dataList: tuple  
   
         @param options: Dictionary of extra options  
         @type options: dict  
   
     @param fname: Filename of the input vtk file  
     @type fname: string  
   
     @param format: Format of the input vtk file ('vtk' or 'vtk-xml')  
     @type format: string  
   
     @param scalars: the name of the scalar data in the vtk file to use  
     @type scalars: string  
         """  
 class Plane(Item):  
     """  
     Generic class for Plane objects  
     """  
   
     def __init__(self, scene):  
         """  
         Initialisation of the Plane object  
         """  
   
     def setOrigin(self, x, y, z):  
         """  
         Set the origin of the plane  
         """  
   
     def getOrigin(self):  
         """  
         Get the current origin of the plane  
         """  
   
     def setNormal(self, vx, vy, vz):  
         """  
         Set the normal vector to the plane  
         """  
   
     def getNormal(self):  
         """  
         Get the current normal vector to the plane  
         """  
   
     def mapImageToPlane(self, image):  
         # this really needs to go somewhere else!!!  
         """  
         Maps an Image object onto a Plane object  
         """  
   
 class CutPlane(Plane):  
     """  
     Cut plane class: used to cut data sets with a plane  
   
     Cut plane objects define a plane to cut a data set or plot by and return  
     the data along the intersection between the data set or plot with the  
     defined plane.  
     """  
   
     def __init__(self):  
         """  
         Intialisation of the CutPlane object  
         """  
   
   
 class ClipPlane(Plane):  
     """  
     Class for planes used to clip datasets  
     """  
   
     def __init__(self):  
         """  
         Intialisation of the ClipPlane object  
         """  
   
     def setInsideOut(self, insideOut):  
         """  
         Set the inside out flag  
         """  
   
     def getInsideOut(self):  
         """  
         Get the current value of the inside out flag  
         """  
   
 class Plot(Item):  
     """  
     Abstract plot class  
     """  
     def __init__(self, scene):  
         """  
         Initialisation of the abstract Plot class  
           
         @param scene: The Scene to render the plot in  
         @type scene: Scene object  
         """  
   
     def setData(self, *dataList, **options):  
         """  
         Set data to the plot  
   
         @param dataList: List of data to set to the plot  
         @type dataList: tuple  
   
     @param options: Dictionary of extra options  
     @type options: dict  
         """  
   
     def setTitle(self, title):  
         """  
         Set the plot title  
   
         @param title: the string holding the title to the plot  
         @type title: string  
         """  
         debugMsg("Called setTitle() in Plot()")  
   
   
     def setXLabel(self, label):  
         """  
         Set the label of the x-axis  
   
         @param label: the string holding the label of the x-axis  
         @type label: string  
         """  
   
     def setYLabel(self, label):  
         """  
         Set the label of the y-axis  
   
         @param label: the string holding the label of the y-axis  
         @type label: string  
         """  
   
     def setZLabel(self, label):  
         """  
         Set the label of the z-axis  
   
         @param label: the string holding the label of the z-axis  
         @type label: string  
         """  
   
     def setLabel(self, axis, label):  
         """  
         Set the label of a given axis  
   
         @param axis: string (Axis object maybe??) of the axis (e.g. x, y, z)  
         @type axis: string or Axis object  
   
         @param label: string of the label to set for the axis  
         @type label: string  
         """  
   
 class Renderer(BaseRenderer):  
     """  
     A generic object holding a renderer of a Scene().  
     """  
   
     def __init__(self):  
         """  
         Initialisation of Renderer() class  
         """  
         debugMsg("Called Renderer.__init__()")  
         BaseRenderer.__init__(self)  
   
         # initialise some attributes  
         self.renderWindowWidth = 640  
         self.renderWindowHeight = 480  
   
         # what is the name of my renderer?  
         self.name = _rendererName  
   
         # the namespace to run the exec code  
         self.renderDict = {}  
   
         # initialise the evalstack  
         self._evalStack = ""  
   
         # keep the initial setup of the module for later reuse  
         self._initStack = ""  
   
         # initialise the renderer module  
         self.runString("# Renderer._initRendererModule")  
         self.addToInitStack("import vtk")  
         self.addToInitStack("from numarray import *")  
   
 __revision__ = '$Revision: 1.33 $'  
   
 class Scene(BaseScene):  
     """  
     The main object controlling the scene.  
       
     Scene object methods and classes overriding the BaseScene class.  
     """  
   
     def __init__(self):  
         """  
         The init function  
         """  
   
     def add(self, obj):  
         """  
         Add a new item to the scene  
   
         @param obj: The object to add to the scene  
         @type obj: object  
         """  
   
     def place(self, obj):  
         """  
         Place an object within a scene  
   
         @param obj: The object to place within the scene  
         @type obj: object  
         """  
   
     def render(self, pause=False, interactive=False):  
         """  
         Render (or re-render) the scene  
           
         Render the scene, either to screen, or to a buffer waiting for a save  
   
         @param pause: Flag to wait at end of script evaluation for user input  
         @type pause: boolean  
   
         @param interactive: Whether or not to have interactive use of the output  
         @type interactive: boolean  
         """  
   
     def save(self, fname, format):  
         """  
         Save the scene to a file  
   
         Possible formats are:  
             - Postscript  
             - PNG  
             - JPEG  
             - TIFF  
             - BMP  
             - PNM  
   
         @param fname: Name of output file  
         @type fname: string  
   
         @param format: Graphics format of output file  
         @type format: Image object or string  
         """  
   
     def setBackgroundColor(self, *color):  
         """  
         Sets the background color of the Scene  
   
         @param color: The color to set the background to.  Can be RGB or CMYK  
         @type color: tuple  
         """  
   
     def getBackgroundColor(self):  
         """  
         Gets the current background color setting of the Scene  
         """  
   
     def setSize(self, xSize, ySize):  
         """  
         Sets the size of the scene.  
   
         This size is effectively the renderer window size.  
   
         @param xSize: the size to set the x dimension  
         @type xSize: float  
   
         @param ySize: the size to set the y dimension  
         @type ySize: float  
         """  
   
     def getSize(self):  
         """  
         Gets the current size of the scene  
   
         This size is effectively the renderer window size.  Returns a tuple  
         of the x and y dimensions respectively, in pixel units(??).  
         """  
 class SurfacePlot(Plot):  
     """  
     Surface plot  
     """  
     def __init__(self, scene):  
         """  
         Initialisation of the SurfacePlot class  
           
         @param scene: The Scene to render the plot in  
         @type scene: Scene object  
         """  
   
     def setData(self, *dataList, **options):  
         """  
         Set data to the plot  
   
         @param dataList: List of data to set to the plot  
         @type dataList: tuple  
   
         @param options: Dictionary of extra options  
         @type options: dict  
   
         @param fname: the name of the input vtk file  
         @type fname: string  
   
         @param format: the format of the input vtk file ('vtk' or 'vtk-xml')  
         @type format: string  
   
         @param scalars: the scalar data in the vtk file to use  
         @type scalars: string  
         """  
   
 class Text(Item):  
     """  
     Text  
     """  
     def __init__(self, scene):  
         """  
         Initialisation of the Text object  
   
         @param scene: the scene with which to associate the Text object  
         @type scene: Scene object  
         """  
   
     def setFont(self, font):  
         """  
         Set the current font  
   
         @param font: the font to set  
         @type font: string  
         """  
   
     def getFont(self):  
         """  
 \end{verbose}  

Legend:
Removed from v.606  
changed lines
  Added in v.1002

  ViewVC Help
Powered by ViewVC 1.1.26