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

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

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

revision 848 by jongui, Fri Sep 8 07:13:01 2006 UTC revision 849 by jongui, Fri Sep 15 07:11:55 2006 UTC
# Line 53  class Position: Line 53  class Position:
53    
54          return self.z_coor          return self.z_coor
55    
56    import vtk
57  from common import *  from common import Common
58    
59  class Plane(Common):  class Plane(Common):
60      """      """
# Line 73  class Plane(Common): Line 73  class Plane(Common):
73          """          """
74    
75          Common.__init__(self, scene, data_collector)          Common.__init__(self, scene, data_collector)
76          self.vtk_plane = None          self.vtk_plane = vtk.vtkPlane()
77          self.vtk_cutter = None          self.vtk_cutter = vtk.vtkCutter()
78          self.setPlane()          self.setPlane()
79          self.setCutter(component)          self.setCutter(component)
80    
81          Common.setMapper(self, "self.vtk_cutter.GetOutput()")          Common.setMapperInput(self, self.vtk_cutter.GetOutput())
82          Common.setActor(self)          Common.setActorInput(self)
83          Common.addActor(self)          Common.addActor(self)
84    
85      def setPlane(self):      def setPlane(self):
# Line 87  class Plane(Common): Line 87  class Plane(Common):
87          Setup the plane.          Setup the plane.
88          """          """
89    
         self.vtk_plane = vtk.vtkPlane()  
90          # Default origin          # Default origin
91          #self.vtk_plane.SetOrigin(          #self.vtk_plane.SetOrigin(
92          #self.data_collector.getReader().GetOutput().GetCenter())          #self.data_collector.getReader().GetOutput().GetCenter())
93          self.vtk_plane.SetOrigin(0,0,0)          self.setPlaneOrigin(0,0,0)
94          # Default normal          # Default normal
95          self.vtk_plane.SetNormal(-1.2, 0.0, 0.9)          self.setPlaneNormal(-1.2, 0.0, 0.9)
96            #self.setPlaneNormal(1,0,1)
97    
98    
99      def setPlaneOrigin(self, x_coor, y_coor, z_coor):      def setPlaneOrigin(self, x_coor, y_coor, z_coor):
# Line 132  class Plane(Common): Line 132  class Plane(Common):
132          @param component: Component to be cut using the plane          @param component: Component to be cut using the plane
133          """          """
134    
135          self.vtk_cutter = vtk.vtkCutter()          self.vtk_cutter.SetInput(component)
         eval("self.vtk_cutter.SetInput(%s)" % component)  
136          self.vtk_cutter.SetCutFunction(self.vtk_plane)          self.vtk_cutter.SetCutFunction(self.vtk_plane)
137    
138  #def Plane(object):  #def Plane(object):

Legend:
Removed from v.848  
changed lines
  Added in v.849

  ViewVC Help
Powered by ViewVC 1.1.26