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

Diff of /trunk/pyvisi/py_src/contour.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 1189 by jongui, Thu Jun 7 05:31:25 2007 UTC
# Line 49  class Contour(DataSetMapper, Actor3D, Co Line 49  class Contour(DataSetMapper, Actor3D, Co
49          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
50          """          """
51    
         self.__scene = scene  
52          self.__data_collector = data_collector          self.__data_collector = data_collector
53          self.__viewport = viewport          self.__viewport = viewport
54          self.__lut = lut          self.__lut = lut
# Line 78  class Contour(DataSetMapper, Actor3D, Co Line 77  class Contour(DataSetMapper, Actor3D, Co
77    
78              # Default line width is 1.              # Default line width is 1.
79              actor3D._setLineWidth(1)              actor3D._setLineWidth(1)
80              self.__scene._addActor3D(self.__viewport, actor3D._getActor3D())              scene._addActor3D(self.__viewport, actor3D._getActor3D())
81    
82          # ----- Contour -----          # ----- Contour -----
83    
# Line 104  class Contour(DataSetMapper, Actor3D, Co Line 103  class Contour(DataSetMapper, Actor3D, Co
103                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
104    
105          self._setupActor3D(self._getDataSetMapper())          self._setupActor3D(self._getDataSetMapper())
106          self.__scene._addActor3D(self.__viewport, self._getActor3D())          scene._addActor3D(self.__viewport, self._getActor3D())
107            
108      def _isModified(self):        def _isModified(self):  
109          """          """
# Line 116  class Contour(DataSetMapper, Actor3D, Co Line 115  class Contour(DataSetMapper, Actor3D, Co
115    
116          return self.__modified or self.__data_collector._isModified()          return self.__modified or self.__data_collector._isModified()
117    
118      def _render(self):      def _render(self, scene):
119          """          """
120          Render the contour.          Render the contour.
121    
122            @type scene: L{Scene <scene.Scene>} object
123            @param scene: Scene in which objects are to be rendered on
124          """          """
125    
126          if (self._isModified() == True):          if (self._isModified() == True):
# Line 141  class Contour(DataSetMapper, Actor3D, Co Line 143  class Contour(DataSetMapper, Actor3D, Co
143              self.generateContours(contours, lower_range, upper_range)              self.generateContours(contours, lower_range, upper_range)
144              self._generateContours()              self._generateContours()
145                                                    
146              self._setScalarRange(self.__data_collector._getScalarRange())              # self._isScalarRangeSet checks whether the scalar range has been
147                # specified by the user. If it has, then the scalar range
148                # read from the source will be ignored.
149                if(not(self._isScalarRangeSet())):
150                    self._setScalarRange(self.__data_collector._getScalarRange())
151              self.__modified = False              self.__modified = False
152    
153    
# Line 191  class ContourOnPlaneCut(DataSetMapper, A Line 197  class ContourOnPlaneCut(DataSetMapper, A
197          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
198          """          """
199    
         self.__scene = scene  
200          self.__data_collector = data_collector          self.__data_collector = data_collector
201          self.__viewport = viewport          self.__viewport = viewport
202          self.__lut = lut          self.__lut = lut
# Line 224  class ContourOnPlaneCut(DataSetMapper, A Line 229  class ContourOnPlaneCut(DataSetMapper, A
229    
230              # Default line width is 1.              # Default line width is 1.
231              actor3D._setLineWidth(1)              actor3D._setLineWidth(1)
232              self.__scene._addActor3D(self.__viewport, actor3D._getActor3D())              scene._addActor3D(self.__viewport, actor3D._getActor3D())
233    
234          # ----- Contour on a cut plane -----          # ----- Contour on a cut plane -----
235    
# Line 252  class ContourOnPlaneCut(DataSetMapper, A Line 257  class ContourOnPlaneCut(DataSetMapper, A
257                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
258    
259          self._setupActor3D(self._getDataSetMapper())          self._setupActor3D(self._getDataSetMapper())
260          self.__scene._addActor3D(self.__viewport, self._getActor3D())          scene._addActor3D(self.__viewport, self._getActor3D())
261            
262      def _isModified(self):        def _isModified(self):  
263          """          """
# Line 264  class ContourOnPlaneCut(DataSetMapper, A Line 269  class ContourOnPlaneCut(DataSetMapper, A
269    
270          return self.__modified or self.__data_collector._isModified()          return self.__modified or self.__data_collector._isModified()
271    
272      def _render(self):      def _render(self, scene):
273          """          """
274          Render the contour cut using a plane.          Render the contour cut using a plane.
275    
276            @type scene: L{Scene <scene.Scene>} object
277            @param scene: Scene in which objects are to be rendered on
278          """          """
279    
280          if (self._isModified() == True):          if (self._isModified() == True):
# Line 289  class ContourOnPlaneCut(DataSetMapper, A Line 297  class ContourOnPlaneCut(DataSetMapper, A
297              self.generateContours(contours, lower_range, upper_range)              self.generateContours(contours, lower_range, upper_range)
298              self._generateContours()              self._generateContours()
299                                                    
300              self._setScalarRange(self.__data_collector._getScalarRange())              # self._isScalarRangeSet checks whether the scalar range has been
301                # specified by the user. If it has, then the scalar range
302                # read from the source will be ignored.
303                if(not(self._isScalarRangeSet())):
304                    self._setScalarRange(self.__data_collector._getScalarRange())
305              self.__modified = False              self.__modified = False
306    
307    
# Line 338  class ContourOnPlaneClip(DataSetMapper, Line 350  class ContourOnPlaneClip(DataSetMapper,
350          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
351          """          """
352    
         self.__scene = scene  
353          self.__data_collector = data_collector          self.__data_collector = data_collector
354          self.__viewport = viewport          self.__viewport = viewport
355          self.__lut = lut          self.__lut = lut
# Line 371  class ContourOnPlaneClip(DataSetMapper, Line 382  class ContourOnPlaneClip(DataSetMapper,
382    
383              # Default line width is 1.              # Default line width is 1.
384              actor3D._setLineWidth(1)              actor3D._setLineWidth(1)
385              self.__scene._addActor3D(self.__viewport, actor3D._getActor3D())              scene._addActor3D(self.__viewport, actor3D._getActor3D())
386    
387          # ----- Contour on a clipped plane -----          # ----- Contour on a clipped plane -----
388    
# Line 402  class ContourOnPlaneClip(DataSetMapper, Line 413  class ContourOnPlaneClip(DataSetMapper,
413                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
414    
415          self._setupActor3D(self._getDataSetMapper())          self._setupActor3D(self._getDataSetMapper())
416          self.__scene._addActor3D(self.__viewport, self._getActor3D())          scene._addActor3D(self.__viewport, self._getActor3D())
417            
418      def _isModified(self):        def _isModified(self):  
419          """          """
420          Return whether the ContourOnPlaneClip or DataCollector has been modified.          Return whether the ContourOnPlaneClip or DataCollector has been
421            modified.
422    
423          @rtype: Boolean          @rtype: Boolean
424          @return: True or False          @return: True or False
# Line 414  class ContourOnPlaneClip(DataSetMapper, Line 426  class ContourOnPlaneClip(DataSetMapper,
426    
427          return self.__modified or self.__data_collector._isModified()          return self.__modified or self.__data_collector._isModified()
428    
429      def _render(self):      def _render(self, scene):
430          """          """
431          Render the contour clip using a plane.          Render the contour clip using a plane.
432    
433            @type scene: L{Scene <scene.Scene>} object
434            @param scene: Scene in which objects are to be rendered on
435          """          """
436    
437          if (self._isModified() == True):          if (self._isModified() == True):
# Line 439  class ContourOnPlaneClip(DataSetMapper, Line 454  class ContourOnPlaneClip(DataSetMapper,
454              self.generateContours(contours, lower_range, upper_range)              self.generateContours(contours, lower_range, upper_range)
455              self._generateContours()              self._generateContours()
456                                                    
457              self._setScalarRange(self.__data_collector._getScalarRange())              # self._isScalarRangeSet checks whether the scalar range has been
458                # specified by the user. If it has, then the scalar range
459                # read from the source will be ignored.
460                if(not(self._isScalarRangeSet())):
461                    self._setScalarRange(self.__data_collector._getScalarRange())
462              self.__modified = False              self.__modified = False
463    
464    

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

  ViewVC Help
Powered by ViewVC 1.1.26