/[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 1142 by jongui, Thu Apr 19 06:31:49 2007 UTC revision 1143 by jongui, Wed May 16 04:49:55 2007 UTC
# Line 34  camer \, / \, light \rightarrow render Line 34  camer \, / \, light \rightarrow render
34  \end{math}  \end{math}
35  \end{center}  \end{center}
36    
 The sequence in which instances are created is very important due to  
 to the dependencies among them. For example, a data input instance must  
 be created BEFORE a data visualization instance, because the source data must  
 be specified before it can be manipulated. If the sequence is switched,  
 the program will throw an error. Similarly, a camera and light instance must  
 be created AFTER a data input instance because the camera and light instance  
 calculates their position based on the source data. If the sequence is switched,  
 the programthe will throw an error .  
   
37  \section{\pyvisi Classes}  \section{\pyvisi Classes}
38  The following subsections give a brief overview of the important classes  The following subsections give a brief overview of the important classes
39  and some of their corresponding methods. Please refer to \ReferenceGuide for  and some of their corresponding methods. Please refer to \ReferenceGuide for
# Line 76  Render the object using either the Onlin Line 67  Render the object using either the Onlin
67    
68  \subsubsection{\Camera class}  \subsubsection{\Camera class}
69    
70  \begin{classdesc}{Camera}{scene, data_collector, viewport = Viewport.SOUTH_WEST}  \begin{classdesc}{Camera}{scene, viewport = Viewport.SOUTH_WEST}
71  A camera controls the display angle of the rendered object and one is  A camera controls the display angle of the rendered object and one is
72  usually created for a \Scene. However, if a \Scene has four viewports, then a  usually created for a \Scene. However, if a \Scene has four viewports, then a
73  separate camera may be created for each viewport.  separate camera may be created for each viewport.
# Line 166  for visualization. Line 157  for visualization.
157  \begin{classdesc}{DataCollector}{source = Source.XML}  \begin{classdesc}{DataCollector}{source = Source.XML}
158  A data collector is used to read data either from an XML file (using  A data collector is used to read data either from an XML file (using
159  \texttt{setFileName()}) or from an escript object directly (using  \texttt{setFileName()}) or from an escript object directly (using
160  \texttt{setData()}).  \texttt{setData()}). Writing XML files are expensive, but this approach has
161    the advantage given that the results can be analyzed easily after the
162    simulation has completed.  
163  \end{classdesc}  \end{classdesc}
164    
165  The following are some of the methods available:  The following are some of the methods available:
# Line 825  Set the scalar clip value (instead of us Line 818  Set the scalar clip value (instead of us
818    
819  The following are some of the methods available:  The following are some of the methods available:
820    
821  \begin{methoddesc}[ContourModule]{generateContours}{contours,  \begin{methoddesc}[ContourModule]{generateContours}{contours = None,
822  lower_range = None, upper_range = None}  lower_range = None, upper_range = None}
823  Generate the specified number of contours within the specified range.  Generate the specified number of contours within the specified range.
824  In order to generate an iso surface, the 'lower_range' and 'upper_range'  In order to generate an iso surface, the 'lower_range' and 'upper_range'
# Line 880  The following are some of the methods av Line 873  The following are some of the methods av
873  Set the radius of the sphere.  Set the radius of the sphere.
874  \end{methoddesc}  \end{methoddesc}
875    
876  \begin{methoddesc}[PointSource]{setPointSourceCenter}{position}  \begin{methoddesc}[PointSource]{setPointSourceCenter}{center}
877  Set the center of the sphere.  Set the center of the sphere.
878  \end{methoddesc}  \end{methoddesc}
879    
# Line 1049  mosc2 = Contour(scene = s, data_collecto Line 1042  mosc2 = Contour(scene = s, data_collecto
1042          outline = True)          outline = True)
1043  mosc2.generateContours(0)  mosc2.generateContours(0)
1044    
1045  # Read in one file one after another and render the object.  # Create a Camera.
1046    cam1 = Camera(scene = s, viewport = Viewport.SOUTH_WEST)
1047    
1048    # Read in one file one after another and render the object.
1049  for i in range(99, 104):  for i in range(99, 104):
1050      dc1.setFileName(file_name =  PYVISI_EXAMPLE_MESHES_PATH + FILE_2D +      dc1.setFileName(file_name =  PYVISI_EXAMPLE_MESHES_PATH + FILE_2D +
1051              "%04d.vtu" % i)              "%04d.vtu" % i)
     dc1.setActiveScalar(scalar = SCALAR_FIELD_POINT_DATA_1)  
1052      dc2.setFileName(file_name =  PYVISI_EXAMPLE_MESHES_PATH + FILE_2D +      dc2.setFileName(file_name =  PYVISI_EXAMPLE_MESHES_PATH + FILE_2D +
1053              "%04d.vtu" % i)              "%04d.vtu" % i)
     dc2.setActiveScalar(scalar = SCALAR_FIELD_POINT_DATA_2)  
1054    
1055      s.render(PYVISI_EXAMPLE_IMAGES_PATH + IMAGE_NAME + "%04d.jpg" % i)      s.render(PYVISI_EXAMPLE_IMAGES_PATH + IMAGE_NAME + "%04d.jpg" % i)
1056  \end{python}  \end{python}

Legend:
Removed from v.1142  
changed lines
  Added in v.1143

  ViewVC Help
Powered by ViewVC 1.1.26