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

Diff of /trunk/pyvisi/py_src/ellipsoid.py

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

revision 1148 by jongui, Wed May 16 22:45:33 2007 UTC revision 1197 by jongui, Mon Jun 18 02:08:34 2007 UTC
# Line 1  Line 1 
1  """  """
2  @author: John NGUI  @var __author__: name of author
3    @var __copyright__: copyrights
4    @var __license__: licence agreement
5    @var __url__: url entry point on documentation
6    @var __version__: version
7    @var __date__: date of the version
8  """  """
9    
10    __author__="John Ngui, john.ngui@uq.edu.au"
11    __copyright__="""  Copyright (c) 2006 by ACcESS MNRF
12                        http://www.access.edu.au
13                    Primary Business: Queensland, Australia"""
14    __license__="""Licensed under the Open Software License version 3.0
15                 http://www.opensource.org/licenses/osl-3.0.php"""
16    __url__="http://www.iservo.edu.au/esys"
17    __version__="$Revision$"
18    __date__="$Date$"
19    
20    
21  import vtk  import vtk
22  from mapper import DataSetMapper  from mapper import DataSetMapper
23  from lookuptable import LookupTable  from lookuptable import LookupTable
# Line 53  class Ellipsoid(DataSetMapper, Actor3D, Line 69  class Ellipsoid(DataSetMapper, Actor3D,
69          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
70          """          """
71    
         self.__scene = scene  
72          self.__data_collector = data_collector          self.__data_collector = data_collector
73          self.__viewport = viewport          self.__viewport = viewport
74          self.__lut = lut          self.__lut = lut
# Line 86  class Ellipsoid(DataSetMapper, Actor3D, Line 101  class Ellipsoid(DataSetMapper, Actor3D,
101    
102              # Default line width is 1.              # Default line width is 1.
103              actor3D._setLineWidth(1)              actor3D._setLineWidth(1)
104              self.__scene._addActor3D(self.__viewport, actor3D._getActor3D())              scene._addActor3D(self.__viewport, actor3D._getActor3D())
105    
106          # ----- Ellipsoid -----          # ----- Ellipsoid -----
107    
# Line 116  class Ellipsoid(DataSetMapper, Actor3D, Line 131  class Ellipsoid(DataSetMapper, Actor3D,
131                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
132    
133          self._setupActor3D(self._getDataSetMapper())          self._setupActor3D(self._getDataSetMapper())
134          self.__scene._addActor3D(self.__viewport, self._getActor3D())          scene._addActor3D(self.__viewport, self._getActor3D())
135    
136      def _isModified(self):        def _isModified(self):  
137          """          """
# Line 128  class Ellipsoid(DataSetMapper, Actor3D, Line 143  class Ellipsoid(DataSetMapper, Actor3D,
143    
144          return self.__modified or self.__data_collector._isModified()          return self.__modified or self.__data_collector._isModified()
145    
146      def _render(self):      def _render(self, scene):
147          """          """
148          Render the ellipsoids.          Render the ellipsoids.
149    
150            @type scene: L{Scene <scene.Scene>} object
151            @param scene: Scene in which objects are to be rendered on
152          """          """
153    
154          if (self._isModified() == True):          if (self._isModified() == True):
# Line 139  class Ellipsoid(DataSetMapper, Actor3D, Line 157  class Ellipsoid(DataSetMapper, Actor3D,
157              if(self.__data_collector._isTensorSet() == True):              if(self.__data_collector._isTensorSet() == True):
158                  self.__data_collector._setActiveTensor()                  self.__data_collector._setActiveTensor()
159    
160              self._setScalarRange(self.__data_collector._getScalarRange())              # self._isScalarRangeSet checks whether the scalar range has been
161                # specified by the user. If it has, then the scalar range
162                # read from the source will be ignored.
163                if(not(self._isScalarRangeSet())):
164                    self._setScalarRange(self.__data_collector._getScalarRange())
165              self.__modified = False              self.__modified = False
166    
167    
# Line 189  class EllipsoidOnPlaneCut(DataSetMapper, Line 211  class EllipsoidOnPlaneCut(DataSetMapper,
211          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
212          """          """
213    
         self.__scene = scene  
214          self.__data_collector = data_collector          self.__data_collector = data_collector
215          self.__viewport = viewport          self.__viewport = viewport
216          self.__lut = lut          self.__lut = lut
# Line 225  class EllipsoidOnPlaneCut(DataSetMapper, Line 246  class EllipsoidOnPlaneCut(DataSetMapper,
246    
247              # Default line width is 1.              # Default line width is 1.
248              actor3D._setLineWidth(1)              actor3D._setLineWidth(1)
249              self.__scene._addActor3D(self.__viewport, actor3D._getActor3D())              scene._addActor3D(self.__viewport, actor3D._getActor3D())
250    
251          # ----- Ellipsoid on a cut plane -----          # ----- Ellipsoid on a cut plane -----
252    
# Line 259  class EllipsoidOnPlaneCut(DataSetMapper, Line 280  class EllipsoidOnPlaneCut(DataSetMapper,
280                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
281    
282          self._setupActor3D(self._getDataSetMapper())          self._setupActor3D(self._getDataSetMapper())
283          self.__scene._addActor3D(self.__viewport, self._getActor3D())          scene._addActor3D(self.__viewport, self._getActor3D())
284    
285      def _isModified(self):        def _isModified(self):  
286          """          """
# Line 272  class EllipsoidOnPlaneCut(DataSetMapper, Line 293  class EllipsoidOnPlaneCut(DataSetMapper,
293    
294          return self.__modified or self.__data_collector._isModified()          return self.__modified or self.__data_collector._isModified()
295    
296      def _render(self):      def _render(self, scene):
297          """          """
298          Render the ellipsoids cut using a plane.          Render the ellipsoids cut using a plane.
299    
300            @type scene: L{Scene <scene.Scene>} object
301            @param scene: Scene in which objects are to be rendered on
302          """          """
303    
304          if (self._isModified() == True):          if (self._isModified() == True):
# Line 282  class EllipsoidOnPlaneCut(DataSetMapper, Line 306  class EllipsoidOnPlaneCut(DataSetMapper,
306                  self.__data_collector._setActiveScalar()                  self.__data_collector._setActiveScalar()
307              if(self.__data_collector._isTensorSet() == True):              if(self.__data_collector._isTensorSet() == True):
308                  self.__data_collector._setActiveTensor()                  self.__data_collector._setActiveTensor()
309              self._setScalarRange(self.__data_collector._getScalarRange())  
310                # self._isScalarRangeSet checks whether the scalar range has been
311                # specified by the user. If it has, then the scalar range
312                # read from the source will be ignored.
313                if(not(self._isScalarRangeSet())):
314                    self._setScalarRange(self.__data_collector._getScalarRange())
315              self.__modified = False              self.__modified = False
316    
317    
# Line 330  class EllipsoidOnPlaneClip(DataSetMapper Line 359  class EllipsoidOnPlaneClip(DataSetMapper
359          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
360          """          """
361    
         self.__scene = scene  
362          self.__data_collector = data_collector          self.__data_collector = data_collector
363          self.__viewport = viewport          self.__viewport = viewport
364          self.__lut = lut          self.__lut = lut
# Line 366  class EllipsoidOnPlaneClip(DataSetMapper Line 394  class EllipsoidOnPlaneClip(DataSetMapper
394    
395              # Default line width is 1.              # Default line width is 1.
396              actor3D._setLineWidth(1)              actor3D._setLineWidth(1)
397              self.__scene._addActor3D(self.__viewport, actor3D._getActor3D())              scene._addActor3D(self.__viewport, actor3D._getActor3D())
398    
399          # ----- Ellipsoid on a clipped plane -----          # ----- Ellipsoid on a clipped plane -----
400    
# Line 406  class EllipsoidOnPlaneClip(DataSetMapper Line 434  class EllipsoidOnPlaneClip(DataSetMapper
434                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
435    
436          self._setupActor3D(self._getDataSetMapper())          self._setupActor3D(self._getDataSetMapper())
437          self.__scene._addActor3D(self.__viewport, self._getActor3D())          scene._addActor3D(self.__viewport, self._getActor3D())
438    
439      def _isModified(self):        def _isModified(self):  
440          """          """
# Line 419  class EllipsoidOnPlaneClip(DataSetMapper Line 447  class EllipsoidOnPlaneClip(DataSetMapper
447    
448          return self.__modified or self.__data_collector._isModified()          return self.__modified or self.__data_collector._isModified()
449    
450      def _render(self):      def _render(self, scene):
451          """          """
452          Render the ellipsoids clip using a plane.          Render the ellipsoids clip using a plane.
453    
454            @type scene: L{Scene <scene.Scene>} object
455            @param scene: Scene in which objects are to be rendered on
456          """          """
457    
458          if (self._isModified() == True):          if (self._isModified() == True):
# Line 429  class EllipsoidOnPlaneClip(DataSetMapper Line 460  class EllipsoidOnPlaneClip(DataSetMapper
460                  self.__data_collector._setActiveScalar()                  self.__data_collector._setActiveScalar()
461              if(self.__data_collector._isTensorSet() == True):              if(self.__data_collector._isTensorSet() == True):
462                  self.__data_collector._setActiveTensor()                  self.__data_collector._setActiveTensor()
463              self._setScalarRange(self.__data_collector._getScalarRange())  
464                # self._isScalarRangeSet checks whether the scalar range has been
465                # specified by the user. If it has, then the scalar range
466                # read from the source will be ignored.
467                if(not(self._isScalarRangeSet())):
468                    self._setScalarRange(self.__data_collector._getScalarRange())
469              self.__modified = False              self.__modified = False
470    
471    

Legend:
Removed from v.1148  
changed lines
  Added in v.1197

  ViewVC Help
Powered by ViewVC 1.1.26