예제 #1
0
파일: gui.py 프로젝트: panaviatornado/hfhom
 def k_output(self, regions, vie, inputinfo):
     quad = regions_to_quad(regions)
     print quad
     quadform = NDQF(quad)
     corr = quadform.correction_terms(self.use_multi.get())
     struct = quadform.group.struct()
     
     if self.condense.get():
         self.output = OutputWindow(self.master, corr, struct, quad,
                                    inputinfo, showhom=self.show_hom.get(),
                                    condense=True)
     else:
         self.output = OutputWindow(self.master, corr, struct, quad, inputinfo,
                                    showhom=self.show_hom.get(),
                                    showquad=self.show_quad.get(), 
                                    showgraph=self.show_graph.get(), 
                                    regions=regions)
     if self.show_shaded.get():
         ShadedLinkWindow(self.master, regions, vie[0], vie[1], vie[2],
                          inputinfo, flip=True) 
         # opens window to show shaded link
         # flips coordinates so drawn right side up (Tkinter y-axis reversed)
     
     if self.show_link.get():
         if not self.archive_num: # loaded file
             # attempt to use filename to load original link
             # e.g. '6x-1-1.txt' or '6x-1-1' will work
             # parsing on '/' will probably not work on Windows
             archive_num = self.filename.split('/')[-1].split('.txt')[0]
             if valid_archive_form(archive_num):
                 browser_link(archive_num)
             # else ignore and do nothing
         else:
             browser_link(self.archive_num) # open browser to original link
예제 #2
0
파일: gui.py 프로젝트: panaviatornado/hfhom
 def knotilus(self):
     self.archive_num = self.entry.get()
     if not valid_archive_form(self.archive_num):
         tkMessageBox.showwarning('Invalid archive form.\n',\
                 'Archive number must have form ax-b-c, for ints a,b,c.')
     else:
         print '\n%s' %self.archive_num
         data = load(self.archive_num, filename=False, 
                     save=self.save_file.get(), gui=True)
         regions = data[3]
         
     if self.show_shaded.get():
         vie = (data[0], data[1], data[2]) # Vertices, Intersections, Edges
     else:
         vie = None
     self.k_output(regions, vie, self.archive_num)