#make some option here afviewer.doPoints = False afviewer.doSpheres = False afviewer.quality = 1 #lowest quality for sphere and cylinder h1.setMinMaxProteinSize() print 'Cyto', rCyto.getMinMaxProteinSize() print 'Surf', rSurf1.getMinMaxProteinSize() print 'Matrix', rMatrix1.getMinMaxProteinSize() #print 'o1', o1.getMinMaxProteinSize() print 'smallest', h1.smallestProteinSize print 'largest', h1.largestProteinSize pad = 100. afviewer.SetHistoVol(h1,pad,display=False) afviewer.displayPreFill() def FILL(h): doc =helper.getCurrentScene() box = doc.GetSelection()[0] bb=helper.getCornerPointCube(box) h.buildGrid(boundingBox=bb) #afviewer.displayFillBox(bb) t1 = time() h.fill3(seedNum=0) t2 = time() print 'time to fill', t2-t1 afviewer.displayFill() print 'time to display', time()-t2
else: import upy helperClass = upy.getHelperClass() helper = helperClass(vi="nogui") AutoFill.helper = helper filename = "/Users/ludo/DEV/autofill_svn/trunk/AutoFillClean/autoFillRecipeScripts/2DsphereFill/Test_Spheres2D1.0.xml" fileName, fileExtension = os.path.splitext(filename) n = os.path.basename(fileName) h = Environment(name=n) recipe = n h.load_XML(filename) afviewer = None if not NOGUI: setattr(h, "helper", helper) afviewer = AFViewer(ViewerType=h.helper.host, helper=h.helper) afviewer.SetHistoVol(h, 20.0, display=False) h.host = h.helper.host afviewer.displayPreFill() h.saveResult = True ingr = h.exteriorRecipe.ingredients[0] resultfilename = h.resultfile = wrkDir + os.sep + "autoFillRecipeScripts/2DsphereFill/results/Test.afr" h.buildGrid(boundingBox=h.boundingBox, gridFileIn=None, rebuild=True, gridFileOut=None, previousFill=False) pack_multi(h, ncpus=1) if not NOGUI: afviewer.displayFill() #load ?