Package Pmv :: Package VisionInterface :: Module CoarseMolSurface_net
[hide private]
[frames] | no frames]

Source Code for Module Pmv.VisionInterface.CoarseMolSurface_net

  1  ######################################################################## 
  2  # 
  3  #    Vision Network - Python source code - file generated by vision 
  4  #    Monday 19 June 2006 16:00:08  
  5  #     
  6  #       The Scripps Research Institute (TSRI) 
  7  #       Molecular Graphics Lab 
  8  #       La Jolla, CA 92037, USA 
  9  # 
 10  # Copyright: Daniel Stoffler, Michel Sanner and TSRI 
 11  #    
 12  # revision: Guillaume Vareille 
 13  #   
 14  ######################################################################### 
 15  # 
 16  # $Header: /opt/cvs/python/packages/share1.5/Pmv/VisionInterface/CoarseMolSurface_net.py,v 1.1 2006/06/28 20:05:38 annao Exp $ 
 17  # 
 18  # $Id: CoarseMolSurface_net.py,v 1.1 2006/06/28 20:05:38 annao Exp $ 
 19  # 
 20   
 21  from traceback import print_exc 
 22   
 23  ## loading libraries ## 
 24  from Pmv.VisionInterface.PmvNodes import pmvlib 
 25  masterNet.getEditor().addLibraryInstance(pmvlib,"Pmv.VisionInterface.PmvNodes", "pmvlib") 
 26   
 27  from Vision.StandardNodes import stdlib 
 28  masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib") 
 29   
 30  from DejaVu.VisionInterface.DejaVuNodes import vizlib 
 31  masterNet.getEditor().addLibraryInstance(vizlib,"DejaVu.VisionInterface.DejaVuNodes", "vizlib") 
 32   
 33  from Volume.VisionInterface.VolumeNodes import vollib 
 34  masterNet.getEditor().addLibraryInstance(vollib,"Volume.VisionInterface.VolumeNodes", "vollib") 
 35   
 36  try: 
 37      ## saving node Pmv ## 
 38      from Pmv.VisionInterface.PmvNodes import PmvNode 
 39      Pmv_0 = PmvNode(vf=masterNet.editor.vf, constrkw = {'vf': 'masterNet.editor.vf'}, name='Pmv', library=pmvlib) 
 40      masterNet.addNode(Pmv_0,22,13) 
 41  except: 
 42      print "WARNING: failed to restore PmvNode named Pmv in network masterNet" 
 43      print_exc() 
 44      Pmv_0=None 
 45   
 46  try: 
 47      ## saving node Get Selection ## 
 48      from Pmv.VisionInterface.PmvNodes import PmvGetSelection 
 49      Get_Selection_1 = PmvGetSelection(constrkw = {}, name='Get Selection', library=pmvlib) 
 50      masterNet.addNode(Get_Selection_1,22,58) 
 51  except: 
 52      print "WARNING: failed to restore PmvGetSelection named Get Selection in network masterNet" 
 53      print_exc() 
 54      Get_Selection_1=None 
 55   
 56  try: 
 57      ## saving node UT Blur ## 
 58      from Volume.VisionInterface.VolumeNodes import UTBlurring 
 59      UT_Blur_2 = UTBlurring(constrkw = {}, name='UT Blur', library=vollib) 
 60      masterNet.addNode(UT_Blur_2,4,142) 
 61      apply(UT_Blur_2.inputPortByName['Xdim'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'}) 
 62      apply(UT_Blur_2.inputPortByName['Ydim'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'}) 
 63      apply(UT_Blur_2.inputPortByName['Zdim'].configure, (), {'color': 'yellow', 'cast': True, 'shape': 'circle'}) 
 64      UT_Blur_2.inputPortByName['Xdim'].widget.set(32, run=False) 
 65      UT_Blur_2.inputPortByName['Xdim'].unbindWidget() 
 66      UT_Blur_2.inputPortByName['Ydim'].widget.set(32, run=False) 
 67      UT_Blur_2.inputPortByName['Ydim'].unbindWidget() 
 68      UT_Blur_2.inputPortByName['Zdim'].widget.set(32, run=False) 
 69      UT_Blur_2.inputPortByName['Zdim'].unbindWidget() 
 70      UT_Blur_2.inputPortByName['blobbyness'].widget.set(-0.2, run=False) 
 71      apply(UT_Blur_2.configure, (), {'expanded': True}) 
 72  except: 
 73      print "WARNING: failed to restore UTBlurring named UT Blur in network masterNet" 
 74      print_exc() 
 75      UT_Blur_2=None 
 76   
 77  try: 
 78      ## saving node UT-Isocontour ## 
 79      from Volume.VisionInterface.VolumeNodes import Isocontour 
 80      UT_Isocontour_3 = Isocontour(constrkw = {}, name='UT-Isocontour', library=vollib) 
 81      masterNet.addNode(UT_Isocontour_3,16,330) 
 82      UT_Isocontour_3.inputPortByName['isovalue'].widget.set(16.85935, run=False) 
 83  except: 
 84      print "WARNING: failed to restore Isocontour named UT-Isocontour in network masterNet" 
 85      print_exc() 
 86      UT_Isocontour_3=None 
 87   
 88  try: 
 89      ## saving node IndexedPolygons ## 
 90      from DejaVu.VisionInterface.GeometryNodes import IndexedPolygonsNE 
 91      IndexedPolygons_4 = IndexedPolygonsNE(constrkw = {}, name='IndexedPolygons', library=vizlib) 
 92      masterNet.addNode(IndexedPolygons_4,17,370) 
 93      IndexedPolygons_4.inputPortByName['name'].widget.set("", run=False) 
 94  except: 
 95      print "WARNING: failed to restore IndexedPolygonsNE named IndexedPolygons in network masterNet" 
 96      print_exc() 
 97      IndexedPolygons_4=None 
 98   
 99  try: 
100      ## saving node Pmv Viewer ## 
101      from Pmv.VisionInterface.PmvNodes import PmvViewer 
102      Pmv_Viewer_5 = PmvViewer(viewer=masterNet.editor.vf.GUI.VIEWER, constrkw = {'viewer': 'masterNet.editor.vf.GUI.VIEWER'}, name='Pmv Viewer', library=pmvlib) 
103      masterNet.addNode(Pmv_Viewer_5,18,416) 
104   
105   
106      ## Clipping Planes for root 
107      if Pmv_Viewer_5.vi.rootObject: 
108          Pmv_Viewer_5.vi.rootObject.clipP = [] 
109          Pmv_Viewer_5.vi.rootObject.clipPI = [] 
110          pass  ## needed in case there no modif 
111      ## End Clipping Planes for root 
112   
113  except: 
114      print "WARNING: failed to restore PmvViewer named Pmv Viewer in network masterNet" 
115      print_exc() 
116      Pmv_Viewer_5=None 
117   
118  try: 
119      ## saving node Dial ## 
120      from Vision.StandardNodes import DialNE 
121      Dial_6 = DialNE(constrkw = {}, name='Dial', library=stdlib) 
122      masterNet.addNode(Dial_6,210,8) 
123      apply(Dial_6.inputPortByName['mini'].configure, (), {'datatype': 'int', 'cast': True, 'shape': 'circle', 'color': 'yellow'}) 
124      apply(Dial_6.inputPortByName['maxi'].configure, (), {'datatype': 'int', 'cast': True, 'shape': 'circle', 'color': 'yellow'}) 
125      apply(Dial_6.inputPortByName['dial'].widget.configure, (), {'continuous': None, 'type': 'int'}) 
126      Dial_6.inputPortByName['dial'].widget.set(32, run=False) 
127  except: 
128      print "WARNING: failed to restore DialNE named Dial in network masterNet" 
129      print_exc() 
130      Dial_6=None 
131   
132  masterNet.freeze() 
133   
134  ## saving connections for network CoarseMolSurface ## 
135  if Pmv_0 is not None and Get_Selection_1 is not None: 
136      try: 
137          masterNet.connectNodes( 
138              Pmv_0, Get_Selection_1, "PMV", "Pmv", blocking=True) 
139      except: 
140          print "WARNING: failed to restore connection between Pmv_0 and Get_Selection_1 in network masterNet" 
141  if UT_Blur_2 is not None and UT_Isocontour_3 is not None: 
142      try: 
143          masterNet.connectNodes( 
144              UT_Blur_2, UT_Isocontour_3, "maskGrid", "grid3D", blocking=True) 
145      except: 
146          print "WARNING: failed to restore connection between UT_Blur_2 and UT_Isocontour_3 in network masterNet" 
147  if UT_Isocontour_3 is not None and IndexedPolygons_4 is not None: 
148      try: 
149          masterNet.connectNodes( 
150              UT_Isocontour_3, IndexedPolygons_4, "coords", "coords", blocking=True) 
151      except: 
152          print "WARNING: failed to restore connection between UT_Isocontour_3 and IndexedPolygons_4 in network masterNet" 
153  if UT_Isocontour_3 is not None and IndexedPolygons_4 is not None: 
154      try: 
155          masterNet.connectNodes( 
156              UT_Isocontour_3, IndexedPolygons_4, "indices", "indices", blocking=True) 
157      except: 
158          print "WARNING: failed to restore connection between UT_Isocontour_3 and IndexedPolygons_4 in network masterNet" 
159  if UT_Isocontour_3 is not None and IndexedPolygons_4 is not None: 
160      try: 
161          masterNet.connectNodes( 
162              UT_Isocontour_3, IndexedPolygons_4, "normals", "vnormals", blocking=True) 
163      except: 
164          print "WARNING: failed to restore connection between UT_Isocontour_3 and IndexedPolygons_4 in network masterNet" 
165  if IndexedPolygons_4 is not None and Pmv_Viewer_5 is not None: 
166      try: 
167          masterNet.connectNodes( 
168              IndexedPolygons_4, Pmv_Viewer_5, "indexedPolygons", "geometries", blocking=True) 
169      except: 
170          print "WARNING: failed to restore connection between IndexedPolygons_4 and Pmv_Viewer_5 in network masterNet" 
171  if Get_Selection_1 is not None and UT_Blur_2 is not None: 
172      try: 
173          masterNet.connectNodes( 
174              Get_Selection_1, UT_Blur_2, "nodes", "molFrag", blocking=True) 
175      except: 
176          print "WARNING: failed to restore connection between Get_Selection_1 and UT_Blur_2 in network masterNet" 
177  if Dial_6 is not None and UT_Blur_2 is not None: 
178      try: 
179          masterNet.connectNodes( 
180              Dial_6, UT_Blur_2, "value", "Xdim", blocking=True) 
181      except: 
182          print "WARNING: failed to restore connection between Dial_6 and UT_Blur_2 in network masterNet" 
183  if Dial_6 is not None and UT_Blur_2 is not None: 
184      try: 
185          masterNet.connectNodes( 
186              Dial_6, UT_Blur_2, "value", "Ydim", blocking=True) 
187      except: 
188          print "WARNING: failed to restore connection between Dial_6 and UT_Blur_2 in network masterNet" 
189  if Dial_6 is not None and UT_Blur_2 is not None: 
190      try: 
191          masterNet.connectNodes( 
192              Dial_6, UT_Blur_2, "value", "Zdim", blocking=True) 
193      except: 
194          print "WARNING: failed to restore connection between Dial_6 and UT_Blur_2 in network masterNet" 
195  masterNet.unfreeze() 
196  if Dial_6: 
197      Dial_6.run() 
198  #try: 
199  #    masterNet.run() 
200  #except: 
201  #    pass 
202