/[escript]/trunk/pyvisi/py_src/datacollector.py
ViewVC logotype

Annotation of /trunk/pyvisi/py_src/datacollector.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 828 - (hide annotations)
Wed Aug 30 07:52:35 2006 UTC (14 years, 10 months ago) by jongui
File MIME type: text/x-python
File size: 1949 byte(s)
Tidy up the codes to include inheritance of common features for reusability. Also added options to change opacity, scale factor, color mode and contour values.

1 gross 792 """
2    
3     classes dealing with data for the visualization
4    
5     @var __author__: name of author
6     @var __license__: licence agreement
7     @var __copyright__: copyrights
8     @var __url__: url entry point on documentation
9     @var __version__: version
10     @var __date__: date of the version
11     """
12    
13     __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
14     http://www.access.edu.au
15     Primary Business: Queensland, Australia"""
16     __license__="""Licensed under the Open Software License version 3.0
17     http://www.opensource.org/licenses/osl-3.0.php"""
18     __author__="Paul Cochrane, L. Gross"
19     __url__="http://www.iservo.edu.au/esys"
20     __version__="$Revision:$"
21     __date__="$Date:$"
22    
23 jongui 822 import vtk
24 jongui 828 from common import *
25 gross 792
26 jongui 828 class DataCollector(Common):
27 gross 792
28 jongui 827 def __init__(self, open_scene, outline = True):
29     self.open_scene = open_scene
30 jongui 822 self.outline = True
31     self.file_name = None
32 jongui 828 self.vtk_outline = None
33 jongui 827 self.vtk_xml_reader = None
34     self.vtk_xml_reader_output = None
35 jongui 822
36 jongui 827 # set up the file reader and set the file name
37 jongui 822 def setSource(self, file_name):
38     self.file_name = file_name
39     self.vtk_xml_reader = vtk.vtkXMLUnstructuredGridReader()
40     self.vtk_xml_reader.SetFileName(self.file_name)
41    
42 jongui 827 if(self.outline == True):
43 jongui 828 self.setOutline()
44     Common.setMapper(self, "self.vtk_outline.GetOutput()")
45     Common.setActor(self)
46     Common.addActor(self)
47     Common.setColor(self, 0, 0, 0)
48    
49    
50 jongui 827
51     # return the file reader output
52 jongui 822 def getReader(self):
53     return self.vtk_xml_reader
54    
55 jongui 827 # set the outline
56 jongui 828 def setOutline(self):
57     self.vtk_outline = vtk.vtkOutlineFilter()
58     self.vtk_outline.SetInput(self.vtk_xml_reader.GetOutput())
59 jongui 827
60 jongui 828 #vtk_outline_mapper = vtk.vtkPolyDataMapper()
61     #vtk_outline_mapper.SetInput(vtk_outline.GetOutput())
62 jongui 827
63 jongui 828 #vtk_outline_actor = vtk.vtkActor()
64     #vtk_outline_actor.SetMapper(vtk_outline_mapper)
65     #vtk_outline_actor.GetProperty().SetColor(0, 0, 0)
66 jongui 822
67 jongui 828 #self.open_scene.getRenderer().AddActor(vtk_outline_actor)
68 jongui 827
69    
70    
71    
72    
73    
74    

  ViewVC Help
Powered by ViewVC 1.1.26